Re: [Qemu-devel] [PATCH 0/2] Lost VNC patches

2012-03-15 Thread Corentin Chary
On Wed, Mar 14, 2012 at 11:16 PM, Stefan Weil s...@weilnetz.de wrote: Am 14.03.2012 22:46, schrieb Anthony Liguori: On 03/14/2012 01:58 AM, Corentin Chary wrote: Hi Anthony, Please merge these two patchs from another age, they fix crash in the VNC server (the iohandler one is only for the

Re: [PATCH 0/2 v3] kvm: notify host when guest panicked

2012-03-15 Thread Wen Congyang
At 03/15/2012 02:46 AM, Eric Northup Wrote: On Wed, Mar 14, 2012 at 6:25 AM, Gleb Natapov g...@redhat.com wrote: On Wed, Mar 14, 2012 at 03:16:05PM +0200, Avi Kivity wrote: On 03/14/2012 03:14 PM, Gleb Natapov wrote: On Wed, Mar 14, 2012 at 03:07:46PM +0200, Avi Kivity wrote: On 03/14/2012

[Bug 42829] KVM Guest with virtio network driver loses network connectivity

2012-03-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=42829 Chun-Hung Chen arn...@gmail.com changed: What|Removed |Added CC||arn...@gmail.com

[PATCH 0/3] KVM: MMU: Improve rmap handling

2012-03-15 Thread Takuya Yoshikawa
This patch series is basen on my srcu-less dirty logging patch series and being sent for letting everybody knows about possible improvements we can add to that. As pasted below, we can achieve 15% improvement for the worst case. I will rebase and post this again after srcu-less gets merged.

[PATCH 1/3] KVM: MMU: Make pte_list_desc fit cache lines well

2012-03-15 Thread Takuya Yoshikawa
We have PTE_LIST_EXT + 1 pointers in this structure and these 40/20 bytes do not fit cache lines well. Furthermore some allocators may use 64/32-byte objects for the pte_list_desc cache. This patch solves this problem by raising PTE_LIST_EXT to 7. Note: with EPT/NPT we almost always have a

[PATCH 2/3] KVM: MMU: Improve iteration over sptes linked by rmap

2012-03-15 Thread Takuya Yoshikawa
Iteration using rmap_next(), the actual body is pte_list_next(), is inefficient: every time we call it we start from checking whether rmap holds a single spte or points to a descriptor which links more sptes. In the case of shadow paging, this quadratic total iteration cost is a problem. Even

[PATCH 3/3] KVM: MMU: Separate trivial NULL check out from rmap_get_next()

2012-03-15 Thread Takuya Yoshikawa
Checking wheter iter-desc is NULL is not worth a function call especially when we use EPT/NPT because we know it would almost always be NULL. Although using inline like this does not look clean, we could see measurable performance improvements: get_dirty_log for 1GB dirty memory became faster by

Re: [PATCH 1/3] KVM: MMU: Make pte_list_desc fit cache lines well

2012-03-15 Thread Avi Kivity
On 03/15/2012 11:19 AM, Takuya Yoshikawa wrote: We have PTE_LIST_EXT + 1 pointers in this structure and these 40/20 bytes do not fit cache lines well. Furthermore some allocators may use 64/32-byte objects for the pte_list_desc cache. This patch solves this problem by raising PTE_LIST_EXT to

Re: [PATCH v3 0/7] RTC: New logic to emulate RTC

2012-03-15 Thread Paolo Bonzini
Il 15/03/2012 01:06, Zhang, Yang Z ha scritto: You are right. Actually, the v4 is ready and it uses the same logic with v2. Since I have other high priority task in hand, I don't test v4 too much. So i plan to delay it for a while and hope v3 can be accepted before v4 is ready. If you really

Re: [PATCH 2/3] KVM: MMU: Improve iteration over sptes linked by rmap

2012-03-15 Thread Avi Kivity
On 03/15/2012 11:20 AM, Takuya Yoshikawa wrote: Iteration using rmap_next(), the actual body is pte_list_next(), is inefficient: every time we call it we start from checking whether rmap holds a single spte or points to a descriptor which links more sptes. In the case of shadow paging, this

Re: [PATCH 3/3] KVM: MMU: Separate trivial NULL check out from rmap_get_next()

2012-03-15 Thread Avi Kivity
On 03/15/2012 11:21 AM, Takuya Yoshikawa wrote: Checking wheter iter-desc is NULL is not worth a function call especially when we use EPT/NPT because we know it would almost always be NULL. Although using inline like this does not look clean, we could see measurable performance improvements:

Re: [PATCH] KVM: VMX: call invvpid only when EPT is disabled

2012-03-15 Thread Avi Kivity
On 03/15/2012 03:44 AM, Davidlohr Bueso wrote: From: Davidlohr Bueso d...@gnu.org With EPT enabled it is not required to explicitly run invvpid to invalidate tagged TLB entries, as KVM does not force vm-exits for cr3 writes and invlpg. Run invvpid only when these instructions are emulated

Re: [PATCH 3/3] KVM: MMU: Separate trivial NULL check out from rmap_get_next()

2012-03-15 Thread Takuya Yoshikawa
Avi Kivity a...@redhat.com wrote: Although using inline like this does not look clean, we could see measurable performance improvements: get_dirty_log for 1GB dirty memory became faster by more than 10% on my test box. WOW. I'd have assumed the processor deals better with this; it

Re: [PATCH 2/3] KVM: MMU: Improve iteration over sptes linked by rmap

2012-03-15 Thread Takuya Yoshikawa
Avi Kivity a...@redhat.com wrote: + * Iteration must be started by this function. This should also be used after + * removing/dropping sptes from rmap because in such cases the information in + * the itererator may not be valid. Note: this suggests rmap_remove(struct rmap_iterator

pci-assign can not work

2012-03-15 Thread Wen Congyang
Hi all When I use pci-assign, I meet the following error: Failed to assign irq for hostdev0: Input/output error Perhaps you are assigning a device that shares an IRQ with another device? Is it a bug or I miss something? I use libvirt to start the guest, and the user/group is root/root(not

Re: [PATCH 0/2 v3] kvm: notify host when guest panicked

2012-03-15 Thread Gleb Natapov
On Wed, Mar 14, 2012 at 11:46:08AM -0700, Eric Northup wrote: On Wed, Mar 14, 2012 at 6:25 AM, Gleb Natapov g...@redhat.com wrote: On Wed, Mar 14, 2012 at 03:16:05PM +0200, Avi Kivity wrote: On 03/14/2012 03:14 PM, Gleb Natapov wrote: On Wed, Mar 14, 2012 at 03:07:46PM +0200, Avi

Re: native kvm tool hrtimer problem

2012-03-15 Thread Asias He
On Mon, Mar 12, 2012 at 11:03 PM, Daniele Carollo carollo.d...@gmail.com wrote: The command I use is something like: sudo /home/kvm/linux-kvm/tools/kvm/lkvm run -p root=/dev/vda1 -d /home/kvm/Internato/debian_squeeze_i386_standard.raw -n

Re: [PATCH 0/2 v3] kvm: notify host when guest panicked

2012-03-15 Thread Jan Kiszka
On 2012-03-15 11:39, Gleb Natapov wrote: On Wed, Mar 14, 2012 at 11:46:08AM -0700, Eric Northup wrote: On Wed, Mar 14, 2012 at 6:25 AM, Gleb Natapov g...@redhat.com wrote: On Wed, Mar 14, 2012 at 03:16:05PM +0200, Avi Kivity wrote: On 03/14/2012 03:14 PM, Gleb Natapov wrote: On Wed, Mar 14,

Re: [PATCH 0/2 v3] kvm: notify host when guest panicked

2012-03-15 Thread Avi Kivity
On 03/15/2012 01:25 PM, Jan Kiszka wrote: There was such vm exit (KVM_EXIT_HYPERCALL), but it was deemed to be a bad idea. BTW, this would help a lot in emulating hypercalls of other hypervisors (or of KVM's VAPIC in the absence of in-kernel irqchip - I had to jump through hoops

Re: [PATCH 3/3] KVM: MMU: Separate trivial NULL check out from rmap_get_next()

2012-03-15 Thread Avi Kivity
On 03/15/2012 12:15 PM, Takuya Yoshikawa wrote: Avi Kivity a...@redhat.com wrote: Although using inline like this does not look clean, we could see measurable performance improvements: get_dirty_log for 1GB dirty memory became faster by more than 10% on my test box. WOW. I'd

Re: [PATCH][SeaBIOS] memory hotplug

2012-03-15 Thread Gleb Natapov
Commenting a little bit late, but since you've said that you are working on a new version of the patch... better late than never. On Thu, Aug 11, 2011 at 04:39:38PM +0200, Vasilis Liaskovitis wrote: Hi, I am testing a set of experimental patches for memory-hotplug on x86_64 host / guest

[PATCH 01/56] KVM: PPC: Book3s_32: Fix compile error

2012-03-15 Thread Alexander Graf
We were failing to compile on book3s_32 with the following errors: arch/powerpc/kvm/book3s_pr.c:883:45: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] arch/powerpc/kvm/book3s_pr.c:898:79: error: cast to pointer from integer of different size

[PATCH 02/56] powerpc/booke: Set CPU_FTR_DEBUG_LVL_EXC on 32-bit

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com Currently 32-bit only cares about this for choice of exception vector, which is done in core-specific code. However, KVM will want to distinguish as well. Signed-off-by: Scott Wood scottw...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de ---

[PATCH 05/56] KVM: PPC: booke: add booke-level vcpu load/put

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com This gives us a place to put load/put actions that correspond to code that is booke-specific but not specific to a particular core. Signed-off-by: Scott Wood scottw...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/44x.c

[PATCH 09/56] KVM: PPC: e500: clean up arch/powerpc/kvm/e500.h

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com Move vcpu to the beginning of vcpu_e500 to give it appropriate prominence, especially if more fields end up getting added to the end of vcpu_e500 (and vcpu ends up in the middle). Remove gratuitous extern and add parameter names to prototypes.

[PATCH 10/56] KVM: PPC: e500: refactor core-specific TLB code

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com The PID handling is e500v1/v2-specific, and is moved to e500.c. The MMU sregs code and kvmppc_core_vcpu_translate will be shared with e500mc, and is moved from e500.c to e500_tlb.c. Partially based on patches from Liu Yu yu@freescale.com.

[PATCH 16/56] KVM: PPC: e500mc support

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com Add processor support for e500mc, using hardware virtualization support (GS-mode). Current issues include: - No support for external proxy (coreint) interrupt mode in the guest. Includes work by Ashish Kalra ashish.ka...@freescale.com, Varun Sethi

[PATCH 13/56] powerpc/booke: Provide exception macros with interrupt name

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com DO_KVM will need to identify the particular exception type. There is an existing set of arbitrary numbers that Linux passes, but it's an undocumented mess that sort of corresponds to server/classic exception vectors but not really. Signed-off-by: Scott

[PATCH 08/56] KVM: PPC: e500: merge asm/kvm_e500.h into arch/powerpc/kvm/e500.h

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com Keeping two separate headers for e500-specific things was a pain, and wasn't even organized along any logical boundary. There was TLB stuff in asm/kvm_e500.h despite the existence of arch/powerpc/kvm/e500_tlb.h, and nothing in asm/kvm_e500.h needed to be

[PATCH 11/56] KVM: PPC: e500: Track TLB1 entries with a bitmap

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com Rather than invalidate everything when a TLB1 entry needs to be taken down, keep track of which host TLB1 entries are used for a given guest TLB1 entry, and invalidate just those entries. Based on code from Ashish Kalra ashish.ka...@freescale.com and Liu

[PATCH 07/56] KVM: PPC: e500: rename e500_tlb.h to e500.h

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com This is in preparation for merging in the contents of arch/powerpc/include/asm/kvm_e500.h. Signed-off-by: Scott Wood scottw...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/e500.c |2 +-

[PATCH 36/56] KVM: PPC: booke: Support perfmon interrupts

2012-03-15 Thread Alexander Graf
When during guest context we get a performance monitor interrupt, we currently bail out and oops. Let's route it to its correct handler instead. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/booke.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git

[PATCH 42/56] KVM: PPC: Book3S HV: Save and restore CR in __kvmppc_vcore_entry

2012-03-15 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org The ABI specifies that CR fields CR2--CR4 are nonvolatile across function calls. Currently __kvmppc_vcore_entry doesn't save and restore the CR, leading to CR2--CR4 getting corrupted with guest values, possibly leading to incorrect behaviour in its caller.

[PATCH 54/56] KVM: PPC: Book3S: PR: Fix preemption

2012-03-15 Thread Alexander Graf
We were leaking preemption counters. Fix the code to always toggle between preempt and non-preempt properly. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_pr.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s_pr.c

[PATCH 55/56] KVM: PPC: Ignore unhalt request from kvm_vcpu_block

2012-03-15 Thread Alexander Graf
When running kvm_vcpu_block and it realizes that the CPU is actually good to run, we get a request bit set for KVM_REQ_UNHALT. Right now, there's nothing we can do with that bit, so let's unset it right after the call again so we don't get confused in our later checks for pending work.

[PATCH 40/56] KVM: PPC: Book3s: PR: Add SPAPR H_BULK_REMOVE support

2012-03-15 Thread Alexander Graf
From: Matt Evans m...@ozlabs.org SPAPR support includes various in-kernel hypercalls, improving performance by cutting out the exit to userspace. H_BULK_REMOVE is implemented in this patch. Signed-off-by: Matt Evans m...@ozlabs.org Signed-off-by: Alexander Graf ag...@suse.de ---

[PATCH 56/56] powerpc/kvm: Fix magic page vs. 32-bit RTAS on ppc64

2012-03-15 Thread Alexander Graf
From: Benjamin Herrenschmidt b...@kernel.crashing.org When the kernel calls into RTAS, it switches to 32-bit mode. The magic page was is longer accessible in that case, causing the patched instructions in the RTAS call wrapper to crash. This fixes it by making available a 32-bit mapping of the

[PATCH 53/56] KVM: PPC: Book3s: PR: Add HV traps so we can run in HV=1 mode on p7

2012-03-15 Thread Alexander Graf
When running PR KVM on a p7 system in bare metal, we get HV exits instead of normal supervisor traps. Semantically they are identical though and the HSRR vs SRR difference is already taken care of in the exit code. So all we need to do is handle them in addition to our normal exits.

[PATCH 50/56] KVM: PPC: Pass EA to updating emulation ops

2012-03-15 Thread Alexander Graf
When emulating updating load/store instructions (lwzu, stwu, ...) we need to write the effective address of the load/store into a register. Currently, we write the physical address in there, which is very wrong. So instead let's save off where the virtual fault was on MMIO and use that

[PATCH 51/56] KVM: PPC: Book3S: Compile fix for ppc32 in HIOR

2012-03-15 Thread Alexander Graf
On PPC32 we can not use get_user/put_user for 64bit wide variables, as there is no single instruction that could load or store variables that big. So instead, we have to use copy_from/to_user which works everywhere. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_pr.c |

[PATCH 49/56] KVM: PPC: Work around POWER7 DABR corruption problem

2012-03-15 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org It turns out that on POWER7, writing to the DABR can cause a corrupted value to be written if the PMU is active and updating SDAR in continuous sampling mode. To work around this, we make sure that the PMU is inactive and SDAR updates are disabled (via

[PATCH 48/56] KVM: PPC: Book 3S: Fix compilation for !HV configs

2012-03-15 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Commits 2f5cdd5487 (KVM: PPC: Book3S HV: Make secondary threads more robust against stray IPIs) and 1c2066b0f7 (KVM: PPC: Book3S HV: Make virtual processor area registration more robust) added fields to struct kvm_vcpu_arch inside #ifdef

[PATCH 52/56] KVM: PPC: Emulate tw and td instructions

2012-03-15 Thread Alexander Graf
There are 4 conditional trapping instructions: tw, twi, td, tdi. The ones with an i take an immediate comparison, the others compare two registers. All of them arrive in the emulator when the condition to trap was successfully fulfilled. Unfortunately, we were only implementing the i versions so

[PATCH 46/56] KVM: PPC: Book3S HV: Report stolen time to guest through dispatch trace log

2012-03-15 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This adds code to measure stolen time per virtual core in units of timebase ticks, and to report the stolen time to the guest using the dispatch trace log (DTL). The guest can register an area of memory for the DTL for a given vcpu. The DTL is a ring buffer

[PATCH 45/56] KVM: PPC: Book3S HV: Make virtual processor area registration more robust

2012-03-15 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org The PAPR API allows three sorts of per-virtual-processor areas to be registered (VPA, SLB shadow buffer, and dispatch trace log), and furthermore, these can be registered and unregistered for another virtual CPU. Currently we just update the vcpu fields

[PATCH 47/56] Restore guest CR after exit timing calculation

2012-03-15 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com No instruction which can change Condition Register (CR) should be executed after Guest CR is loaded. So the guest CR is restored after the Exit Timing in lightweight_exit executes cmpw, which can clobber CR. Signed-off-by: Bharat Bhushan

[PATCH 44/56] KVM: PPC: Book3S HV: Make secondary threads more robust against stray IPIs

2012-03-15 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Currently on POWER7, if we are running the guest on a core and we don't need all the hardware threads, we do nothing to ensure that the unused threads aren't executing in the kernel (other than checking that they are offline). We just assume they're napping

[PATCH 43/56] KVM: PPC: Save/Restore CR over vcpu_run

2012-03-15 Thread Alexander Graf
On PPC, CR2-CR4 are nonvolatile, thus have to be saved across function calls. We didn't respect that for any architecture until Paul spotted it in his patch for Book3S-HV. This patch saves/restores CR for all KVM capable PPC hosts. Signed-off-by: Alexander Graf ag...@suse.de ---

[PATCH 41/56] KVM: PPC: Book3S HV: Fix kvm_alloc_linear in case where no linears exist

2012-03-15 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org In kvm_alloc_linear we were using and deferencing ri after the list_for_each_entry had come to the end of the list. In that situation, ri is not really defined and probably points to the list head. This will happen every time if the free_linears list is

[PATCH 39/56] KVM: PPC: Booke: only prepare to enter when we enter

2012-03-15 Thread Alexander Graf
So far, we've always called prepare_to_enter even when all we did was return to the host. This patch changes that semantic to only call prepare_to_enter when we actually want to get back into the guest. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/booke.c | 18

[PATCH 38/56] KVM: PPC: booke: Reinject performance monitor interrupts

2012-03-15 Thread Alexander Graf
When we get a performance monitor interrupt, we need to make sure that the host receives it. So reinject it like we reinject the other host destined interrupts. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/hw_irq.h |1 + arch/powerpc/kvm/booke.c |4

[PATCH 37/56] KVM: PPC: booke: expose good state on irq reinject

2012-03-15 Thread Alexander Graf
When reinjecting an interrupt into the host interrupt handler after we're back in host kernel land, we need to tell the kernel where the interrupt happened. We can't tell it that we were in guest state, because that might lead to random code walking host addresses. So instead, we tell it that we

[PATCH 35/56] KVM: PPC: e500: fix typo in tlb code

2012-03-15 Thread Alexander Graf
The tlbncfg registers should be populated with their respective TLB's values. Fix the obvious typo. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/e500_tlb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/e500_tlb.c

[PATCH 32/56] KVM: PPC: booke: Readd debug abort code for machine check

2012-03-15 Thread Alexander Graf
When during guest execution we get a machine check interrupt, we don't know how to handle it yet. So let's add the error printing code back again that we dropped accidently earlier and tell user space that something went really wrong. Signed-off-by: Alexander Graf ag...@suse.de ---

[PATCH 34/56] KVM: PPC: bookehv: remove unused code

2012-03-15 Thread Alexander Graf
There was some unused code in the exit code path that must have been a leftover from earlier iterations. While it did no harm, it's superfluous and thus should be removed. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/bookehv_interrupts.S |7 --- 1 files changed, 0

[PATCH 33/56] KVM: PPC: booke: add GS documentation for program interrupt

2012-03-15 Thread Alexander Graf
The comment for program interrupts triggered when using bookehv was misleading. Update it to mention why MSR_GS indicates that we have to inject an interrupt into the guest again, not emulate it. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/booke.c | 10 -- 1 files

[PATCH 31/56] KVM: PPC: bookehv: add comment about shadow_msr

2012-03-15 Thread Alexander Graf
For BookE HV the guest visible MSR is shared-msr and is identical to the MSR that is in use while the guest is running, because we can't trap reads from/to MSR. So shadow_msr is unused there. Indicate that with a comment. Signed-off-by: Alexander Graf ag...@suse.de ---

[PATCH 29/56] KVM: PPC: bookehv: remove SET_VCPU

2012-03-15 Thread Alexander Graf
The SET_VCPU macro is a leftover from times when the vcpu struct wasn't stored in the thread on vcpu_load/put. It's not needed anymore. Remove it. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/bookehv_interrupts.S |8 1 files changed, 0 insertions(+), 8

[PATCH 30/56] KVM: PPC: bookehv: disable MAS register updates early

2012-03-15 Thread Alexander Graf
We need to make sure that no MAS updates happen automatically while we have the guest MAS registers loaded. So move the disabling code a bit higher up so that it covers the full time we have guest values in MAS registers. The race this patch fixes should never occur, but it makes the code a bit

[PATCH 28/56] KVM: PPC: bookehv: remove negation for CONFIG_64BIT

2012-03-15 Thread Alexander Graf
Instead if doing #ifndef CONFIG_64BIT ... #else ... #endif we should rather do #ifdef CONFIG_64BIT ... #else ... #endif which is a lot easier to read. Change the bookehv implementation to stick with this rule. Signed-off-by: Alexander Graf ag...@suse.de ---

[PATCH 27/56] KVM: PPC: bookehv: fix exit timing

2012-03-15 Thread Alexander Graf
When using exit timing stats, we clobber r9 in the NEED_EMU case, so better move that part down a few lines and fix it that way. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/bookehv_interrupts.S |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 26/56] KVM: PPC: booke: BOOKE_IRQPRIO_MAX is n+1

2012-03-15 Thread Alexander Graf
The semantics of BOOKE_IRQPRIO_MAX changed to denote the highest available irqprio + 1, so let's reflect that in the code too. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/booke.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH 25/56] KVM: PPC: booke: rework rescheduling checks

2012-03-15 Thread Alexander Graf
Instead of checking whether we should reschedule only when we exited due to an interrupt, let's always check before entering the guest back again. This gets the target more in line with the other archs. Also while at it, generalize the whole thing so that eventually we could have a single

[PATCH 23/56] KVM: PPC: booke: remove leftover debugging

2012-03-15 Thread Alexander Graf
The e500mc patches left some debug code in that we don't need. Remove it. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/booke.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index

[PATCH 24/56] KVM: PPC: booke: deliver program int on emulation failure

2012-03-15 Thread Alexander Graf
When we fail to emulate an instruction for the guest, we better go in and tell it that we failed to emulate it, by throwing an illegal instruction exception. Please beware that we basically never get around to telling the guest that we failed thanks to the debugging code right above it. If user

[PATCH 21/56] KVM: PPC: rename CONFIG_KVM_E500 - CONFIG_KVM_E500V2

2012-03-15 Thread Alexander Graf
The CONFIG_KVM_E500 option really indicates that we're running on a V2 machine, not on a machine of the generic E500 class. So indicate that properly and change the config name accordingly. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/Kconfig|8

[PATCH 22/56] KVM: PPC: make e500v2 kvm and e500mc cpu mutually exclusive

2012-03-15 Thread Alexander Graf
We can't run e500v2 kvm on e500mc kernels, so indicate that by making the 2 options mutually exclusive in kconfig. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/Kconfig

[PATCH 19/56] KVM: PPC: e500mc: Move r1/r2 restoration very early

2012-03-15 Thread Alexander Graf
If we hit any exception whatsoever in the restore path and r1/r2 aren't the host registers, we don't get a working oops. So it's always a good idea to restore them as early as possible. This time, it actually has practical reasons to do so too, since we need to have the host page fault handler

[PATCH 20/56] KVM: PPC: e500mc: add load inst fixup

2012-03-15 Thread Alexander Graf
There's always a chance we're unable to read a guest instruction. The guest could have its TLB mapped execute-, but not readable, something odd happens and our TLB gets flushed. So it's a good idea to be prepared for that case and have a fallback that allows us to fix things up in that case. Add

[PATCH 12/56] KVM: PPC: e500: emulate tlbilx

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com tlbilx is the new, preferred invalidation instruction. It is not found on e500 prior to e500mc, but there should be no harm in supporting it on all e500. Based on code from Ashish Kalra ashish.ka...@freescale.com. Signed-off-by: Scott Wood

[PATCH 18/56] KVM: PPC: e500mc: implicitly set MSR_GS

2012-03-15 Thread Alexander Graf
When setting MSR for an e500mc guest, we implicitly always set MSR_GS to make sure the guest is in guest state. Since we have this implicit rule there, we don't need to explicitly pass MSR_GS to set_msr(). Remove all explicit setters of MSR_GS. Signed-off-by: Alexander Graf ag...@suse.de ---

[PATCH 14/56] KVM: PPC: booke: category E.HV (GS-mode) support

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com Chips such as e500mc that implement category E.HV in Power ISA 2.06 provide hardware virtualization features, including a new MSR mode for guest state. The guest OS can perform many operations without trapping into the hypervisor, including transitions to

[PATCH 15/56] KVM: PPC: booke: standard PPC floating point support

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com e500mc has a normal PPC FPU, rather than SPE which is found on e500v1/v2. Based on code from Liu Yu yu@freescale.com. Signed-off-by: Scott Wood scottw...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/system.h

[PATCH 17/56] KVM: PPC: e500mc: Add doorbell emulation support

2012-03-15 Thread Alexander Graf
When one vcpu wants to kick another, it can issue a special IPI instruction called msgsnd. This patch emulates this instruction, its clearing counterpart and the infrastructure required to actually trigger that interrupt inside a guest vcpu. With this patch, SMP guests on e500mc work.

[PATCH 06/56] KVM: PPC: booke: Move vm core init/destroy out of booke.c

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com e500mc will want to do lpid allocation/deallocation here. Signed-off-by: Scott Wood scottw...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/44x.c |9 + arch/powerpc/kvm/booke.c |9 -

[PATCH 04/56] KVM: PPC: factor out lpid allocator from book3s_64_mmu_hv

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com We'll use it on e500mc as well. Signed-off-by: Scott Wood scottw...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_book3s.h |3 ++ arch/powerpc/include/asm/kvm_booke.h |3 ++

[PATCH 03/56] powerpc/e500: split CPU_FTRS_ALWAYS/CPU_FTRS_POSSIBLE

2012-03-15 Thread Alexander Graf
From: Scott Wood scottw...@freescale.com Split e500 (v1/v2) and e500mc/e5500 to allow optimization of feature checks that differ between the two. Signed-off-by: Scott Wood scottw...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/cputable.h | 12

[PULL 00/56] ppc patch queue 2012-03-15

2012-03-15 Thread Alexander Graf
Hi Avi, This is my current patch queue for ppc. Please pull. Alex The following changes since commit eb9ede961ffe8040e499f3bade88f38395610543: Marcelo Tosatti (1): KVM: fix kvm_vcpu_kick build failure on S390 are available in the git repository at:

Re: [PATCH 2/4 V16] Add functions to check if the host has stopped the vm

2012-03-15 Thread Eric B Munson
On Wed, 14 Mar 2012 11:12:35 +0100, Jan Kiszka wrote: On 2012-03-10 20:37, Eric B Munson wrote: When a host stops or suspends a VM it will set a flag to show this. The watchdog will use these functions to determine if a softlockup is real, or the result of a suspended VM. ... diff --git

Re: [PATCH 3/3] KVM: MMU: Separate trivial NULL check out from rmap_get_next()

2012-03-15 Thread Takuya Yoshikawa
Avi Kivity a...@redhat.com wrote: What I checked was: original with-patch2 with-patch3 8.7ms 8.5ms 7.5ms What's the per-call numbers? I did not look into details at that time. I will try to see more details later if possible! What I mean is, modern cpus effectively

Re: [PATCH 3/3] KVM: MMU: Separate trivial NULL check out from rmap_get_next()

2012-03-15 Thread Avi Kivity
On 03/15/2012 03:41 PM, Takuya Yoshikawa wrote: Anyway I will re-check if we can achieve the same performance with a bit cleaner implementation. Not needed -- it's fine as it is (. I'm just interested in the normalized numbers (nanoseconds per call, instead of aggregated time per unknown

Re: [PATCH 3/3] KVM: MMU: Separate trivial NULL check out from rmap_get_next()

2012-03-15 Thread Avi Kivity
On 03/15/2012 03:41 PM, Takuya Yoshikawa wrote: What I mean is, modern cpus effectively inline simple function calls by predicting the call, and branchs within the function, and the return, so they don't have to stop their pipelines at any of these points. But again, the numbers talk

Re: [PATCH v9 2/4] KVM: PPC: epapr: Add idle hcall support for host

2012-03-15 Thread Stuart Yoder
On Wed, Mar 7, 2012 at 5:27 PM, Alexander Graf ag...@suse.de wrote: #define KVM_SC_MAGIC_R0               0x4b564d21 /* KVM! */ -#define HC_VENDOR_KVM                (42 16) + +#include asm/epapr_hcalls.h + +/* ePAPR Hypercall Vendor ID */ +#define HC_VENDOR_EPAPR              

Re: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Konrad Rzeszutek Wilk
On Thu, Mar 08, 2012 at 09:59:41PM +0530, Akshay Karle wrote: Hi, We are undergraduate engineering students of Maharashtra Academy of Engineering, Pune, India and we are working on a project entitled 'Transcendent Memory on KVM' as a part of our academics. The project members are: 1.

Re: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Konrad Rzeszutek Wilk
--- kvm-tmem Patch details: This patch adds appropriate shims at the guest that invokes the kvm hypercalls, and the host uses zcache pools to implement the required functions. To enable tmem on the 'kvm host' add the boot parameter: kvmtmem And to enable tmem in the 'kvm guests' add the

Re: [RFC 1/2] kvm: host-side changes for tmem on KVM

2012-03-15 Thread Konrad Rzeszutek Wilk
On Thu, Mar 08, 2012 at 10:24:08PM +0530, Akshay Karle wrote: From: Akshay Karle akshay.a.ka...@gmail.com Subject: [RFC 1/2] kvm: host-side changes for tmem on KVM Working at host: Once the guest exits to the kvm host, the host determines that the guest exited to perform some tmem

Re: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Avi Kivity
On 03/08/2012 06:29 PM, Akshay Karle wrote: Hi, We are undergraduate engineering students of Maharashtra Academy of Engineering, Pune, India and we are working on a project entitled 'Transcendent Memory on KVM' as a part of our academics. The project members are: 1. Ashutosh Tripathi 2.

Re: [RFC 2/2] kvm: guest-side changes for tmem on KVM

2012-03-15 Thread Konrad Rzeszutek Wilk
On Thu, Mar 08, 2012 at 10:32:37PM +0530, Akshay Karle wrote: From: Akshay Karle akshay.a.ka...@gmail.com Subject: [RFC 2/2] kvm: guest-side changes for tmem on KVM Working in the guest: At the kvm guest, we add the appropriate tmem shims to intercept the tmem operations and then invoke the

Re: PATCH: nVMX: Better MSR_IA32_FEATURE_CONTROL handling

2012-03-15 Thread Nadav Har'El
On Wed, Mar 07, 2012, Avi Kivity wrote about Re: PATCH: nVMX: Better MSR_IA32_FEATURE_CONTROL handling: struct page *apic_access_page; + u64 msr_ia32_feature_control; }; ... (msrs_to_save). The variable itself should live in vcpu-arch, even if some bits are vendor specific. Does

RE: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Dan Magenheimer
From: Avi Kivity [mailto:a...@redhat.com] Subject: Re: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM On 03/08/2012 06:29 PM, Akshay Karle wrote: Hi, We are undergraduate engineering students of Maharashtra Academy of Engineering, Pune, India and we are working on a project entitled

Re: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Avi Kivity
On 03/15/2012 07:49 PM, Dan Magenheimer wrote: One of the potential problems with tmem is reduction in performance when the cache hit rate is low, for example when streaming. Can you test this by creating a large file, for example with dd /dev/urandom file bs=1M count=10

Re: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Konrad Rzeszutek Wilk
On Thu, Mar 15, 2012 at 08:01:52PM +0200, Avi Kivity wrote: On 03/15/2012 07:49 PM, Dan Magenheimer wrote: One of the potential problems with tmem is reduction in performance when the cache hit rate is low, for example when streaming. Can you test this by creating a large file, for

Re: PATCH: nVMX: Better MSR_IA32_FEATURE_CONTROL handling

2012-03-15 Thread Avi Kivity
On 03/15/2012 07:40 PM, Nadav Har'El wrote: On Wed, Mar 07, 2012, Avi Kivity wrote about Re: PATCH: nVMX: Better MSR_IA32_FEATURE_CONTROL handling: struct page *apic_access_page; + u64 msr_ia32_feature_control; }; ... (msrs_to_save). The variable itself should live in vcpu-arch,

Re: [RFC 1/2] kvm: host-side changes for tmem on KVM

2012-03-15 Thread Akshay Karle
Working at host: Once the guest exits to the kvm host, the host determines that the guest exited to perform some tmem operation(done at kvm_emulate_hypercall)and then we use zcache to implement this required operations(performed by kvm_pv_tmem_op). Do you need any modifications to the

Re: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Avi Kivity
On 03/15/2012 08:02 PM, Konrad Rzeszutek Wilk wrote: Nice. This takes care of the tail-end of the streaming (the more important one - since it always involves a cold copy). What about the other side? Won't the read code invoke cleancache_get_page() for every page? (this one is just a

RE: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Dan Magenheimer
From: Konrad Rzeszutek Wilk Subject: Re: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM On Thu, Mar 15, 2012 at 08:01:52PM +0200, Avi Kivity wrote: On 03/15/2012 07:49 PM, Dan Magenheimer wrote: The WasActive patch (https://lkml.org/lkml/2012/1/25/300) is intended to avoid the

RE: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Dan Magenheimer
From: Avi Kivity [mailto:a...@redhat.com] Sent: Thursday, March 15, 2012 12:11 PM To: Konrad Rzeszutek Wilk Cc: Dan Magenheimer; Akshay Karle; linux-ker...@vger.kernel.org; kvm@vger.kernel.org; ashu tripathi; nishant gulhane; amarmore2006; Shreyas Mahure; mahesh mohan Subject: Re: [RFC

RE: [RFC 1/2] kvm: host-side changes for tmem on KVM

2012-03-15 Thread Dan Magenheimer
From: Akshay Karle [mailto:akshay.a.ka...@gmail.com] Subject: Re: [RFC 1/2] kvm: host-side changes for tmem on KVM Working at host: Once the guest exits to the kvm host, the host determines that the guest exited to perform some tmem operation(done at kvm_emulate_hypercall)and then

Re: [PATCH v9 1/4] KVM: PPC: epapr: Factor out the epapr init

2012-03-15 Thread Stuart Yoder
+early_initcall(epapr_paravirt_init); Just want to double-check. Are you 100% sure that this gets called before kvm_guest_init()? Yes, kvm_guest_init is a postcore_initcall, which comes after early. Some printks confirmed this. Stuart -- To unsubscribe from this list: send the line

Re: [RFC 0/2] kvm: Transcendent Memory (tmem) on KVM

2012-03-15 Thread Konrad Rzeszutek Wilk
On Thu, Mar 15, 2012 at 12:36:48PM -0700, Dan Magenheimer wrote: From: Avi Kivity [mailto:a...@redhat.com] Sent: Thursday, March 15, 2012 12:11 PM To: Konrad Rzeszutek Wilk Cc: Dan Magenheimer; Akshay Karle; linux-ker...@vger.kernel.org; kvm@vger.kernel.org; ashu tripathi; nishant

  1   2   >