Re: [edk2] KVM: MTRR: fix memory type handling if MTRR is completely disabled

2015-10-13 Thread Xiao Guangrong
Janusz, Could you please try this: $ git diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 185fc16..bdd564f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4957,12 +4957,14 @@ static int handle_emulation_failure(struct kvm_vcpu *vcpu)

Re: [Qemu-devel] [PATCH v3 00/32] implement vNVDIMM

2015-10-13 Thread Xiao Guangrong
On 10/13/2015 02:36 PM, Dan Williams wrote: On Mon, Oct 12, 2015 at 10:49 PM, Xiao Guangrong wrote: On 10/13/2015 11:38 AM, Dan Williams wrote: On Mon, Oct 12, 2015 at 8:14 PM, Xiao Guangrong wrote: On 10/13/2015 12:36

Re: [Qemu-devel] [PATCH v3 00/32] implement vNVDIMM

2015-10-13 Thread Dan Williams
On Mon, Oct 12, 2015 at 10:49 PM, Xiao Guangrong wrote: > > > On 10/13/2015 11:38 AM, Dan Williams wrote: >> >> On Mon, Oct 12, 2015 at 8:14 PM, Xiao Guangrong >> wrote: >>> >>> On 10/13/2015 12:36 AM, Dan Williams wrote:

[PATCH] KVM: arm/arm64: Fix vGIC documentation

2015-10-13 Thread Pavel Fedin
Correct some old mistakes in the API documentation: 1. VCPU is identified by index (using kvm_get_vcpu() function), but "cpu id" can be mistaken for affinity ID. 2. Some error codes are wrong. Signed-off-by: Pavel Fedin --- This is a small extraction from my vGICv3 live

[Bug 105841] "KVM: x86: apply guest MTRR virtualization on host reserved pages" causes kernel to panic on boot

2015-10-13 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=105841 Paolo Bonzini changed: What|Removed |Added Status|NEW |RESOLVED

[PATCH 1/2] KVM: x86: clean up kvm_arch_vcpu_runnable

2015-10-13 Thread Paolo Bonzini
Split the huge conditional in two functions. Fixes: 64d6067057d9658acb8675afcfba549abdb7fc16 Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini --- arch/x86/kvm/x86.c | 39 +-- 1 file changed, 29 insertions(+), 10 deletions(-) diff

[PATCH 0/2] KVM: x86: fix deliver of SMIs to halted VCPUs

2015-10-13 Thread Paolo Bonzini
While SeaBIOS only uses synchronous SMI delivery through port 0xb2, OVMF also uses APIC delivery, and it is buggy. This is enough to run OVMF with SMM enabled and multiple processors, up to a UEFI shell, but it literally takes minutes to get there. However, the same behavior is visible with KVM

[PATCH 2/2] KVM: x86: fix SMI to halted VCPU

2015-10-13 Thread Paolo Bonzini
An SMI to a halted VCPU must wake it up, hence a VCPU with a pending SMI must be considered runnable. Fixes: 64d6067057d9658acb8675afcfba549abdb7fc16 Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini --- arch/x86/kvm/x86.c | 3 +++ 1 file changed, 3 insertions(+)

Re: [PATCH v3 04/32] acpi: add aml_mutex, aml_acquire, aml_release

2015-10-13 Thread Igor Mammedov
On Sun, 11 Oct 2015 11:52:36 +0800 Xiao Guangrong wrote: > Implement Mutex, Acquire and Release terms which are used by NVDIMM _DSM > method > in later patch > > Signed-off-by: Xiao Guangrong > --- > hw/acpi/aml-build.c

[GIT PULL 03/10] KVM: s390: set interception requests for all floating irqs

2015-10-13 Thread Christian Borntraeger
From: David Hildenbrand No need to separate pending and floating irqs when setting interception requests. Let's do it for all equally. Reviewed-by: Christian Borntraeger Signed-off-by: David Hildenbrand Signed-off-by:

