[PATCH] Qemu: add virt sched domain device

2012-05-22 Thread Liu Ping Fan
From: Liu Ping Fan The device will demand the collection of vcpus' numa info, and trigger the guest to rebuild the sched domain. Signed-off-by: Liu Ping Fan --- Makefile.target |1 + hmp-commands.hx | 16 + hw/qdev.h |1 + hw/virt_sd.c

[PATCH] kvm: collect vcpus' numa info for guest's scheduler

2012-05-22 Thread Liu Ping Fan
From: Liu Ping Fan The guest's scheduler can not see the numa info on the host and this will result to the following scene: Supposing vcpu-a on nodeA, vcpu-b on nodeB, when load balance, the tasks' pull and push between these vcpus will cost more. But unfortunately, currently, the guest is

[PATCH 1/2] sched: add virt sched domain for the guest

2012-05-22 Thread Liu Ping Fan
From: Liu Ping Fan The guest's scheduler can not see the numa info on the host and this will result to the following scene: Supposing vcpu-a on nodeA, vcpu-b on nodeB, when load balance, the tasks' pull and push between these vcpus will cost more. But unfortunately, currently, the guest is just

[PATCH 2/2] sched: add virt domain device's driver

2012-05-22 Thread Liu Ping Fan
From: Liu Ping Fan A driver plays with Qemu's emulated "virt domain device". They aims to export the host numa info to the guest. --todo: A more proper place to archive this driver? Signed-off-by: Liu Ping Fan --- drivers/virtio/Kconfig |4 ++ drivers/virtio/Makefile |1 + drivers/

[RFC] kvm: export host NUMA info to guest's scheduler

2012-05-22 Thread Liu Ping Fan
Currently, the guest can not know the NUMA info of the vcpu, which will result in performance drawback. For example: Supposing vcpu-a on nodeA, vcpu-b on nodeB, when load balance, the tasks' pull and push between these vcpus will cost more. But unfortunately, currently, the guest is just blind to

RE: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-22 Thread Mao, Junjie
> > > > The previous patch regards PCID and INVPCID as a whole because qemu > doesn't support cpuid leaf 7 configuration at present. This is not the case > in this > version. > > > The problem with cpu_has_hypervisor check is that its Linux specific. > > > Any solution should also take into accoun

[PATCH qom-next 44/59] target-i386: Pass X86CPU to kvm_mce_inject()

2012-05-22 Thread Andreas Färber
Needed for cpu_x86_inject_mce(). Signed-off-by: Andreas Färber --- target-i386/kvm.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 92ad338..758bf8f 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -221,8 +221,

[PATCH qom-next 46/59] cpus: Pass CPUState to run_on_cpu()

2012-05-22 Thread Andreas Färber
CPUArchState is no longer needed. Move the declaration to include/qemu/cpu.h and add documentation. Signed-off-by: Andreas Färber --- cpu-all.h|1 - cpus.c |3 +-- hw/kvm/apic.c|2 +- hw/kvmvapic.c|6 -- hw/ppce500_spin.c|2 +

[PATCH qom-next 45/59] target-i386: Pass X86CPU to cpu_x86_inject_mce()

2012-05-22 Thread Andreas Färber
Needed for run_on_cpu(). Signed-off-by: Andreas Färber --- monitor.c|6 -- target-i386/cpu.h|2 +- target-i386/helper.c |3 ++- target-i386/kvm.c|2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/monitor.c b/monitor.c index 12a6fe2..07d2

[PATCH qom-next 50/59] target-i386: Pass X86CPU to kvm_get_mp_state()

2012-05-22 Thread Andreas Färber
Needed for moving halted field to CPUState. Signed-off-by: Andreas Färber --- target-i386/kvm.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index f611a96..21de2e1 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@

[PATCH qom-next 51/59] target-i386: Pass X86CPU to kvm_handle_halt()

