From owner-soc-status@freebsd.org Mon Aug 10 17:39:43 2015 Return-Path: Delivered-To: soc-status@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 421C999E9B4 for ; Mon, 10 Aug 2015 17:39:43 +0000 (UTC) (envelope-from mihai.carabas@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (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 C5777CF8 for ; Mon, 10 Aug 2015 17:39:42 +0000 (UTC) (envelope-from mihai.carabas@gmail.com) Received: by wicne3 with SMTP id ne3so145309028wic.1 for ; Mon, 10 Aug 2015 10:39:40 -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=W2GkQAcUtaEqWWHpAWLkEfhOeQBMq5K96jJpkw2DBl4=; b=0PA4TU+OWAXq0jv6FP/qbKygdqqCet9JBfon2caF9ht8d+AV3YltSXIDj1Mgz5eCd6 Rv97kmtG7We3vAvwOyZq18VHIJSXKFV314lHUT3VOYUWWqS6KMbbfATiDuoLKl7XwZH2 FBShYvxOwWdPaDAzMXupi7TBCTQt26O9WuekUOapPvQ6kZds1fuzzLdsUzUqaebYJxDz kYmYwYTfJq+M/IHZdx7JLhLtn5IcLWToLo8/m3WI4R7uNndobvT/xPJ0JSTpAYVGqe9k 0fKxFmuBaM+zeAhi608MwU+pEPbNSYp2zosSdAvWurvdSLfm31bx0JcmQYtImaKg7A0Q WgvQ== MIME-Version: 1.0 X-Received: by 10.194.171.9 with SMTP id aq9mr49275014wjc.30.1439228380303; Mon, 10 Aug 2015 10:39:40 -0700 (PDT) Received: by 10.28.21.132 with HTTP; Mon, 10 Aug 2015 10:39:40 -0700 (PDT) In-Reply-To: References: Date: Mon, 10 Aug 2015 20:39:40 +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, 10 Aug 2015 17:39:43 -0000 Hi everyone, > In the past week I managed to boot the guest all the way down to Interrupt > Controller initialization [1]. There were minor bugs in the emulation code > I had to fix. After that I've start reading the GIC ARM manual and tried to > look at other vGIC implementations (virtualization of the Generic Interrupt > Controller). I didn't get to write any code yet, I'm still trying to get > the whole picture. This would be the last step before being able to run a > guest (without timer virtualization - we can use an auxiliary timer mapped > to the guest). > In the last week I've started coding on ARM VGIC infrastructure: - I've created a new header file gic.h to export current registers to be used by the VGIC - I've exported the arm_gic_softc which is used to probe the VGIC specific registers (I know it's unclean, but until I find a cleaner method, I will go this way -> it's not so clear yet how much of the gic.c internals I will need in the vgic.c) - I've created in sys/arm/vmm/vgic.c the vgic_hyp_init function which is probing the VGIC specific addresses from the DTS file, I've mapped the virtual cpu control interface into hyp-mode (to be able to save/restore these at each context switch) and saved the virtual cpu interface base for later use - I've created a new userspace ioctl VMM_ATTACH_VGIC which is sending the physical address for the distributor that needs to be emulated and for the cpu interface that will be mapped on top of the virtual cpu interface - I've created a new function vgic_attach in sys/arm/vmm/vgic.c which is called by the previous ioctl which is saving the userspace data, it's initializing some structures and maps the cpu control interface - We need to do an in-kernel emulation for the VGIC distributor. Further I've created a new function called vgic_emulate_distributor which is called in the vmm.c code (I know it's unclean, but I wanted to ressemble with x86 in-kernel emulation and here I didn't have any defines for the emulated addresses, I needed the struct hyp). The vgic_emulate_distributor is calling vmm_emulate_instruction which specific handlers for read/write emulation. I will push the code tomorrow. Right now I'm adding some printfs to check that the flow for vgic distributor is working ok. Thank you, Mihai