[GIT PULL 01/10] KVM: s390: remove unused variable in __inject_vm

2015-10-13 Thread Christian Borntraeger
the float int structure is no longer used in __inject_vm. Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/s390/kvm/interrupt.c

[GIT PULL 09/10] KVM: s390: factor out and fix setting of guest TOD clock

2015-10-13 Thread Christian Borntraeger
From: David Hildenbrand Let's move that whole logic into one function. We now always use unsigned values when calculating the epoch (to avoid over/underflow defined). Also, we always have to get all VCPUs out of SIE before doing the update to avoid running differing

[GIT PULL 05/10] KVM: s390: drop out early in kvm_s390_has_irq()

2015-10-13 Thread Christian Borntraeger
From: David Hildenbrand Let's get rid of the local variable and exit directly if we found any pending interrupt. This is not only faster, but also better readable. Reviewed-by: Christian Borntraeger Signed-off-by: David Hildenbrand

[GIT PULL 00/10] KVM: s390: Fixes for 4.4

2015-10-13 Thread Christian Borntraeger
Paolo, The following changes since commit 9ffecb10283508260936b96022d4ee43a7798b4c: Linux 4.3-rc3 (2015-09-27 07:50:08 -0400) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git tags/kvm-s390-next-20151013 for you to fetch changes up

[GIT PULL 04/10] KVM: s390: kvm_arch_vcpu_runnable already cares about timer interrupts

2015-10-13 Thread Christian Borntraeger
From: David Hildenbrand We can remove that double check. Reviewed-by: Christian Borntraeger Signed-off-by: David Hildenbrand Signed-off-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c |

[GIT PULL 10/10] KVM: s390: factor out reading of the guest TOD clock

2015-10-13 Thread Christian Borntraeger
From: David Hildenbrand Let's factor this out and always use get_tod_clock_fast() when reading the guest TOD. STORE CLOCK FAST does not do serialization and, therefore, might result in some fuzziness between different processors in a way that subsequent calls on

[GIT PULL 02/10] KVM: s390: disabled wait cares about machine checks, not PER

2015-10-13 Thread Christian Borntraeger
From: David Hildenbrand We don't care about program event recording irqs (synchronous program irqs) but asynchronous irqs when checking for disabled wait. Machine checks were missing. Let's directly switch to the functions we have for that purpose instead of testing

[GIT PULL 08/10] KVM: s390: switch to get_tod_clock() and fix STP sync races

2015-10-13 Thread Christian Borntraeger
From: David Hildenbrand Nobody except early.c makes use of store_tod_clock() to handle the cc. So if we would get a cc != 0, we would be in more trouble. Let's replace all users with get_tod_clock(). Returning a cc on an ioctl sounded strange either way. We can now

[GIT PULL 07/10] KVM: s390: correctly handle injection of pgm irqs and per events

2015-10-13 Thread Christian Borntraeger
From: David Hildenbrand PER events can always co-exist with other program interrupts. For now, we always overwrite all program interrupt parameters when injecting any type of program interrupt. Let's handle that correctly by only overwriting the relevant portion of the

[GIT PULL 06/10] KVM: s390: simplify in-kernel program irq injection

2015-10-13 Thread Christian Borntraeger
From: David Hildenbrand The main reason to keep program injection in kernel separated until now was that we were able to do some checking, if really only the owning thread injects program interrupts (via waitqueue_active(li->wq)). This BUG_ON was never triggered and the

Re: [PATCH v3 02/32] acpi: add aml_sizeof

2015-10-13 Thread Igor Mammedov
On Sun, 11 Oct 2015 11:52:34 +0800 Xiao Guangrong wrote: > Implement SizeOf term which is used by NVDIMM _DSM method in later patch > > Signed-off-by: Xiao Guangrong Reviewed-by: Igor Mammedov > --- >

Re: [PATCH 0/2] KVM: x86: fix deliver of SMIs to halted VCPUs

