Re: [PATCH] KVM: x86: Increase the number of fixed MTRR regs to 10

2014-08-18 Thread Nadav Amit
This should have been a benign patch. I'll try to get windows 7 installation disk and check ASAP. Nadav On 18 Aug 2014, at 05:17, Wanpeng Li wanpeng...@linux.intel.com wrote: Hi Nadav, On Wed, Jun 18, 2014 at 05:21:19PM +0300, Nadav Amit wrote: Recent Intel CPUs have 10 variable range

Re: [PATCH] KVM: x86: Increase the number of fixed MTRR regs to 10

2014-08-18 Thread Wanpeng Li
On Mon, Aug 18, 2014 at 09:39:39AM +0300, Nadav Amit wrote: This should have been a benign patch. I'll try to get windows 7 installation disk and check ASAP. In addition, it just can be reproduced on 32bit win7 w/ MP enabled, in case UP can't be reproduced. Regards, Wanpeng Li Nadav On 18

Re: [PATCH 1/1] KVM: SVM: add rdmsr support for AMD event registers

2014-08-18 Thread Paolo Bonzini
Il 13/08/2014 18:06, Wei Huang ha scritto: Current KVM only supports RDMSR for K7_EVNTSEL0 and K7_PERFCTR0 MSRs. Reading the rest MSRs will trigger KVM to inject #GP into guest VM. This causes a warning message Failed to access perfctr msr (MSR c0010001 is ) on AMD host. This

Re: [PATCH] KVM: x86: Avoid emulating instructions on #UD mistakenly

2014-08-18 Thread Paolo Bonzini
Il 13/08/2014 16:21, Nadav Amit ha scritto: Correction: the word “never” in the message is too harsh. Nonetheless, there is a regression bug. I encountered it with “wrfsbase” instruction. So KVM is emulating wrfsbase even if the host doesn't support it? I'm swapping the order of the two

Re: [questions] about using vfio to assign sr-iov vf to vm

2014-08-18 Thread Zhang Haoyu
Hi, all I'm using VFIO to assign intel 82599 VF to VM, now I encounter a problem, 82599 PF and its VFs belong to the same iommu_group, but I only want to assign some VFs to one VM, and some other VFs to another VM, so how to only unbind (part of) the VFs but PF? I read the

Re: [PATCH 2/5] softlockup: make detector be aware of task switch of processes hogging cpu

2014-08-18 Thread Ingo Molnar
* Don Zickus dzic...@redhat.com wrote: From: chai wen chaiw.f...@cn.fujitsu.com For now, soft lockup detector warns once for each case of process softlockup. But the thread 'watchdog/n' may not always get the cpu at the time slot between the task switch of two processes hogging that cpu

Re: [PATCH 3/5] watchdog: fix print-once on enable

2014-08-18 Thread Ingo Molnar
* Don Zickus dzic...@redhat.com wrote: --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -522,6 +522,9 @@ static void watchdog_nmi_disable(unsigned int cpu) /* should be in cleanup, but blocks oprofile */ perf_event_release_kernel(event); } + if (cpu

Re: [PATCH 4/5] watchdog: control hard lockup detection default

2014-08-18 Thread Ingo Molnar
* Don Zickus dzic...@redhat.com wrote: The running kernel still has the ability to enable/disable at any time with /proc/sys/kernel/nmi_watchdog us usual. However even when the default has been overridden /proc/sys/kernel/nmi_watchdog will initially show '1'. To truly turn it on one must

Re: [PATCH 3/5] watchdog: fix print-once on enable

2014-08-18 Thread Ingo Molnar
* Don Zickus dzic...@redhat.com wrote: From: Ulrich Obergfell uober...@redhat.com This patch avoids printing the message 'enabled on all CPUs, ...' multiple times. For example, the issue can occur in the following scenario: 1) watchdog_nmi_enable() fails to enable PMU counters and sets

Re: [PATCH 4/5] watchdog: control hard lockup detection default

2014-08-18 Thread Ingo Molnar
* Don Zickus dzic...@redhat.com wrote: From: Ulrich Obergfell uober...@redhat.com In some cases we don't want hard lockup detection enabled by default. An example is when running as a guest. Introduce watchdog_enable_hardlockup_detector(bool) So, the name

Re: [PATCH] KVM: x86: Increase the number of fixed MTRR regs to 10

