RE: [v4 01/16] KVM: Extend struct pi_desc for VT-d Posted-Interrupts

2015-06-23 Thread Wu, Feng
> -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Tuesday, June 23, 2015 11:50 PM > To: Wu, Feng; kvm@vger.kernel.org; linux-ker...@vger.kernel.org > Cc: mtosa...@redhat.com; alex.william...@redhat.com; > eric.au...@linaro.org > Subject: Re: [v4 01/16] KVM: E

Re: [PATCH 10/23] userfaultfd: add new syscall to provide memory externalization

2015-06-23 Thread Andrea Arcangeli
Hi Dave, On Tue, Jun 23, 2015 at 12:00:19PM -0700, Dave Hansen wrote: > Down in userfaultfd_wake_function(), it looks like you intended for a > len=0 to mean "wake all". But the validate_range() that we do from > userspace has a !len check in it, which keeps us from passing a len=0 in > from user

Re: [PATCH 10/23] userfaultfd: add new syscall to provide memory externalization

2015-06-23 Thread Dave Hansen
On 05/14/2015 10:31 AM, Andrea Arcangeli wrote: > +static int userfaultfd_wake_function(wait_queue_t *wq, unsigned mode, > + int wake_flags, void *key) > +{ > + struct userfaultfd_wake_range *range = key; > + int ret; > + struct userfaultfd_wait_queue *u

[GIT PULL] First batch of KVM changes for 4.2

2015-06-23 Thread Paolo Bonzini
Linus, The following changes since commit c447e76b4cabb49ddae8e49c5758f031f35d55fb: kvm/fpu: Enable eager restore kvm FPU for MPX (2015-05-20 12:30:26 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus for you to fetch changes up to

Re: [v4 15/16] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2015-06-23 Thread Paolo Bonzini
On 11/06/2015 12:51, Feng Wu wrote: > - vcpu->arch.mp_state = KVM_MP_STATE_HALTED; > + /* Handle posted-interrupt when vCPU is to be halted */ > + if (!kvm_x86_ops->pi_pre_block || > + (kvm_x86_ops->pi_pre_block && This condition is unnecessary

Re: [v4 12/16] KVM: kvm-vfio: implement the VFIO skeleton for VT-d Posted-Interrupts

2015-06-23 Thread Paolo Bonzini
On 12/06/2015 16:51, Alex Williamson wrote: > > > The code below can't get to this function without > > > __KVM_HAVE_ARCH_KVM_VFIO_POST, but this seems like it should return an > > > error if not implemented. > > > > kvm_arch_vfio_update_pi_irte() is called by kvm_vfio_control_pi(), if we > > r

Re: [v4 01/16] KVM: Extend struct pi_desc for VT-d Posted-Interrupts

2015-06-23 Thread Paolo Bonzini
On 11/06/2015 12:51, Feng Wu wrote: > + union { > + struct { > + /* bit 256 - Outstanding Notification */ > + u64 on : 1, > + /* bit 257 - Suppress Notification */ > +

[RFC PATCH 2/2] Makefile: use xxd for converting guest/init

2015-06-23 Thread Andre Przywara
Currently we use ld to convert the static guest/init binary back into an object file, which we can embed as a binary blob into our lkvm binary. This works fine as long as compiler and linker use the same ELF target format, which seems to be not true for most of the MIPS toolchains. Use a different

[RFC PATCH 1/2] Makefile: cleanup guest/init generation

2015-06-23 Thread Andre Przywara
The dependencies and targets for the guest userland binary are currently not correct, some are redundant. Fix them by splitting up guest/guest_init.o creation into its two steps and describe the dependencies properly. On the way use automatic variables in some rules. Signed-off-by: Andre Przywara

[RFC PATCH 0/2] kvmtool: Rework guest/init integration

2015-06-23 Thread Andre Przywara
Hi, this mini series aims at solving long standing issues with compiling and linking the guest/init binary for MIPS. It seems that many MIPS toolchains use different default ELF targets for the compiler and the linker, rendering the approach of linking the guest/init executable into the lkvm binar

Re: [PATCH 1/1] KVM: s390: clear floating interrupt bitmap and parameters

2015-06-23 Thread Paolo Bonzini
On 22/06/2015 13:20, Christian Borntraeger wrote: > From: Jens Freimann > > commit 6d3da24141 ("KVM: s390: deliver floating interrupts in order > of priority") introduced a regression for the reset handling. > > We don't clear the bitmap of pending floating interrupts > and interrupt parameters.

Re: [PATCH] arm64/kvm: Add generic v8 KVM target

2015-06-23 Thread Peter Maydell
On 23 June 2015 at 15:03, Suzuki K. Poulose wrote: > On 23/06/15 13:39, Christoffer Dall wrote: >> On Mon, Jun 22, 2015 at 09:44:48AM +0100, Peter Maydell wrote: >> I'm guessing the intention is to avoid having to add code in the kernel >> to support KVM on a new CPU where nothing else needs to be

Re: [PATCH] arm64/kvm: Add generic v8 KVM target

2015-06-23 Thread Suzuki K. Poulose
On 23/06/15 13:39, Christoffer Dall wrote: On Mon, Jun 22, 2015 at 09:44:48AM +0100, Peter Maydell wrote: On 17 June 2015 at 10:00, Suzuki K. Poulose wrote: From: "Suzuki K. Poulose" This patch adds a generic ARM v8 KVM target cpu type for use by the new CPUs which eventualy ends up using th

Re: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-23 Thread Eric Auger
Andre, On 06/23/2015 11:03 AM, Andre Przywara wrote: > Hi Eric, > > I went back reading the code and looked at how the x86 APIC works more > closely to understand the GSI routing better. > See below for more ... > > On 22/06/15 10:21, Eric Auger wrote: >> On 06/22/2015 10:40 AM, Andre Przywara wr

Re: [PATCH] arm64/kvm: Add generic v8 KVM target

2015-06-23 Thread Christoffer Dall
On Mon, Jun 22, 2015 at 09:44:48AM +0100, Peter Maydell wrote: > On 17 June 2015 at 10:00, Suzuki K. Poulose wrote: > > From: "Suzuki K. Poulose" > > > > This patch adds a generic ARM v8 KVM target cpu type for use > > by the new CPUs which eventualy ends up using the common sys_reg > > table. Fo

Re: [PATCH 1/2] powerpc: Define the hcall opcodes & return values we need

2015-06-23 Thread Paolo Bonzini
On 23/06/2015 12:31, Andre Przywara wrote: >> > >> > Because it's not part of the kernel API, never was, still isn't. > Technically it may not - if I get this correctly it is more a platform > API defined by the architecture, like ACPI or PSCI on ARM. > But if I get this correctly Linux re-uses

Re: [PATCH 1/2] powerpc: Define the hcall opcodes & return values we need

2015-06-23 Thread Andre Przywara
Hi, On 23/06/15 11:05, Michael Ellerman wrote: > On Tue, 2015-06-23 at 11:33 +0200, Paolo Bonzini wrote: >> On 19/06/2015 09:21, Michael Ellerman wrote: >>> diff --git a/powerpc/spapr.h b/powerpc/spapr.h >>> index 0537f881c0e4..7a377d093ef4 100644 >>> --- a/powerpc/spapr.h >>> +++ b/powerpc/spapr.

Re: [PATCH 07/11] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-06-23 Thread Paolo Bonzini
On 23/06/2015 12:08, Denis V. Lunev wrote: > the behavior becomes controlled by libvirt, which has > appropriate event configuration, specified here > https://libvirt.org/formatdomain.html > namely > restart > > Thus it looks like without libvirt help the guest will stuck > in RUN_STATE_GUES

Re: [PATCH 07/11] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-06-23 Thread Denis V. Lunev
On 23/06/15 12:51, Paolo Bonzini wrote: On 23/06/2015 11:47, Denis V. Lunev wrote: The current implementation is potentially more flexible but makes the MSR handling a little more awkward since the host_initiated bool needs to be passed around (patch 09). I guess either approach seems ok to me.

Re: [PATCH 1/2] powerpc: Define the hcall opcodes & return values we need

2015-06-23 Thread Michael Ellerman
On Tue, 2015-06-23 at 11:33 +0200, Paolo Bonzini wrote: > On 19/06/2015 09:21, Michael Ellerman wrote: > > diff --git a/powerpc/spapr.h b/powerpc/spapr.h > > index 0537f881c0e4..7a377d093ef4 100644 > > --- a/powerpc/spapr.h > > +++ b/powerpc/spapr.h > > @@ -16,17 +16,32 @@ > > > > #include > >

Re: [PATCH 11/11] qemu/kvm: mark in cpu state that hyper-v crash occured

2015-06-23 Thread Paolo Bonzini
On 22/06/2015 19:46, Andreas Färber wrote: > On the other hand, I wonder if current_cpu is available in > qemu_system_guest_panicked. If so, you could add the field to the > generic CPUState struct and migrate it as a subsection of > vmstate_cpu_common. >>> >>

Re: [PATCH 07/11] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-06-23 Thread Paolo Bonzini
On 23/06/2015 11:47, Denis V. Lunev wrote: >> >> The current implementation is potentially more flexible but makes the >> MSR handling a little more awkward since the host_initiated bool needs >> to be passed around (patch 09). I guess either approach seems ok to >> me. >> >> Also, if this patchs

Re: [PATCH 09/11] kvm/x86: distingiush hyper-v guest crash notification

2015-06-23 Thread Paolo Bonzini
On 23/06/2015 01:55, Peter Hornyack wrote: >> > -static int kvm_hv_msr_set_crash_ctl(struct kvm_vcpu *vcpu, u64 data) >> > +static int kvm_hv_msr_set_crash_ctl(struct kvm_vcpu *vcpu, u64 data, bool >> > host) >> > { >> > struct kvm_arch_hyperv *hv = &vcpu->kvm->arch.hyperv; >> > >> >

Re: [PATCH 07/11] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-06-23 Thread Denis V. Lunev
On 23/06/15 02:52, Peter Hornyack wrote: On Mon, Jun 22, 2015 at 9:05 AM, Denis V. Lunev wrote: From: Andrey Smetanin Added hyper-v crash msr's(HV_X64_MSR_CRASH*) data and control geters and setters. Signed-off-by: Andrey Smetanin Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Gleb N

Re: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-23 Thread Eric Auger
Hi Favel, On 06/23/2015 10:50 AM, Pavel Fedin wrote: > Hello! > >> I was talking about what >> is done without this "gsi direct mapping" feature. In that case the low >> GSI numbers are used by irqchip routing entries. So kvm_irqchip_get_virq >> returns a gsi beyond the irqchip routed gsi's. > >

Re: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-23 Thread Eric Auger
Salut Andre, On 06/23/2015 11:03 AM, Andre Przywara wrote: > Hi Eric, > > I went back reading the code and looked at how the x86 APIC works more > closely to understand the GSI routing better. > See below for more ... > > On 22/06/15 10:21, Eric Auger wrote: >> On 06/22/2015 10:40 AM, Andre Przyw

Re: [PATCH 1/2] powerpc: Define the hcall opcodes & return values we need

2015-06-23 Thread Paolo Bonzini
On 19/06/2015 09:21, Michael Ellerman wrote: > Now that we don't have the kernel header on hand, just define the > minimum set of hcall opcodes and return values we need in order to > build. > > Signed-off-by: Michael Ellerman > --- > powerpc/spapr.h | 25 - > 1 file ch

Re: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-23 Thread Andre Przywara
Hi Eric, I went back reading the code and looked at how the x86 APIC works more closely to understand the GSI routing better. See below for more ... On 22/06/15 10:21, Eric Auger wrote: > On 06/22/2015 10:40 AM, Andre Przywara wrote: >> Hi Eric, >> >> I briefly looked over the series, the patches

RE: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-23 Thread Pavel Fedin
Hello! > I was talking about what > is done without this "gsi direct mapping" feature. In that case the low > GSI numbers are used by irqchip routing entries. So kvm_irqchip_get_virq > returns a gsi beyond the irqchip routed gsi's. But aren't these low numbers just routed by the qemu too? I don

Re: [PATCH v2 11/15] KVM: MTRR: sort variable MTRRs

2015-06-23 Thread Xiao Guangrong
On 06/23/2015 04:00 PM, Paolo Bonzini wrote: On 23/06/2015 04:29, Xiao Guangrong wrote: If so, can you look at kvm/queue and see if it is okay for you (so that we can get the series in 4.2)? Ping? If I don't get testing results before Wednesday, I'll drop this series from the 4.2 pull r

Re: Hang on reboot in FreeBSD guest on Linux KVM host

2015-06-23 Thread Paolo Bonzini
On 23/06/2015 00:08, John Nielsen wrote: Thank you. This both narrows the problem considerably and provides an acceptable workaround. It would still be nice to see it fixed, of course. Keep me CC'ed as I'm not on the KVM list. >>> >>> I’m resurrecting an old thread since I haven’t

Re: [PATCH v2 11/15] KVM: MTRR: sort variable MTRRs

2015-06-23 Thread Paolo Bonzini
On 23/06/2015 04:29, Xiao Guangrong wrote: >>> >>> >>> If so, can you look at kvm/queue and see if it is okay for you (so that >>> we can get the series in 4.2)? >> >> Ping? >> >> If I don't get testing results before Wednesday, I'll drop this series >> from the 4.2 pull request. > > Paolo, sorr

Re: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-23 Thread Eric Auger
Hi Pavel, On 06/23/2015 09:38 AM, Pavel Fedin wrote: > Hello! > >> What is done currently at qemu level for other archs - if I understand >> it correctly - is there is static GSI routing for standard IRQ. > > Yes, this is correct. GSI number = SPI number for ARM. Also something > similar for

RE: [RFC 0/6] KVM: arm/arm64: gsi routing support

2015-06-23 Thread Pavel Fedin
Hello! > What is done currently at qemu level for other archs - if I understand > it correctly - is there is static GSI routing for standard IRQ. Yes, this is correct. GSI number = SPI number for ARM. Also something similar for MIPS (haven't study that). > For MSI > irqfd setup they use spa

Re: [RFC 1/6] KVM: api: add kvm_irq_routing_extended_msi

2015-06-23 Thread Eric Auger
Hi André, On 06/22/2015 06:32 PM, Andre Przywara wrote: > Hi Eric, > > On 18/06/15 18:40, Eric Auger wrote: >> On ARM, the MSI msg (address and data) comes along with >> out-of-band device ID information. The device ID encodes the device >> that composes the MSI msg. Let's create a new routing ent