RE: [PATCH v7 00/17] KVM: arm64: GICv3 ITS emulation

2016-06-28 Thread Bharat Bhushan
> -Original Message- > From: kvmarm-boun...@lists.cs.columbia.edu [mailto:kvmarm- > boun...@lists.cs.columbia.edu] On Behalf Of Andre Przywara > Sent: Tuesday, June 28, 2016 6:02 PM > To: Marc Zyngier ; Christoffer Dall > ; Eric Auger

Re: [PATCH 15/15] arm/arm64: KVM: Check that IDMAP doesn't intersect with VA range

2016-06-28 Thread Christoffer Dall
On Tue, Jun 07, 2016 at 11:58:35AM +0100, Marc Zyngier wrote: > This is more of a safety measure than anything else: If we end-up > with an idmap page that intersect with the range picked for the > the HYP VA space, abort the KVM setup, as it is unsafe to go > further. > > I cannot imagine it

Re: [PATCH 12/15] arm: KVM: Simplify HYP init

2016-06-28 Thread Christoffer Dall
On Tue, Jun 07, 2016 at 11:58:32AM +0100, Marc Zyngier wrote: > Just like for arm64, we can now make the HYP setup a lot simpler, > and we can now initialise it in one go (instead of the two > phases we currently have). > > Signed-off-by: Marc Zyngier > --- >

Re: [PATCH 08/15] arm/arm64: KVM: Always have merged page tables

2016-06-28 Thread Christoffer Dall
On Tue, Jun 07, 2016 at 11:58:28AM +0100, Marc Zyngier wrote: > We're in a position where we can now always have "merged" page > tables, where both the runtime mapping and the idmap coexist. > > This results in some code being removed, but there is more to come. > > Signed-off-by: Marc Zyngier

Re: [PATCH 09/15] arm64: KVM: Simplify HYP init/teardown

2016-06-28 Thread Christoffer Dall
On Tue, Jun 07, 2016 at 11:58:29AM +0100, Marc Zyngier wrote: > Now that we only have the "merged page tables" case to deal with, > there is a bunch of things we can simplify in the HYP code (both > at init and teardown time). > > Signed-off-by: Marc Zyngier > --- >

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Alexander Graf
On 06/28/2016 12:55 PM, Laszlo Ersek wrote: On 06/27/16 12:34, Christoffer Dall wrote: On Mon, Jun 27, 2016 at 11:47:18AM +0200, Ard Biesheuvel wrote: So first of all, let me reiterate that I could only find a single instance in QEMU where a PCI MMIO region is backed by host memory, which is

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Andrew Jones
On Tue, Jun 28, 2016 at 02:25:19PM +0100, Catalin Marinas wrote: > On Tue, Jun 28, 2016 at 03:19:14PM +0200, Ard Biesheuvel wrote: > > On 28 June 2016 at 15:10, Catalin Marinas wrote: > > > On Tue, Jun 28, 2016 at 02:20:43PM +0200, Christoffer Dall wrote: > > >> On Tue,

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Laszlo Ersek
(adding Gerd) On 06/28/16 15:14, Ard Biesheuvel wrote: > In any case, reconciling software that requires a framebuffer with a > GPU emulation that does not expose one by design is going to be > problematic even without this issue. How is this supposed to work on > x86? AFAIK: "virtio-gpu-pci"

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Catalin Marinas
On Tue, Jun 28, 2016 at 03:19:14PM +0200, Ard Biesheuvel wrote: > On 28 June 2016 at 15:10, Catalin Marinas wrote: > > On Tue, Jun 28, 2016 at 02:20:43PM +0200, Christoffer Dall wrote: > >> On Tue, Jun 28, 2016 at 01:06:36PM +0200, Laszlo Ersek wrote: > >> > On 06/28/16

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Ard Biesheuvel
On 28 June 2016 at 15:10, Catalin Marinas wrote: > On Tue, Jun 28, 2016 at 02:20:43PM +0200, Christoffer Dall wrote: >> On Tue, Jun 28, 2016 at 01:06:36PM +0200, Laszlo Ersek wrote: >> > On 06/28/16 12:04, Christoffer Dall wrote: >> > > On Mon, Jun 27, 2016 at 03:57:28PM

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Ard Biesheuvel
On 28 June 2016 at 12:55, Laszlo Ersek wrote: > On 06/27/16 12:34, Christoffer Dall wrote: >> On Mon, Jun 27, 2016 at 11:47:18AM +0200, Ard Biesheuvel wrote: > >>> So first of all, let me reiterate that I could only find a single >>> instance in QEMU where a PCI MMIO region is

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Catalin Marinas
On Tue, Jun 28, 2016 at 02:20:43PM +0200, Christoffer Dall wrote: > On Tue, Jun 28, 2016 at 01:06:36PM +0200, Laszlo Ersek wrote: > > On 06/28/16 12:04, Christoffer Dall wrote: > > > On Mon, Jun 27, 2016 at 03:57:28PM +0200, Ard Biesheuvel wrote: > > >> So if vga-pci.c is the only problematic

Re: [PATCH 05/15] arm64: KVM: Refactor kern_hyp_va/hyp_kern_va to deal with multiple offsets

