Re: [PATCH v2] KVM: Synthesize G bit for all segments.

2014-07-10 Thread Jan Kiszka
On 2014-07-08 06:17, Alok Kataria wrote: Thanks Jan and Paolo for looking at the change, I have added a comment in svm_get_segment. Joerg, please consider this for the next merge. -- From: Jim Mattson jmatt...@vmware.com We have noticed that qemu-kvm hangs early in the BIOS when

Re: [PATCH V4 1/2] perf ignore LBR and extra_regs.

2014-07-10 Thread Peter Zijlstra
/me reminds you of 78 char text wrap. On Wed, Jul 09, 2014 at 07:32:09PM +, Liang, Kan wrote: Sure; but what I meant was, check_msr() is broken when ran on such a kernel. You need to fix check_msr() to return failure on these 'ignored' MSRs, after all they don't function as expected,

Re: [PATCH] KVM: svm: virtualize MSR reads from MC4_MISC1

2014-07-10 Thread Matthias Lange
On Wed, Jul 09, 2014 at 06:26:23PM +0200, Paolo Bonzini wrote: Il 26/06/2014 14:22, Matthias Lange ha scritto: Linux' AMD MCE code tries to read from the MC4_MISC1 (0xc408) MSR. Because this read is not virtualized within KVM, a GPE is injected into the guest. This patch handles guest

[PATCH] powerpc/kvm: Create proper names for the kvm_host_state PMU fields

2014-07-10 Thread Michael Ellerman
We have two arrays in kvm_host_state that contain register values for the PMU. Currently we only create an asm-offsets symbol for the base of the arrays, and do the array offset in the assembly code. Creating an asm-offsets symbol for each field individually makes the code much nicer to read,

Re: [PATCH] powerpc/kvm: Create proper names for the kvm_host_state PMU fields

2014-07-10 Thread Alexander Graf
On 10.07.14 11:34, Michael Ellerman wrote: We have two arrays in kvm_host_state that contain register values for the PMU. Currently we only create an asm-offsets symbol for the base of the arrays, and do the array offset in the assembly code. Creating an asm-offsets symbol for each field

[3.11.y.z extended stable] Patch MIPS: KVM: Remove redundant NULL checks before kfree() has been added to staging queue

2014-07-10 Thread Luis Henriques
This is a note to let you know that I have just added a patch titled MIPS: KVM: Remove redundant NULL checks before kfree() to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree which can be found at:

Re: [Qemu-devel] [PATCH v5 00/12] KVM Support for MIPS32 Processors

2014-07-10 Thread Peter Maydell
On 17 June 2014 23:10, James Hogan james.ho...@imgtec.com wrote: The patchset depends on v4 of target-mips: implement UserLocal Register. I'm aiming for QEMU 2.1, hopefully it isn't too late to get some final review. Thanks to everybody who has already taken part in review. This patchset

Re: [PATCH v2] KVM: Synthesize G bit for all segments.

