[PATCH] KVM: SVM: Fix copypaste mistake in 32-bit host GS loading

2010-10-24 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/x86/kvm/svm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index fad4038..1a5757a 100644 --- a/arch/x86/kvm/svm.c +++

Re: [PATCH] KVM: SVM: Fix copypaste mistake in 32-bit host GS loading

2010-10-24 Thread Avi Kivity
On 10/24/2010 11:13 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com Applied, thanks. I'll go and set up a buildbot for i386. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message

[PATCH 2/2] Fix cpu/pci hotplug to generate level triggered interrupt.

2010-10-24 Thread Gleb Natapov
SCI is level triggered. cpu/pci hotplug should behave appropriately. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/acpi_piix4.c | 16 +++- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 1db5ee3..de3bb88 100644 ---

[PATCH 1/2] Use defines instead of numbers for cpu hotplug

2010-10-24 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- hw/acpi_piix4.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 1c8e4e2..1db5ee3 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -39,6 +39,7 @@ #define PCI_BASE 0xae00

[KVM-AUTOTEST PATCH 1/7] KVM test: simplify MAC address management

2010-10-24 Thread Michael Goldish
- Remove the VM.mac_prefix attribute - Remove the 'root_dir' parameter from generate_mac_address() and free_mac_address() - Remove the 'prefix' parameter from generate_mac_address() - Remove the explicit setting and clearing of bits in the most significant byte (it is fixed to 0x9A anyway) -

[KVM-AUTOTEST PATCH 2/7] KVM test: VM.get_address(): fix handling of multiple NICs

2010-10-24 Thread Michael Goldish
Use VM.get_mac_address() instead of kvm_utils.get_mac_ip_pair_from_dict(). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py |6 +- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index

[KVM-AUTOTEST PATCH 4/7] KVM test: get_ifname(): use self.instance instead of self.vnc_port

2010-10-24 Thread Michael Goldish
The vnc_port attribute is only unique among VMs that use a VNC display. Other VMs don't bother to look for a free VNC port and don't occupy one, so vnc_port can't be considered unique. The last 11 characters of self.instance make up a fairly unique string which can be used instead. (The whole

[KVM-AUTOTEST PATCH 3/7] [RFC] KVM test: remove all code related to the old MAC address pool method

2010-10-24 Thread Michael Goldish
This patch removes all code related to the old manual method (address_pools.cfg). Note that now running in TAP mode requires an external DHCP server that accepts *any* MAC address, because MAC addresses are randomly generated and cannot be manually configured. Signed-off-by: Michael Goldish

[KVM-AUTOTEST PATCH 5/7] KVM test: kvm_monitor.py: replace MonitorSendError with MonitorSocketError

2010-10-24 Thread Michael Goldish
- Replace MonitorSendError with MonitorSocketError. - Embed socket.error messages in MonitorSocketError messages. - Catch exceptions raised while receiving data (in addition to those raised while sending data). Signed-off-by: Michael Goldish mgold...@redhat.com ---

[KVM-AUTOTEST PATCH 6/7] KVM test: refactor migration code

2010-10-24 Thread Michael Goldish
- Refactor migration code so that the '-incoming ...' strings are hardcoded only in a single location (kvm_test_utils.py). - Wrap the removal of the gzipped state file in a finally: clause. - Get rid of the 'for_migration' and 'extra_params' parameters of VM.create() and introduce

[KVM-AUTOTEST PATCH 7/7] [RFC] KVM test: migrate_cancel: allow for alternative spellings of 'cancelled'

2010-10-24 Thread Michael Goldish
Is there any chance someone will decide to switch over to the American spelling? Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_test_utils.py |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_test_utils.py

Re: [PATCH 6/8] KVM: assigned dev: Preparation for mask support in userspace

2010-10-24 Thread Sheng Yang
On Friday 22 October 2010 22:53:13 Marcelo Tosatti wrote: On Wed, Oct 20, 2010 at 04:26:30PM +0800, Sheng Yang wrote: The feature wouldn't be enabled until later patch set msix_flags_enabled. It would be enabled along with mask support in kernel. Signed-off-by: Sheng Yang

[PATCHv3] Add support for async page fault to qemu

2010-10-24 Thread Gleb Natapov
Add save/restore of MSR for migration and cpuid bit. Signed-off-by: Gleb Natapov g...@redhat.com -- v1-v2 - use vmstate subsection to migrate new msr. v2-v3 - rebase onto uq/master - protect use of MSR_KVM_ASYNC_PF_EN with ifdef KVM_CAP_ASYNC_PF diff --git a/target-i386/cpu.h

Re: [PATCH 6/8] KVM: assigned dev: Preparation for mask support in userspace

2010-10-24 Thread Michael S. Tsirkin
On Sun, Oct 24, 2010 at 08:19:09PM +0800, Sheng Yang wrote: You need a guarantee that MSIX per-vector mask is used for disable_irq/enable_irq, right? I can't see how this provides it. This one meant to directly operate the mask/unmask bit of the MSI-X table, to emulate the mask/unmask

