Re: [PATCH 01/12] KVM: x86: Collect information for setting TSC scaling ratio

2015-09-28 Thread Eric Northup
On Sun, Sep 27, 2015 at 10:38 PM, Haozhong Zhang wrote: > > The number of bits of the fractional part of the 64-bit TSC scaling > ratio in VMX and SVM is different. This patch makes the architecture > code to collect the number of fractional bits and other related >

Re: [PATCH 00/12] KVM: x86: add support for VMX TSC scaling

2015-09-28 Thread Eric Northup
migrated among machines with different host TSC rates. > > VMX TSC scaling shares some common logics with SVM TSC scaling which > is already supported by KVM. Patch 1 ~ 8 move those common logics from > SVM code to the common code. Upon them, patch 9 ~ 12 add VMX-specific > support

Re: [PATCH] vhost: support upto 509 memory regions

2015-02-17 Thread Eric Northup
On Tue, Feb 17, 2015 at 4:32 AM, Michael S. Tsirkin m...@redhat.com wrote: On Tue, Feb 17, 2015 at 11:59:48AM +0100, Paolo Bonzini wrote: On 17/02/2015 10:02, Michael S. Tsirkin wrote: Increasing VHOST_MEMORY_MAX_NREGIONS from 65 to 509 to match KVM_USER_MEM_SLOTS fixes issue for

Re: [PATCH] KVM: x86 emulator: emulate MOVNTDQ

2014-07-11 Thread Eric Northup
On Fri, Jul 11, 2014 at 10:56 AM, Alex Williamson alex.william...@redhat.com wrote: Windows 8.1 guest with NVIDIA driver and GPU fails to boot with an emulation failure. The KVM spew suggests the fault is with lack of movntdq emulation (courtesy of Paolo): Code=02 00 00 b8 08 00 00 00 f3 0f

Re: [PATCH 3/3] KVM: x86: correct mwait and monitor emulation

2014-06-18 Thread Eric Northup
On Wed, Jun 18, 2014 at 7:19 AM, Nadav Amit na...@cs.technion.ac.il wrote: mwait and monitor are currently handled as nop. Considering this behavior, they should still be handled correctly, i.e., check execution conditions and generate exceptions when required. mwait and monitor may also be

Re: [PATCH 3/3] KVM: x86: correct mwait and monitor emulation

2014-06-18 Thread Eric Northup
...@gmail.com wrote: On 6/18/14, 8:59 PM, Eric Northup wrote: On Wed, Jun 18, 2014 at 7:19 AM, Nadav Amit na...@cs.technion.ac.il wrote: mwait and monitor are currently handled as nop. Considering this behavior, they should still be handled correctly, i.e., check execution conditions and generate

Re: [PATCH v2] kvm: x86: emulate monitor and mwait instructions as nop

2014-06-05 Thread Eric Northup
On Wed, May 7, 2014 at 1:52 PM, Gabriel L. Somlo gso...@gmail.com wrote: Treat monitor and mwait instructions as nop, which is architecturally correct (but inefficient) behavior. We do this to prevent misbehaving guests (e.g. OS X = 10.7) from crashing after they fail to check for

Re: [PATCH 4/4] kvm: Implement PEBS virtualization

2014-06-02 Thread Eric Northup
On Thu, May 29, 2014 at 6:12 PM, Andi Kleen a...@firstfloor.org wrote: From: Andi Kleen a...@linux.intel.com PEBS (Precise Event Bases Sampling) profiling is very powerful, allowing improved sampling precision and much additional information, like address or TSX abort profiling. cycles:p and

Re: [PATCH v4 00/12] arm/arm64: KVM: host cache maintenance when guest caches are off

2014-02-18 Thread Eric Northup
On Tue, Feb 18, 2014 at 7:27 AM, Marc Zyngier marc.zyng...@arm.com wrote: When we run a guest with cache disabled, we don't flush the cache to the Point of Coherency, hence possibly missing bits of data that have been written in the cache, but have not yet reached memory. We also have the

Re: [PATCH V12 3/5] kvm : Fold pv_unhalt flag into GET_MP_STATE ioctl to aid migration

