RE: [PATCH v2] KVM: x86: keep eoi exit bitmap accurate before loading it.

2014-08-28 Thread Zhang, Yang Z
Paolo Bonzini wrote on 2014-08-27: Il 27/08/2014 16:05, Wei Wang ha scritto: Guest may mask the IOAPIC entry before issue EOI. In such case, EOI will not be intercepted by the hypervisor, since the corresponding bit in eoi_exit_bitmap is not set after the masking of IOAPIC entry. The

Re: [Qemu-devel] [question] e1000 interrupt storm happened becauseofits correspondingioapic-irr bit always set

2014-08-28 Thread Jason Wang
On 08/27/2014 05:31 PM, Zhang Haoyu wrote: Hi, all I use a qemu-1.4.1/qemu-2.0.0 to run win7 guest, and encounter e1000 NIC interrupt storm, because if (!ent-fields.mask (ioapic-irr (1 i))) is always true in __kvm_ioapic_update_eoi(). Any ideas? We meet this several times:

Re: [PATCH v2] KVM: x86: keep eoi exit bitmap accurate before loading it.

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 08:17, Zhang, Yang Z ha scritto: Program edge-triggered MSI for vector 123 Interrupt comes in, ISR[123]=1 Mask MSI Program level-triggered IOAPIC interrupt for vector 123 You cannot assign the vector 123 to another trigger mode interrupt before previous

Re: [PATCH v4] KVM: PPC: BOOKE: Emulate debug registers and exception

2014-08-28 Thread Alexander Graf
On 13.08.14 11:09, Bharat Bhushan wrote: This patch emulates debug registers and debug exception to support guest using debug resource. This enables running gdb/kgdb etc in guest. On BOOKE architecture we cannot share debug resources between QEMU and guest because: When QEMU is using

Re: [Qemu-devel] [PATCH v3 2/2] docs: update ivshmem device spec

2014-08-28 Thread Stefan Hajnoczi
On Tue, Aug 26, 2014 at 01:04:30PM +0200, Paolo Bonzini wrote: Il 26/08/2014 08:47, David Marchand ha scritto: Using a version message supposes we want to keep ivshmem-server and QEMU separated (for example, in two distribution packages) while we can avoid this, so why would we do so ?

Re: [PATCH 2/5] kvmtool: ARM64: Fix compile error for aarch64

2014-08-28 Thread Pekka Enberg
On 08/07/2014 12:12 PM, Will Deacon wrote: Ok. Pekka, could you merge in 3.16 to the kvmtool master branch please? You'll need my patch below to resolve some ARM build fallout. Done. - Pekka -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [PATCH 2/5] kvmtool: ARM64: Fix compile error for aarch64

2014-08-28 Thread Will Deacon
On Thu, Aug 28, 2014 at 10:56:29AM +0100, Pekka Enberg wrote: On 08/07/2014 12:12 PM, Will Deacon wrote: Ok. Pekka, could you merge in 3.16 to the kvmtool master branch please? You'll need my patch below to resolve some ARM build fallout. Done. Thanks, Pekka! We'll give it a spin. Will

RE: [PATCH v2] KVM: x86: keep eoi exit bitmap accurate before loading it.

2014-08-28 Thread Wang, Wei W
We will do some more tests on it to make sure there are no problems. Wei -Original Message- From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo Bonzini Sent: Thursday, August 28, 2014 4:44 PM To: Zhang, Yang Z; Wang, Wei W; kvm@vger.kernel.org Cc:

Re: [PATCH v2] KVM: x86: keep eoi exit bitmap accurate before loading it.

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 12:14, Wang, Wei W ha scritto: We will do some more tests on it to make sure there are no problems. No, I don't think there are any easily-detected practical problems with the patch. But I'm not sure I understand all the theoretical problems and whether possible races are benign.

Re: [Qemu-devel] [question] e1000 interrupt storm happenedbecauseofits correspondingioapic-irr bit always set

2014-08-28 Thread Zhang Haoyu
Hi Jason, I tested below patch, it's okay, the e1000 interrupt storm disappeared. But I am going to make a bit change on it, could you help review it? Currently, we call ioapic_service() immediately when we find the irq is still active during eoi broadcast. But for real hardware, there's some

[PATCH 1/2] KVM: static inline empty kvm_arch functions

2014-08-28 Thread Radim Krčmář
Using static inline is going to save few bytes and cycles. For example on powerpc, the difference is 700 B after stripping. (5 kB before) This patch also deals with two overlooked empty functions: kvm_arch_flush_shadow was not removed from arch/mips/kvm/mips.c 2df72e9bc KVM: split

[PATCH 0/2] KVM: minor cleanup and optimizations