[GIT PULL] KVM updates for the 2.6.37 merge window

2010-10-24 Thread Avi Kivity
Linus, the repository and branch git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm-updates/2.6.37 contains the kvm updates for the 2.6.37 merge window. Major changes this time around include powerpc paravirtualization, a virtual tsc rework, and exposing npt to the guest for fast nested

[PATCH 2/2] KVM: Mask KVM_GET_SUPPORTED_CPUID data with Linux cpuid info

2010-10-24 Thread Avi Kivity
This allows Linux to mask cpuid bits if, for example, nx is enabled on only some cpus. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/x86.c |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 48ce015..54fda7e

[PATCH 1/2] KVM: SVM: Replace svm_has() by standard Linux cpuid accessors

2010-10-24 Thread Avi Kivity
Instead of querying cpuid directly, use the Linux accessors (boot_cpu_has, etc.). This allows the things like the clearcpuid kernel command line to work (when it's fixed wrt scattered cpuid bits). Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/svm.c | 15 +-- 1 files

[PATCH 0/2] Use host cpuid facilities

2010-10-24 Thread Avi Kivity
Use the host's cpuid facilities to see if features are supporte. This allows the clearcpuid boot parameter to work, and allows Linux to disable nx if it is not enabled on all cpus. Avi Kivity (2): KVM: SVM: Replace svm_has() by standard Linux cpuid accessors KVM: Mask KVM_GET_SUPPORTED_CPUID

Re: [patch 0/5] use upstream x86 state save/restore code

2010-10-24 Thread Avi Kivity
On 10/24/2010 12:05 AM, Marcelo Tosatti wrote: Presumably you did a line-by-line verification that nothing is lost? -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [PATCH 2/2] Fix cpu/pci hotplug to generate level triggered interrupt.

2010-10-24 Thread Avi Kivity
On 10/24/2010 01:00 PM, Gleb Natapov wrote: register_ioport_write(GPE_BASE, 4, 1, gpe_writeb, s); register_ioport_read(GPE_BASE, 4, 1, gpe_readb, s); -register_ioport_write(PROC_BASE, 32, 1, gpe_writeb, gpe); -register_ioport_read(PROC_BASE, 32, 1, gpe_readb, gpe); +

[PATCH v2 1/3] Fix cpu hotplug ioport function registration.

2010-10-24 Thread Gleb Natapov
Callback gets pointer to PIIX4PMState as parameter now instead of gpe. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/acpi_piix4.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 1c8e4e2..03abc61 100644 --- a/hw/acpi_piix4.c

[PATCH v2 2/3] Use defines instead of numbers for cpu hotplug

2010-10-24 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- hw/acpi_piix4.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 03abc61..dfabc75 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -39,6 +39,7 @@ #define PCI_BASE 0xae00

[PATCH v2 3/3] Fix cpu/pci hotplug to generate level triggered interrupt.

2010-10-24 Thread Gleb Natapov
SCI is level triggered. cpu/pci hotplug should behave appropriately. Signed-off-by: Gleb Natapov g...@redhat.com --- hw/acpi_piix4.c | 12 +--- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index dfabc75..de3bb88 100644 ---

Re: [PATCH v2 3/3] Fix cpu/pci hotplug to generate level triggered interrupt.

2010-10-24 Thread Avi Kivity
On 10/24/2010 04:32 PM, Gleb Natapov wrote: SCI is level triggered. cpu/pci hotplug should behave appropriately. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

[PATCHv2] trace exit to userspace event

2010-10-24 Thread Gleb Natapov
Add tracepoint for userspace exit. Signed-off-by: Gleb Natapov g...@redhat.com --- ChangeLog: v1-v2 log error case too. diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 9c2cc6a..c86f4e8 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h @@

[PATCH 2/2] piix4 acpi: convert io BAR to type-safe ioport callbacks

2010-10-24 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- hw/acpi_piix4.c | 30 ++ 1 files changed, 18 insertions(+), 12 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index f74f34c..5772667 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -52,6 +52,7 @@

[PATCH 0/2] Type-safe ioport callbacks

2010-10-24 Thread Avi Kivity
A recent qemu - qemu-kvm merge broke cpu hotplug without the compiler complaining because of the type-unsafeness of the ioport callbacks. This patchset adds a type-safe variant of ioport callbacks and coverts a sample ioport. Converting the other 300-odd registrations is left as an excercise to

[PATCH 1/2] Type-safe ioport callbacks

2010-10-24 Thread Avi Kivity
The current ioport callbacks are not type-safe, in that they accept an opaque pointer as an argument whose type must match the argument to the registration function; this is not checked by the compiler. This patch adds an alternative that is type-safe. Instead of an opaque argument, both

Re: [PATCH 1/2] Type-safe ioport callbacks

2010-10-24 Thread Avi Kivity
On 10/24/2010 05:34 PM, Avi Kivity wrote: Currently the old and new methods exist side by side; once the old way is gone, we can also save a bunch of memory since the new method requires one pointer per ioport instead of 6. Actually, 1:7, we replace 3 read callbacks, 3 write callbacks, and 1

Re: [PATCHv2] trace exit to userspace event

2010-10-24 Thread Avi Kivity
On 10/24/2010 04:49 PM, Gleb Natapov wrote: Add tracepoint for userspace exit. + +TRACE_EVENT(kvm_userspace_exit, + TP_PROTO(__u32 reason, int errno), + TP_ARGS(reason, errno), + + TP_STRUCT__entry( + __field(__u32, reason ) +

[PATCH] kvm: get rid of srcu idx

2010-10-24 Thread Michael S. Tsirkin
srcu_idx is easy to misuse as it can not be used in nested srcu_read_lock calls. Switch to local index to make correctness easier to verify. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- Lightly tested. diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 311f6da..edb9dfa 100644

Re: [PATCHv2] trace exit to userspace event

2010-10-24 Thread Gleb Natapov
On Sun, Oct 24, 2010 at 07:01:30PM +0200, Avi Kivity wrote: On 10/24/2010 04:49 PM, Gleb Natapov wrote: Add tracepoint for userspace exit. + +TRACE_EVENT(kvm_userspace_exit, +TP_PROTO(__u32 reason, int errno), +TP_ARGS(reason, errno), + +TP_STRUCT__entry( +

Re: [PATCHv2] trace exit to userspace event

2010-10-24 Thread Avi Kivity
On 10/24/2010 07:24 PM, Gleb Natapov wrote: On Sun, Oct 24, 2010 at 07:01:30PM +0200, Avi Kivity wrote: On 10/24/2010 04:49 PM, Gleb Natapov wrote: Add tracepoint for userspace exit. + +TRACE_EVENT(kvm_userspace_exit, + TP_PROTO(__u32 reason, int errno), +

Re: [PATCH 0/2] Type-safe ioport callbacks

2010-10-24 Thread Paolo Bonzini
On 10/24/2010 05:34 PM, Avi Kivity wrote: A recent qemu - qemu-kvm merge broke cpu hotplug without the compiler complaining because of the type-unsafeness of the ioport callbacks. This patchset adds a type-safe variant of ioport callbacks and coverts a sample ioport. Converting the other

Re: [PATCHv2] trace exit to userspace event

2010-10-24 Thread Gleb Natapov
On Sun, Oct 24, 2010 at 07:27:21PM +0200, Avi Kivity wrote: On 10/24/2010 07:24 PM, Gleb Natapov wrote: On Sun, Oct 24, 2010 at 07:01:30PM +0200, Avi Kivity wrote: On 10/24/2010 04:49 PM, Gleb Natapov wrote: Add tracepoint for userspace exit. +

Re: [PATCH 0/2] Type-safe ioport callbacks

2010-10-24 Thread Avi Kivity
On 10/24/2010 07:35 PM, Paolo Bonzini wrote: On 10/24/2010 05:34 PM, Avi Kivity wrote: A recent qemu - qemu-kvm merge broke cpu hotplug without the compiler complaining because of the type-unsafeness of the ioport callbacks. This patchset adds a type-safe variant of ioport callbacks and

Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks

2010-10-24 Thread Blue Swirl
On Sun, Oct 24, 2010 at 3:34 PM, Avi Kivity a...@redhat.com wrote: The current ioport callbacks are not type-safe, in that they accept an opaque pointer as an argument whose type must match the argument to the registration function; this is not checked by the compiler. This patch adds an

Re: [patch 0/5] use upstream x86 state save/restore code

2010-10-24 Thread Marcelo Tosatti
On Sun, Oct 24, 2010 at 03:46:22PM +0200, Avi Kivity wrote: On 10/24/2010 12:05 AM, Marcelo Tosatti wrote: Presumably you did a line-by-line verification that nothing is lost? Yes, missing parts were sent upstream in the last uq/master pull request (which is already merged). -- To

Re: [GIT PULL] KVM updates for the 2.6.37 merge window

2010-10-24 Thread Stephen Rothwell
Hey Linus, On Sun, 24 Oct 2010 15:29:12 +0200 Avi Kivity a...@redhat.com wrote: Linus, the repository and branch git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm-updates/2.6.37 contains the kvm updates for the 2.6.37 merge window. Major changes this time around include powerpc

[PATCH RFC] kvm: write protect memory after slot swap

2010-10-24 Thread Michael S. Tsirkin
I have observed the following bug trigger: 1. userspace calls GET_DIRTY_LOG 2. kvm_mmu_slot_remove_write_access is called and makes a page ro 3. page fault happens and makes the page writeable fault is logged in the bitmap appropriately 4. kvm_vm_ioctl_get_dirty_log swaps slot pointers a lot