2015-10-13 Thread Paolo Bonzini
On 13/10/2015 12:34, Paolo Bonzini wrote: > While SeaBIOS only uses synchronous SMI delivery through port 0xb2, > OVMF also uses APIC delivery, and it is buggy. > > This is enough to run OVMF with SMM enabled and multiple processors, > up to a UEFI shell, but it literally takes minutes to get

Re: [Qemu-devel] [PATCH v3 11/32] hostmem-file: use whole file size if possible

2015-10-13 Thread Vladimir Sementsov-Ogievskiy
On 11.10.2015 06:52, Xiao Guangrong wrote: Use the whole file size if @size is not specified which is useful if we want to directly pass a file to guest Signed-off-by: Xiao Guangrong --- backends/hostmem-file.c | 47

Re: [PATCH v3 03/32] acpi: add aml_create_field

2015-10-13 Thread Igor Mammedov
On Sun, 11 Oct 2015 11:52:35 +0800 Xiao Guangrong wrote: > Implement CreateField term which is used by NVDIMM _DSM method in later patch > > Signed-off-by: Xiao Guangrong > --- > hw/acpi/aml-build.c | 13 + >

Re: [PATCH v3 01/32] acpi: add aml_derefof

2015-10-13 Thread Igor Mammedov
On Sun, 11 Oct 2015 11:52:33 +0800 Xiao Guangrong wrote: > Implement DeRefOf term which is used by NVDIMM _DSM method in later patch > > Signed-off-by: Xiao Guangrong Reviewed-by: Igor Mammedov > --- >

Re: [PATCH v2 5/5] KVM: nVMX: expose VPID capability to L1

2015-10-13 Thread Paolo Bonzini
On 08/10/2015 07:57, Wanpeng Li wrote: > Expose VPID capability to L1. For nested guests, we don't do anything > specific for single context invalidation. Hence, only advertise support > for global context invalidation. The major benefit of nested VPID comes > from having separate vpids when

Re: [Qemu-devel] [PATCH v3 25/32] nvdimm: build ACPI nvdimm devices

2015-10-13 Thread Igor Mammedov
On Sun, 11 Oct 2015 11:52:57 +0800 Xiao Guangrong wrote: > NVDIMM devices is defined in ACPI 6.0 9.20 NVDIMM Devices > > There is a root device under \_SB and specified NVDIMM devices are under the > root device. Each NVDIMM device has _ADR which returns its

Re: [GIT PULL 00/10] KVM: s390: Fixes for 4.4

2015-10-13 Thread Paolo Bonzini
cm/linux/kernel/git/kvms390/linux.git > tags/kvm-s390-next-20151013 > > for you to fetch changes up to 60417fcc2b0235dfe3dcd589c56dbe3ea1a64c54: > > KVM: s390: factor out reading of the guest TOD clock (2015-10-13 15:50:35 > +0200) > >

Re: [PATCH v2 3/5] KVM: nVMX: emulate the INVVPID instruction

2015-10-13 Thread Paolo Bonzini
On 08/10/2015 07:57, Wanpeng Li wrote: > Add the INVVPID instruction emulation. > > Reviewed-by: Wincy Van > Signed-off-by: Wanpeng Li > --- > arch/x86/include/asm/vmx.h | 3 +++ > arch/x86/kvm/vmx.c | 49 >

Re: [PATCH 1/2] KVM: x86: build kvm_userspace_memory_region in x86_set_memory_region

2015-10-13 Thread Radim Krčmář
2015-10-12 14:09+0200, Paolo Bonzini: > The next patch will make x86_set_memory_region fill the > userspace_addr. Since the struct is not used untouched > anymore, it makes sense to build it in x86_set_memory_region > directly; it also simplifies the callers. > > Reported-by: Alexandre DERUMIER

Re: [PATCH 13/15] arm64: kvm: Rewrite fake pgd handling