2014-08-28 Thread Radim Krčmář
The first patch answers a demand for inline arch functions. (There is a lot of constant functions that could be inlined as well.) Second patch digs a bit into the history of KVM and removes a useless argument that seemed suspicious when preparing the first patch. Radim Krčmář (2): KVM: static

[PATCH 2/2] KVM: remove garbage arg to *hardware_{en,dis}able

2014-08-28 Thread Radim Krčmář
In the beggining was on_each_cpu(), which required an unused argument to kvm_arch_ops.hardware_{en,dis}able, but this was soon forgotten. Remove unnecessary arguments that stem from this. Signed-off-by: Radim Krčmář rkrc...@redhat.com --- arch/arm/include/asm/kvm_host.h | 2 +-

Re: GET_RNG_SEED hypercall ABI? (Re: [PATCH v5 0/5] random,x86,kvm: Rework arch RNG seeds and get some from kvm)

2014-08-28 Thread Gleb Natapov
On Tue, Aug 26, 2014 at 04:58:34PM -0700, Andy Lutomirski wrote: hpa pointed out that the ABI that I chose (an MSR from the KVM range and a KVM cpuid bit) is unnecessarily KVM-specific. It would be nice to allocate an MSR that everyone involved can agree on and, rather than relying on a cpuid

Re: GET_RNG_SEED hypercall ABI? (Re: [PATCH v5 0/5] random,x86,kvm: Rework arch RNG seeds and get some from kvm)

2014-08-28 Thread Andy Lutomirski
On Aug 28, 2014 7:17 AM, Gleb Natapov g...@kernel.org wrote: On Tue, Aug 26, 2014 at 04:58:34PM -0700, Andy Lutomirski wrote: hpa pointed out that the ABI that I chose (an MSR from the KVM range and a KVM cpuid bit) is unnecessarily KVM-specific. It would be nice to allocate an MSR that

[PATCH 1/3] x86: apic: Look up MAXPHYADDR on CPUID correctly

2014-08-28 Thread Eduardo Habkost
When the CPUID xlevel on QEMU is 0x8008, we get the following: $ ./x86-run x86/apic.flat -smp 2 -cpu qemu64,xlevel=0x8007 [...] FAIL: apicbase: reserved physaddr bits That happens because CPUID[0x8008].EAX won't have the expected data if xlevel 0x8008. When the

[PATCH 0/3] kvm-unit-tests: Check CPUID level/xlevel before using CPUID data

2014-08-28 Thread Eduardo Habkost
Change the kvm-unit-tests x86 code to always check CPUID level/xlevel before looking at CPUID data. Otherwise, the test code will be looking at bogus data. Eduardo Habkost (3): x86: apic: Look up MAXPHYADDR on CPUID correctly x86: vmx: Use cpuid_maxphyaddr() x86: Check level, xlevel before

[PATCH 2/3] x86: vmx: Use cpuid_maxphyaddr()

2014-08-28 Thread Eduardo Habkost
The vmx test code calls cpuid(0x8008) without checking xlevel first. Change it to use cpuid_maxphyaddr() instead. Signed-off-by: Eduardo Habkost ehabk...@redhat.com --- x86/vmx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x86/vmx.c b/x86/vmx.c index

[PATCH 3/3] x86: Check level, xlevel before returning CPUID data

2014-08-28 Thread Eduardo Habkost
None of the existing code using cpuid checks level or xlevel before running it. Instead of changing all callers, make the cpuid() function check if the requested leaf is available, before returning any data. All existing callers of cpuid() and cpuid_indexed() are checks for the presence of

Re: [PATCH v10 0/6] arm: dirty page logging support for ARMv7

2014-08-28 Thread Joel Schopp
On 08/26/2014 06:51 PM, Mario Smarduch wrote: This patch adds support for ARMv7 dirty page logging. Some functions of dirty page logging have been split to generic and arch specific implementations, details below. Dirty page logging is one of serveral features required for live migration, live

Re: GET_RNG_SEED hypercall ABI? (Re: [PATCH v5 0/5] random,x86,kvm: Rework arch RNG seeds and get some from kvm)

2014-08-28 Thread Paolo Bonzini
Il 28/08/2014 18:22, Andy Lutomirski ha scritto: Is there a non-cpuid interface between QEMU and KVM for this? No. AFAICT, even turning off cpuid bits for things like async pf doesn't actually disable the MSRs (which is arguably an attack surface issue). No, it doesn't. You cannot disable

Re: [PATCH v10 0/6] arm: dirty page logging support for ARMv7