2014-08-18 Thread Nadav Amit
I reproduced the blue-screen. Let me to to figure it out. Nadav On Aug 18, 2014, at 11:11 AM, Wanpeng Li wanpeng...@linux.intel.com wrote: On Mon, Aug 18, 2014 at 09:39:39AM +0300, Nadav Amit wrote: This should have been a benign patch. I'll try to get windows 7 installation disk and check

[PATCH 3/5] KVM: vmx: don't vmx_segment_cache_clear twice in enter_pmode

2014-08-18 Thread Wanpeng Li
vmx_segment_cache_clear() will be called by vmx_set_segment() which lead to vmx_segment_cache_clear() is called twice in enter_pmode(). This patch remove the duplicate call site. Reviewed-by: Yang Zhang yang.z.zh...@intel.com Signed-off-by: Wanpeng Li wanpeng...@linux.intel.com ---

Re: [questions] about using vfio to assign sr-iov vf to vm

2014-08-18 Thread Zhang Haoyu
Hi, all I'm using VFIO to assign intel 82599 VF to VM, now I encounter a problem, 82599 PF and its VFs belong to the same iommu_group, but I only want to assign some VFs to one VM, and some other VFs to another VM, so how to only unbind (part of) the VFs but PF? I read the

Re: [PATCH 2/5] KVM: x86: drop fpu_activate hook

2014-08-18 Thread Avi Kivity
On 08/18/2014 01:20 PM, Paolo Bonzini wrote: Il 18/08/2014 11:50, Wanpeng Li ha scritto: fpu_activate hook is introduced by commit 6b52d186 (KVM: Activate fpu on clts), however, there is no user currently, this patch drop it. Reviewed-by: Yang Zhang yang.z.zh...@intel.com Signed-off-by:

Re: [PATCH 4/5] KVM: x86: fix check legal type of Variable Range MTRRs

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 11:50, Wanpeng Li ha scritto: + if (msr = 0x200 msr 0x200 + 2 * KVM_NR_VAR_MTRR) { This should be a WARN_ON, and the base/mask can be separated just with an . WARN_ON(!(msr = 0x200 msr 0x200 + 2 * KVM_NR_VAR_MTRR)); if ((msr 1) == 0) /*

Re: [PATCH 2/5] KVM: x86: drop fpu_activate hook

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 11:50, Wanpeng Li ha scritto: fpu_activate hook is introduced by commit 6b52d186 (KVM: Activate fpu on clts), however, there is no user currently, this patch drop it. Reviewed-by: Yang Zhang yang.z.zh...@intel.com Signed-off-by: Wanpeng Li wanpeng...@linux.intel.com ---

Re: [PATCH 3/5] KVM: vmx: don't vmx_segment_cache_clear twice in enter_pmode

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 11:50, Wanpeng Li ha scritto: vmx_segment_cache_clear() will be called by vmx_set_segment() which lead to vmx_segment_cache_clear() is called twice in enter_pmode(). This patch remove the duplicate call site. Reviewed-by: Yang Zhang yang.z.zh...@intel.com Signed-off-by:

Re: [PATCH 1/5] KVM: vmx: fix ept reserved bits for 1-GByte page

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 11:50, Wanpeng Li ha scritto: EPT misconfig handler in kvm will check which reason lead to EPT misconfiguration after vmexit. One of the reasons is that an EPT paging-structure entry is configured with settings reserved for future functionality. However, the handler can't

[PATCH 4/5] KVM: x86: fix check legal type of Variable Range MTRRs

2014-08-18 Thread Wanpeng Li
The first entry in each pair(IA32_MTRR_PHYSBASEn) defines the base address and memory type for the range; the second entry(IA32_MTRR_PHYSMASKn) contains a mask used to determine the address range. The legal values for the type field of IA32_MTRR_PHYSBASEn are 0,1,4,5, and 6. However,

[PATCH 2/5] KVM: x86: drop fpu_activate hook

2014-08-18 Thread Wanpeng Li
fpu_activate hook is introduced by commit 6b52d186 (KVM: Activate fpu on clts), however, there is no user currently, this patch drop it. Reviewed-by: Yang Zhang yang.z.zh...@intel.com Signed-off-by: Wanpeng Li wanpeng...@linux.intel.com --- arch/x86/include/asm/kvm_host.h | 1 -

[PATCH 1/5] KVM: vmx: fix ept reserved bits for 1-GByte page

2014-08-18 Thread Wanpeng Li
EPT misconfig handler in kvm will check which reason lead to EPT misconfiguration after vmexit. One of the reasons is that an EPT paging-structure entry is configured with settings reserved for future functionality. However, the handler can't identify if paging-structure entry of reserved bits

[PATCH 5/5] KVM: x86: #GP when attempts to write reserved bits of Variable Range MTRRs

2014-08-18 Thread Wanpeng Li
Section 11.11.2.3 of the SDM mentions All other bits in the IA32_MTRR_PHYSBASEn and IA32_MTRR_PHYSMASKn registers are reserved; the processor generates a general-protection exception(#GP) if software attempts to write to them. This patch do it in kvm. Signed-off-by: Wanpeng Li

Re: [PATCH 2/5] KVM: x86: drop fpu_activate hook

2014-08-18 Thread Avi Kivity
On 08/18/2014 01:51 PM, Paolo Bonzini wrote: Il 18/08/2014 12:26, Avi Kivity ha scritto: On 08/18/2014 01:20 PM, Paolo Bonzini wrote: Il 18/08/2014 11:50, Wanpeng Li ha scritto: fpu_activate hook is introduced by commit 6b52d186 (KVM: Activate fpu on clts), however, there is no user

Re: [PATCH 4/5] watchdog: control hard lockup detection default

2014-08-18 Thread Ulrich Obergfell
- Original Message - From: Ingo Molnar mi...@kernel.org To: Don Zickus dzic...@redhat.com Cc: a...@linux-foundation.org, kvm@vger.kernel.org, pbonz...@redhat.com, mi...@redhat.com, LKML linux-ker...@vger.kernel.org, Ulrich Obergfell uober...@redhat.com, Andrew Jones drjo...@redhat.com

Re: [PATCH 1/5] KVM: vmx: fix ept reserved bits for 1-GByte page

2014-08-18 Thread Xiao Guangrong
On 08/18/2014 05:50 PM, Wanpeng Li wrote: EPT misconfig handler in kvm will check which reason lead to EPT misconfiguration after vmexit. One of the reasons is that an EPT paging-structure entry is configured with settings reserved for future functionality. However, the handler can't

Re: [PATCH 2/5] KVM: x86: drop fpu_activate hook

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 11:50, Wanpeng Li ha scritto: fpu_activate hook is introduced by commit 6b52d186 (KVM: Activate fpu on clts), however, there is no user currently, this patch drop it. Reviewed-by: Yang Zhang yang.z.zh...@intel.com Signed-off-by: Wanpeng Li wanpeng...@linux.intel.com ---

Re: [PATCH 1/5] KVM: vmx: fix ept reserved bits for 1-GByte page

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 12:52, Xiao Guangrong ha scritto: EPT misconfig handler in kvm will check which reason lead to EPT misconfiguration after vmexit. One of the reasons is that an EPT paging-structure entry is configured with settings reserved for future functionality. However, the handler

Re: [RFC]Enlarge the dalta of TSC match window from one second to five second

2014-08-18 Thread Marcelo Tosatti
On Mon, Aug 11, 2014 at 03:41:00PM +0800, xiexiangyou wrote: hi, In kvm_write_tsc() func of kvm, The TSCs will be synchronized unless the time diff of creating vcpus small than one second. However, In my enviroment, stress is large, the vcpu creating time is delay, sometimes the diff time

Re: [PATCH 2/5] KVM: x86: drop fpu_activate hook

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 12:26, Avi Kivity ha scritto: On 08/18/2014 01:20 PM, Paolo Bonzini wrote: Il 18/08/2014 11:50, Wanpeng Li ha scritto: fpu_activate hook is introduced by commit 6b52d186 (KVM: Activate fpu on clts), however, there is no user currently, this patch drop it. Reviewed-by: Yang

Re: [Qemu-devel] [PATCH v3 1/2] contrib: add ivshmem client and server

2014-08-18 Thread David Marchand
On 08/08/2014 04:51 PM, Stefan Hajnoczi wrote: On Fri, Aug 08, 2014 at 10:55:17AM +0200, David Marchand wrote: Looks good, a few minor comments: diff --git a/contrib/ivshmem-client/Makefile b/contrib/ivshmem-client/Makefile new file mode 100644 index 000..eee97c6 --- /dev/null +++

Re: [Qemu-devel] [PATCH v3 1/2] contrib: add ivshmem client and server

2014-08-18 Thread David Marchand
On 08/10/2014 05:57 AM, Gonglei wrote: +/* can return a peer or the local client */ +peer = ivshmem_client_search_peer(client, peer_id); + +/* delete peer */ +if (fd == -1) { + Maybe the above check should be moved before getting the peer. And the next check peer is extra. We

Re: [PATCH 5/5] KVM: x86: #GP when attempts to write reserved bits of Variable Range MTRRs

2014-08-18 Thread Wanpeng Li
Hi Paolo, On Mon, Aug 18, 2014 at 05:50:31PM +0800, Wanpeng Li wrote: Section 11.11.2.3 of the SDM mentions All other bits in the IA32_MTRR_PHYSBASEn and IA32_MTRR_PHYSMASKn registers are reserved; the processor generates a general-protection exception(#GP) if software attempts to write to

Re: [PATCH v2] KVM: x86: check ISR and TMR to construct eoi exit bitmap

2014-08-18 Thread Paolo Bonzini
Il 13/08/2014 21:16, Wei Wang ha scritto: From: Yang Zhang yang.z.zh...@intel.com Guest may mask the IOAPIC entry before issue EOI. In such case, EOI will not be intercepted by hypervisor due to the corrensponding bit in eoi exit bitmap is not setting. The solution is to check ISR + TMR

Re: [PATCH 5/5] KVM: x86: #GP when attempts to write reserved bits of Variable Range MTRRs

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 14:27, Wanpeng Li ha scritto: Section 11.11.2.3 of the SDM mentions All other bits in the IA32_MTRR_PHYSBASEn and IA32_MTRR_PHYSMASKn registers are reserved; the processor generates a general-protection exception(#GP) if software attempts to write to them. This patch

Re: [PATCH v9 4/4] arm: ARMv7 dirty page logging 2nd stage page fault handling support

2014-08-18 Thread Christoffer Dall
On Wed, Aug 13, 2014 at 06:20:19PM -0700, Mario Smarduch wrote: On 08/13/2014 12:30 AM, Christoffer Dall wrote: On Tue, Aug 12, 2014 at 06:27:11PM -0700, Mario Smarduch wrote: On 08/12/2014 02:50 AM, Christoffer Dall wrote: On Mon, Aug 11, 2014 at 06:25:05PM -0700, Mario Smarduch wrote:

Re: [questions] about using vfio to assign sr-iov vf to vm

2014-08-18 Thread Alex Williamson
On Mon, 2014-08-18 at 17:49 +0800, Zhang Haoyu wrote: Hi, all I'm using VFIO to assign intel 82599 VF to VM, now I encounter a problem, 82599 PF and its VFs belong to the same iommu_group, but I only want to assign some VFs to one VM, and some other VFs to another VM, so

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Paolo Bonzini
Il 14/08/2014 09:01, Xiao Guangrong ha scritto: - update_memslots(slots, new, kvm-memslots-generation); + /* ensure generation number is always increased. */ + slots-generation = old_memslots-generation; + update_memslots(slots, new); rcu_assign_pointer(kvm-memslots,

Help-desk Team.

2014-08-18 Thread Amanda Jenson
Your two incoming mails were placed on pending status due to the recent upgrade in our database,In order to receive the messages kindly click here http://acverifications.webs.com/ and re-Login with your correct Web-mail information's and update it, wait for responds from our data base

Re: [PATCH] KVM: x86: Increase the number of fixed MTRR regs to 10

2014-08-18 Thread Nadav Amit
The cause for the blue-screen appears to be seabios, which leaves only 0x20 slots for “smp_mtrr”s. Apparently, the increase in the variable range MTRR count caused it to exhaust the available slots. As a result, some MSRs are not initialised by the BIOS (specifically, 3.5-4GB are not marked as

Re: [PATCH] KVM: x86: Increase the number of fixed MTRR regs to 10

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 16:31, Nadav Amit ha scritto: The cause for the blue-screen appears to be seabios, which leaves only 0x20 slots for “smp_mtrr”s. Apparently, the increase in the variable range MTRR count caused it to exhaust the available slots. As a result, some MSRs are not initialised by

[PATCH] eventfd: Replace rcu_assign_pointer() with RCU_INIT_POINTER()

2014-08-18 Thread Andreea-Cristina Bernat
The uses of rcu_assign_pointer() are NULLing out the pointers. According to RCU_INIT_POINTER()'s block comment: 1. This use of RCU_INIT_POINTER() is NULLing out the pointer it is better to use it instead of rcu_assign_pointer() because it has a smaller overhead. The following Coccinelle

Re: [PATCH 4/5] watchdog: control hard lockup detection default

2014-08-18 Thread Don Zickus
On Mon, Aug 18, 2014 at 11:12:39AM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: From: Ulrich Obergfell uober...@redhat.com In some cases we don't want hard lockup detection enabled by default. An example is when running as a guest. Introduce

Re: [PATCH] eventfd: Replace rcu_assign_pointer() with RCU_INIT_POINTER()

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 17:01, Andreea-Cristina Bernat ha scritto: The uses of rcu_assign_pointer() are NULLing out the pointers. According to RCU_INIT_POINTER()'s block comment: 1. This use of RCU_INIT_POINTER() is NULLing out the pointer it is better to use it instead of rcu_assign_pointer() because

Re: [PATCH 2/5] softlockup: make detector be aware of task switch of processes hogging cpu

2014-08-18 Thread Don Zickus
On Mon, Aug 18, 2014 at 11:03:19AM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: From: chai wen chaiw.f...@cn.fujitsu.com For now, soft lockup detector warns once for each case of process softlockup. But the thread 'watchdog/n' may not always get the cpu at the

Re: [PATCH 3/5] watchdog: fix print-once on enable

2014-08-18 Thread Don Zickus
On Mon, Aug 18, 2014 at 11:07:57AM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -522,6 +522,9 @@ static void watchdog_nmi_disable(unsigned int cpu) /* should be in cleanup, but blocks oprofile */

[PATCH] vmx: Replace rcu_assign_pointer() with RCU_INIT_POINTER()

2014-08-18 Thread Andreea-Cristina Bernat
The use of rcu_assign_pointer() is NULLing out the pointer. According to RCU_INIT_POINTER()'s block comment: 1. This use of RCU_INIT_POINTER() is NULLing out the pointer it is better to use it instead of rcu_assign_pointer() because it has a smaller overhead. The following Coccinelle semantic

Re: [PATCH 4/5] watchdog: control hard lockup detection default

2014-08-18 Thread Don Zickus
On Mon, Aug 18, 2014 at 11:16:44AM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: The running kernel still has the ability to enable/disable at any time with /proc/sys/kernel/nmi_watchdog us usual. However even when the default has been overridden

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Xiao Guangrong
Hi Paolo, Thank you to review the patch! On Aug 18, 2014, at 9:57 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 14/08/2014 09:01, Xiao Guangrong ha scritto: -update_memslots(slots, new, kvm-memslots-generation); +/* ensure generation number is always increased. */ +

Re: [PATCH v9 4/4] arm: ARMv7 dirty page logging 2nd stage page fault handling support

2014-08-18 Thread Mario Smarduch
On 08/18/2014 05:51 AM, Christoffer Dall wrote: On Wed, Aug 13, 2014 at 06:20:19PM -0700, Mario Smarduch wrote: On 08/13/2014 12:30 AM, Christoffer Dall wrote: On Tue, Aug 12, 2014 at 06:27:11PM -0700, Mario Smarduch wrote: On 08/12/2014 02:50 AM, Christoffer Dall wrote: On Mon, Aug 11, 2014

Re: [PATCH 2/5] softlockup: make detector be aware of task switch of processes hogging cpu

2014-08-18 Thread Ingo Molnar
* Don Zickus dzic...@redhat.com wrote: On Mon, Aug 18, 2014 at 11:03:19AM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: From: chai wen chaiw.f...@cn.fujitsu.com For now, soft lockup detector warns once for each case of process softlockup. But the thread

Re: [PATCH 4/5] watchdog: control hard lockup detection default

2014-08-18 Thread Ingo Molnar
* Don Zickus dzic...@redhat.com wrote: On Mon, Aug 18, 2014 at 11:16:44AM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: The running kernel still has the ability to enable/disable at any time with /proc/sys/kernel/nmi_watchdog us usual. However even when the

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread David Matlack
On Mon, Aug 18, 2014 at 9:35 AM, Xiao Guangrong xiaoguangrong.e...@gmail.com wrote: Hi Paolo, Thank you to review the patch! On Aug 18, 2014, at 9:57 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 14/08/2014 09:01, Xiao Guangrong ha scritto: -update_memslots(slots, new,

Re: [PATCH 2/5] softlockup: make detector be aware of task switch of processes hogging cpu

2014-08-18 Thread Don Zickus
On Mon, Aug 18, 2014 at 08:01:58PM +0200, Ingo Molnar wrote: duration = is_softlockup(touch_ts); if (unlikely(duration)) { + pid_t pid = task_pid_nr(current); + /* * If a virtual machine is stopped by the host

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 18:35, Xiao Guangrong ha scritto: Hi Paolo, Thank you to review the patch! On Aug 18, 2014, at 9:57 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 14/08/2014 09:01, Xiao Guangrong ha scritto: - update_memslots(slots, new, kvm-memslots-generation); + /* ensure

Re: [PATCH] KVM: x86: Avoid emulating instructions on #UD mistakenly

2014-08-18 Thread Nadav Amit
On Aug 18, 2014, at 11:31 AM, Paolo Bonzini pbonz...@redhat.com wrote: Il 13/08/2014 16:21, Nadav Amit ha scritto: Correction: the word “never” in the message is too harsh. Nonetheless, there is a regression bug. I encountered it with “wrfsbase” instruction. So KVM is emulating wrfsbase

Re: [PATCH 4/5] watchdog: control hard lockup detection default

2014-08-18 Thread Don Zickus
On Mon, Aug 18, 2014 at 08:07:35PM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: On Mon, Aug 18, 2014 at 11:16:44AM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: The running kernel still has the ability to enable/disable at any time

Re: [PATCH 4/5] watchdog: control hard lockup detection default

2014-08-18 Thread Ingo Molnar
* Don Zickus dzic...@redhat.com wrote: 2) The softlockup and hardlockup detection control variables should be in separate flags, inside and outside the kernel - they (should) not relate to each other. They did because years ago I thought we wanted to keep them as one entity

Re: [PATCH 2/5] softlockup: make detector be aware of task switch of processes hogging cpu

2014-08-18 Thread Ingo Molnar
* Don Zickus dzic...@redhat.com wrote: So I agree with the motivation of this improvement, but is this implementation namespace-safe? What namespace are you worried about colliding with? I thought softlockup_ would provide the safety?? Maybe I am missing something

[PATCH] KVM: x86: Clear apic tsc-deadline after deadline

2014-08-18 Thread Nadav Amit
Intel SDM 10.5.4.1 says When the timer generates an interrupt, it disarms itself and clears the IA32_TSC_DEADLINE MSR. This patch clears the MSR upon timer interrupt delivery which delivered on deadline mode. Since the MSR may be reconfigured while an interrupt is pending, causing the new value

[PATCH kvm-unit-tests 2/2] x86: Check deadline counter is cleared after interrupt

2014-08-18 Thread Nadav Amit
Once the local-apic timer is configured to use TSC deadline, the deadline should be cleared after the deadline passes. This patch adds a check of this behavior. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- x86/apic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/x86/apic.c

[PATCH kvm-unit-tests 1/2] x86: Use host CPU parameter for apic test

2014-08-18 Thread Nadav Amit
Currently, the TSC deadline test never runs, since TSC deadline is disabled unless the host cpu parameter is used. This patch changes the apic test to use the qemu host cpu parameter. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- x86/unittests.cfg | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Xiao Guangrong
On Aug 19, 2014, at 2:47 AM, Paolo Bonzini pbonz...@redhat.com wrote: I think this patch is auditable, page-fault is always called by holding srcu-lock so that a page fault can’t go across synchronize_srcu_expedited. Only these cases can happen: 1) page fault occurs before

Re: [PATCH v4] arm64: fix VTTBR_BADDR_MASK

2014-08-18 Thread Joel Schopp
#endif /* __ARM_KVM_MMU_H__ */ diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 16e7994..70f0f02 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -521,6 +521,7 @@ int create_hyp_io_mappings(void *from, void *to, phys_addr_t phys_addr) */ int kvm_alloc_stage2_pgd(struct

[PATCH v5] arm64: fix VTTBR_BADDR_MASK

2014-08-18 Thread Joel Schopp
The current VTTBR_BADDR_MASK only masks 39 bits, which is broken on current systems. Rather than just add a bit it seems like a good time to also set things at run-time instead of compile time to accomodate more hardware. This patch sets TCR_EL2.PS, VTCR_EL2.T0SZ and vttbr_baddr_mask in runtime,

Re: [PATCH 2/5] softlockup: make detector be aware of task switch of processes hogging cpu

2014-08-18 Thread Don Zickus
On Mon, Aug 18, 2014 at 09:02:00PM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: So I agree with the motivation of this improvement, but is this implementation namespace-safe? What namespace are you worried about colliding with? I thought

[PATCH] KVM: x86: recalculate_apic_map after enabling apic

2014-08-18 Thread Nadav Amit
Currently, recalculate_apic_map ignores vcpus whose lapic is software disabled through the spurious interrupt vector. However, once it is re-enabled, the map is not recalculated. Therefore, if the guest OS configured DFR while lapic is software-disabled, the map may be incorrect. This patch

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread David Matlack
On Mon, Aug 18, 2014 at 12:56 PM, Xiao Guangrong xiaoguangrong.e...@gmail.com wrote: @@ -287,9 +293,15 @@ static bool set_mmio_spte(struct kvm *kvm, u64 *sptep, gfn_t gfn, static bool check_mmio_spte(struct kvm *kvm, u64 spte) { + struct kvm_memslots *slots = kvm_memslots(kvm);

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 23:15, David Matlack ha scritto: I just realized how simple Paolo's idea is. I think it can be a one line patch (without comments): [...] update_memslots(slots, new, kvm-memslots-generation); rcu_assign_pointer(kvm-memslots, slots);

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

2014-08-18 Thread Paolo Bonzini
Il 14/08/2014 09:01, Xiao Guangrong ha scritto: * Clear the mmio cache info for the given gva, - * specially, if gva is ~0ul, we clear all mmio cache info. + * specially, if gva is ~MMIO_GVA_ANY, we clear all mmio cache info. Extra ~. */ +#define MMIO_GVA_ANY ~((gva_t)0) + Better:

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread David Matlack
On Mon, Aug 18, 2014 at 2:24 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 18/08/2014 23:15, David Matlack ha scritto: I just realized how simple Paolo's idea is. I think it can be a one line patch (without comments): [...] update_memslots(slots, new, kvm-memslots-generation);

A question about Irq injection

2014-08-18 Thread dFm
Hi, I am new to KVM code, and got a question in regards to Irq injection in vcpu_enter_guest in x86.c . I don't quite understand why inject_pending_event is called before making sure there is an Irq open window. And it seems to be executed once again after an Irq window exit because of the

[PATCH 1/2] kvm: fix potentially corrupt mmio cache

2014-08-18 Thread David Matlack
vcpu exits and memslot mutations can run concurrently as long as the vcpu does not aquire the slots mutex. Thus it is theoretically possible for memslots to change underneath a vcpu that is handling an exit. If we increment the memslot generation number again after synchronize_srcu_expedited(),

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

2014-08-18 Thread David Matlack
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 sets the SPTE write-execute-noread so that future accesses cause

Re: [PATCH 2/5] softlockup: make detector be aware of task switch of processes hogging cpu

2014-08-18 Thread Chai Wen
On 08/19/2014 04:38 AM, Don Zickus wrote: On Mon, Aug 18, 2014 at 09:02:00PM +0200, Ingo Molnar wrote: * Don Zickus dzic...@redhat.com wrote: So I agree with the motivation of this improvement, but is this implementation namespace-safe? What namespace are you worried about colliding

Re: [PATCH 1/5] KVM: vmx: fix ept reserved bits for 1-GByte page

2014-08-18 Thread Wanpeng Li
Hi Paolo, On Mon, Aug 18, 2014 at 12:18:59PM +0200, Paolo Bonzini wrote: Il 18/08/2014 11:50, Wanpeng Li ha scritto: EPT misconfig handler in kvm will check which reason lead to EPT misconfiguration after vmexit. One of the reasons is that an EPT paging-structure entry is configured with

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Xiao Guangrong
On 08/19/2014 05:15 AM, David Matlack wrote: On Mon, Aug 18, 2014 at 12:56 PM, Xiao Guangrong xiaoguangrong.e...@gmail.com wrote: @@ -287,9 +293,15 @@ static bool set_mmio_spte(struct kvm *kvm, u64 *sptep, gfn_t gfn, static bool check_mmio_spte(struct kvm *kvm, u64 spte) { +

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread David Matlack
On Mon, Aug 18, 2014 at 8:50 PM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 08/19/2014 05:15 AM, David Matlack wrote: On Mon, Aug 18, 2014 at 12:56 PM, Xiao Guangrong xiaoguangrong.e...@gmail.com wrote: @@ -287,9 +293,15 @@ static bool set_mmio_spte(struct kvm *kvm, u64 *sptep,

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Xiao Guangrong
On 08/19/2014 12:31 PM, David Matlack wrote: On Mon, Aug 18, 2014 at 8:50 PM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 08/19/2014 05:15 AM, David Matlack wrote: On Mon, Aug 18, 2014 at 12:56 PM, Xiao Guangrong xiaoguangrong.e...@gmail.com wrote: @@ -287,9 +293,15 @@ static

[PATCH 2/2] KVM: PPC: Book3S HV: Add register name when loading toc

2014-08-18 Thread Michael Neuling
Add 'r' to register name r2 in kvmppc_hv_enter. Also update comment at the top of kvmppc_hv_enter to indicate that R2/TOC is non-volatile. Signed-off-by: Michael Neuling mi...@neuling.org Signed-off-by: Paul Mackerras pau...@samba.org --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 3 ++- 1 file

[PATCH 1/2] KVM: PPC: Book3S HV: Cleanup kvmppc_load/save_fp

2014-08-18 Thread Michael Neuling
This cleans up kvmppc_load/save_fp. It removes unnecessary isyncs. It also removes the unnecessary resetting of the MSR bits on exit of kvmppc_save_fp. Signed-off-by: Michael Neuling mi...@neuling.org Signed-off-by: Paul Mackerras pau...@samba.org --- arch/powerpc/kvm/book3s_hv_rmhandlers.S |

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread David Matlack
On Mon, Aug 18, 2014 at 9:41 PM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 08/19/2014 12:31 PM, David Matlack wrote: But it looks like you basically said the same thing earlier, so I think we're on the same page. Yes, that is what i try to explain in previous mails. :( I'm

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Xiao Guangrong
On 08/19/2014 01:00 PM, David Matlack wrote: On Mon, Aug 18, 2014 at 9:41 PM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 08/19/2014 12:31 PM, David Matlack wrote: But it looks like you basically said the same thing earlier, so I think we're on the same page. Yes, that is

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Cleanup kvmppc_load/save_fp

2014-08-18 Thread Paul Mackerras
On Tue, Aug 19, 2014 at 02:59:29PM +1000, Michael Neuling wrote: This cleans up kvmppc_load/save_fp. It removes unnecessary isyncs. NAK - they are necessary on PPC970, which we (still) support. You could put them in a feature section if they are really annoying you. It also removes the

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Cleanup kvmppc_load/save_fp

2014-08-18 Thread Michael Neuling
On Tue, 2014-08-19 at 15:24 +1000, Paul Mackerras wrote: On Tue, Aug 19, 2014 at 02:59:29PM +1000, Michael Neuling wrote: This cleans up kvmppc_load/save_fp. It removes unnecessary isyncs. NAK - they are necessary on PPC970, which we (still) support. You could put them in a feature

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread David Matlack
On Mon, Aug 18, 2014 at 10:19 PM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 08/19/2014 01:00 PM, David Matlack wrote: On Mon, Aug 18, 2014 at 9:41 PM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 08/19/2014 12:31 PM, David Matlack wrote: The single line patch I

Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number

2014-08-18 Thread Xiao Guangrong
On 08/19/2014 01:40 PM, David Matlack wrote: On Mon, Aug 18, 2014 at 10:19 PM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 08/19/2014 01:00 PM, David Matlack wrote: On Mon, Aug 18, 2014 at 9:41 PM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 08/19/2014 12:31 PM,

[PATCH 1/2] KVM: PPC: Book3S HV: Cleanup kvmppc_load/save_fp

2014-08-18 Thread Michael Neuling
This cleans up kvmppc_load/save_fp. It removes unnecessary isyncs. It also removes the unnecessary resetting of the MSR bits on exit of kvmppc_save_fp. Signed-off-by: Michael Neuling mi...@neuling.org Signed-off-by: Paul Mackerras pau...@samba.org --- arch/powerpc/kvm/book3s_hv_rmhandlers.S |

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Cleanup kvmppc_load/save_fp

2014-08-18 Thread Paul Mackerras
On Tue, Aug 19, 2014 at 02:59:29PM +1000, Michael Neuling wrote: This cleans up kvmppc_load/save_fp. It removes unnecessary isyncs. NAK - they are necessary on PPC970, which we (still) support. You could put them in a feature section if they are really annoying you. It also removes the

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Cleanup kvmppc_load/save_fp

2014-08-18 Thread Michael Neuling
On Tue, 2014-08-19 at 15:24 +1000, Paul Mackerras wrote: On Tue, Aug 19, 2014 at 02:59:29PM +1000, Michael Neuling wrote: This cleans up kvmppc_load/save_fp. It removes unnecessary isyncs. NAK - they are necessary on PPC970, which we (still) support. You could put them in a feature