Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-10 Thread Gleb Natapov
On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: > Changelog: > V3: > All of these changes are from Gleb's review: > 1) rename RET_MMIO_PF_EMU to RET_MMIO_PF_EMULATE. > 2) smartly adjust kvm generation number in kvm_current_mmio_generatio() > to avoid kvm_memslots->generat

Re: [PATCH v3 3/6] KVM: MMU: make return value of mmio page fault handler more readable

2013-06-10 Thread Gleb Natapov
On Fri, Jun 07, 2013 at 04:51:25PM +0800, Xiao Guangrong wrote: > Define some meaningful names instead of raw code > > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm/mmu.c | 15 +-- > arch/x86/kvm/mmu.h | 14 ++ > arch/x86/kvm/vmx.c | 4 ++-- > 3 files changed, 21 in

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-10 Thread Xiao Guangrong
On 06/10/2013 03:56 PM, Gleb Natapov wrote: > On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: >> Changelog: >> V3: >> All of these changes are from Gleb's review: >> 1) rename RET_MMIO_PF_EMU to RET_MMIO_PF_EMULATE. >> 2) smartly adjust kvm generation number in kvm_current_mmi

Re: [PATCH v3 3/6] KVM: MMU: make return value of mmio page fault handler more readable

2013-06-10 Thread Xiao Guangrong
On 06/10/2013 03:57 PM, Gleb Natapov wrote: > On Fri, Jun 07, 2013 at 04:51:25PM +0800, Xiao Guangrong wrote: >> Define some meaningful names instead of raw code >> >> Signed-off-by: Xiao Guangrong >> --- >> arch/x86/kvm/mmu.c | 15 +-- >> arch/x86/kvm/mmu.h | 14 ++ >> ar