2014-08-28 Thread Mario Smarduch
On 08/28/2014 12:26 PM, Joel Schopp wrote: On 08/26/2014 06:51 PM, Mario Smarduch wrote: This patch adds support for ARMv7 dirty page logging. Some functions of dirty page logging have been split to generic and arch specific implementations, details below. Dirty page logging is one of

Re: [PATCH 2/2] kvm: x86: fix stale mmio cache bug

2014-08-28 Thread David Matlack
On Mon, Aug 18, 2014 at 3:46 PM, David Matlack dmatl...@google.com wrote: The following events can lead to an incorrect KVM_EXIT_MMIO bubbling up to userspace: (1) Guest accesses gpa X without a memory slot. The gfn is cached in struct kvm_vcpu_arch (mmio_gfn). On Intel EPT-enabled hosts, KVM

Re: GET_RNG_SEED hypercall ABI? (Re: [PATCH v5 0/5] random,x86,kvm: Rework arch RNG seeds and get some from kvm)

2014-08-28 Thread Andy Lutomirski
On Thu, Aug 28, 2014 at 12:46 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 28/08/2014 18:22, Andy Lutomirski ha scritto: Is there a non-cpuid interface between QEMU and KVM for this? No. Hmm. Then, assuming that someone manages to allocate a cross-hypervisor MSR number for this, what am I

RE: [PATCH v2] KVM: x86: keep eoi exit bitmap accurate before loading it.

2014-08-28 Thread Wang, Wei W
I think we can think about it for another couple of days and see if any corner case is not covered. Wei -Original Message- From: Paolo Bonzini [mailto:pbonz...@redhat.com] Sent: Thursday, August 28, 2014 7:01 PM To: Wang, Wei W; Zhang, Yang Z; kvm@vger.kernel.org Cc:

Re: [Qemu-devel] [question] e1000 interrupt storm happenedbecauseofits correspondingioapic-irr bit always set

2014-08-28 Thread Jason Wang
On 08/28/2014 08:55 PM, Zhang Haoyu wrote: Hi Jason, I tested below patch, it's okay, the e1000 interrupt storm disappeared. But I am going to make a bit change on it, could you help review it? Currently, we call ioapic_service() immediately when we find the irq is still active during eoi

Re: [Qemu-devel] [question] e1000 interrupt storm happenedbecauseofitscorrespondingioapic-irr bit always set

2014-08-28 Thread Zhang Haoyu
Hi, Yang, Gleb, Michael, Could you help review below patch please? Thanks, Zhang Haoyu Hi Jason, I tested below patch, it's okay, the e1000 interrupt storm disappeared. But I am going to make a bit change on it, could you help review it? Currently, we call ioapic_service() immediately when

Re: [Qemu-devel] [question] e1000 interrupt storm happenedbecauseofitscorrespondingioapic-irr bit always set

2014-08-28 Thread Jason Wang
On 08/29/2014 12:07 PM, Zhang, Yang Z wrote: Zhang Haoyu wrote on 2014-08-29: Hi, Yang, Gleb, Michael, Could you help review below patch please? I don't quite understand the background. Why ioacpi-irr is setting before EOI? It should be driver's responsibility to clear the interrupt before

Re: [PATCH v4] KVM: PPC: BOOKE: Emulate debug registers and exception

2014-08-28 Thread Alexander Graf
On 13.08.14 11:09, Bharat Bhushan wrote: This patch emulates debug registers and debug exception to support guest using debug resource. This enables running gdb/kgdb etc in guest. On BOOKE architecture we cannot share debug resources between QEMU and guest because: When QEMU is using

[PATCH 2/2] KVM: remove garbage arg to *hardware_{en,dis}able

2014-08-28 Thread Radim Krčmář
In the beggining was on_each_cpu(), which required an unused argument to kvm_arch_ops.hardware_{en,dis}able, but this was soon forgotten. Remove unnecessary arguments that stem from this. Signed-off-by: Radim Krčmář rkrc...@redhat.com --- arch/arm/include/asm/kvm_host.h | 2 +-

[PATCH 1/2] KVM: static inline empty kvm_arch functions

2014-08-28 Thread Radim Krčmář
Using static inline is going to save few bytes and cycles. For example on powerpc, the difference is 700 B after stripping. (5 kB before) This patch also deals with two overlooked empty functions: kvm_arch_flush_shadow was not removed from arch/mips/kvm/mips.c 2df72e9bc KVM: split

[PATCH 0/2] KVM: minor cleanup and optimizations

2014-08-28 Thread Radim Krčmář
The first patch answers a demand for inline arch functions. (There is a lot of constant functions that could be inlined as well.) Second patch digs a bit into the history of KVM and removes a useless argument that seemed suspicious when preparing the first patch. Radim Krčmář (2): KVM: static