[COMMIT master] svm: Add test for NX bit check in emulated NPT

2010-09-19 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch adds a test to check if the NX bit is checked in the NPT emulation of KVM. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/svm.c b/x86/svm.c index 7c7909e..05e15b1 100644 ---

[COMMIT master] svm: Add test for selective cr0 intercept

2010-09-19 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch adds a test to check if the selective cr0 intercept emulation of the kvm svm emulation works. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/svm.c b/x86/svm.c index 2f1c900..689880d

[COMMIT master] svm: Add test for RSVD bit check in emulated NPT

2010-09-19 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch adds a test to check if the RSVD bits are checked in the NPT emulation of KVM. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/svm.c b/x86/svm.c index 04ca028..03e07e2 100644 ---

[COMMIT master] svm: Run tests with NPT enabled if available

2010-09-19 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch adds code to setup a nested page table which is used for all tests. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/svm.c b/x86/svm.c index 689880d..7c7909e 100644 --- a/x86/svm.c +++

[COMMIT master] svm: Add test for US bit check in emulated NPT

2010-09-19 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch adds a test to check if the US bit is checked in the NPT emulation of KVM. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/svm.c b/x86/svm.c index 05e15b1..04ca028 100644 ---

[COMMIT master] svm: Add test for RW bit check in emulated NPT

2010-09-19 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch adds a test to check if the RW bit is checked in the NPT emulation of KVM. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/svm.c b/x86/svm.c index 03e07e2..3421736 100644 ---

[COMMIT master] svm: Add test for the NPT page table walker

2010-09-19 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch adds a test to check if NPT faults that occur while walking the guest page table are reported correctly. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/svm.c b/x86/svm.c index

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sat, Sep 18, 2010 at 08:27:54PM +0200, Conrad Wood wrote: On Sat, 2010-09-18 at 10:32 -0400, Kevin O'Connor wrote: On Fri, Sep 17, 2010 at 11:39:36PM +0200, Conrad Wood wrote: Hi everyone, I'm currently looking into hotplugging CPUs. This exclusively with linux-guests and

Re: [PATCH v4 0/6] Nonatomic interrupt injection

2010-09-19 Thread Avi Kivity
On 09/17/2010 09:12 PM, Marcelo Tosatti wrote: This is now merged, with the change pointed out by Marcelo. Windows XP x64 fails installation without (vmx.c handle_cr()) case 8: { u8 cr8_prev = kvm_get_cr8(vcpu); u8 cr8 =

Re: [PATCH v4 0/6] Nonatomic interrupt injection

2010-09-19 Thread Avi Kivity
On 09/19/2010 11:25 AM, Avi Kivity wrote: Let's assume that this is so (I'll check). It's trivially so. If a completion causes an interrupt to be raised, the vcpu's apic code is executed in the iothread context. -- error compiling committee.c: too many arguments to function -- To

Re: [PATCH 0/7] New Unit-Tests for KVM SVM emulation v2

2010-09-19 Thread Avi Kivity
On 09/14/2010 05:59 PM, Joerg Roedel wrote: Hi Avi, here is the second version of the new unit-tests for the KVM SVM emulation. The changes to the previous version are really minor: * Fixed coding-style * Fixed comment in the code that builds the nested page table *

Re: [PATCH v4 0/6] Nonatomic interrupt injection

2010-09-19 Thread Avi Kivity
On 09/19/2010 11:28 AM, Avi Kivity wrote: On 09/19/2010 11:25 AM, Avi Kivity wrote: Let's assume that this is so (I'll check). It's trivially so. If a completion causes an interrupt to be raised, the vcpu's apic code is executed in the iothread context. However, that's a bug even

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
On Sun, 2010-09-19 at 08:38 +0200, Gleb Natapov wrote: On Sat, Sep 18, 2010 at 08:27:54PM +0200, Conrad Wood wrote: On Sat, 2010-09-18 at 10:32 -0400, Kevin O'Connor wrote: On Fri, Sep 17, 2010 at 11:39:36PM +0200, Conrad Wood wrote: Hi everyone, I'm currently looking into

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 12:41:37PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 08:38 +0200, Gleb Natapov wrote: On Sat, Sep 18, 2010 at 08:27:54PM +0200, Conrad Wood wrote: On Sat, 2010-09-18 at 10:32 -0400, Kevin O'Connor wrote: On Fri, Sep 17, 2010 at 11:39:36PM +0200, Conrad Wood