2012-05-22 Thread Andreas Färber
Needed for moving interrupt_request and halted fields to CPUState. Signed-off-by: Andreas Färber --- target-i386/kvm.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 21de2e1..f7651bf 100644 --- a/target-i386/kvm.c +++ b/

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-22 Thread Xiao Guangrong
On 05/22/2012 10:27 PM, Avi Kivity wrote: > On 05/22/2012 08:31 AM, Gleb Natapov wrote: >> On Mon, May 21, 2012 at 04:30:41PM -0300, Marcelo Tosatti wrote: >>> On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote: On 05/21/2012 04:08 PM, Gleb Natapov wrote: > On Mon, May 21

[PATCH qom-next 34/59] cpus: Pass CPUState to qemu_cpu_kick()

2012-05-22 Thread Andreas Färber
Signed-off-by: Andreas Färber --- cpus.c | 13 + exec.c |2 +- hw/ppc.c |4 ++-- hw/ppce500_spin.c |2 +- hw/spapr_rtas.c|5 - hw/sun4m.c |2 +- hw/sun4u.c |2 +- include/qemu/cpu.h |8 k

[PATCH qom-next 40/59] spapr: Pass PowerPCCPU to spapr_hypercall()

2012-05-22 Thread Andreas Färber
Needed for the hypercall handlers. Signed-off-by: Andreas Färber --- hw/spapr.c |2 +- hw/spapr.h |2 +- hw/spapr_hcall.c |4 +++- target-ppc/kvm.c |3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/spapr.c b/hw/spapr.c index 70068b4..f9c3631 10

[PATCH qom-next 33/59] target-s390x: Pass S390CPU to s390_cpu_restart()

2012-05-22 Thread Andreas Färber
Needed for qemu_cpu_kick(). Signed-off-by: Andreas Färber --- target-s390x/kvm.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 2153e38..5800fd6 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -292,8 +292,10

[PATCH qom-next 32/59] s390-virtio: Let s390_cpu_addr2state() return S390CPU

2012-05-22 Thread Andreas Färber
Convert ipi_states to S390CPU**. Needed for s390_cpu_restart() in handle_sigp(). Signed-off-by: Andreas Färber --- hw/s390-virtio-bus.c |6 -- hw/s390-virtio.c |8 target-s390x/cpu.h |2 +- target-s390x/kvm.c |6 -- 4 files changed, 13 insertions(+), 9 d

[PATCH qom-next 29/59] target-ppc: Rename kvm_kick_{env => cpu} and pass PowerPCCPU

2012-05-22 Thread Andreas Färber
Needed for qemu_cpu_kick(). Signed-off-by: Andreas Färber --- target-ppc/kvm.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index c09cc39..f111e87 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -71,8 +71,11 @@ static

[PATCH qom-next 15/59] cpus: Pass CPUState to cpu_is_stopped()

2012-05-22 Thread Andreas Färber
CPUArchState is no longer needed there. Also change the return type to bool. Signed-off-by: Andreas Färber --- cpu-all.h |1 - cpus.c |4 +--- include/qemu/cpu.h | 11 +++ target-i386/kvm.c |4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) d

[PATCH qom-next 06/59] pc: Pass X86CPU to cpu_is_bsp()

2012-05-22 Thread Andreas Färber
Also change return type to bool. Signed-off-by: Andreas Färber --- hw/apic.h|2 +- hw/apic_common.c |2 +- hw/pc.c |6 +++--- target-i386/helper.c |2 +- target-i386/kvm.c|4 +++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/

[PATCH qom-next 00/59] QOM CPUState, part 4: CPU_COMMON

2012-05-22 Thread Andreas Färber
Hello, This series, based on qom-next and the two pending ARM cleanup patches, starts moving fields from CPUArchState (CPU_COMMON) to QOM CPUState. It stops short of moving all easily possible fields (i.e., those not depending on target_ulong or target_phys_addr_t) since the series got too long al

[PATCH qom-next 09/59] cpus: Pass CPUState to qemu_cpu_is_self()

2012-05-22 Thread Andreas Färber
Change return type to bool, move to include/qemu/cpu.h and add documentation. Signed-off-by: Andreas Färber --- cpus.c | 10 -- exec.c |3 ++- hw/apic.c |2 +- include/qemu/cpu.h | 10 ++ kvm-all.c |4 +++- qemu-common.h