2015-10-13 Thread Christoffer Dall
On Mon, Oct 12, 2015 at 10:55:24AM +0100, Suzuki K. Poulose wrote: > On 10/10/15 15:52, Christoffer Dall wrote: > >Hi Suzuki, > > Hi Christoffer, > > Thanks for being patient enough to review the code :-) without much of > the comments. I now realise there needs much more documentation than >

Re: [PATCH 2/2] KVM: x86: map/unmap private slots in __x86_set_memory_region

2015-10-13 Thread Radim Krčmář
2015-10-12 14:09+0200, Paolo Bonzini: > Otherwise, two copies (one of them never used and thus bogus) are > allocated for the regular and SMM address spaces. This breaks > SMM with EPT but without unrestricted guest support, because the > SMM copy of the identity page map is all zeros. (Have you

Re: [PATCH 1/2] KVM: arm/arm64: Optimize away redundant LR tracking

2015-10-13 Thread Christoffer Dall
On Mon, Oct 12, 2015 at 05:56:14PM +0100, Andre Przywara wrote: > Hi, > > On 02/10/15 15:44, Pavel Fedin wrote: > > Currently we use vgic_irq_lr_map in order to track which LRs hold which > > IRQs, and lr_used bitmap in order to track which LRs are used or free. > > > > vgic_irq_lr_map is

Re: [PATCH 1/2] KVM: x86: clean up kvm_arch_vcpu_runnable

2015-10-13 Thread Radim Krčmář
2015-10-13 12:34+0200, Paolo Bonzini: > Split the huge conditional in two functions. > > Fixes: 64d6067057d9658acb8675afcfba549abdb7fc16 > Cc: sta...@vger.kernel.org > Signed-off-by: Paolo Bonzini > --- Thanks! Reviewed-by: Radim Krčmář -- To

RE: [PATCH v3 00/16] KVM: arm64: GICv3 ITS emulation

2015-10-13 Thread Pavel Fedin
Hello! I already suggested one bunch of fixes on top of vITS series, and here is another one. It reconciles it with spurious interrupt fix, and adds missing check in vgic_retire_disabled_irqs(), which was removed in original v3 series. --- >From bdbedc35a4dc9bc258b21792cf734aa3b2383dff Mon

Re: [PATCH 2/2] KVM: x86: fix SMI to halted VCPU

2015-10-13 Thread Radim Krčmář
2015-10-13 12:34+0200, Paolo Bonzini: > An SMI to a halted VCPU must wake it up, hence a VCPU with a pending > SMI must be considered runnable. > > Fixes: 64d6067057d9658acb8675afcfba549abdb7fc16 > Cc: sta...@vger.kernel.org > Signed-off-by: Paolo Bonzini > --- Reviewed-by:

Re: [PATCH v3 04/32] acpi: add aml_mutex, aml_acquire, aml_release

2015-10-13 Thread Xiao Guangrong
On 10/13/2015 09:34 PM, Igor Mammedov wrote: On Sun, 11 Oct 2015 11:52:36 +0800 Xiao Guangrong wrote: Implement Mutex, Acquire and Release terms which are used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong

Re: [Qemu-devel] [PATCH v3 25/32] nvdimm: build ACPI nvdimm devices

2015-10-13 Thread Xiao Guangrong
On 10/13/2015 10:39 PM, Igor Mammedov wrote: On Sun, 11 Oct 2015 11:52:57 +0800 Xiao Guangrong wrote: NVDIMM devices is defined in ACPI 6.0 9.20 NVDIMM Devices There is a root device under \_SB and specified NVDIMM devices are under the root device. Each

Re: [PATCH 2/2] KVM: x86: map/unmap private slots in __x86_set_memory_region

2015-10-13 Thread Paolo Bonzini
On 13/10/2015 17:39, Radim Krčmář wrote: > 2015-10-12 14:09+0200, Paolo Bonzini: >> Otherwise, two copies (one of them never used and thus bogus) are >> allocated for the regular and SMM address spaces. This breaks >> SMM with EPT but without unrestricted guest support, because the >> SMM copy

Re: [Qemu-devel] [PATCH v3 11/32] hostmem-file: use whole file size if possible

2015-10-13 Thread Xiao Guangrong
On 10/13/2015 07:50 PM, Vladimir Sementsov-Ogievskiy wrote: On 11.10.2015 06:52, Xiao Guangrong wrote: Use the whole file size if @size is not specified which is useful if we want to directly pass a file to guest Signed-off-by: Xiao Guangrong ---

Re: [PATCH 2/2] KVM: x86: map/unmap private slots in __x86_set_memory_region

2015-10-13 Thread Radim Krčmář
2015-10-13 18:28+0200, Paolo Bonzini: > On 13/10/2015 17:39, Radim Krčmář wrote: >> 2015-10-12 14:09+0200, Paolo Bonzini: >>> Otherwise, two copies (one of them never used and thus bogus) are >>> allocated for the regular and SMM address spaces. This breaks >>> SMM with EPT but without

Re: [PATCH 13/15] arm64: kvm: Rewrite fake pgd handling

2015-10-13 Thread Suzuki K. Poulose
On 13/10/15 16:39, Christoffer Dall wrote: On Mon, Oct 12, 2015 at 10:55:24AM +0100, Suzuki K. Poulose wrote: On 10/10/15 15:52, Christoffer Dall wrote: Hi Suzuki, Hi Christoffer, Thanks for being patient enough to review the code :-) without much of the comments. I now realise there needs