Re: [PATCH RFC] kvm: enable irq injection from interrupt context

2010-09-19 Thread Michael S. Tsirkin
On Fri, Sep 17, 2010 at 09:59:29AM +0200, Gleb Natapov wrote: writing 0 to eventfd does nothing. The way to deassert irq That is implementation detail of current irqfd. It was designed for MSI not level triggered interrupts. Maybe we should add a check that gsi is mapped to MSI (or unmapped)

Re: [PATCH RFC] kvm: enable irq injection from interrupt context

2010-09-19 Thread Avi Kivity
On 09/19/2010 12:45 PM, Michael S. Tsirkin wrote: On Fri, Sep 17, 2010 at 09:59:29AM +0200, Gleb Natapov wrote: writing 0 to eventfd does nothing. The way to deassert irq That is implementation detail of current irqfd. It was designed for MSI not level triggered interrupts. Maybe we

Re: [PATCH RFC] kvm: enable irq injection from interrupt context

2010-09-19 Thread Michael S. Tsirkin
On Sun, Sep 19, 2010 at 12:56:12PM +0200, Avi Kivity wrote: On 09/19/2010 12:45 PM, Michael S. Tsirkin wrote: On Fri, Sep 17, 2010 at 09:59:29AM +0200, Gleb Natapov wrote: writing 0 to eventfd does nothing. The way to deassert irq That is implementation detail of current irqfd. It was

Re: [PATCH RFC] kvm: enable irq injection from interrupt context

2010-09-19 Thread Avi Kivity
On 09/19/2010 12:55 PM, Michael S. Tsirkin wrote: On Sun, Sep 19, 2010 at 12:56:12PM +0200, Avi Kivity wrote: On 09/19/2010 12:45 PM, Michael S. Tsirkin wrote: On Fri, Sep 17, 2010 at 09:59:29AM +0200, Gleb Natapov wrote: writing 0 to eventfd does nothing. The way to deassert irq

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
On Sun, 2010-09-19 at 12:46 +0200, Gleb Natapov wrote: [...] But... why does the command info cpus in the monitor report all cpus apart from CPU0 as (halted) ? Because they are halted? Run multiple cpu hogs in the guest and see if cpus will still be halted as reported by monitor. Also

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 01:09:39PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 12:46 +0200, Gleb Natapov wrote: [...] But... why does the command info cpus in the monitor report all cpus apart from CPU0 as (halted) ? Because they are halted? Run multiple cpu hogs in the guest and

Re: [PATCH RFC] kvm: enable irq injection from interrupt context

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 12:55:12PM +0200, Michael S. Tsirkin wrote: On Sun, Sep 19, 2010 at 12:56:12PM +0200, Avi Kivity wrote: On 09/19/2010 12:45 PM, Michael S. Tsirkin wrote: On Fri, Sep 17, 2010 at 09:59:29AM +0200, Gleb Natapov wrote: writing 0 to eventfd does nothing. The way to

Re: [PATCH RFC] kvm: enable irq injection from interrupt context

