Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread Gleb Natapov
On Wed, Jun 05, 2013 at 07:41:17PM -0500, Anthony Liguori wrote: H. Peter Anvin h...@zytor.com writes: On 06/05/2013 03:08 PM, Anthony Liguori wrote: Definitely an option. However, we want to be able to boot from native devices, too, so having an I/O BAR (which would not be used by the

Re: Bug#707257: linux-image-3.8-1-686-pae: KVM crashes with entry failed, hardware error 0x80000021

2013-06-06 Thread Gleb Natapov
On Wed, Jun 05, 2013 at 02:51:19PM +0200, Stefan Pietsch wrote: On 05.06.2013 14:10, Gleb Natapov wrote: On Wed, Jun 05, 2013 at 01:57:25PM +0200, Stefan Pietsch wrote: On 19.05.2013 14:32, Gleb Natapov wrote: On Sun, May 19, 2013 at 02:00:31AM +0100, Ben Hutchings wrote: Dear KVM

Re: [PATCH] kvm-unit-tests: Add test case for accessing bpl via modr/m

2013-06-06 Thread 李春奇
On Thu, Jun 6, 2013 at 1:45 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 01:03:44PM +0800, Arthur Chunqi Li wrote: Test access to %bpl via modr/m addressing mode. This case can test another bug in the boot of RHEL5.9 64-bit. We have growing number of instructions tests

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread 李春奇
On Thu, Jun 6, 2013 at 1:40 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 12:28:16AM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 12:13 AM, Gleb Natapov g...@redhat.com wrote: This time the email is perfect :) On Thu, Jun 06, 2013 at 12:02:52AM +0800, Arthur

Re: [PATCH] kvm-unit-tests: Add test case for accessing bpl via modr/m

2013-06-06 Thread Gleb Natapov
On Thu, Jun 06, 2013 at 02:47:49PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 1:45 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 01:03:44PM +0800, Arthur Chunqi Li wrote: Test access to %bpl via modr/m addressing mode. This case can test another bug in the

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread Gleb Natapov
On Thu, Jun 06, 2013 at 02:49:14PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 1:40 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 12:28:16AM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 12:13 AM, Gleb Natapov g...@redhat.com wrote: This time the

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread 李春奇
On Thu, Jun 6, 2013 at 3:02 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 02:49:14PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 1:40 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 12:28:16AM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6,

Re: Bug#707257: linux-image-3.8-1-686-pae: KVM crashes with entry failed, hardware error 0x80000021

2013-06-06 Thread Gleb Natapov
On Thu, Jun 06, 2013 at 09:42:40AM +0300, Gleb Natapov wrote: On Wed, Jun 05, 2013 at 02:51:19PM +0200, Stefan Pietsch wrote: On 05.06.2013 14:10, Gleb Natapov wrote: On Wed, Jun 05, 2013 at 01:57:25PM +0200, Stefan Pietsch wrote: On 19.05.2013 14:32, Gleb Natapov wrote: On Sun, May

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread 李春奇
On Thu, Jun 6, 2013 at 3:17 PM, 李春奇 Arthur Chunqi Li yzt...@gmail.com wrote: On Thu, Jun 6, 2013 at 3:02 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 02:49:14PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 1:40 PM, Gleb Natapov g...@redhat.com wrote: On Thu,

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread Gleb Natapov
On Thu, Jun 06, 2013 at 03:22:59PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 3:17 PM, 李春奇 Arthur Chunqi Li yzt...@gmail.com wrote: On Thu, Jun 6, 2013 at 3:02 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 02:49:14PM +0800, 李春奇 Arthur Chunqi Li wrote: On

[PATCH] kvm-unit-tests: Test case of emulating multibyte NOP

2013-06-06 Thread Arthur Chunqi Li
Add multibyte (1 to 4-bytes) NOPL test case to kvm-unit-tests x86/realmode.c. This test only consist of 16-bit NOPL insn, other test cases (5 to 9-bytes NOPL) should be placed in x86/emulator.c. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- x86/realmode.c | 14 ++ 1 file