2014-07-10 Thread Paolo Bonzini
Il 10/07/2014 10:55, Jan Kiszka ha scritto: + /* + * SVM spec doesn't require the platform to track the G bit for all + * segments, so similar to CS, let's synthesize this bit for all + * segments. Either I misunderstand the reference to CS or it does no longer apply once the

Re: [Qemu-devel] [PATCH v5 00/12] KVM Support for MIPS32 Processors

2014-07-10 Thread Paolo Bonzini
Il 10/07/2014 14:17, Peter Maydell ha scritto: More generally, there doesn't really seem to be provision in the KVM KVM_EXIT_MMIO API for returning this access failed. I guess in theory userspace could do all the figure out how to adjust CPU state to do exception entry and then run VCPU, but

[PATCH/RFC 2/5] KVM: s390: move finalization of SIGP STOP orders to kvm_s390_vcpu_stop

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com Let's move the finalization of SIGP STOP and SIGP STOP AND STORE STATUS orders to the point where the VCPU is actually stopped. This change is needed to prepare for a user space driven VCPU state change. The action_bits may only be cleared when

[PATCH/RFC 0/5] KVM: s390: Let user space control the cpu states

2014-07-10 Thread Christian Borntraeger
Paolo, here is a preview of a rework of CPU state on s390x. Since we extend MP_STATE I wanted to send an RFC upfront. I will wait for some feedback and send a proper pull request in the next week: - This series enables the KVM_SET_MP_STATE ioctl on s390 to make the cpu state settable by

[PATCH/RFC 3/5] KVM: s390: remove __cpu_is_stopped and expose is_vcpu_stopped

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com The function __cpu_is_stopped is not used any more. Let's remove it and expose the function is_vcpu_stopped instead, which is actually what we want. This patch also converts an open coded check for CPUSTAT_STOPPED to is_vcpu_stopped().

[PATCH/RFC 0/5] s390x/kvm: track the logical cpu state in QEMU and propagate it to kvm

2014-07-10 Thread Christian Borntraeger
This is the qemu part of kernel series Let user space control the cpu states Christian Borntraeger (1): update linux headers with with cpustate changes David Hildenbrand (4): s390x/kvm: introduce proper states for s390 cpus s390x/kvm: proper use of the cpu states OPERATING and STOPPED

[PATCH/RFC 1/5] KVM: s390: allow only one SIGP STOP (AND STORE STATUS) at a time

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com A SIGP STOP (AND STORE STATUS) order is complete as soon as the VCPU has been stopped. This patch makes sure that only one SIGP STOP (AND STORE STATUS) may be pending at a time (as defined by the architecture). If the action_bits are still set, a

[PATCH/RFC 4/5] KVM: prepare for KVM_(S|G)ET_MP_STATE on other architectures

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com Highlight the aspects of the ioctls that are actually specific to x86 and ia64. As defined restrictions (irqchip) and mp states may not apply to other architectures, these parts are flagged to belong to x86 and ia64. In preparation for the use of

[PATCH/RFC 2/5] s390x/kvm: introduce proper states for s390 cpus

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com Until now, when a s390 cpu was stopped or halted, the number of running CPUs was tracked in a global variable. This was problematic for migration, so Jason came up with a per-cpu running state. As it turns out, we want to track the full logical

[PATCH/RFC 4/5] s390x/kvm: test whether a cpu is STOPPED when checking has_work

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com If a cpu is stopped, it must never be allowed to run and no interrupt may wake it up. A cpu also has to be unhalted if it is halted and has work to do - this scenario wasn't hit in kvm case yet, as only disabled wait is processed within QEMU.

[PATCH/RFC 3/5] s390x/kvm: proper use of the cpu states OPERATING and STOPPED

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com This patch makes sure that halting a cpu and stopping a cpu are two different things. Stopping a cpu will also set the cpu halted - this is needed for common infrastructure to work (note that the stop and stopped flag cannot be used for our purpose

[PATCH/RFC 5/5] s390x/kvm: propagate s390 cpu state to kvm

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com Let QEMU propagate the cpu state to kvm. If kvm doesn't yet support it, it is silently ignored as kvm will still handle the cpu state itself in that case. The state is not synced back, thus kvm won't have a chance to actively modify the cpu state.

[PATCH/RFC 5/5] KVM: s390: implement KVM_(S|G)ET_MP_STATE for user space state control

2014-07-10 Thread Christian Borntraeger
From: David Hildenbrand d...@linux.vnet.ibm.com This patch - adds s390 specific MP states to linux headers and documents them - implements the KVM_{SET,GET}_MP_STATE ioctls - enables KVM_CAP_MP_STATE - allows user space to control the VCPU state on s390. If user space sets the VCPU state using

[PATCH/RFC 1/5] update linux headers with with cpustate changes

2014-07-10 Thread Christian Borntraeger
Will do a proper headers sync when ready Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- linux-headers/linux/kvm.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index f5d2c38..9b584da 100644 ---

Re: [PATCH/RFC 0/5] s390x/kvm: track the logical cpu state in QEMU and propagate it to kvm

2014-07-10 Thread David Hildenbrand
This is the qemu part of kernel series Let user space control the cpu states Christian Borntraeger (1): update linux headers with with cpustate changes David Hildenbrand (4): s390x/kvm: introduce proper states for s390 cpus s390x/kvm: proper use of the cpu states OPERATING and

Re: [PATCH/RFC 0/5] s390x/kvm: track the logical cpu state in QEMU and propagate it to kvm

2014-07-10 Thread David Hildenbrand
This is the qemu part of kernel series Let user space control the cpu states Christian Borntraeger (1): update linux headers with with cpustate changes David Hildenbrand (4): s390x/kvm: introduce proper states for s390 cpus s390x/kvm: proper use of the cpu states OPERATING and

Re: [PATCH/RFC 0/5] s390x/kvm: track the logical cpu state in QEMU and propagate it to kvm

2014-07-10 Thread David Hildenbrand
This is the qemu part of kernel series Let user space control the cpu states Christian Borntraeger (1): update linux headers with with cpustate changes David Hildenbrand (4): s390x/kvm: introduce proper states for s390 cpus s390x/kvm: proper use of the cpu states

[PATCH] arm/arm64: KVM: Support KVM_CAP_READONLY_MEM

2014-07-10 Thread Christoffer Dall
When userspace loads code and data in a read-only memory regions, KVM needs to be able to handle this on arm and arm64. Specifically this is used when running code directly from a read-only flash device; the common scenario is a UEFI blob loaded with the -bios option in QEMU. To avoid looking

[PATCH v2 09/10] target-arm/kvm.c: better error reporting

2014-07-10 Thread Alex Bennée
From: Alex Bennée a...@bennee.com When we have a problem syncing CP registers between kvm-qemu it's a lot more useful to have the names of the registers in the log than just a random abort() and core dump. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - less verbose log message -

[PATCH v2 10/10] target-arm/kvm: make reg sync code common between kvm32/64

2014-07-10 Thread Alex Bennée
Before we launch a guest we query KVM for the list of co-processor registers it knows about which is used later for save/restore of machine state. The logic is identical for both 32-bit and 64-bit so I've moved it all into the common code and simplified the exit paths (as failure = exit). This

[PATCH 0/2] KVM: PPC: Fix Mac OS X guests on non-Apple hosts

2014-07-10 Thread Alexander Graf
While trying to get Mac-on-Linux to work on a POWER7 box I stumbled over two issues in our book3s_32 MMU emulation. With these issues fixed and a hack to disable magic page mapping (very hard to get right with 64k pages in this case) I can successfully run Mac OS X guests on a POWER7 host. Alex

[PATCH 1/2] KVM: PPC: Deflect page write faults properly in kvmppc_st

2014-07-10 Thread Alexander Graf
When we have a page that we're not allowed to write to, xlate() will already tell us -EPERM on lookup of that page. With the code as is we change it into a page missing error which a guest may get confused about. Instead, just tell the caller about the -EPERM directly. This fixes Mac OS X guests

[PATCH 2/2] KVM: PPC: Book3S: Stop PTE lookup on write errors

2014-07-10 Thread Alexander Graf
When a page lookup failed because we're not allowed to write to the page, we should not overwrite that value with another lookup on the second PTEG which will return page not found. Instead, we should just tell the caller that we had a permission problem. This fixes Mac OS X guests looping

[PATCH V5 1/2] perf ignore LBR and extra_regs

2014-07-10 Thread kan . liang
From: Kan Liang kan.li...@intel.com x86, perf: Protect LBR and extra_regs against KVM lying With -cpu host, KVM reports LBR and extra_regs support, if the host has support. When the guest perf driver tries to access LBR or extra_regs MSR, it #GPs all MSR accesses,since KVM doesn't handle LBR and

[PATCH V5 2/2] kvm: ignore LBR and extra_reg

2014-07-10 Thread kan . liang
From: Kan Liang kan.li...@intel.com With -cpu host KVM reports LBR and extra_regs support, so the perf driver may accesses the LBR and extra_regs MSRs. However, there is no LBR and extra_regs virtualization support yet. This could causes guest to crash. As a workaround, KVM just simply ignore

Re: [PATCH] arm64: fix VTTBR_BADDR_MASK

2014-07-10 Thread Christoffer Dall
On Wed, Jul 09, 2014 at 11:17:04AM -0500, Joel Schopp wrote: The current calculation for VTTBR_BADDR_MASK masks only 39 bits and not all 40 bits. That last bit is important as some systems allocate from near the top of the available address space. This patch is necessary to run KVM on an

Re: [PATCH] arm64: fix VTTBR_BADDR_MASK

2014-07-10 Thread Joel Schopp
On 07/10/2014 03:25 PM, Christoffer Dall wrote: On Wed, Jul 09, 2014 at 11:17:04AM -0500, Joel Schopp wrote: The current calculation for VTTBR_BADDR_MASK masks only 39 bits and not all 40 bits. That last bit is important as some systems allocate from near the top of the available address

Re: [PATCH] arm64: fix VTTBR_BADDR_MASK

2014-07-10 Thread Joel Schopp
On 07/10/2014 04:02 PM, Joel Schopp wrote: On 07/10/2014 03:25 PM, Christoffer Dall wrote: On Wed, Jul 09, 2014 at 11:17:04AM -0500, Joel Schopp wrote: The current calculation for VTTBR_BADDR_MASK masks only 39 bits and not all 40 bits. That last bit is important as some systems allocate

[PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread Ethan Zhao
Current implementation of helper function pci_vfs_assigned() is a little complex, to get sum of VFs that assigned to VM, access low level configuration space register and then loop in traversing device tree. This patch introduce an atomic reference counter for VFs that assigned to VM in struct

[PATCH 2/4] xen-pciback: use PCI VFs assignment helper functions

2014-07-10 Thread Ethan Zhao
New VFs reference counter mechanism and VFs assignment helper functions are introduced to PCI SRIOV, use them instead of manipulating device flag directly. Signed-off-by: Ethan Zhao ethan.z...@oracle.com --- drivers/xen/xen-pciback/pci_stub.c |4 ++-- 1 files changed, 2 insertions(+), 2

[PATCH 4/4] i40e: use PCI VFs assignment helper function simplify i40e_vfs_are_assigned()

2014-07-10 Thread Ethan Zhao
New VFs reference counter mechanism and VFs assignment helper functions are introduced to PCI SRIOV, use them instead of manipulating device flag directly. Signed-off-by: Ethan Zhao ethan.z...@oracle.com --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 17 ++--- 1 files

[PATCH 3/4] KVM: use PCI VFs assignment helper functions

2014-07-10 Thread Ethan Zhao
New VFs reference counter mechanism and VFs assignment helper functions are introduced to PCI SRIOV, use them instead of manipulating device flag directly. Signed-off-by: Ethan Zhao ethan.z...@oracle.com --- virt/kvm/assigned-dev.c |2 +- virt/kvm/iommu.c|4 ++-- 2 files

[PATCH] KVM: PPC: Book3S: Add hack for split real mode

2014-07-10 Thread Alexander Graf
Today we handle split real mode by mapping both instruction and data faults into a special virtual address space that only exists during the split mode phase. This is good enough to catch 32bit Linux guests that use split real mode for copy_from/to_user. In this case we're always prefixed with

Re: [PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread Alex Williamson
Since there's no 0th patch, I guess I'll comment here. This series is not bisectable, patch 1 breaks the existing implementation. I'd suggest: patch 1 - fix i40e patch 2 - create assign/deassign that uses dev_flags patch 3 - convert users to new interface patch 4 - convert interface to use

Re: [PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread ethan zhao
Alex, Thanks for your reviewing, when I create the patch order, I thought about the question you concerned for quit a while, make every patch be independent to each other as possible as I could, so we can do bisect when hit problem. I manage to take more time to figure out better patch

Re: [PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread Alex Williamson
On Fri, 2014-07-11 at 10:10 +0800, ethan zhao wrote: Alex, Thanks for your reviewing, when I create the patch order, I thought about the question you concerned for quit a while, make every patch be independent to each other as possible as I could, so we can do bisect when hit problem.

Re: [PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread ethan zhao
On 2014/7/11 10:22, Alex Williamson wrote: On Fri, 2014-07-11 at 10:10 +0800, ethan zhao wrote: Alex, Thanks for your reviewing, when I create the patch order, I thought about the question you concerned for quit a while, make every patch be independent to each other as possible as I

Re: [PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread Alex Williamson
On Fri, 2014-07-11 at 10:29 +0800, ethan zhao wrote: On 2014/7/11 10:22, Alex Williamson wrote: On Fri, 2014-07-11 at 10:10 +0800, ethan zhao wrote: Alex, Thanks for your reviewing, when I create the patch order, I thought about the question you concerned for quit a while, make

Re:letter..

2014-07-10 Thread Bussgg
reply me on the email id below for explanation of better opportunity for us. email: chnsnn...@gmail.com -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/4] PCI: introduce VFs reference counter and simplify pci_vfs_assigned() implementation

2014-07-10 Thread ethan zhao
On 2014/7/11 10:33, Alex Williamson wrote: On Fri, 2014-07-11 at 10:29 +0800, ethan zhao wrote: On 2014/7/11 10:22, Alex Williamson wrote: On Fri, 2014-07-11 at 10:10 +0800, ethan zhao wrote: Alex, Thanks for your reviewing, when I create the patch order, I thought about the question

[PATCH][RESEND] KVM: nVMX: Fix vmptrld fail and vmwrite error when L1 goes down

2014-07-10 Thread Wanpeng Li
This bug can be trigger by L1 goes down directly w/ enable_shadow_vmcs. [ 6413.158950] kvm: vmptrld (null)/7800 failed [ 6413.158954] vmwrite error: reg 401e value 4 (err 1) [ 6413.158957] CPU: 0 PID: 4840 Comm: qemu-system-x86 Tainted: G OE 3.16.0kvm+ #2 [

Re: [PATCH] powerpc/kvm: Create proper names for the kvm_host_state PMU fields

2014-07-10 Thread Michael Ellerman
On Thu, 2014-07-10 at 12:16 +0200, Alexander Graf wrote: On 10.07.14 11:34, Michael Ellerman wrote: We have two arrays in kvm_host_state that contain register values for the PMU. Currently we only create an asm-offsets symbol for the base of the arrays, and do the array offset in the

[PATCH 2/2 V2] PCI: implement VFs assignment reference counter

2014-07-10 Thread Ethan Zhao
Current implementation of helper function pci_vfs_assigned() is a little complex, to get sum of VFs that assigned to VM, access low level configuration space register and then loop in traversing device tree. This patch introduces an atomic reference counter for VFs those were assigned to VM in

[PATCH 1/2 V2] PCI: introduce device assignment interface and refactory related code

2014-07-10 Thread Ethan Zhao
This patch introduces two new device assignment functions pci_sriov_assign_device(), pci_sriov_deassign_device() along with the existed one pci_vfs_assigned() They construct the VFs assignment management interface, used to assign/ deassign device to VM and query the VFs reference counter.

Re: [PATCH v2] Use the POWER8 Micro Partition Prefetch Engine in KVM HV on POWER8

2014-07-10 Thread Alexander Graf
On 09.07.14 00:59, Stewart Smith wrote: Hi! Thanks for review, much appreciated! Alexander Graf ag...@suse.de writes: On 08.07.14 07:06, Stewart Smith wrote: @@ -1528,6 +1535,7 @@ static void kvmppc_run_core(struct kvmppc_vcore *vc) int i, need_vpa_update; int srcu_idx;

Re: [PATCH v2] Use the POWER8 Micro Partition Prefetch Engine in KVM HV on POWER8

2014-07-10 Thread Mel Gorman
On Thu, Jul 10, 2014 at 01:05:47PM +0200, Alexander Graf wrote: On 09.07.14 00:59, Stewart Smith wrote: Hi! Thanks for review, much appreciated! Alexander Graf ag...@suse.de writes: On 08.07.14 07:06, Stewart Smith wrote: @@ -1528,6 +1535,7 @@ static void kvmppc_run_core(struct

Re: [PATCH v2] Use the POWER8 Micro Partition Prefetch Engine in KVM HV on POWER8

2014-07-10 Thread Alexander Graf
On 10.07.14 15:07, Mel Gorman wrote: On Thu, Jul 10, 2014 at 01:05:47PM +0200, Alexander Graf wrote: On 09.07.14 00:59, Stewart Smith wrote: Hi! Thanks for review, much appreciated! Alexander Graf ag...@suse.de writes: On 08.07.14 07:06, Stewart Smith wrote: @@ -1528,6 +1535,7 @@ static

Re: [PATCH v2] Use the POWER8 Micro Partition Prefetch Engine in KVM HV on POWER8

2014-07-10 Thread Mel Gorman
On Thu, Jul 10, 2014 at 03:17:16PM +0200, Alexander Graf wrote: On 10.07.14 15:07, Mel Gorman wrote: On Thu, Jul 10, 2014 at 01:05:47PM +0200, Alexander Graf wrote: On 09.07.14 00:59, Stewart Smith wrote: Hi! Thanks for review, much appreciated! Alexander Graf ag...@suse.de writes: On

[PATCH 0/2] KVM: PPC: Fix Mac OS X guests on non-Apple hosts

2014-07-10 Thread Alexander Graf
While trying to get Mac-on-Linux to work on a POWER7 box I stumbled over two issues in our book3s_32 MMU emulation. With these issues fixed and a hack to disable magic page mapping (very hard to get right with 64k pages in this case) I can successfully run Mac OS X guests on a POWER7 host. Alex

[PATCH 1/2] KVM: PPC: Deflect page write faults properly in kvmppc_st

2014-07-10 Thread Alexander Graf
When we have a page that we're not allowed to write to, xlate() will already tell us -EPERM on lookup of that page. With the code as is we change it into a page missing error which a guest may get confused about. Instead, just tell the caller about the -EPERM directly. This fixes Mac OS X guests

[PATCH 2/2] KVM: PPC: Book3S: Stop PTE lookup on write errors

2014-07-10 Thread Alexander Graf
When a page lookup failed because we're not allowed to write to the page, we should not overwrite that value with another lookup on the second PTEG which will return page not found. Instead, we should just tell the caller that we had a permission problem. This fixes Mac OS X guests looping

[PATCH] KVM: PPC: Book3S: Add hack for split real mode

2014-07-10 Thread Alexander Graf
Today we handle split real mode by mapping both instruction and data faults into a special virtual address space that only exists during the split mode phase. This is good enough to catch 32bit Linux guests that use split real mode for copy_from/to_user. In this case we're always prefixed with