2010-09-19 Thread Michael S. Tsirkin
On Sun, Sep 19, 2010 at 01:05:09PM +0200, Avi Kivity wrote: On 09/19/2010 12:55 PM, Michael S. Tsirkin wrote: On Sun, Sep 19, 2010 at 12:56:12PM +0200, Avi Kivity wrote: On 09/19/2010 12:45 PM, Michael S. Tsirkin wrote: On Fri, Sep 17, 2010 at 09:59:29AM +0200, Gleb Natapov wrote:

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
On Sun, 2010-09-19 at 13:13 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 01:09:39PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 12:46 +0200, Gleb Natapov wrote: [...] But... why does the command info cpus in the monitor report all cpus apart from CPU0 as (halted) ?

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 01:32:28PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 13:13 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 01:09:39PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 12:46 +0200, Gleb Natapov wrote: [...] But... why does the command info cpus in the

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
On Sun, 2010-09-19 at 13:39 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 01:32:28PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 13:13 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 01:09:39PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 12:46 +0200, Gleb Natapov wrote:

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 01:51:29PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 13:39 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 01:32:28PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 13:13 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 01:09:39PM +0200, Conrad Wood

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
On Sun, 2010-09-19 at 13:59 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 01:51:29PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 13:39 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 01:32:28PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 13:13 +0200, Gleb Natapov wrote:

[PATCH 0/4] Real mode interrupt injection emulation