Re: [PATCH] kvm-unit-tests: Add test case for accessing bpl via modr/m

2013-06-06 Thread 李春奇
On Thu, Jun 6, 2013 at 3:01 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 02:47:49PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 1:45 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 01:03:44PM +0800, Arthur Chunqi Li wrote: Test access to %bpl

Re: [PATCH] kvm-unit-tests: Add test case for accessing bpl via modr/m

2013-06-06 Thread Gleb Natapov
On Thu, Jun 06, 2013 at 03:42:56PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 3:01 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 02:47:49PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 1:45 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun

Re: [PATCH] kvm-unit-tests: Test case of emulating multibyte NOP

2013-06-06 Thread Gleb Natapov
On Thu, Jun 06, 2013 at 03:38:29PM +0800, Arthur Chunqi Li wrote: Add multibyte (1 to 4-bytes) NOPL test case to kvm-unit-tests x86/realmode.c. This test only consist of 16-bit NOPL insn, other test cases (5 to 9-bytes NOPL) should be placed in x86/emulator.c. Applied, thanks!

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread Michael S. Tsirkin
On Tue, Jun 04, 2013 at 03:01:50PM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Mon, Jun 03, 2013 at 09:56:15AM +0930, Rusty Russell wrote: Michael S. Tsirkin m...@redhat.com writes: On Thu, May 30, 2013 at 08:53:45AM -0500, Anthony Liguori wrote: Rusty

Regression after Remove support for reporting coalesced APIC IRQs

2013-06-06 Thread Gleb Natapov
Hi Jan, I bisected [1] to f1ed0450a5fac7067590317cbf027f566b6ccbca. Fortunately further investigation showed that it is not really related to removing APIC timer interrupt reinjection and the real problem is that we cannot assume that __apic_accept_irq() always injects interrupts like the patch

Re: [PATCH] kvm-unit-tests: Add test case for accessing bpl via modr/m

2013-06-06 Thread 李春奇
On Thu, Jun 6, 2013 at 3:45 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 03:42:56PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 3:01 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 02:47:49PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6,

Re: [PATCH] kvm-unit-tests: Add test case for accessing bpl via modr/m

2013-06-06 Thread Gleb Natapov
On Thu, Jun 06, 2013 at 05:33:52PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 3:45 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 03:42:56PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 3:01 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun

RE: [RFC PATCH 0/6] KVM: PPC: Book3E: AltiVec support

2013-06-06 Thread Caraman Mihai Claudiu-B02008
This looks like a bit much for 3.10 (certainly, subject lines like refactor and enhance and add support aren't going to make Linus happy given that we're past rc4) so I think we should apply http://patchwork.ozlabs.org/patch/242896/ for 3.10. Then for 3.11, revert it after

Re: Bug#707257: linux-image-3.8-1-686-pae: KVM crashes with entry failed, hardware error 0x80000021

2013-06-06 Thread Stefan Pietsch
On 06.06.2013 08:42, Gleb Natapov wrote: On Wed, Jun 05, 2013 at 02:51:19PM +0200, Stefan Pietsch wrote: On 05.06.2013 14:10, Gleb Natapov wrote: On Wed, Jun 05, 2013 at 01:57:25PM +0200, Stefan Pietsch wrote: On 19.05.2013 14:32, Gleb Natapov wrote: On Sun, May 19, 2013 at 02:00:31AM +0100,

Re: Bug#707257: linux-image-3.8-1-686-pae: KVM crashes with entry failed, hardware error 0x80000021

2013-06-06 Thread Gleb Natapov
On Thu, Jun 06, 2013 at 01:35:13PM +0200, Stefan Pietsch wrote: On 06.06.2013 08:42, Gleb Natapov wrote: On Wed, Jun 05, 2013 at 02:51:19PM +0200, Stefan Pietsch wrote: On 05.06.2013 14:10, Gleb Natapov wrote: On Wed, Jun 05, 2013 at 01:57:25PM +0200, Stefan Pietsch wrote: On 19.05.2013