Re: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-22 Thread Marcelo Tosatti
On Tue, May 22, 2012 at 12:46:54AM +, Mao, Junjie wrote: > > > > @@ > > > > > -1711,6 +1717,22 @@ static bool vmx_rdtscp_supported(void) > > > > > return cpu_has_vmx_rdtscp(); > > > > > } > > > > > > > > > > +static bool vmx_pcid_supported(void) { > > > > > + /* > > > > > + * Th

qemu core dump and filtering guest pages

2012-05-22 Thread Christian Borntraeger
Folks, today we discussed the situation of a qemu crash (with coredump) and big guests. Quite often the guest pages are not needed but make the core file pretty big. The most appealing proposal that we had was to adopt the core file code in the kernel to have an option for discarding guest pages

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-22 Thread Eric Northup
On Mon, May 21, 2012 at 8:53 PM, Yanfei Zhang wrote: > 于 2012年05月22日 02:58, Eric Northup 写道: [...] >> So you can have the VMCS offset dumping be a manually-loaded module. >> Build a database mapping from (CPUID, microcode revision) -> (VMCSINFO). >> There's no need for anything beyond the (CPUID,

Re: [PATCH] kvm: optimize ISR lookups

2012-05-22 Thread Thomas Gleixner
On Tue, 22 May 2012, Avi Kivity wrote: > On 05/22/2012 12:04 AM, Thomas Gleixner wrote: > > The only justification for having the same layout as the actual > > hardware is when you are going to map the memory into the guest space, > > which is not the case here. > > The APIC page is in fact mapped

Re: [RFC PATCH 1/5] block: Introduce q->abort_queue_fn()

2012-05-22 Thread Tejun Heo
Hello, On Tue, May 22, 2012 at 03:30:37PM +0800, Asias He wrote: > On 05/21/2012 11:42 PM, Tejun Heo wrote: > 1) if the queue is stopped, q->request_fn() will never call called. > we will be stuck in the loop forever. This can happen if the remove > method is called after the q->request_fn() calls

[Bug 11963] S3: second resume fails unless BIOS "Intel TXT Feature" disabled - Thinkpad W500

2012-05-22 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=11963 Alan changed: What|Removed |Added Status|RESOLVED|CLOSED -- Configure bugmail: https://bugzilla

[Bug 11963] S3: second resume fails unless BIOS "Intel TXT Feature" disabled - Thinkpad W500

2012-05-22 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=11963 Alan changed: What|Removed |Added Status|NEEDINFO|RESOLVED CC|

Re: [PATCH v2 2/5] KVM: MMU: Convert remote flushes to kvm_mark_tlb_dirty() and a conditional flush

2012-05-22 Thread Takuya Yoshikawa
On Thu, 17 May 2012 13:24:41 +0300 Avi Kivity wrote: > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 2256f51..a2149d8 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -3130,7 +3130,9 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct > kvm_dirty_log *log) >

[Autotest][PATCH] virt: Add possiblity to find subtests in more directory

2012-05-22 Thread Jiří Župka
example: ovirt tests in client/tests/ovirt wants to use test from kvm/tests/ vm_type = ovirt other_tests_dirs = "kvm" This adds client/test/kvm/tests path to subtests dir group where subtest will be searched. Signed-off-by: Jiří Župka --- client/tests/kvm/tests-shared.cfg.sample |

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-22 Thread Avi Kivity
On 05/22/2012 08:31 AM, Gleb Natapov wrote: > On Mon, May 21, 2012 at 04:30:41PM -0300, Marcelo Tosatti wrote: >> On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote: >> > On 05/21/2012 04:08 PM, Gleb Natapov wrote: >> > >> > > On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wr

[PATCHv5 5/5] kvm: host side for eoi optimization

2012-05-22 Thread Michael S. Tsirkin
Implementation of PV EOI using shared memory. This reduces the number of exits an interrupt causes as much as by half. The idea is simple: there's a bit, per APIC, in guest memory, that tells the guest that it does not need EOI. We set it before injecting an interrupt and clear before injecting a

[PATCHv5 4/5] kvm: only sync when attention bits set

2012-05-22 Thread Michael S. Tsirkin
Commit eb0dc6d0368072236dcd086d7fdc17fd3c4574d4 introduced apic attention bitmask but kvm still syncs lapic unconditionally. As that commit suggested and in anticipation of adding more attention bits, only sync lapic if(apic_attention). Signed-off-by: Michael S. Tsirkin --- arch/x86/kvm/x86.c |

[PATCHv5 3/5] kvm: eoi msi documentation

2012-05-22 Thread Michael S. Tsirkin
Document the new EOI MSR. Couldn't decide whether this change belongs conceptually on guest or host side, so a separate patch. Signed-off-by: Michael S. Tsirkin --- Documentation/virtual/kvm/msr.txt | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff

[PATCHv5 2/5] x86/bitops: note on __test_and_clear_bit atomicity

2012-05-22 Thread Michael S. Tsirkin
__test_and_clear_bit is actually atomic with respect to the local CPU. Add a note saying that KVM on x86 relies on this behaviour so people don't accidentaly break it. Also warn not to rely on this in portable code. Signed-off-by: Michael S. Tsirkin --- arch/x86/include/asm/bitops.h |7 +

[PATCHv5 1/5] kvm_para: guest side for eoi avoidance

2012-05-22 Thread Michael S. Tsirkin
The idea is simple: there's a bit, per APIC, in guest memory, that tells the guest that it does not need EOI. Guest tests it using a single est and clear operation - this is necessary so that host can detect interrupt nesting - and if set, it can skip the EOI MSR. I run a simple microbenchmark to

[PATCHv5 0/5] apic: eoi optimization support

2012-05-22 Thread Michael S. Tsirkin
I'm looking at reducing the interrupt overhead for virtualized guests: some workloads spend a large part of their time processing interrupts. On kvm, an EOI write from the guest causes an expensive exit to host; we avoid this using shared memory. The patches work fine on my boxes. See individual

Re: KVM call agenda for May, Tuesday 22

2012-05-22 Thread Juan Quintela
Juan Quintela wrote: > Hi > > Please send in any agenda items you are interested in covering. Hi As there are no topics for the agenda, call is canceled for this week. Happy hacking, Juan. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vg

[Bug 11219] KVM modules break emergency reboot

2012-05-22 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=11219 Alan changed: What|Removed |Added Status|RESOLVED|CLOSED -- Configure bugmail: https://bugzilla

[Bug 11219] KVM modules break emergency reboot

2012-05-22 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=11219 Alan changed: What|Removed |Added Status|ASSIGNED|RESOLVED CC|

[GIT PULL] KVM updates for Linux 3.5

2012-05-22 Thread Avi Kivity
Linus, please pull the KVM updates for the 3.5 cycle from git://git.kernel.org/pub/scm/virt/kvm/kvm.git next Changes include additional instruction emulation, page-crossing MMIO, faster dirty logging, preventing the watchdog from killing a stopped guest, module autoload, a new MSI ABI, and some

[PATCHv2] kvm: optimize ISR lookups

2012-05-22 Thread Michael S. Tsirkin
We perform ISR lookups twice: during interrupt injection and on EOI. Typical workloads only have a single bit set there. So we can avoid ISR scans by 1. counting bits as we set/clear them in ISR 2. if count is 1, caching the vector number 3. if count != 1, invalidating the cache The real purpose o

Re: [PATCH 3/3] deal with guest panicked event

2012-05-22 Thread Jan Kiszka
On 2012-05-21 03:50, Wen Congyang wrote: > When the guest is panicked, it will write 0x1 to the port 0x505. So if > qemu reads 0x1 from this port, we can do the folloing three things > according to the parameter -onpanic: > 1. emit QEVENT_GUEST_PANICKED only > 2. emit QEVENT_GUEST_PANICKED and paus

Re: [PATCH] kvm: optimize ISR lookups

2012-05-22 Thread Avi Kivity
On 05/22/2012 12:04 AM, Thomas Gleixner wrote: > > > > +static u8 count_vectors(void *bitmap) > > +{ > > + u32 *word = bitmap; > > + int word_offset; > > + u8 count = 0; > > + for (word_offset = 0; word_offset < MAX_APIC_VECTOR >> 5; ++word_offset) > > + count += hweight32(word[

Re: [PATCH] kvm: optimize ISR lookups

2012-05-22 Thread Avi Kivity
On 05/22/2012 02:01 AM, Thomas Gleixner wrote: > > > > Others are not my fault :) > > > > Seriously, if Avi/Marcelo want to rewrite the ISR emulation > > Interesting POV, really. > > Did you ever notice that the kernel is a collaborative effort and not > controlled by "Avi/Marcelo"? > > Did you e

Re: [RFC:kvm] export host NUMA info to guest & make emulated device NUMA attr

2012-05-22 Thread Liu ping fan
On Sat, May 19, 2012 at 12:14 AM, Shirley Ma wrote: > On Thu, 2012-05-17 at 17:20 +0800, Liu Ping Fan wrote: >> Currently, the guest can not know the NUMA info of the vcpu, which >> will >> result in performance drawback. >> >> This is the discovered and experiment by >>         Shirley Ma >>    

[PATCH] KVM:PPC:clean up in-kernel exit_timing statistics

2012-05-22 Thread Olivia Yin
1. Line up the columns with headings. 2. Add units for min/max/sum columns. 3. add_exit_timing only count the exited types. For other types, the min value should be zero, instead of the init value (0x). Signed-off-by: Olivia Yin --- arch/powerpc/kvm/timing.c | 13 + 1 file

Re: [RFC PATCH 5/5] virtio-blk: Use block layer provided spinlock

2012-05-22 Thread Asias He
On 05/22/2012 04:59 AM, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 05:08:33PM +0800, Asias He wrote: Block layer will allocate a spinlock for the queue if the driver does not provide one in blk_init_queue(). The reason to use the internal spinlock is that blk_cleanup_queue() will switch

RE: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-05-22 Thread Ren, Yongjie
> -Original Message- > From: Kevin Wolf [mailto:kw...@redhat.com] > Sent: Monday, May 21, 2012 11:30 PM > To: Ren, Yongjie > Cc: Avi Kivity; kvm@vger.kernel.org; Liu, RongrongX > Subject: Re: Biweekly KVM Test report, kernel 51bfd299... qemu > a1fce560... > > Am 21.05.2012 11:45, schrieb R

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-22 Thread Benjamin Herrenschmidt
On Tue, 2012-05-22 at 09:13 +0200, Alexander Graf wrote: > On 22.05.2012, at 09:01, Alexey Kardashevskiy wrote: > > This is internal kitchen of PCIDevice which I do not want to touch > from anywhere but pci.c. And > > there is no "fixup_capability" or something. > > Hrm. Maybe we should have one?

Re: [RFC PATCH 1/5] block: Introduce q->abort_queue_fn()

2012-05-22 Thread Asias He
On 05/21/2012 11:42 PM, Tejun Heo wrote: On Mon, May 21, 2012 at 05:08:29PM +0800, Asias He wrote: When user hot-unplug a disk which is busy serving I/O, __blk_run_queue might be unable to drain all the requests. As a result, the blk_drain_queue() would loop forever and blk_cleanup_queue would n

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-22 Thread Alexander Graf
On 22.05.2012, at 09:01, Alexey Kardashevskiy wrote: > On 22/05/12 16:31, Alexander Graf wrote: >> >> >> On 22.05.2012, at 08:11, Alexey Kardashevskiy wrote: >> >>> On 22/05/12 15:52, Alexander Graf wrote: On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: > On 2

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-22 Thread Alexey Kardashevskiy
On 22/05/12 16:31, Alexander Graf wrote: > > > On 22.05.2012, at 08:11, Alexey Kardashevskiy wrote: > >> On 22/05/12 15:52, Alexander Graf wrote: >>> >>> >>> On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: >>> On 22/05/12 13:21, Alexander Graf wrote: > > > On 22.05.2012,