2010-09-19 Thread Avi Kivity
Our current real mode interrupt injection injects external interrupts as software interrupts, which is somewhat hacky. This is problematic in big real mode (can't use vmx there) and on via processors (a cpu bug prevents this from working correctly). Replace the current mechanism with emulation;

[PATCH 2/4] KVM: Add kvm_inject_realmode_interrupt() wrapper

2010-09-19 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com This adds a wrapper function kvm_inject_realmode_interrupt() around the emulator function emulate_int_real() to allow real mode interrupt injection. [avi: initialize operand and address sizes before emulating interrupts] [avi: initialize rip for real

[PATCH 4/4] KVM: VMX: Respect interrupt window in big real mode

2010-09-19 Thread Avi Kivity
If an interrupt is pending, we need to stop emulation so we can inject it. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 2572153..1a5ecfd 100644 ---

[PATCH 1/4] KVM: x86 emulator: Expose emulate_int_real()

2010-09-19 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/include/asm/kvm_emulate.h

[PATCH 3/4] KVM: VMX: Emulated real mode interrupt injection

2010-09-19 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com Replace the inject-as-software-interrupt hack we currently have with emulated injection. Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 65

Re: [v2 RFC PATCH 0/4] Implement multiqueue virtio-net

2010-09-19 Thread Michael S. Tsirkin
On Fri, Sep 17, 2010 at 03:33:07PM +0530, Krishna Kumar wrote: For 1 TCP netperf, I ran 7 iterations and summed it. Explanation for degradation for 1 stream case: Could you document how exactly do you measure multistream bandwidth: netperf flags, etc? 1. Without any tuning, BW falls

raw_spinlock_t rules

2010-09-19 Thread Avi Kivity
Some time ago, the i8259 emulation code in kvm was changed to use raw_spinlock_t, as it was called in a preempt_disable() and local_irq_disable() context, which doesn't work with preemptible spinlocks used with CONFIG_PREEMPT_RT. In Linux 2.6.37, the spinlock will no longer be taken in these

Re: cpu hotplug

2010-09-19 Thread Kevin O'Connor
On Sun, Sep 19, 2010 at 08:38:12AM +0200, Gleb Natapov wrote: On Sat, Sep 18, 2010 at 08:27:54PM +0200, Conrad Wood wrote: hm... after upgrading to seabios 0.6.1 and qemu-kvm 0.13.50 (git today) I get: [...] any ideas ? Known problem in qemu. There was a patch for this, but qemu

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
On Sun, 2010-09-19 at 09:26 -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 08:38:12AM +0200, Gleb Natapov wrote: On Sat, Sep 18, 2010 at 08:27:54PM +0200, Conrad Wood wrote: hm... after upgrading to seabios 0.6.1 and qemu-kvm 0.13.50 (git today) I get: [...] any ideas ?

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 03:29:35PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 09:26 -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 08:38:12AM +0200, Gleb Natapov wrote: On Sat, Sep 18, 2010 at 08:27:54PM +0200, Conrad Wood wrote: hm... after upgrading to seabios 0.6.1 and

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
hm... that's the version I am using und it does not work here ;( the hotplug itself seems to work but they're reported as halted. I told you this is cosmetic. They are working. I agree, the hotplug itself seems to be working! Then it seems to be a local misconfiguration. and if so, I

Re: cpu hotplug

2010-09-19 Thread Kevin O'Connor
On Sun, Sep 19, 2010 at 03:29:35PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 09:26 -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 08:38:12AM +0200, Gleb Natapov wrote: Known problem in qemu. There was a patch for this, but qemu maintainers think it is not good enough. Old

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
On Sun, 2010-09-19 at 09:38 -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 03:29:35PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 09:26 -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 08:38:12AM +0200, Gleb Natapov wrote: Known problem in qemu. There was a patch for this,

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 03:35:47PM +0200, Conrad Wood wrote: hm... that's the version I am using und it does not work here ;( the hotplug itself seems to work but they're reported as halted. I told you this is cosmetic. They are working. I agree, the hotplug itself seems to be

Re: cpu hotplug

2010-09-19 Thread Kevin O'Connor
On Sun, Sep 19, 2010 at 03:40:45PM +0200, Gleb Natapov wrote: halted state is not the way to check for whether cpu is online or offline. cpu may be online but executing hlt instruction so its state will be halted, but cpu itself is online. Actually with kvm today you are not able to check

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 09:46:21AM -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 03:40:45PM +0200, Gleb Natapov wrote: halted state is not the way to check for whether cpu is online or offline. cpu may be online but executing hlt instruction so its state will be halted, but cpu

[PATCH 0/2] unit-tests: Add tests to measure svm instruction latencys

2010-09-19 Thread Joerg Roedel
Hi, here are two patches for the svm unit-test framework that measure the latency of the emulated vmrun, vmload, and vmsave instructions as well as the latency of emulated vmexits. On my Phenom II X6 1090T running in P0 it produces output like this: Latency VMRUN : max: 140956 min: 6770

[PATCH 2/2] svm: Add VMLOAD/VMSAVE latency test

2010-09-19 Thread Joerg Roedel
This patch adds a test to measure the latency of the VMLOAD and VMSAVE instructions. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- x86/svm.c | 52 1 files changed, 52 insertions(+), 0 deletions(-) diff --git a/x86/svm.c b/x86/svm.c

[PATCH 1/2] svm: Add VMRUN/VMEXIT latency test

2010-09-19 Thread Joerg Roedel
This patch adds a test to measure the latency of VMRUN and VMEXIT. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- x86/svm.c | 81 + 1 files changed, 81 insertions(+), 0 deletions(-) diff --git a/x86/svm.c b/x86/svm.c index

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
On Sun, 2010-09-19 at 15:50 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 09:46:21AM -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 03:40:45PM +0200, Gleb Natapov wrote: halted state is not the way to check for whether cpu is online or offline. cpu may be online but executing

Re: cpu hotplug

2010-09-19 Thread Kevin O'Connor
On Sun, Sep 19, 2010 at 04:07:50PM +0200, Conrad Wood wrote: 1) Thanks for clarifying online vs halted - that makes sense and is probably part of what confused me. I need to get the online/offline status of cpus, not if they are halted or not. I understand this is currently not possible with

[PATCH trace-cmd] plugin_kvm: disassemble instructions for kvm_emulate_insn

2010-09-19 Thread Avi Kivity
Override kvm_emulate_insn formatting to use a disassembler to format the emulated instruction. If a disassembler (udis86) is not available, fall back to showing the instruction bytes in hex. Signed-off-by: Avi Kivity a...@redhat.com --- Note 1: on top of 'master' with 'trace-cmd-kvm'

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 04:07:50PM +0200, Conrad Wood wrote: On Sun, 2010-09-19 at 15:50 +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 09:46:21AM -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 03:40:45PM +0200, Gleb Natapov wrote: halted state is not the way to check for

Re: [PATCH 2/2] svm: Add VMLOAD/VMSAVE latency test

2010-09-19 Thread Roedel, Joerg
Just figured out that it makes a lot of sens to measure the latency of stgi and clgi too in this test. Here is an updated one. From 350d33d155db8928f81cc801587787c84d6bc8c5 Mon Sep 17 00:00:00 2001 From: Joerg Roedel joerg.roe...@amd.com Date: Sun, 19 Sep 2010 15:34:37 +0200 Subject: [PATCH] svm:

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
[..] Lets establish some terminology to understand each other better: Lets use CPU inserted/ejected to refer to cpu being available/not available to a guest. Lest use CPU online/offline to refer to cpu been used by a guest OS. CPU hot-plug works like this: cpu is inserted (plugged into

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 05:16:24PM +0200, Conrad Wood wrote: [..] Lets establish some terminology to understand each other better: Lets use CPU inserted/ejected to refer to cpu being available/not available to a guest. Lest use CPU online/offline to refer to cpu been used by a guest OS.

Re: cpu hotplug

2010-09-19 Thread Avi Kivity
On 09/19/2010 01:59 PM, Gleb Natapov wrote: I fixed it several times in the past[0][1][3], but it keeps re-appearing :) I hope current qemu-kvm head is OK. [0] 865aa3fec2b3d83c9b6edd452050a30ef6eaf3b8 [1] 8c7d4cb7163d1c97df4439e2e0edb5918abf106b [2] d6d233543d543fcf34df6190bbce5daf38d870f5

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 05:20:38PM +0200, Avi Kivity wrote: On 09/19/2010 01:59 PM, Gleb Natapov wrote: I fixed it several times in the past[0][1][3], but it keeps re-appearing :) I hope current qemu-kvm head is OK. [0] 865aa3fec2b3d83c9b6edd452050a30ef6eaf3b8 [1]