Re: [patch 2/2] tools: lkvm - Filter out cpu vendor string

2013-06-06 Thread Pekka Enberg
On Tue, May 28, 2013 at 2:49 PM, Cyrill Gorcunov gorcu...@openvz.org wrote: If cpuvendor string is not filetered in case of host amd machine we get unhandled msr reads | [1709265.368464] kvm: 25706: cpu6 unhandled rdmsr: 0xc0010048 | [1709265.397161] kvm: 25706: cpu7 unhandled rdmsr:

Re: [patch 2/2] tools: lkvm - Filter out cpu vendor string

2013-06-06 Thread Cyrill Gorcunov
On Thu, Jun 06, 2013 at 03:03:03PM +0300, Pekka Enberg wrote: /* Set X86_FEATURE_HYPERVISOR */ if (entry-index == 0) Ping! Is there someone out there who has a AMD box they could test this on? I don't have it, sorry :-( -- To unsubscribe from

Re: Bug#707257: linux-image-3.8-1-686-pae: KVM crashes with entry failed, hardware error 0x80000021

2013-06-06 Thread Stefan Pietsch
On 06.06.2013 13:40, Gleb Natapov wrote: On Thu, Jun 06, 2013 at 01:35:13PM +0200, Stefan Pietsch wrote: I had no success with the Debian kernel 3.10~rc4-1~exp1 (3.10-rc4-686-pae). The machine hangs after Enabling APIC mode: Flat. Using 1 I/O APICs. OK, since it looks like it hangs during

[PATCH net 2/2] vhost: fix ubuf_info cleanup

2013-06-06 Thread Michael S. Tsirkin
vhost_net_clear_ubuf_info didn't clear ubuf_info after kfree, this could trigger double free. Fix this and simplify this code to make it more robust: make sure ubuf info is always freed through vhost_net_clear_ubuf_info. Reported-by: Tommi Rantala tt.rant...@gmail.com Signed-off-by: Michael S.

[PATCH net 1/2] vhost: check owner before we overwrite ubuf_info

2013-06-06 Thread Michael S. Tsirkin
If device has an owner, we shouldn't touch ubuf_info since it might be in use. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/vhost/net.c | 4 drivers/vhost/vhost.c | 8 +++- drivers/vhost/vhost.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git

[PATCH net 0/2] vhost fixes for 3.10

2013-06-06 Thread Michael S. Tsirkin
Two patches fixing the fallout from the vhost cleanup in 3.10. Thanks to Tommi Rantala who reported the issue. Tommi, could you please confirm this fixes the crashes for you? Michael S. Tsirkin (2): vhost: check owner before we overwrite ubuf_info vhost: fix ubuf_info cleanup

Re: [patch 2/2] tools: lkvm - Filter out cpu vendor string

2013-06-06 Thread Asias He
On Thu, Jun 6, 2013 at 8:03 PM, Pekka Enberg penb...@kernel.org wrote: On Tue, May 28, 2013 at 2:49 PM, Cyrill Gorcunov gorcu...@openvz.org wrote: If cpuvendor string is not filetered in case of host amd machine we get unhandled msr reads | [1709265.368464] kvm: 25706: cpu6 unhandled rdmsr:

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread H. Peter Anvin
On 06/05/2013 11:34 PM, Gleb Natapov wrote: SeaBIOS runs the virtio code in 32-bit mode with a flat memory layout. There are loads of ASSERT32FLAT()s in the code to make sure of this. Well, not exactly. Initialization is done in 32bit, but disk reads/writes are done in 16bit mode since it

Re: [PATCH v2] virtio_balloon: leak_balloon(): only tell host if we got pages deflated

2013-06-06 Thread Rafael Aquini
On Wed, Jun 05, 2013 at 09:18:37PM -0400, Luiz Capitulino wrote: The balloon_page_dequeue() function can return NULL. If it does for the first page being freed, then leak_balloon() will create a scatter list with len=0. Which in turn seems to generate an invalid virtio request. I didn't get