2013-08-06 Thread Eric Northup
On Tue, Aug 6, 2013 at 11:23 AM, Raghavendra K T raghavendra...@linux.vnet.ibm.com wrote: kvm : Fold pv_unhalt flag into GET_MP_STATE ioctl to aid migration From: Raghavendra K T raghavendra...@linux.vnet.ibm.com During migration, any vcpu that got kicked but did not become runnable (still

Re: [RFC PATCH 1/2] Hyper-H reference counter

2013-05-13 Thread Eric Northup
On Mon, May 13, 2013 at 4:45 AM, Vadim Rozenfeld vroze...@redhat.com wrote: Signed-off: Peter Lieven p...@dlh.net Signed-off: Gleb Natapov g...@redhat.com Signed-off: Vadim Rozenfeld vroze...@redhat.com The following patch allows to activate Hyper-V reference time counter ---

Re: [PATCH] kvm tools: virtio-net mergable rx buffers

2013-04-23 Thread Eric Northup
Do you care about guests with drivers that don't negotiate VIRTIO_NET_F_MRG_RXBUF? On Mon, Apr 22, 2013 at 5:32 PM, Sasha Levin sasha.le...@oracle.com wrote: Support mergable rx buffers for virtio-net. This helps reduce the amount of memory the guest kernel has to allocate per rx vq.

Re: [PATCHv2] KVM: x86: Fix memory leak in vmx.c

2013-04-17 Thread Eric Northup
On Wed, Apr 17, 2013 at 10:54 AM, Andrew Honig aho...@google.com wrote: If userspace creates and destroys multiple VMs within the same process we leak 20k of memory in the userspace process context per VM. This patch frees the memory in kvm_arch_destroy_vm. If the process exits without

Re: Is this really a CVE? - buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796)