Re: [PATCH 0/4] Real mode interrupt injection emulation

2010-09-19 Thread Avi Kivity
On 09/19/2010 02:34 PM, Avi Kivity wrote: Our current real mode interrupt injection injects external interrupts as software interrupts, which is somewhat hacky. This is problematic in big real mode (can't use vmx there) and on via processors (a cpu bug prevents this from working correctly).

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
I need to know if a cpu is currently inserted or ejected. The only way to do that currently is to track it in your management app. The Management App does know which one should be inserted or ejected. I see now way of enforcing it though. This is what I had in mind: (simplified) 1.

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 05:37:18PM +0200, Conrad Wood wrote: I need to know if a cpu is currently inserted or ejected. The only way to do that currently is to track it in your management app. The Management App does know which one should be inserted or ejected. I see now way of

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
However after step 7 the guest can turn the cpu online again by issuing echo 1 /sys/devices/.../cpuX/online There will be no /sys/devices/.../cpuX/online in guest after step 7. Well then at least in my version there's a bug, because it still is there and never goes away. (kvm 0.12.5) And

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 05:44:00PM +0200, Conrad Wood wrote: However after step 7 the guest can turn the cpu online again by issuing echo 1 /sys/devices/.../cpuX/online There will be no /sys/devices/.../cpuX/online in guest after step 7. Well then at least in my version there's a

Re: cpu hotplug

2010-09-19 Thread Kevin O'Connor
On Sun, Sep 19, 2010 at 05:53:47PM +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 05:44:00PM +0200, Conrad Wood wrote: However after step 7 the guest can turn the cpu online again by issuing echo 1 /sys/devices/.../cpuX/online There will be no /sys/devices/.../cpuX/online in

Re: cpu hotplug

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 12:04:51PM -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 05:53:47PM +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 05:44:00PM +0200, Conrad Wood wrote: However after step 7 the guest can turn the cpu online again by issuing echo 1

Re: cpu hotplug

2010-09-19 Thread Conrad Wood
On Sun, 2010-09-19 at 12:04 -0400, Kevin O'Connor wrote: On Sun, Sep 19, 2010 at 05:53:47PM +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 05:44:00PM +0200, Conrad Wood wrote: However after step 7 the guest can turn the cpu online again by issuing echo 1

Re: raw_spinlock_t rules

2010-09-19 Thread Avi Kivity
On 09/19/2010 06:38 PM, Steven Rostedt wrote: On Sun, 2010-09-19 at 15:09 +0200, Avi Kivity wrote: Some time ago, the i8259 emulation code in kvm was changed to use raw_spinlock_t, as it was called in a preempt_disable() and local_irq_disable() context, which doesn't work with preemptible

[PATCH] KVM: Convert PIC lock from raw spinlock to ordinary spinlock

2010-09-19 Thread Avi Kivity
The PIC code used to be called from preempt_disable() context, which wasn't very good for PREEMPT_RT. That is no longer the case, so move back from raw_spinlock_t to spinlock_t. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/i8259.c |6 +++--- arch/x86/kvm/irq.h |2 +-

[PATCH] kvm: fix irqfd assign/deassign race

2010-09-19 Thread Michael S. Tsirkin
I think I see the following (theoretical) race: During irqfd assign, we drop irqfds lock before we schedule inject work. Therefore, deassign running on another CPU could cause shutdown and flush to run before inject, causing user after free in inject. A simple fix it to schedule inject under the

Re: [PATCH] SVM: do not generate external interrupt exit if other exit is pending

2010-09-19 Thread Joerg Roedel
On Sun, Sep 19, 2010 at 06:41:27PM +0200, Gleb Natapov wrote: Nested SVM checks for external interrupt after injecting nested exception. In case there is external interrupt pending the code generates external interrupt exit and overwrites previous exit info. If previously injected exception

Re: [PATCH] SVM: do not generate external interrupt exit if other exit is pending

2010-09-19 Thread Gleb Natapov
On Sun, Sep 19, 2010 at 07:29:41PM +0200, Joerg Roedel wrote: On Sun, Sep 19, 2010 at 06:41:27PM +0200, Gleb Natapov wrote: Nested SVM checks for external interrupt after injecting nested exception. In case there is external interrupt pending the code generates external interrupt exit and

Re: [PATCH] SVM: do not generate external interrupt exit if other exit is pending

2010-09-19 Thread Joerg Roedel
On Sun, Sep 19, 2010 at 07:50:27PM +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 07:29:41PM +0200, Joerg Roedel wrote: On Sun, Sep 19, 2010 at 06:41:27PM +0200, Gleb Natapov wrote: Nested SVM checks for external interrupt after injecting nested exception. In case there is external

Re: [PATCH] kvm: fix irqfd assign/deassign race

2010-09-19 Thread Gregory Haskins
On 9/19/2010 at 01:02 PM, in message 20100919170231.ga12...@redhat.com, Michael S. Tsirkin m...@redhat.com wrote: I think I see the following (theoretical) race: During irqfd assign, we drop irqfds lock before we schedule inject work. Therefore, deassign running on another CPU could cause

Re: cpu hotplug

2010-09-19 Thread Kevin O'Connor
On Sun, Sep 19, 2010 at 06:24:33PM +0200, Conrad Wood wrote: a script with my exact steps is below. Result is reproducible. [...] echo Ejecting CPU #4 echo cpu_set 4 offline | nc ${MONITORHOST} ${MONITORPORT} /dev/null printInfo echo Setting all available cpus to online... ssh -lroot

Re: cpu hotplug

2010-09-19 Thread Kevin O'Connor
On Sun, Sep 19, 2010 at 06:12:14PM +0200, Gleb Natapov wrote: On Sun, Sep 19, 2010 at 12:04:51PM -0400, Kevin O'Connor wrote: I'm confused. The cpu_set x offline doesn't appear to do anything for me. It does not disable the cpu, nor does it inform the guest to disable the cpu. [...] Then