Re: [PATCH v2] virtio_balloon: leak_balloon(): only tell host if we got pages deflated

2013-06-06 Thread Luiz Capitulino
On Thu, 6 Jun 2013 11:13:58 -0300 Rafael Aquini aqu...@redhat.com wrote: On Wed, Jun 05, 2013 at 09:18:37PM -0400, Luiz Capitulino wrote: The balloon_page_dequeue() function can return NULL. If it does for the first page being freed, then leak_balloon() will create a scatter list with

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread Anthony Liguori
Hi Rusty, Rusty Russell ru...@rustcorp.com.au writes: Anthony Liguori aligu...@us.ibm.com writes: 4) Do virtio-pcie, make it PCI-e friendly (drop the IO BAR completely), give it a new device/vendor ID. Continue to use virtio-pci for existing devices potentially adding

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread Anthony Liguori
Gleb Natapov g...@redhat.com writes: On Wed, Jun 05, 2013 at 07:41:17PM -0500, Anthony Liguori wrote: H. Peter Anvin h...@zytor.com writes: On 06/05/2013 03:08 PM, Anthony Liguori wrote: Definitely an option. However, we want to be able to boot from native devices, too, so having an

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread Gerd Hoffmann
On 06/06/13 08:34, Gleb Natapov wrote: On Wed, Jun 05, 2013 at 07:41:17PM -0500, Anthony Liguori wrote: Oh, you mean in real mode. SeaBIOS runs the virtio code in 32-bit mode with a flat memory layout. There are loads of ASSERT32FLAT()s in the code to make sure of this. Well, not exactly.

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread Gleb Natapov
On Thu, Jun 06, 2013 at 05:06:32PM +0200, Gerd Hoffmann wrote: On 06/06/13 08:34, Gleb Natapov wrote: On Wed, Jun 05, 2013 at 07:41:17PM -0500, Anthony Liguori wrote: Oh, you mean in real mode. SeaBIOS runs the virtio code in 32-bit mode with a flat memory layout. There are loads of

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread H. Peter Anvin
On 06/06/2013 08:10 AM, Gleb Natapov wrote: On Thu, Jun 06, 2013 at 05:06:32PM +0200, Gerd Hoffmann wrote: Isn't this approach broken? How can SeaBIOS be sure it restores real mode registers to exactly same state they were before entering 32bit mode? It can't... so yes, it is broken.

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread Gerd Hoffmann
Hi, For seabios itself this isn't a big issue, see pci_{readl,writel} in src/pci.c. When called in 16bit mode it goes into 32bit mode temporarily, just for accessing the mmio register. ahci driver uses it, xhci driver (wip atm) will use that too, and virtio-{blk,scsi} drivers in seabios

[PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-06 Thread Arthur Chunqi Li
Add a function trap_emulator to run an instruction in emulator. Set inregs first (%rax is invalid because it is used as return address), put instruction codec in alt_insn and call func with alt_insn_length. Get results in outregs. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com ---

[PATCH 2/2] kvm-unit-tests: Change two cases to use trap_emulator

2013-06-06 Thread Arthur Chunqi Li
Change two functions (test_mmx_movq_mf and test_movabs) using unified trap_emulator. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- x86/emulator.c | 66 1 file changed, 14 insertions(+), 52 deletions(-) diff --git a/x86/emulator.c

RE: Regression after Remove support for reporting coalesced APIC IRQs

2013-06-06 Thread Ren, Yongjie
-Original Message- From: Gleb Natapov [mailto:g...@redhat.com] Sent: Thursday, June 06, 2013 4:54 PM To: Jan Kiszka Cc: kvm@vger.kernel.org; Ren, Yongjie Subject: Regression after Remove support for reporting coalesced APIC IRQs Hi Jan, I bisected [1] to

[Bug 58931] SMP x64 Windows 2003 guest can't boot up

2013-06-06 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=58931 --- Comment #1 from Jay Ren yongjie@intel.com 2013-06-06 15:40:58 --- After bisection, we found the first bad commit is: f1ed0450a5fac7067590317cbf027f566b6ccbca commit f1ed0450a5fac7067590317cbf027f566b6ccbca Author: Jan Kiszka

[PATCH 2/2] KVM: PPC: Book3E: Get vcpu's last instruction for emulation

2013-06-06 Thread Mihai Caraman
lwepx faults needs to be handled by KVM and this implies additional code in DO_KVM macro to identify the source of the exception originated in host context. This requires to check the Exception Syndrome Register (ESR[EPID]) and External PID Load Context Register (EPLC[EGS]) for DTB_MISS, DSI and

[PATCH 1/2] KVM: PPC: e500mc: Revert add load inst fixup

2013-06-06 Thread Mihai Caraman
lwepx faults needs to be handled by KVM. With the current solution the host kernel searches for the faulting address using its LPID context. If a host translation is found we return to the lwepx instr instead of the fixup ending up in an infinite loop. Revert the commit 1d628af7 add load inst

Re: [PATCH] vhost_net: clear msg.control for non-zerocopy case during tx

2013-06-06 Thread Sergei Shtylyov
Hello. On 06/06/2013 07:27 AM, Jason Wang wrote: When we decide not use zero-copy, msg.control should be set to NULL otherwise macvtap/tap may set zerocopy callbacks which may decrease the kref of ubufs wrongly. Bug were introduced by commit cedb9bdce099206290a2bdd02ce47a7b253b6a84 (vhost-net:

Re: [PATCH net 0/2] vhost fixes for 3.10

2013-06-06 Thread Tommi Rantala
2013/6/6 Michael S. Tsirkin m...@redhat.com: Two patches fixing the fallout from the vhost cleanup in 3.10. Thanks to Tommi Rantala who reported the issue. Tommi, could you please confirm this fixes the crashes for you? Confirmed! With the two patches applied, I can no longer reproduce the

Re: [RFC PATCH 0/6] KVM: PPC: Book3E: AltiVec support

2013-06-06 Thread Scott Wood
On 06/06/2013 04:42:44 AM, Caraman Mihai Claudiu-B02008 wrote: This looks like a bit much for 3.10 (certainly, subject lines like refactor and enhance and add support aren't going to make Linus happy given that we're past rc4) so I think we should apply

[PATCH 6/8] kvm/ppc: IRQ disabling cleanup

2013-06-06 Thread Scott Wood
Simplify the handling of lazy EE by going directly from fully-enabled to hard-disabled. This replaces the lazy_irq_pending() check (including its misplaced kvm_guest_exit() call). As suggested by Tiejun Chen, move the interrupt disabling into kvmppc_prepare_to_enter() rather than have each

[PATCH 3/8] kvm/ppc/booke: Hold srcu lock when calling gfn functions

2013-06-06 Thread Scott Wood
KVM core expects arch code to acquire the srcu lock when calling gfn_to_memslot and similar functions. Signed-off-by: Scott Wood scottw...@freescale.com --- arch/powerpc/kvm/44x_tlb.c |5 + arch/powerpc/kvm/booke.c|7 +++ arch/powerpc/kvm/e500_mmu.c |5 + 3 files

[PATCH 0/8] kvm/ppc: fixes for 3.10

2013-06-06 Thread Scott Wood
Most of these have been posted before, but I grouped them together as there are some contextual dependencies between them. Gleb/Paolo: As Alex doesn't appear to be back yet, can you apply these if there's no objection over the next few days? Mihai Caraman (1): kvm/ppc/booke64: Fix AltiVec

[PATCH 7/8] kvm/ppc/booke: Delay kvmppc_fix_ee_before_entry

2013-06-06 Thread Scott Wood
kwmppc_fix_ee_before_entry() should be called as late as possible, or else we get things like WARN_ON(preemptible()) in enable_kernel_fp() in configurations where preemptible() works. Note that book3s_pr already waits until just before __kvmppc_vcpu_run to call kvmppc_fix_ee_before_entry().

[PATCH 4/8] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit()

2013-06-06 Thread Scott Wood
EE is hard-disabled on entry to kvmppc_handle_exit(), so call hard_irq_disable() so that PACA_IRQ_HARD_DIS is set, and soft_enabled is unset. Without this, we get warnings such as arch/powerpc/kernel/time.c:300, and sometimes host kernel hangs. Signed-off-by: Scott Wood scottw...@freescale.com

[PATCH 5/8] kvm/ppc: Call trace_hardirqs_on before entry

2013-06-06 Thread Scott Wood
Currently this is only being done on 64-bit. Rather than just move it out of the 64-bit ifdef, move it to kvm_lazy_ee_enable() so that it is consistent with lazy ee state, and so that we don't track more host code as interrupts-enabled than necessary. Rename kvm_lazy_ee_enable() to

[PATCH 8/8] kvm/ppc/booke: Don't call kvm_guest_enter twice

2013-06-06 Thread Scott Wood
kvm_guest_enter() was already called by kvmppc_prepare_to_enter(). Don't call it again. Signed-off-by: Scott Wood scottw...@freescale.com --- arch/powerpc/kvm/booke.c |2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index

[PATCH 1/8] kvm/ppc/booke64: Fix AltiVec interrupt numbers and build breakage

2013-06-06 Thread Scott Wood
From: Mihai Caraman mihai.cara...@freescale.com Interrupt numbers defined for Book3E follows IVORs definition. Align BOOKE_INTERRUPT_ALTIVEC_UNAVAIL and BOOKE_INTERRUPT_ALTIVEC_ASSIST to this rule which also fixes the build breakage. IVORs 32 and 33 are shared so reflect this in the interrupts

[PATCH 2/8] kvm/ppc/booke64: Disable e6500 support

2013-06-06 Thread Scott Wood
The previous patch made 64-bit booke KVM build again, but Altivec support is still not complete, and we can't prevent the guest from turning on Altivec (which can corrupt host state until state save/restore is implemented). Disable e6500 on KVM until this is fixed. Signed-off-by: Scott Wood

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-06 Thread 李春奇
This version of save/restore general register seems a bit too ugly, I will change it and commit another patch. Some of the registers cannot be set as realmode.c do, for example %rax used to save return value, wrong %esp %ebp may cause crash, and I think changed %rflags may cause some unknown

[PATCH 2/2] kvm-unit-tests: Change two cases to use trap_emulator

2013-06-06 Thread Arthur Chunqi Li
Change two functions (test_mmx_movq_mf and test_movabs) using unified trap_emulator. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- x86/emulator.c | 66 1 file changed, 14 insertions(+), 52 deletions(-) diff --git a/x86/emulator.c

[PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-06 Thread Arthur Chunqi Li
Add a function trap_emulator to run an instruction in emulator. Set inregs first (%rax, %rsp, %rbp, %rflags have special usage and cannot set in inregs), put instruction codec in alt_insn and call func with alt_insn_length. Get results in outregs. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com

Re: [PATCH RFC] virtio-pci: new config layout: using memory BAR

2013-06-06 Thread Rusty Russell
Anthony Liguori aligu...@us.ibm.com writes: Hi Rusty, Rusty Russell ru...@rustcorp.com.au writes: Anthony Liguori aligu...@us.ibm.com writes: 4) Do virtio-pcie, make it PCI-e friendly (drop the IO BAR completely), give it a new device/vendor ID. Continue to use virtio-pci for existing

[PATCH 2/2] KVM: PPC: Book3E: Get vcpu's last instruction for emulation

2013-06-06 Thread Mihai Caraman
lwepx faults needs to be handled by KVM and this implies additional code in DO_KVM macro to identify the source of the exception originated in host context. This requires to check the Exception Syndrome Register (ESR[EPID]) and External PID Load Context Register (EPLC[EGS]) for DTB_MISS, DSI and

Re: [RFC PATCH 0/6] KVM: PPC: Book3E: AltiVec support

2013-06-06 Thread Scott Wood
On 06/06/2013 04:42:44 AM, Caraman Mihai Claudiu-B02008 wrote: This looks like a bit much for 3.10 (certainly, subject lines like refactor and enhance and add support aren't going to make Linus happy given that we're past rc4) so I think we should apply

[PATCH 0/8] kvm/ppc: fixes for 3.10

2013-06-06 Thread Scott Wood
Most of these have been posted before, but I grouped them together as there are some contextual dependencies between them. Gleb/Paolo: As Alex doesn't appear to be back yet, can you apply these if there's no objection over the next few days? Mihai Caraman (1): kvm/ppc/booke64: Fix AltiVec

[PATCH 3/8] kvm/ppc/booke: Hold srcu lock when calling gfn functions

2013-06-06 Thread Scott Wood
KVM core expects arch code to acquire the srcu lock when calling gfn_to_memslot and similar functions. Signed-off-by: Scott Wood scottw...@freescale.com --- arch/powerpc/kvm/44x_tlb.c |5 + arch/powerpc/kvm/booke.c|7 +++ arch/powerpc/kvm/e500_mmu.c |5 + 3 files

[PATCH 6/8] kvm/ppc: IRQ disabling cleanup

2013-06-06 Thread Scott Wood
Simplify the handling of lazy EE by going directly from fully-enabled to hard-disabled. This replaces the lazy_irq_pending() check (including its misplaced kvm_guest_exit() call). As suggested by Tiejun Chen, move the interrupt disabling into kvmppc_prepare_to_enter() rather than have each

[PATCH 8/8] kvm/ppc/booke: Don't call kvm_guest_enter twice

2013-06-06 Thread Scott Wood
kvm_guest_enter() was already called by kvmppc_prepare_to_enter(). Don't call it again. Signed-off-by: Scott Wood scottw...@freescale.com --- arch/powerpc/kvm/booke.c |2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index

[PATCH 4/8] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit()

2013-06-06 Thread Scott Wood
EE is hard-disabled on entry to kvmppc_handle_exit(), so call hard_irq_disable() so that PACA_IRQ_HARD_DIS is set, and soft_enabled is unset. Without this, we get warnings such as arch/powerpc/kernel/time.c:300, and sometimes host kernel hangs. Signed-off-by: Scott Wood scottw...@freescale.com

[PATCH 1/8] kvm/ppc/booke64: Fix AltiVec interrupt numbers and build breakage

2013-06-06 Thread Scott Wood
From: Mihai Caraman mihai.cara...@freescale.com Interrupt numbers defined for Book3E follows IVORs definition. Align BOOKE_INTERRUPT_ALTIVEC_UNAVAIL and BOOKE_INTERRUPT_ALTIVEC_ASSIST to this rule which also fixes the build breakage. IVORs 32 and 33 are shared so reflect this in the interrupts

[PATCH 5/8] kvm/ppc: Call trace_hardirqs_on before entry

2013-06-06 Thread Scott Wood
Currently this is only being done on 64-bit. Rather than just move it out of the 64-bit ifdef, move it to kvm_lazy_ee_enable() so that it is consistent with lazy ee state, and so that we don't track more host code as interrupts-enabled than necessary. Rename kvm_lazy_ee_enable() to

[PATCH 2/8] kvm/ppc/booke64: Disable e6500 support

2013-06-06 Thread Scott Wood
The previous patch made 64-bit booke KVM build again, but Altivec support is still not complete, and we can't prevent the guest from turning on Altivec (which can corrupt host state until state save/restore is implemented). Disable e6500 on KVM until this is fixed. Signed-off-by: Scott Wood

[PATCH 7/8] kvm/ppc/booke: Delay kvmppc_fix_ee_before_entry

2013-06-06 Thread Scott Wood
kwmppc_fix_ee_before_entry() should be called as late as possible, or else we get things like WARN_ON(preemptible()) in enable_kernel_fp() in configurations where preemptible() works. Note that book3s_pr already waits until just before __kvmppc_vcpu_run to call kvmppc_fix_ee_before_entry().