2013-04-03 Thread Eric Northup
On Tue, Apr 2, 2013 at 11:05 PM, Florian Beck beckfloria...@gmail.com wrote: The CVE-2013-1796 (https://git.kernel.org/cgit/virt/kvm/kvm.git/commit/?id=c300aa64ddf57d9c5d9c898a64b36877345dd4a9) reports a possibility of host memory corruption. I see that this could lead into corruption of guest

Re: Best way to busy-wait for a virtio queue?

2013-04-01 Thread Eric Northup
On Fri, Mar 29, 2013 at 4:12 PM, H. Peter Anvin h...@zytor.com wrote: Is there any preferred way to busy-wait on a virtio event? As in: the guest doesn't have anything useful to do until something is plopped down on the virtio queue, but would like to proceed as quickly as possible after

Re: [PATCH 5/5] KVM: MMU: fast invalid all mmio sptes

2013-03-18 Thread Eric Northup
On Fri, Mar 15, 2013 at 8:29 AM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: This patch tries to introduce a very simple and scale way to invalid all mmio sptes - it need not walk any shadow pages and hold mmu-lock KVM maintains a global mmio invalid generation-number which is

[PATCH] virtio_scsi: fix memory leak on full queue condition.

2012-11-08 Thread Eric Northup
virtscsi_queuecommand was leaking memory when the virtio queue was full. Tested: Guest operates correctly even with very small queue sizes, validated we're not leaking kmalloc-192 sized allocations anymore. Signed-off-by: Eric Northup digitale...@google.com --- drivers/scsi/virtio_scsi.c |2

Re: [PATCH 0/8] use jump labels to streamline common APIC configuration

2012-08-05 Thread Eric Northup
On Sun, Aug 5, 2012 at 5:58 AM, Gleb Natapov g...@redhat.com wrote: APIC code has a lot of checks for apic presence and apic HW/SW enable state. Most common configuration is when each vcpu has in kernel apic and it is fully enabled. This path series uses jump labels to turn checks to nops in

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-22 Thread Eric Northup
On Mon, May 21, 2012 at 8:53 PM, Yanfei Zhang zhangyan...@cn.fujitsu.com wrote: 于 2012年05月22日 02:58, Eric Northup 写道: [...] So you can have the VMCS offset dumping be a manually-loaded module. Build a database mapping from (CPUID, microcode revision) - (VMCSINFO). There's no need for anything

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-21 Thread Eric Northup
On Wed, May 16, 2012 at 12:50 AM, zhangyanfei zhangyan...@cn.fujitsu.com wrote: This patch set exports offsets of VMCS fields as note information for kdump. We call it VMCSINFO. The purpose of VMCSINFO is to retrieve runtime state of guest machine image, such as registers, in host machine's

Re: [PATCH] kvm: don't call mmu_shrinker w/o used_mmu_pages

2012-04-22 Thread Eric Northup
On Sun, Apr 22, 2012 at 2:16 AM, Avi Kivity a...@redhat.com wrote: On 04/21/2012 05:15 AM, Mike Waychison wrote: [...] There is no mmu_list_lock.  Do you mean kvm_lock or kvm-mmu_lock? If the former, then we could easily fix this by dropping kvm_lock while the work is being done.  If the

Re: Linux Crash Caused By KVM?

2012-04-11 Thread Eric Northup
On Wed, Apr 11, 2012 at 7:45 AM, Avi Kivity a...@redhat.com wrote: On 04/11/2012 05:11 AM, Peijie Yu wrote:      For this problem, i found that panic is caused by BUG_ON(in_nmi()) which means NMI happened during another NMI Context; But i check the Intel Technical Manual and found While an NMI

Re: [PATCH v2] KVM: Introduce direct MSI message injection for in-kernel irqchips

2012-03-28 Thread Eric Northup
On Wed, Mar 28, 2012 at 10:47 AM, Jan Kiszka jan.kis...@siemens.com wrote: [...] +4.61 KVM_SET_MSI + +Capability: KVM_CAP_SET_MSI +Architectures: x86 +Type: vm ioctl +Parameters: struct kvm_msi (in) +Returns: 0 on success, -1 on error Is this the actual behavior? It looked to me like the

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

2012-03-14 Thread Eric Northup
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 01:11 PM, Wen Congyang wrote: I

Re: [RFC] Next gen kvm api

2012-02-03 Thread Eric Northup
On Thu, Feb 2, 2012 at 8:09 AM, Avi Kivity a...@redhat.com wrote: [...] Moving to syscalls avoids these problems, but introduces new ones: - adding new syscalls is generally frowned upon, and kvm will need several - syscalls into modules are harder and rarer than into core kernel code - will

[RFC] KVM MMU: improve large munmap efficiency

2012-01-26 Thread Eric Northup
the process is unkillable. Worse, all page allocation could be delayed if there's enough memory pressure that mmu_shrink gets called. Signed-off-by: Eric Northup digitale...@google.com --- We have seen delays of over 30 seconds doing a large (128GB) unmap. It'd be nicer to check if the amount of work

Re: [PATCH 06/13] x86/ticketlock: add slowpath logic

2011-09-02 Thread Eric Northup
On Thu, Sep 1, 2011 at 5:54 PM, Jeremy Fitzhardinge jer...@goop.org wrote: From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Maintain a flag in both LSBs of the ticket lock which indicates whether anyone is in the lock slowpath and may need kicking when the current holder unlocks.  The

Re: [PATCH] kvm tools: adds a PCI device that exports a host shared segment as a PCI BAR in the guest

2011-08-25 Thread Eric Northup
Just FYI, one issue that I found with exposing host memory regions as a PCI BAR (including via a very old version of the ivshmem driver... haven't tried a newer one) is that x86's pci_mmap_page_range doesn't want to set up a write-back cacheable mapping of a BAR. It may not matter for your

Re: [RFC v5 86/86] 440fx: fix PAM, PCI holes

2011-07-25 Thread Eric Northup
On Wed, Jul 20, 2011 at 9:50 AM, Avi Kivity a...@redhat.com wrote: [...] @@ -130,7 +137,13 @@ static void pc_init1(MemoryRegion *system_memory,     if (pci_enabled) {         pci_bus = i440fx_init(i440fx_state, piix3_devfn, isa_irq, -                              system_memory, system_io,

Re: [PATCH] kvm: log directly from the guest to the host kvm buffer

2011-05-12 Thread Eric Northup
On Thu, May 12, 2011 at 8:42 AM, Avi Kivity a...@redhat.com wrote: On 05/12/2011 06:39 PM, Dhaval Giani wrote:  I think that one hypercall per trace is too expensive.  Tracing is meant to  be lightweight!  I think the guest can log to a buffer, which is flushed on  overflow or

Re: [PATCH RFC] KVM MMU: fix hashing for TDP and non-paging modes

2010-04-26 Thread Eric Northup
by fixing the inputs used for the shadow page table hash in mmu_alloc_roots(). Signed-off-by: Eric Northup digitale...@google.com --- diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index ddfa865..9696d65 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2059,10 +2059,12 @@ static int

[PATCH RFC] KVM MMU: fix hashing for TDP and non-paging modes

2010-04-22 Thread Eric Northup
for the single guest-to-host physical address map by fixing the inputs used for the shadow page table hash in mmu_alloc_roots(). Signed-off-by: Eric Northup digitale...@google.com --- arch/x86/kvm/mmu.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm