From owner-soc-status@FreeBSD.ORG Mon Jun 8 22:47:27 2015 Return-Path: Delivered-To: soc-status@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7ED3518 for ; Mon, 8 Jun 2015 22:47:27 +0000 (UTC) (envelope-from mihai.carabas@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5019E1C01 for ; Mon, 8 Jun 2015 22:47:27 +0000 (UTC) (envelope-from mihai.carabas@gmail.com) Received: by wiga1 with SMTP id a1so101449283wig.0 for ; Mon, 08 Jun 2015 15:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=5OrtW75frE3L24LdVQilUtmqKVgaYGYCV0X6OjgpE2A=; b=rR6a96mwyP1bZE915onQ73+B6Q2hEJgmnRaRRlOdIUV/9s4ARt8m5NKQGzYz03i/BN UwdfoQ68zzE6oi0GLYiw2c5ccSXb9oMkw48oqcoBfY5pPmUSOhsKkbovTxKE8QAXfAq6 8nvyzS/k9XYtP7HZPtpyJNem/Zr0t1/4uVKHMGVLBbDi2A8+WCO6u4bLTDH7AP+vVAZV 9+yPHSZ8jYMBKktj6QxnyZc4YQTE5YfhXwU7OJo9tblRGMQlPvLTXlIpV41QFK3QMk1/ vC4xHXxD1MfV3mPDGNfvluo9O4HXISBUh+194jR1G6OpIEFm40eX6rAlVGFNmgib4s/Y vsNw== MIME-Version: 1.0 X-Received: by 10.194.77.179 with SMTP id t19mr35768839wjw.30.1433803645885; Mon, 08 Jun 2015 15:47:25 -0700 (PDT) Received: by 10.28.21.134 with HTTP; Mon, 8 Jun 2015 15:47:25 -0700 (PDT) In-Reply-To: References: Date: Tue, 9 Jun 2015 01:47:25 +0300 Message-ID: Subject: Re: [GSOC] bhyve port on ARM - weekly status report From: Mihai Carabas To: soc-status@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: soc-status@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Summer of Code Status Reports and Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2015 22:47:27 -0000 Hi everyone, On Mon, Jun 1, 2015 at 9:48 PM, Mihai Carabas wrote: > Hi, > > My name is Mihai Carabas and this year's edition of GSoC I will work on > porting bhyve on ARM-based platforms (last year I've worked on bhyve > instruction caching [1]). > > I've created a wiki page where I've describe the project and the > milestones [2]. > > This week I've started preparing the development infrastructure. We've > switched from Exynos5 development board initially proposed with FastModels > emulator, the Versatile Express board (CortexA15 model: > FVP_VE_Cortex-A15x1) because we need advanced debug features which was not > possible on the Exynos5 board without having acces to a JTAG-like device. > > Next I've started creating a new config for the VersatileExpress platform > with minimal config options. I've also copied the DTS files for > VersatileExpress from linux-arm.org [3] and compiled them directly into > the kernel image. All these are pushed in my SVN repo [4]. > > The ARM guys have a boot-wrapper to use it with the FastModels emulator > (instead of u-boot). I've pulled this wrapper from [5] and cross-compiled > it to obtain the image of the boot-wrapper which instead will load the > FreeBSD kernel. I will come with a detailed feedback after I will manage to > boot up FreeBSD on Versatile Express emulated platform. > > I've loaded the boot-wrapper image into the FastModel emulator. I've also given some custom parameters to load the kernel binary (kernel.bin generated by the build system) at physical address 0XC0004000 (the same as the virtual address). I've modified the original physical address in order to make the VA==PA and have a match between the dissambled code shown by Model Debugger and the C code even if I had no MMU (to make debugging easier until the MMU gets activated). In order to be able to debug in Model Debugger, I've loaded the kernel.debug ELF file just for debug purposes (I have this option). Even if I did this trick, the ASM instructions didn't match the C code loaded by the Model Debugger. After manually dumping the kernel.debug ELF file I've seen that the text area is shifted with 0x180 at 0xC0004000, being different than the start of the kernel text area. Peter noticed that ldscript.arm has an offset added before the .text section ( . = KERNVIRTADDR + SIZEOF_HEADERS;). I've removed the SIZEOF_HEADERS and now the C code matched with the ASM one. Further I've been executing step by step until the MMU gets activated for the first time (init_mmu) in the locore-v6 with the primitive page table (a 64MB zone mapped from the begining of the kernel). The simulation was failing when activating the second time the MMU (after building the kernel page table using the pmap). This was caused by the chosen physical address C0008000. The locore-v6 code was alligning this address at 1MB boundary thus the kernel start became C0000000, instead of C0004000. The C0000000 was passed to the arm_physmem_kernaddr variable with in turn was used for KERNEL_P2V macro, thus creating invalid mappings. After modifying in the boot-wrapper the address where the kernel text is loaded at C0200000 the problem was solved (I've used the 4000 offset initially because this was configured by the boot-wrapper). Now I've managed to boot-up the FreeBSD kernel until the console init function in initarm (cninit function). Further I'm trying to build an early_putc function using the semihosting feature exposed by the emulator until I get the console up. Thank you, Mihai