2016-06-28 Thread Christoffer Dall
On Tue, Jun 07, 2016 at 11:58:25AM +0100, Marc Zyngier wrote: > As we move towards a selectable HYP VA range, it is obvious that > we don't want to test a variable to find out if we need to use > the bottom VA range, the top VA range, or use the address as is > (for VHE). > > Instead, we can

[PATCH v7 17/17] KVM: arm64: enable ITS emulation as a virtual MSI controller

2016-06-28 Thread Andre Przywara
Now that all ITS emulation functionality is in place, we advertise MSI functionality to userland and also the ITS device to the guest - if userland has configured that. Signed-off-by: Andre Przywara --- Documentation/virtual/kvm/api.txt | 2 +- arch/arm64/kvm/Kconfig

[PATCH v7 16/17] KVM: arm64: implement MSI injection in ITS emulation

2016-06-28 Thread Andre Przywara
When userland wants to inject a MSI into the guest, it uses the KVM_SIGNAL_MSI ioctl, which carries the doorbell address along with the payload and the device ID. We convert this into an MMIO write to the ITS translation register, so we can use the knowledge of the kvm_io_bus framework about the

[PATCH v7 08/17] KVM: arm64: handle ITS related GICv3 redistributor registers

2016-06-28 Thread Andre Przywara
In the GICv3 redistributor there are the PENDBASER and PROPBASER registers which we did not emulate so far, as they only make sense when having an ITS. In preparation for that emulate those MMIO accesses by storing the 64-bit data written into it into a variable which we later read in the ITS

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Christoffer Dall
On Tue, Jun 28, 2016 at 01:06:36PM +0200, Laszlo Ersek wrote: > On 06/28/16 12:04, Christoffer Dall wrote: > > On Mon, Jun 27, 2016 at 03:57:28PM +0200, Ard Biesheuvel wrote: > >> On 27 June 2016 at 15:35, Christoffer Dall > >> wrote: > >>> On Mon, Jun 27, 2016 at

Re: [PATCH 02/15] arm64: KVM: Kill HYP_PAGE_OFFSET

2016-06-28 Thread Christoffer Dall
On Mon, Jun 27, 2016 at 03:20:23PM +0100, Marc Zyngier wrote: > On 27/06/16 14:47, Christoffer Dall wrote: > > On Tue, Jun 07, 2016 at 11:58:22AM +0100, Marc Zyngier wrote: > >> HYP_PAGE_OFFSET is not massively useful. And the way we use it > >> in KERN_HYP_VA is inconsistent with the equivalent

Re: [PATCH 01/15] arm64: KVM: Merged page tables documentation

2016-06-28 Thread Christoffer Dall
On Mon, Jun 27, 2016 at 03:06:11PM +0100, Marc Zyngier wrote: > On 27/06/16 14:28, Christoffer Dall wrote: > > On Tue, Jun 07, 2016 at 11:58:21AM +0100, Marc Zyngier wrote: > >> Since dealing with VA ranges tends to hurt my brain badly, let's > >> start with a bit of documentation that will

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Laszlo Ersek
On 06/28/16 12:04, Christoffer Dall wrote: > On Mon, Jun 27, 2016 at 03:57:28PM +0200, Ard Biesheuvel wrote: >> On 27 June 2016 at 15:35, Christoffer Dall >> wrote: >>> On Mon, Jun 27, 2016 at 02:30:46PM +0200, Ard Biesheuvel wrote: On 27 June 2016 at 12:34,

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Laszlo Ersek
On 06/27/16 16:29, Alexander Graf wrote: > > >> Am 27.06.2016 um 15:57 schrieb Ard Biesheuvel : >> >>> On 27 June 2016 at 15:35, Christoffer Dall >>> wrote: On Mon, Jun 27, 2016 at 02:30:46PM +0200, Ard Biesheuvel wrote: > On 27

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Laszlo Ersek
On 06/27/16 12:34, Christoffer Dall wrote: > On Mon, Jun 27, 2016 at 11:47:18AM +0200, Ard Biesheuvel wrote: >> So first of all, let me reiterate that I could only find a single >> instance in QEMU where a PCI MMIO region is backed by host memory, >> which is vga-pci.c. I wonder of there are any

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Christoffer Dall
On Mon, Jun 27, 2016 at 03:10:20PM +0100, Peter Maydell wrote: > On 27 June 2016 at 14:49, Mark Rutland wrote: > > On Mon, Jun 27, 2016 at 02:15:29PM +0100, Peter Maydell wrote: > >> I get the impression dma-coherent is the right thing to advertise > >> anyway. Do you have

Re: issues with emulated PCI MMIO backed by host memory under KVM

2016-06-28 Thread Christoffer Dall
On Mon, Jun 27, 2016 at 03:57:28PM +0200, Ard Biesheuvel wrote: > On 27 June 2016 at 15:35, Christoffer Dall > wrote: > > On Mon, Jun 27, 2016 at 02:30:46PM +0200, Ard Biesheuvel wrote: > >> On 27 June 2016 at 12:34, Christoffer Dall >