Re: [PATCH v3 03/32] acpi: add aml_create_field

2015-10-13 Thread Xiao Guangrong
On 10/13/2015 08:38 PM, Igor Mammedov wrote: On Sun, 11 Oct 2015 11:52:35 +0800 Xiao Guangrong wrote: Implement CreateField term which is used by NVDIMM _DSM method in later patch Signed-off-by: Xiao Guangrong ---

[kvm:master 9/11] arch/x86/kvm/x86.c:7499:3: note: in expansion of macro 'if'

2015-10-13 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git master head: 73917739334c6509833b0403b81d4a04a8784bdf commit: f0d648bdf0a5bbc91da6099d5282f77996558ea4 [9/11] KVM: x86: map/unmap private slots in __x86_set_memory_region config: i386-randconfig-x000-10121721 (attached as .config)

[kvm:master 9/11] arch/x86/kvm/x86.c:7499:14: warning: cast to pointer from integer of different size

2015-10-13 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git master head: 73917739334c6509833b0403b81d4a04a8784bdf commit: f0d648bdf0a5bbc91da6099d5282f77996558ea4 [9/11] KVM: x86: map/unmap private slots in __x86_set_memory_region config: i386-randconfig-s0-201541 (attached as .config) reproduce:

Re: [PATCH v2 5/5] KVM: nVMX: expose VPID capability to L1

2015-10-13 Thread Wanpeng Li
On 10/13/15 10:44 PM, Paolo Bonzini wrote: On 08/10/2015 07:57, Wanpeng Li wrote: Expose VPID capability to L1. For nested guests, we don't do anything specific for single context invalidation. Hence, only advertise support for global context invalidation. The major benefit of nested VPID

Re: [PATCH v3 23/32] nvdimm: build ACPI NFIT table

2015-10-13 Thread Xiao Guangrong
On 10/13/2015 01:42 PM, Michael S. Tsirkin wrote: On Tue, Oct 13, 2015 at 01:13:18PM +0800, Xiao Guangrong wrote: #endif This header is too small to be worth it. nvdimm_get_built_list seems to be the only interface - just stick it in the header you have under include. Other functions

Re: [PATCH v3 23/32] nvdimm: build ACPI NFIT table

2015-10-13 Thread Michael S. Tsirkin
On Tue, Oct 13, 2015 at 01:17:20PM +0800, Xiao Guangrong wrote: > >Would it worth including / copying the ACPICA header files directly? > > > >https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/acpi/actbl1.h >