Re: [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

2013-06-10 Thread Ralf Baechle
On Mon, Jun 10, 2013 at 12:40:42AM +0100, Maciej W. Rozycki wrote: > > > How different MIPS SMP systems are? > > > > o Old SGI heavy metal (several different system architectures). > > > > o Cavium OCTEON SMP SoCs. > > > > o Broadcom (several flavors) SoCs > > > > o Loongson > > o Old DEC h

[RFC PATCH 0/4] Enable async page faults on s390

2013-06-10 Thread Dominik Dingel
Gleb, Paolo, based on the work from Martin and Carsten, this implementation enables async page faults. To the guest it will provide the pfault interface, but internally it uses the async page fault common code. The inital submission and it's discussion can be followed on http://www.mail-archi

[PATCH 1/4] PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault

2013-06-10 Thread Dominik Dingel
In case of a fault retry exit sie64a() with the gmap_fault indication set. This makes it possbile to handle async page faults without the need for mm notifiers. Based on a patch from Marin Schwidefsky. Todo: - Add access to distinguish fault types to prevent double fault Signed-off-by: Dominik

[PATCH 4/4] PF: Intial async page fault support on s390x

2013-06-10 Thread Dominik Dingel
This patch adds the handling for async page faults to s390x code. It provides the userspace API to enable, disable or get the status of this feature. Also it includes the diagnose code, called by the guest, to enable async page faults by pfault or disable them. Signed-off-by: Dominik Dingel ---

[PATCH 3/4] PF: Additional flag for direct page fault inject

2013-06-10 Thread Dominik Dingel
On some architectures, as on s390x we may want to be able to directly inject notifications to the guest in case of a swapped in page. Also on s390x there is no need to go from gfn to hva as by calling gmap_fault we already have the needed address. Due to a possible race, we now always have to inse

[PATCH 2/4] PF: Move architecture specifics to the backends

2013-06-10 Thread Dominik Dingel
Current common code use PAGE_OFFSET to indicate a bad host virtual address. This works for x86 but not necessarily on other architectures. So the check is moved into architecture specific code. Todo: - apply to other architectures when applicable Signed-off-by: Dominik Dingel --- arch/s390/inc

Re: [PATCH v3 3/6] KVM: MMU: make return value of mmio page fault handler more readable

2013-06-10 Thread Takuya Yoshikawa
On Mon, 10 Jun 2013 10:57:50 +0300 Gleb Natapov wrote: > On Fri, Jun 07, 2013 at 04:51:25PM +0800, Xiao Guangrong wrote: > > + > > +/* > > + * Return values of handle_mmio_page_fault_common: > > + * RET_MMIO_PF_EMULATE: it is a real mmio page fault, emulate the > > instruction > > + *

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

2013-06-10 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 --- x86/emulator.c | 106 +++

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-10 Thread Takuya Yoshikawa
On Mon, 10 Jun 2013 16:39:37 +0800 Xiao Guangrong wrote: > On 06/10/2013 03:56 PM, Gleb Natapov wrote: > > On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: > > Looks good to me, but doesn't tis obsolete kvm_mmu_zap_mmio_sptes() and > > sp->mmio_cached, so they should be removed as

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

2013-06-10 Thread Arthur Chunqi Li
Change two functions (test_mmx_movq_mf and test_movabs) using unified trap_emulator. Signed-off-by: Arthur Chunqi Li --- x86/emulator.c | 63 +++- 1 file changed, 12 insertions(+), 51 deletions(-) diff --git a/x86/emulator.c b/x86/emulator.c

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

2013-06-10 Thread 李春奇
Sorry, there are some small mistakes in the first path, recommit it. Arthur On Mon, Jun 10, 2013 at 9:45 PM, Arthur Chunqi Li wrote: > Change two functions (test_mmx_movq_mf and test_movabs) using > unified trap_emulator. > > Signed-off-by: Arthur Chunqi Li > --- > x86/emulator.c | 63 > +++

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

2013-06-10 Thread Arthur Chunqi Li
Change two functions (test_mmx_movq_mf and test_movabs) using unified trap_emulator. Signed-off-by: Arthur Chunqi Li --- x86/emulator.c | 65 1 file changed, 13 insertions(+), 52 deletions(-) diff --git a/x86/emulator.c b/x86/emulator.c

[Bug 59521] New: KVM linux guest reads uninitialized pvclock values before executing rdmsr MSR_KVM_WALL_CLOCK

2013-06-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=59521 Summary: KVM linux guest reads uninitialized pvclock values before executing rdmsr MSR_KVM_WALL_CLOCK Product: Virtualization Version: unspecified Kernel Version: 3.8 and higher Pla

Re: [PATCH] kvm tools: add status notification hook to virtio-mmio

2013-06-10 Thread Will Deacon
On Mon, May 27, 2013 at 01:10:28AM +0100, Asias He wrote: > On Sun, May 26, 2013 at 11:33 PM, Sasha Levin wrote: > > On 05/21/2013 08:29 AM, Marc Zyngier wrote: > >> Patch e03b449cbddf (kvm tools: add status notification hook for > >> virtio) converted virtio-net to use a new notification mechanis

Re: [PATCH] kvm tools: add status notification hook to virtio-mmio

2013-06-10 Thread Pekka Enberg
On Mon, Jun 10, 2013 at 5:22 PM, Will Deacon wrote: > Can you pick this one up please Pekka? If it helps: > > Acked-by: Will Deacon CC'ing me helped even more! ;-) Applied, thanks guys! -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger

[PATCH] x86: kvmclock: zero initialize pvclock shared memory area

2013-06-10 Thread Igor Mammedov
=== Could be the following an acceptable fix? === kernel might hung in pvclock_clocksource_read() due to uninitialized memory might contain odd version value in following cycle: do { version = __pvclock_read_cycles(src, &ret, &flags); } while ((src->version & 1) ||

Re: [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

2013-06-10 Thread Sanjay Lal
On Jun 9, 2013, at 4:23 PM, David Daney wrote: > On 06/09/2013 12:31 AM, Gleb Natapov wrote: >> On Fri, Jun 07, 2013 at 04:15:00PM -0700, David Daney wrote: >>> I should also add that I will shortly send patches for the kvm tool >>> required to drive this VM as well as a small set of patches that

Re: [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

2013-06-10 Thread Sanjay Lal
On Jun 7, 2013, at 4:03 PM, David Daney wrote: > From: David Daney > > These patches take a somewhat different approach to MIPS > virtualization via the MIPS-VZ extensions than the patches previously > sent by Sanjay Lal. > > Several facts about the code: > > > o Currently probably only usab

Re: KVM call agenda for 2013-06-11

2013-06-10 Thread Michael S. Tsirkin
On Tue, Jun 04, 2013 at 04:24:31PM +0300, Michael S. Tsirkin wrote: > Juan is not available now, and Anthony asked for > agenda to be sent early. > So here comes: > > Agenda for the meeting Tue, June 11: > > - Generating acpi tables, redux I've just posted a proof of concept patch on list, as p

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-10 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 10:43:52PM +0900, Takuya Yoshikawa wrote: > On Mon, 10 Jun 2013 16:39:37 +0800 > Xiao Guangrong wrote: > > > On 06/10/2013 03:56 PM, Gleb Natapov wrote: > > > On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: > > > > Looks good to me, but doesn't tis obsolet

Re: [PATCH 3/4] PF: Additional flag for direct page fault inject

2013-06-10 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 02:03:47PM +0200, Dominik Dingel wrote: > On some architectures, as on s390x we may want to be able to directly inject > notifications to the guest in case of a swapped in page. Also on s390x > there is no need to go from gfn to hva as by calling gmap_fault we already > have

Re: [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

2013-06-10 Thread David Daney
On 06/10/2013 09:43 AM, Sanjay Lal wrote: On Jun 7, 2013, at 4:03 PM, David Daney wrote: From: David Daney These patches take a somewhat different approach to MIPS virtualization via the MIPS-VZ extensions than the patches previously sent by Sanjay Lal. Several facts about the code: o Cur

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

2013-06-10 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 09:38:32PM +0800, Arthur Chunqi Li wrote: > 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 out

[PATCH 0/2] kvm/mips: ABI fix for 3.10

2013-06-10 Thread David Daney
From: David Daney As requested by Gleb Natapov, we need to define and use KVM_REG_MIPS when using the GET_ONE_REG/SET_ONE_REG ioctl. Since this is part of the MIPS kvm support that is new in 3.10, it should be merged before a bad ABI leaks out into an 'official' kernel release. David Daney (2):

[PATCH 2/2] mips/kvm: Use KVM_REG_MIPS and proper size indicators for *_ONE_REG

2013-06-10 Thread David Daney
From: David Daney The API requires that the GET_ONE_REG and SET_ONE_REG ioctls have this extra information encoded in the register identifiers. Signed-off-by: David Daney --- arch/mips/include/uapi/asm/kvm.h | 81 +++ arch/mips/kvm/kvm_mips.c | 83 ++

[PATCH 1/2] kvm: Add definition of KVM_REG_MIPS

2013-06-10 Thread David Daney
From: David Daney We use 0x7000ULL as 0x6000ULL is reserved for ARM64. Signed-off-by: David Daney --- include/uapi/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index a5c86fc..d88c8ee 100644 --- a/inc

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

2013-06-10 Thread Scott Wood
On 06/09/2013 03:09:21 AM, Gleb Natapov wrote: On Thu, Jun 06, 2013 at 07:16:28PM -0500, Scott Wood wrote: > 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 y

Re: [PATCH] x86: kvmclock: zero initialize pvclock shared memory area

2013-06-10 Thread Marcelo Tosatti
On Mon, Jun 10, 2013 at 06:31:11PM +0200, Igor Mammedov wrote: > === > Could be the following an acceptable fix? > === Read of kvmclock should return proper value from hypervisor: system timestamp + tsc delta. Should find the offender site and have it register MSR_KVM_SYSTEM_TIME before reading

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

2013-06-10 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 5 Jun 2013 12:02:52 +0300 > On Wed, Jun 05, 2013 at 03:40:46PM +0800, 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.

Re: [Qemu-devel] [PATCH qom-cpu 02/59] kvm: Change cpu_synchronize_state() argument to CPUState

2013-06-10 Thread Andreas Färber
Am 10.06.2013 04:00, schrieb li guang: > 在 2013-06-09日的 21:12 +0200,Andreas Färber写道: >> Change Monitor::mon_cpu to CPUState as well. >> In cpu_sychronize_all_states() use qemu_for_each_cpu() now. > > Oh, s/sychronize/synchronize Fixed, thanks for noticing! > with that, > Reviewed-by: liguang

[PATCH 0/7] KVM: arm-vgic: Implement save/restore of VGIC state

2013-06-10 Thread Christoffer Dall
This patch series adds support for user space save/restore of the VGIC state. Instead of expanding the ONE_REG interface, which works on VCPUs, we first introduce support for the new KVM device control API and the VGIC. Now, instead of calling KVM_CREATE_IRQCHIP, user space can call KVM_CREATE_DE

[PATCH 1/7] KVM: arm-vgic: Support KVM_CREATE_DEVICE for VGIC

2013-06-10 Thread Christoffer Dall
Support creating the ARM VGIC device through the KVM_CREATE_DEVICE ioctl, which can then later be leveraged to use the KVM_{GET/SET}_DEVICE_ATTR, which is useful both for setting addresses in a more generic API than the ARM-specific one and is useful for save/restore of VGIC state. Adds KVM_CAP_DE

[PATCH 2/7] KVM: arm-vgic: Set base addr through device API

2013-06-10 Thread Christoffer Dall
Support setting the distributor and cpu interface base addresses in the VM physical address space through the KVM_{SET,GET}_DEVICE_ATTR API in addition the ARM specific API. This has the added benefit of being able to share more code in user space and do things in a uniform maner. Also deprecate

[PATCH 4/7] KVM: arm-vgic: Make vgic mmio functions more generic

2013-06-10 Thread Christoffer Dall
Rename the vgic_ranges array to vgic_dist_ranges to be more specific and to prepare for handling CPU interface register access as well (for save/restore of VGIC state). Pass offset from distributor or interface MMIO base to find_matching_range function instead of the physical address of the access

[PATCH 5/7] KVM: arm-vgic: Add vgic reg access from dev attr

2013-06-10 Thread Christoffer Dall
Adds infrastructure to handle distributor and cpu interface register accesses through the KVM_{GET/SET}_DEVICE_ATTR interface by adding the KVM_DEV_ARM_VGIC_GRP_DIST_REGS and KVM_DEV_ARM_VGIC_GRP_CPU_REGS groups and defining the semantics of the attr field to be the MMIO offset as specified in the

[PATCH 3/7] irqchip: arm-gic: Define additional MMIO offsets and masks

2013-06-10 Thread Christoffer Dall
Define CPU interface offsets for the GICC_ABPR, GICC_APR, and GICC_IIDR registers. Define distributor registers for the GICD_SPENDSGIR and the GICD_CPENDSGIR. KVM/ARM needs to know about these definitions to fully support save/restore of the VGIC. Also define some masks and shifts for the variou

[PATCH 6/7] KVM: arm-vgic: Add GICD_SPENDSGIR and GICD_CPENDSGIR handlers

2013-06-10 Thread Christoffer Dall
Handle MMIO accesses to the two registers which should support both the case where the VMs want to read/write either of these registers and the case where user space reads/writes these registers to do save/restore of the VGIC state. Note that the added complexity compared to simple set/clear enabl

[PATCH 7/7] KVM: arm-vgic: Support CPU interface reg access

2013-06-10 Thread Christoffer Dall
Implement support for the CPU interface register access driven by MMIO address offsets from the CPU interface base address. Useful for user space to support save/restore of the VGIC state. This commit adds support only for the same logic as the current VGIC support, and no more. For example, the