[PATCH 1/3] PCI: define max devices number on PCIBus as PCIBUS_MAX_DEVICES in pci.h

2010-08-24 Thread Ken CC
Signed-off-by: Ken CC ken.c...@gmail.com --- hw/pci.c |2 +- hw/pci.h |1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 70dbace..02019a1 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -47,7 +47,7 @@ struct PCIBus { pci_hotplug_fn hotplug;

[PATCH 2/3] pci init: fail qemu if devfn exceeding the max devices number supported on bus

2010-08-24 Thread Ken CC
assert(devfn PCIBUS_MAX_DEVICES) Signed-off-by: Ken CC ken.c...@gmail.com --- hw/pci.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 02019a1..1e804da 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -747,6 +747,7 @@ static PCIDevice

[PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Ken CC
Define MAX_PCI_SLOTS as 0x1f, if pci addr provided from command line is bigger than 0x1f, return error -EINVAL. 0x1f 3 | 7 == 255 (PCIBUS_MAX_DEVICES - 1) Signed-off-by: Ken CC ken.c...@gmail.com --- hw/qdev-properties.c |2 ++ hw/qdev.h|3 +++ 2 files changed, 5

[PATCH 2/3] pci init: fail qemu if devfn exceeding the max devices number supported on bus

2010-08-24 Thread Ken CC
assert(devfn PCIBUS_MAX_DEVICES) Signed-off-by: Ken CC ken.c...@gmail.com --- hw/pci.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 02019a1..1e804da 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -747,6 +747,7 @@ static PCIDevice

[PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Ken CC
Define MAX_PCI_SLOTS as 0x1f, if pci addr provided from command line is bigger than 0x1f, return error -EINVAL. 0x1f 3 | 7 == 255 (PCIBUS_MAX_DEVICES - 1) Signed-off-by: Ken CC ken.c...@gmail.com --- hw/qdev-properties.c |2 ++ hw/qdev.h|3 +++ 2 files changed, 5

Re: [PATCH 2/3] pci init: fail qemu if devfn exceeding the max devices number supported on bus

2010-08-24 Thread Ken CC
broken thread, please ignore. On Tue, Aug 24, 2010 at 02:33:51PM +0800, Ken CC wrote: assert(devfn PCIBUS_MAX_DEVICES) Signed-off-by: Ken CC ken.c...@gmail.com --- hw/pci.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Christian Borntraeger
Am 23.08.2010 23:31, schrieb Alexander Graf: Currenty the ext_param field only distinguishes between config change and vring interrupt. We can do a lot more with it though, so let's enable a full byte of possible values and constants to #defines while at it. Makes a lot of sense. [...]

Re: [PATCH 2/2] S390: Add virtio hotplug add support

2010-08-24 Thread Christian Borntraeger
Am 23.08.2010 23:31, schrieb Alexander Graf: The one big missing feature in s390-virtio was hotplugging. This is no more. This patch implements hotplug add support, so you can on the fly add new devices in the guest. Nice :-) Keep in mind that this needs a patch for qemu to actually

Re: [PATCH v5 04/12] Provide special async page fault handler when async PF capability is detected

2010-08-24 Thread Gleb Natapov
On Mon, Aug 23, 2010 at 06:48:53PM +0300, Avi Kivity wrote: On 07/19/2010 06:30 PM, Gleb Natapov wrote: When async PF capability is detected hook up special page fault handler that will handle async page fault events and bypass other page faults to regular page fault handler. Acked-by: Rik

Re: [PATCH v5 08/12] Inject asynchronous page fault into a guest if page is swapped out.

2010-08-24 Thread Gleb Natapov
On Mon, Aug 23, 2010 at 07:17:20PM +0300, Avi Kivity wrote: On 07/19/2010 06:30 PM, Gleb Natapov wrote: If guest access swapped out memory do not swap it in from vcpu thread context. Setup slow work to do swapping and send async page fault to a guest. Allow async page fault injection only

confusion about kvm_mmu_pte_write

2010-08-24 Thread cs-jerry**
hello all, i am reading kvm code and confused about the mmu_pte_write process, when update a gpte, function kvm_mmu_pte_write is called , and walk the shadow page for it.why condition is : if (sp-gfn != gfn || sp-role.direct || sp-role.invalid) continue; and not update those sp-gfn == gfn

Re: [PATCH v5 04/12] Provide special async page fault handler when async PF capability is detected

2010-08-24 Thread Avi Kivity
On 08/24/2010 10:31 AM, Gleb Natapov wrote: + +static void apf_task_wait(struct task_struct *tsk, u32 token) +{ + u32 key = hash_32(token, KVM_TASK_SLEEP_HASHBITS); + struct kvm_task_sleep_head *b =async_pf_sleepers[key]; + struct kvm_task_sleep_node n, *e; +

Re: [PATCH v5 08/12] Inject asynchronous page fault into a guest if page is swapped out.

2010-08-24 Thread Avi Kivity
On 08/24/2010 10:52 AM, Gleb Natapov wrote: This nice cache needs to be outside apf to reduce complexity for reviewers and since it is useful for others. Would be good to have memslot-cached kvm_put_guest() and kvm_get_guest(). Will look into it. In the meantime, you can just drop the

Re: [PATCH v5 09/12] Retry fault before vmentry

2010-08-24 Thread Avi Kivity
On 07/19/2010 06:30 PM, Gleb Natapov wrote: When page is swapped in it is mapped into guest memory only after guest tries to access it again and generate another fault. To save this fault we can map it immediately since we know that guest is going to access the page. -static int

Re: [PATCH v5 10/12] Handle async PF in non preemptable context

2010-08-24 Thread Avi Kivity
On 07/19/2010 06:31 PM, Gleb Natapov wrote: If async page fault is received by idle task or when preemp_count is not zero guest cannot reschedule, so do sti; hlt and wait for page to be ready. vcpu can still process interrupts while it waits for the page to be ready. Acked-by: Rik van

Re: [PATCH v5 11/12] Let host know whether the guest can handle async PF in non-userspace context.

2010-08-24 Thread Avi Kivity
On 07/19/2010 06:31 PM, Gleb Natapov wrote: If guest can detect that it runs in non-preemptable context it can handle async PFs at any time, so let host know that it can send async PF even if guest cpu is not in userspace. Acked-by: Rik van Rielr...@redhat.com Signed-off-by: Gleb

Re: [PATCH v5 09/12] Retry fault before vmentry

2010-08-24 Thread Gleb Natapov
On Tue, Aug 24, 2010 at 12:25:33PM +0300, Avi Kivity wrote: On 07/19/2010 06:30 PM, Gleb Natapov wrote: When page is swapped in it is mapped into guest memory only after guest tries to access it again and generate another fault. To save this fault we can map it immediately since we know that

Re: [PATCH v5 12/12] Send async PF when guest is not in userspace too.

2010-08-24 Thread Avi Kivity
On 07/19/2010 06:31 PM, Gleb Natapov wrote: If guest indicates that it can handle async pf in kernel mode too send it, but only if interrupt are enabled. Reviewed-by: Rik van Rielr...@redhat.com Signed-off-by: Gleb Natapovg...@redhat.com --- arch/x86/kvm/mmu.c |8 +++- 1 files

Re: [PATCH v5 10/12] Handle async PF in non preemptable context

2010-08-24 Thread Gleb Natapov
On Tue, Aug 24, 2010 at 12:30:25PM +0300, Avi Kivity wrote: On 07/19/2010 06:31 PM, Gleb Natapov wrote: If async page fault is received by idle task or when preemp_count is not zero guest cannot reschedule, so do sti; hlt and wait for page to be ready. vcpu can still process interrupts while

Re: [PATCH v5 09/12] Retry fault before vmentry

2010-08-24 Thread Avi Kivity
On 08/24/2010 12:33 PM, Gleb Natapov wrote: @@ -505,6 +506,37 @@ out_unlock: return 0; } +static int FNAME(page_fault_other_cr3)(struct kvm_vcpu *vcpu, gpa_t cr3, + gva_t addr, u32 error_code) +{ + int r = 0; + gpa_t curr_cr3 =

Re: [PATCH v5 10/12] Handle async PF in non preemptable context

2010-08-24 Thread Avi Kivity
On 08/24/2010 12:36 PM, Gleb Natapov wrote: On Tue, Aug 24, 2010 at 12:30:25PM +0300, Avi Kivity wrote: On 07/19/2010 06:31 PM, Gleb Natapov wrote: If async page fault is received by idle task or when preemp_count is not zero guest cannot reschedule, so do sti; hlt and wait for page to be

Re: [PATCH 0/4 v2] kvm: rework KVM mmu_shrink() code

2010-08-24 Thread Xiaotian Feng
On Tue, Aug 24, 2010 at 10:07 AM, Marcelo Tosatti mtosa...@redhat.com wrote: On Mon, Aug 23, 2010 at 07:11:11PM +0800, Xiaotian Feng wrote: On Mon, Aug 23, 2010 at 6:27 PM, Avi Kivity a...@redhat.com wrote:  On 08/23/2010 01:22 PM, Avi Kivity wrote: I see a lot of soft lockups with this

Re: confusion about kvm_mmu_pte_write

2010-08-24 Thread Avi Kivity
On 08/24/2010 11:16 AM, cs-jerry** wrote: hello all, i am reading kvm code and confused about the mmu_pte_write process, when update a gpte, function kvm_mmu_pte_write is called , and walk the shadow page for it.why condition is : if (sp-gfn != gfn || sp-role.direct || sp-role.invalid)

[PATCH kvm-unit-tests 1/3] Support #DE (divide error) exception handlers

2010-08-24 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- x86/idt.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/x86/idt.c b/x86/idt.c index 590839f..4480833 100644 --- a/x86/idt.c +++ b/x86/idt.c @@ -100,6 +100,11 @@ asm (.pushsection .text \n\t pushq $13 \n\t

[PATCH kvm-unit-tests 0/3] DIV exception tests

2010-08-24 Thread Avi Kivity
DIV may raise an exception if dividing by zero or causing an overflow. Test it. Avi Kivity (3): Support #DE (divide error) exception handlers Allow emulation tests to trap exceptions Add DIV tests config-x86-common.mak |3 ++- x86/emulator.c| 20

[PATCH kvm-unit-tests 3/3] Add DIV tests

2010-08-24 Thread Avi Kivity
Test divide-by-zero and normal cases. Signed-off-by: Avi Kivity a...@redhat.com --- x86/emulator.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/x86/emulator.c b/x86/emulator.c index 5d1659f..845e7a0 100644 --- a/x86/emulator.c +++ b/x86/emulator.c @@

[PATCH kvm-unit-tests 2/3] Allow emulation tests to trap exceptions

2010-08-24 Thread Avi Kivity
Some instructions trap on execution, we need a way to see if they raise an exception as expected. Signed-off-by: Avi Kivity a...@redhat.com --- config-x86-common.mak |3 ++- x86/emulator.c|2 ++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/config-x86-common.mak

[PATCH 2/3] KVM: x86 emulator: add macros for executing instructions that may trap

2010-08-24 Thread Avi Kivity
Like DIV and IDIV. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c | 43 +++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 808934c..f82e43a 100644 ---

[PATCH 0/3] Trap and propagate divide errors when emulating DIV

2010-08-24 Thread Avi Kivity
KVM recently started emulating DIV and IDIV. However, those instructions trap when given the right operands. Since figuring out when to trap or not is difficult, we just execute the instruction and see if the processor trapped or not. tip: please queue the first patch on fast-forward-only

[PATCH 3/3] KVM: x86 emulator: trap and propagate #DE from DIV and IDIV

2010-08-24 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c | 17 ++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index f82e43a..a7e26d0 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@

[PATCH 1/3] x86: allow kernel exception fixup for divide errors (#DE)

2010-08-24 Thread Avi Kivity
KVM wants to emulate the DIV and IDIV instructions by executing them natively; this can cause a #DE to be raised. Allow the exception handling mechanism to process #DE exceptions so KVM can catch and process them. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kernel/traps.c | 10

Re: [PATCH 1/3] x86: allow kernel exception fixup for divide errors (#DE)

2010-08-24 Thread Brian Gerst
On Tue, Aug 24, 2010 at 7:10 AM, Avi Kivity a...@redhat.com wrote: KVM wants to emulate the DIV and IDIV instructions by executing them natively; this can cause a #DE to be raised. Allow the exception handling mechanism to process #DE exceptions so KVM can catch and process them.

Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Isaku Yamahata
Add Cc: m...@redhat.com. MAX_PCI_SLOTS should be in pci.h instead of qdev.h? And the name should be start with PCI_ prefix for consistency? Except that, the patches look okay. thanks, On Tue, Aug 24, 2010 at 02:49:27PM +0800, Ken CC wrote: Define MAX_PCI_SLOTS as 0x1f, if pci addr provided

[PATCH 1/3] KVM: x86 emulator: Rename variable that shadows another local variable.

2010-08-24 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 017ae0c..f9f8353 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3393,7

[PATCH 2/3] KVM: x86 emulator: move string instruction completion check into separate function

2010-08-24 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 42 +- 1 files changed, 29 insertions(+), 13 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index f9f8353..d34d706 100644 --- a/arch/x86/kvm/emulate.c

[PATCH 3/3] KVM: x86 emulator: get rid of restart in emulation context.

2010-08-24 Thread Gleb Natapov
x86_emulate_insn() will return 1 if instruction can be restarted without re-entering a guest. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 - arch/x86/kvm/emulate.c | 47 --- arch/x86/kvm/x86.c

Re: [PATCH 1/3] x86: allow kernel exception fixup for divide errors (#DE)

2010-08-24 Thread Avi Kivity
On 08/24/2010 02:22 PM, Brian Gerst wrote: +dotraplinkage void do_divide_error(struct pt_regs *regs, long error_code) +{ + if (!user_mode_vm(regs) fixup_exception(regs)) + return; + do_divide_error_user(regs, error_code); +} + #ifdef CONFIG_X86_64 /* Runs on IST

Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Avi Kivity
On 08/24/2010 02:35 PM, Isaku Yamahata wrote: Add Cc: m...@redhat.com. MAX_PCI_SLOTS should be in pci.h instead of qdev.h? And the name should be start with PCI_ prefix for consistency? Except that, the patches look okay. These aren't slots, are they? They are functions. There's a lot of

Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Isaku Yamahata
On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: On 08/24/2010 02:35 PM, Isaku Yamahata wrote: Add Cc: m...@redhat.com. MAX_PCI_SLOTS should be in pci.h instead of qdev.h? And the name should be start with PCI_ prefix for consistency? Except that, the patches look okay. These

Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Avi Kivity
On 08/24/2010 03:07 PM, Isaku Yamahata wrote: On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: On 08/24/2010 02:35 PM, Isaku Yamahata wrote: Add Cc: m...@redhat.com. MAX_PCI_SLOTS should be in pci.h instead of qdev.h? And the name should be start with PCI_ prefix for

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Alexander Graf
Christian Borntraeger wrote: Am 23.08.2010 23:31, schrieb Alexander Graf: Currenty the ext_param field only distinguishes between config change and vring interrupt. We can do a lot more with it though, so let's enable a full byte of possible values and constants to #defines while at it.

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Christian Borntraeger
Am 24.08.2010 14:06, schrieb Alexander Graf: #define VIRTIO_SUBCODE_64 0x0D00 +#define VIRTIO_PARAM_MASK 0xff +#define VIRTIO_PARAM_VRING_INTERRUPT 0x0 +#define VIRTIO_PARAM_CONFIG_CHANGED0x1 Maybe this should be exported in a header, something like

Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Isaku Yamahata
On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: On 08/24/2010 03:07 PM, Isaku Yamahata wrote: On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: On 08/24/2010 02:35 PM, Isaku Yamahata wrote: Add Cc: m...@redhat.com. MAX_PCI_SLOTS should be in pci.h instead of qdev.h?

Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Avi Kivity
On 08/24/2010 03:24 PM, Isaku Yamahata wrote: On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: On 08/24/2010 03:07 PM, Isaku Yamahata wrote: On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: On 08/24/2010 02:35 PM, Isaku Yamahata wrote: Add Cc: m...@redhat.com.

Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Chen Cao
On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: On 08/24/2010 03:07 PM, Isaku Yamahata wrote: On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: On 08/24/2010 02:35 PM, Isaku Yamahata wrote: Add Cc: m...@redhat.com. MAX_PCI_SLOTS should be in pci.h instead of qdev.h?

Re: [Qemu-devel] [PATCH 3/3] Check pci slot number in parse_pci_devfn

2010-08-24 Thread Avi Kivity
On 08/24/2010 03:16 PM, Chen Cao wrote: On Tue, Aug 24, 2010 at 03:04:44PM +0300, Avi Kivity wrote: On 08/24/2010 03:07 PM, Isaku Yamahata wrote: On Tue, Aug 24, 2010 at 02:42:18PM +0300, Avi Kivity wrote: On 08/24/2010 02:35 PM, Isaku Yamahata wrote: Add Cc: m...@redhat.com.

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Avi Kivity
On 08/24/2010 03:14 PM, Christian Borntraeger wrote: I have no strong opinion on that, but I think its more a matter of where to put an interface description. A header file seems just the right place. I will let you (or Rusty) decide. First of all we need a virtio/s390 specification, like we

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Alexander Graf
Avi Kivity wrote: On 08/24/2010 03:14 PM, Christian Borntraeger wrote: I have no strong opinion on that, but I think its more a matter of where to put an interface description. A header file seems just the right place. I will let you (or Rusty) decide. First of all we need a virtio/s390

Re: [PATCH v5 08/12] Inject asynchronous page fault into a guest if page is swapped out.

2010-08-24 Thread Gleb Natapov
On Mon, Aug 23, 2010 at 07:17:20PM +0300, Avi Kivity wrote: +static int apf_put_user(struct kvm_vcpu *vcpu, u32 val) +{ +if (unlikely(vcpu-arch.apf_memslot_ver != + vcpu-kvm-memslot_version)) { +u64 gpa = vcpu-arch.apf_msr_val ~0x3f; +unsigned

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Avi Kivity
On 08/24/2010 03:25 PM, Alexander Graf wrote: Avi Kivity wrote: On 08/24/2010 03:14 PM, Christian Borntraeger wrote: I have no strong opinion on that, but I think its more a matter of where to put an interface description. A header file seems just the right place. I will let you (or Rusty)

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Alexander Graf
Avi Kivity wrote: On 08/24/2010 03:25 PM, Alexander Graf wrote: Avi Kivity wrote: On 08/24/2010 03:14 PM, Christian Borntraeger wrote: I have no strong opinion on that, but I think its more a matter of where to put an interface description. A header file seems just the right place. I

Re: [PATCH v5 08/12] Inject asynchronous page fault into a guest if page is swapped out.

2010-08-24 Thread Avi Kivity
On 08/24/2010 03:28 PM, Gleb Natapov wrote: On Mon, Aug 23, 2010 at 07:17:20PM +0300, Avi Kivity wrote: +static int apf_put_user(struct kvm_vcpu *vcpu, u32 val) +{ + if (unlikely(vcpu-arch.apf_memslot_ver != +vcpu-kvm-memslot_version)) { + u64 gpa =

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Avi Kivity
On 08/24/2010 03:32 PM, Alexander Graf wrote: Perhaps we should freeze virtio/s390 development until someone feels sufficiently motivated. Sure, go ahead. I don't think that'll help anyone but if it makes you feel good... I don't maintain virtio or the virtio-s390 interface, so I can't

Re: Having trouble with ballooning

2010-08-24 Thread Moritz Duge
Am 23.08.2010 20:16, schrieb Marcelo Tosatti: On Thu, Aug 05, 2010 at 01:41:16PM +0200, Moritz Duge wrote: Hi, I had some trouble while using the ballooning feature of KVM (using Ubuntu 10.04 with standard software versions). The first scenario: 1. Having a guest started by this command:

Re: KVM call agenda for August 24

2010-08-24 Thread Anthony Liguori
On 08/23/2010 05:30 PM, Chris Wright wrote: Please send in any agenda items you are interested in covering. There are quite a few important discussions on the list but I think they should stay on the list right now. So it sounds like we don't have an agenda for today. Regards, Anthony

Re: [PATCH 2/3] KVM: x86 emulator: move string instruction completion check into separate function

2010-08-24 Thread Avi Kivity
On 08/24/2010 02:30 PM, Gleb Natapov wrote: Signed-off-by: Gleb Natapovg...@redhat.com --- arch/x86/kvm/emulate.c | 42 +- 1 files changed, 29 insertions(+), 13 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

Re: [PATCH -kvm] kvm: fix regression from rework KVM mmu_shrink() code

2010-08-24 Thread Marcelo Tosatti
On Tue, Aug 24, 2010 at 10:31:07AM +0800, Xiaotian Feng wrote: Latest kvm mmu_shrink code rework makes kernel changes kvm-arch.n_used_mmu_pages/ kvm-arch.n_max_mmu_pages at kvm_mmu_free_page/kvm_mmu_alloc_page, which is called by kvm_mmu_commit_zap_page. So the kvm-arch.n_used_mmu_pages or

Re: [PATCH 3/3] KVM: x86 emulator: get rid of restart in emulation context.

2010-08-24 Thread Avi Kivity
On 08/24/2010 02:30 PM, Gleb Natapov wrote: x86_emulate_insn() will return 1 if instruction can be restarted without re-entering a guest. So now we have an undocumented -1/0/1 return code? Better to have an enum for this. -- error compiling committee.c: too many arguments to function --

Re: [PATCH 2/3] KVM: x86 emulator: move string instruction completion check into separate function

2010-08-24 Thread Gleb Natapov
On Tue, Aug 24, 2010 at 04:11:20PM +0300, Avi Kivity wrote: On 08/24/2010 02:30 PM, Gleb Natapov wrote: Signed-off-by: Gleb Natapovg...@redhat.com --- arch/x86/kvm/emulate.c | 42 +- 1 files changed, 29 insertions(+), 13 deletions(-) diff --git

Re: [PATCH 2/3] KVM: x86 emulator: move string instruction completion check into separate function

2010-08-24 Thread Avi Kivity
On 08/24/2010 04:20 PM, Gleb Natapov wrote: +{ + struct decode_cache *c =ctxt-decode; + + /* All REP prefixes have the same first termination condition */ + if (address_mask(c, c-regs[VCPU_REGS_RCX]) == 0) + return true; This is checked during the beginning of

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Christian Borntraeger
Am 24.08.2010 14:22, schrieb Avi Kivity: First of all we need a virtio/s390 specification, like we have a virtio/pci spec. Here is something that I started a year ago but never finished. Christian guest/host interface for s390/virtio devices KVM_DEVICE_DESCRIPTOR PAGE

[PATCH 1/4] PCI: define PCIBUS_MAX_DEVICES and PCI_FUNCTIONS_PER_DEVICE in pci.h

2010-08-24 Thread Ken CC
And update the max function number used in struct PCIBus{} to PCIBUS_MAX_FUNCTIONS = PCI_FUNCTIONS_PER_DEVICE * PCIBUS_MAX_DEVICES TODO: according to Avi Kivity, PCIBus.devices[] should be renamed to functions[] Signed-off-by: Ken CC ken.c...@gmail.com --- hw/pci.c |2 +- hw/pci.h |

[PATCH 2/4] pci init: fail qemu if devfn exceeding the max function number supported on bus

2010-08-24 Thread Ken CC
Check if devfn PCIBUS_MAX_DEVICES * PCI_FUNCTIONS_PER_DEVICE Signed-off-by: Ken CC ken.c...@gmail.com --- hw/pci.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 9234fe3..fc4becd 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -747,6 +747,7 @@ static

[PATCH 3/4] Check pci slot number against PCIBUS_MAX_DEVICES in parse_pci_devfn

2010-08-24 Thread Ken CC
If pci addr provided from command line is bigger than 32, PCIBUS_MAX_DEVICES, return error -EINVAL. 32 3 | 7 == 256 (PCIBUS_MAX_FUNCTIONS) PCIBUS_MAX_FUNCTIONS = PCIBUS_MAX_DEVICES * PCI_FUNCTIONS_PER_DEVICE Signed-off-by: Ken CC ken.c...@gmail.com --- hw/qdev-properties.c |4 +++- 1 files

[PATCH 4/4] Rename PCI_FUNC_MAX to PCI_FUNCTIONS_PER_DEVICES in pci.[ch]

2010-08-24 Thread Ken CC
PCI_FUNC_MAX is introduced by 6eab3de16d36c48a983366b09d0a0029a5260bc3 and 6fa84913eccec4266a27c81ae88465f6790742b9 which should be safe to rename to PCI_FUNCTIONS_PER_DEVICES. Signed-off-by: Ken CC ken.c...@gmail.com --- hw/pci.c |4 ++-- hw/pci.h |1 - 2 files changed, 2 insertions(+),

KVM call cancelled [was: Re: KVM call agenda for August 24]

2010-08-24 Thread Chris Wright
* Anthony Liguori (anth...@codemonkey.ws) wrote: On 08/23/2010 05:30 PM, Chris Wright wrote: Please send in any agenda items you are interested in covering. There are quite a few important discussions on the list but I think they should stay on the list right now. So it sounds like we

Re: KVM timekeeping and TSC virtualization

2010-08-24 Thread David S. Ahern
On 08/23/10 23:47, Zachary Amsden wrote: I've heard the rumor that TSC is orders of magnitude faster under VMware than under KVM from three people now, and I thought you were part of that camp. Needless to say, they are either laughably incorrect, or possess some great secret knowledge of

Re: [PATCH 3/3] KVM: x86 emulator: get rid of restart in emulation context.

2010-08-24 Thread Gleb Natapov
On Tue, Aug 24, 2010 at 04:13:38PM +0300, Avi Kivity wrote: On 08/24/2010 02:30 PM, Gleb Natapov wrote: x86_emulate_insn() will return 1 if instruction can be restarted without re-entering a guest. So now we have an undocumented -1/0/1 return code? Better to have an enum for this. We

Re: [PATCH 3/3] KVM: x86 emulator: get rid of restart in emulation context.

2010-08-24 Thread Avi Kivity
On 08/24/2010 04:37 PM, Gleb Natapov wrote: On Tue, Aug 24, 2010 at 04:13:38PM +0300, Avi Kivity wrote: On 08/24/2010 02:30 PM, Gleb Natapov wrote: x86_emulate_insn() will return 1 if instruction can be restarted without re-entering a guest. So now we have an undocumented -1/0/1 return

[PATCH kvm-unit-tests 00/10] Minor cleanup and fix for 32bit test

2010-08-24 Thread Jason Wang
The following series do some minor cleanup and fix for the 32bit test. --- Jason Wang (10): Do not track config.mak and kvmtrace Remove trailing whitespaces Makefile cleanup Correct the path in README Drop print.S Remove the duplicated rdmsr/wrmsr

[PATCH kvm-unit-tests 01/10] Do not track config.mak and kvmtrace

2010-08-24 Thread Jason Wang
config.mak was generated by configure and kvmtrace were compiled throuh makefile. Signed-off-by: Jason Wang jasow...@redhat.com --- config.mak |8 kvmtrace | Bin 2 files changed, 0 insertions(+), 8 deletions(-) delete mode 100644 config.mak delete mode 100755 kvmtrace diff

[PATCH kvm-unit-tests 02/10] Remove trailing whitespaces

2010-08-24 Thread Jason Wang
Signed-off-by: Jason Wang jasow...@redhat.com --- config-x86-common.mak | 14 +++--- x86/access.c |2 +- x86/cstart64.S|4 ++-- x86/print.S |6 +++--- x86/sieve.c |2 +- x86/vm.c |6 +++--- 6 files changed, 17

[PATCH kvm-unit-tests 03/10] Makefile cleanup

2010-08-24 Thread Jason Wang
Remove the obsoleted target and directories. Signed-off-by: Jason Wang jasow...@redhat.com --- Makefile |9 + 1 files changed, 1 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 5347ce8..d25e6f2 100644 --- a/Makefile +++ b/Makefile @@ -30,10 +30,6 @@ CFLAGS +=

[PATCH kvm-unit-tests 04/10] Correct the path in README

2010-08-24 Thread Jason Wang
Signed-off-by: Jason Wang jasow...@redhat.com --- README | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README b/README index 6a83831..9c0c518 100644 --- a/README +++ b/README @@ -7,17 +7,17 @@ Tests uses a qemu's virtual test device, named testdev, for

[PATCH kvm-unit-tests 05/10] Drop print.S

2010-08-24 Thread Jason Wang
We've already had lib/printf.c. Signed-off-by: Jason Wang jasow...@redhat.com --- config-x86-common.mak |9 - x86/print.S | 31 --- 2 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 x86/print.S diff --git

[PATCH kvm-unit-tests 06/10] Remove the duplicated rdmsr/wrmsr

2010-08-24 Thread Jason Wang
They have been implemented in lib/x86/processor.h. Also rename the cpuid to cpuid_test because cpuid have been defined. Signed-off-by: Jason Wang jasow...@redhat.com --- x86/msr.c| 16 +--- x86/vmexit.c | 20 +++- 2 files changed, 4 insertions(+), 32

[PATCH kvm-unit-tests 07/10] Correct the tss size

2010-08-24 Thread Jason Wang
TSS size should be 104 byte. Signed-off-by: Jason Wang jasow...@redhat.com --- x86/cstart64.S |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/x86/cstart64.S b/x86/cstart64.S index 5d358ad..b871153 100644 --- a/x86/cstart64.S +++ b/x86/cstart64.S @@ -69,7 +69,7 @@ tss:

[PATCH kvm-unit-tests 08/10] Check whether in long mode before testing vmexit caused by cr8 access

2010-08-24 Thread Jason Wang
CR8 is only availabe when in long mode. Signed-off-by: Jason Wang jasow...@redhat.com --- x86/vmexit.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/x86/vmexit.c b/x86/vmexit.c index 819c24b..34b0af4 100644 --- a/x86/vmexit.c +++ b/x86/vmexit.c @@ -48,6

[PATCH kvm-unit-tests 09/10] Do not test IA32_EFER in 32bit mode.

2010-08-24 Thread Jason Wang
Signed-off-by: Jason Wang jasow...@redhat.com --- x86/msr.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/x86/msr.c b/x86/msr.c index 9c85369..c3e0014 100644 --- a/x86/msr.c +++ b/x86/msr.c @@ -49,9 +49,11 @@ struct msr_info msr_info[] = { .index = 0xc102,

[PATCH kvm-unit-tests 10/10] Add the 32bit smp initialization code

2010-08-24 Thread Jason Wang
Add the smp initlaization codes for 32bit. This would make the 32bit smp tests available. Signed-off-by: Jason Wang jasow...@redhat.com --- x86/cstart.S | 179 -- 1 files changed, 173 insertions(+), 6 deletions(-) diff --git

[PATCH 3/3] S390: Export kvm_virtio.h

2010-08-24 Thread Alexander Graf
As suggested by Christian, we should expose headers to user space with information that might be valuable there. The s390 virtio interface is one of those cases. It defines an ABI between hypervisor and guest, so it should be exposed to user space. Reported-by: Christian Borntraeger

[PATCH 1/3] S390: take a full byte as ext_param indicator

2010-08-24 Thread Alexander Graf
Currenty the ext_param field only distinguishes between config change and vring interrupt. We can do a lot more with it though, so let's enable a full byte of possible values and constants to #defines while at it. Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - move defines to

Re: [PATCH 3/3] KVM: x86 emulator: get rid of restart in emulation context.

2010-08-24 Thread Gleb Natapov
On Tue, Aug 24, 2010 at 04:41:10PM +0300, Avi Kivity wrote: On 08/24/2010 04:37 PM, Gleb Natapov wrote: On Tue, Aug 24, 2010 at 04:13:38PM +0300, Avi Kivity wrote: On 08/24/2010 02:30 PM, Gleb Natapov wrote: x86_emulate_insn() will return 1 if instruction can be restarted without

Re: [PATCH kvm-unit-tests 07/10] Correct the tss size

2010-08-24 Thread Avi Kivity
On 08/24/2010 04:47 PM, Jason Wang wrote: TSS size should be 104 byte. Signed-off-by: Jason Wangjasow...@redhat.com --- x86/cstart64.S |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/x86/cstart64.S b/x86/cstart64.S index 5d358ad..b871153 100644 --- a/x86/cstart64.S

Re: [PATCH kvm-unit-tests 08/10] Check whether in long mode before testing vmexit caused by cr8 access

2010-08-24 Thread Avi Kivity
On 08/24/2010 04:47 PM, Jason Wang wrote: CR8 is only availabe when in long mode. Signed-off-by: Jason Wangjasow...@redhat.com --- x86/vmexit.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/x86/vmexit.c b/x86/vmexit.c index 819c24b..34b0af4 100644

Re: [PATCH 3/3] KVM: x86 emulator: get rid of restart in emulation context.

2010-08-24 Thread Avi Kivity
On 08/24/2010 04:52 PM, Gleb Natapov wrote: We can, of course. But for me it looks as arbitrary as -1/0/1 since not all enum values have meanings to the caller. Yeah. -1/0/1's problem is that between reading the callee code and caller code, I manage to forget what the values mean. --

Re: [PATCH 3/3] KVM: x86 emulator: get rid of restart in emulation context.

2010-08-24 Thread Gleb Natapov
On Tue, Aug 24, 2010 at 05:01:10PM +0300, Avi Kivity wrote: On 08/24/2010 04:52 PM, Gleb Natapov wrote: We can, of course. But for me it looks as arbitrary as -1/0/1 since not all enum values have meanings to the caller. Yeah. -1/0/1's problem is that between reading the callee code and

KVM Bridged Networking Issue in Ubuntu Lucid

2010-08-24 Thread Rus Hughes
Hi guys, I'm trying to sort out networking for a VM I've created on my Ubuntu Lucid box but the VM cannot access the Internet. I can connect to the VM (crisps) from the host (holly) and to the host from the VM. But the VM cannot connect to the Internet and the Internet cannot connect to the VM.

Re: GRUB and support for Virtio

2010-08-24 Thread Daniel Bareiro
On Wednesday, 18 August 2010 21:45:56 +0300, Nikolai K. Bochev wrote: Strange, i did 2 clean installs of centos 5.5 on an ubuntu 9.10 host and it went flawless with virtio devices ( both disks and network ). Doing some tests with CentOS 5.5 on a KVM virtual machine, after doing the

Re: [PATCH 3/3] KVM: x86 emulator: get rid of restart in emulation context.

2010-08-24 Thread Avi Kivity
On 08/24/2010 05:06 PM, Gleb Natapov wrote: On Tue, Aug 24, 2010 at 05:01:10PM +0300, Avi Kivity wrote: On 08/24/2010 04:52 PM, Gleb Natapov wrote: We can, of course. But for me it looks as arbitrary as -1/0/1 since not all enum values have meanings to the caller. Yeah. -1/0/1's problem

Re: [PATCH v3] Add realmode test for jcxz instruction

2010-08-24 Thread Marcelo Tosatti
On Tue, Aug 24, 2010 at 10:57:12AM +0800, Wei Yongjun wrote: Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com --- v2 - v3: rebased --- x86/realmode.c | 42 ++ 1 files changed, 42 insertions(+), 0 deletions(-) Applied, thanks. -- To unsubscribe from

Re: WARNING: at arch/x86/kernel/apic/apic.c:1238 setup_local_APIC+0x169/0x24b()

2010-08-24 Thread Marcelo Tosatti
[    0.00] NR_IRQS:4352 nr_irqs:512 [    0.00] Console: colour VGA+ 80x25 [    0.00] console [tty0] enabled [    0.00] ODEBUG: 0 of 0 active objects replaced [    0.00] Fast TSC calibration failed [    0.00] TSC: Unable to calibrate against PIT [    0.00] TSC: No

UIO: per-handle event counts

2010-08-24 Thread Phil Edworthy
Hi, I've been using UIO for a userspace driver and noticed a feature when multiple uio file handles have been opened for the same device (e.g. when running separate processes). Since each handle stores its own count of the interrupts and uses this to determine whether uio_read returns, it's

Re: [PATCH 3/3] KVM: x86 emulator: get rid of restart in emulation context.

2010-08-24 Thread Gleb Natapov
On Tue, Aug 24, 2010 at 05:28:12PM +0300, Avi Kivity wrote: On 08/24/2010 05:06 PM, Gleb Natapov wrote: On Tue, Aug 24, 2010 at 05:01:10PM +0300, Avi Kivity wrote: On 08/24/2010 04:52 PM, Gleb Natapov wrote: We can, of course. But for me it looks as arbitrary as -1/0/1 since not all enum

How to debug KVM with gdb?

2010-08-24 Thread SHEN Hao
Hello, I would like to debug the OS kernel loaded and simulated by kvm. I know that QEMU have some problem with KVM debug. So how can I debug this kernel? Is there any suggestion? Best regards, -- Hao Shen -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message

Re: WARNING: at arch/x86/kernel/apic/apic.c:1238 setup_local_APIC+0x169/0x24b()

2010-08-24 Thread Tharindu Rukshan Bamunuarachchi
it worked. thankx a lot. On Tue, Aug 24, 2010 at 2:22 PM, Marcelo Tosatti mtosa...@redhat.com wrote: [    0.00] NR_IRQS:4352 nr_irqs:512 [    0.00] Console: colour VGA+ 80x25 [    0.00] console [tty0] enabled [    0.00] ODEBUG: 0 of 0 active objects replaced [   

Re: WARNING: at arch/x86/kernel/apic/apic.c:1238 setup_local_APIC+0x169/0x24b()

2010-08-24 Thread Tharindu Rukshan Bamunuarachchi
it worked. thankx a lot. On Tue, Aug 24, 2010 at 2:22 PM, Marcelo Tosatti mtosa...@redhat.com wrote: [    0.00] NR_IRQS:4352 nr_irqs:512 [    0.00] Console: colour VGA+ 80x25 [    0.00] console [tty0] enabled [    0.00] ODEBUG: 0 of 0 active objects replaced [   

Re: [PATCH] KVM: MMU: fix missing percpu counter destroy

2010-08-24 Thread Tim Pepper
On Mon 23 Aug at 16:13:15 +0800 yj...@cn.fujitsu.com said: commit ad05c88266b4cce1c820928ce8a0fb7690912ba1 (KVM: create aggregate kvm_total_used_mmu_pages value) introduce percpu counter kvm_total_used_mmu_pages but never destroy it, this may cause oops when rmmod modprobe. Signed-off-by:

Re: KVM Bridged Networking Issue in Ubuntu Lucid

2010-08-24 Thread Brian Jackson
On Tuesday, August 24, 2010 09:08:30 am Rus Hughes wrote: Hi guys, I'm trying to sort out networking for a VM I've created on my Ubuntu Lucid box but the VM cannot access the Internet. I can connect to the VM (crisps) from the host (holly) and to the host from the VM. But the VM cannot

Re: SeaBIOS and GRUB booting from Virtio devices [was: GRUB and support for Virtio]

2010-08-24 Thread Daniel Bareiro
On Tuesday, 24 August 2010 11:23:59 -0300, Daniel Bareiro wrote: Strange, i did 2 clean installs of centos 5.5 on an ubuntu 9.10 host and it went flawless with virtio devices ( both disks and network ). Doing some tests with CentOS 5.5 on a KVM virtual machine, after doing the

  1   2   >