Re: [PATCH] kvm: x86: fix comment about {mmu,nested_mmu}.gva_to_gpa

2016-01-07 Thread Paolo Bonzini
On 30/12/2015 17:26, David Matlack wrote: > The comment had the meaning of mmu.gva_to_gpa and nested_mmu.gva_to_gpa > swapped. Fix that, and also add some details describing how each translation > works. > > Signed-off-by: David Matlack > --- > arch/x86/kvm/mmu.c | 10

Re: [PULL] KVM/ARM updates for 4.5

2016-01-07 Thread Paolo Bonzini
On 24/12/2015 12:12, Marc Zyngier wrote: > Hi Paolo, > > THis is the first pull request for the 4.5 merge window. Not much in > terms of features, but a rewrite of our 64bit world switch, making it > a lot nicer, maintainable, and much more likely to cope with things > like VHE. Also support

Re: [PATCH RESEND] kvm:x86:Make sure kvm_write_guest successes for first call in kvm_write_wall_clock

2016-01-07 Thread Paolo Bonzini
On 30/12/2015 19:08, Nicholas Krause wrote: > This makes sure that kvm_write_guest successes for the first call > in order to make sure that the wall clock is successfully written > to the host system before being calucated as required by the > guest system. > > Signed-off-by: Nicholas Krause

Re: [PATCH 1/2] KVM: Remove unused KVM_REQ_KICK to save a bit in vcpu->requests

2016-01-07 Thread Paolo Bonzini
On 07/01/2016 12:43, Takuya Yoshikawa wrote: > Signed-off-by: Takuya Yoshikawa > --- > include/linux/kvm_host.h | 45 ++--- > 1 file changed, 22 insertions(+), 23 deletions(-) > > diff --git a/include/linux/kvm_host.h

Re: [PATCH 3/4] KVM: renumber architecture-dependent requests

2016-01-07 Thread Paolo Bonzini
On 07/01/2016 16:27, Christian Borntraeger wrote: > On 01/07/2016 03:17 PM, Paolo Bonzini wrote: >> Leave room for 4 more arch-independent requests. > > The patch subject is wrong. > > "renumber architecture-dependent requests" > > --> "re

Re: [PATCH 4/4] KVM: move architecture-dependent requests to arch/

2016-01-07 Thread Paolo Bonzini
On 07/01/2016 16:54, Christian Borntraeger wrote: > On 01/07/2016 03:17 PM, Paolo Bonzini wrote: > > Can you add at least a one line patch description? Yes, and it will be more than one line. :) "Since the numbers now overlap, it makes sense to enumerate them in asm/kvm_host

Re: [PATCH v1 0/6] KVM: Hyper-V SynIC timers migration fixes

2016-01-07 Thread Paolo Bonzini
guest with Hyper-V SynIC timers enabled > succeed. > > The series applies on top of > 'kvm/x86: Remove Hyper-V SynIC timer stopping' > previously sent. > > Signed-off-by: Andrey Smetanin <asmeta...@virtuozzo.com> > Reviewed-by: Roman Kagan <rka...@virtuozzo.com> &g

Re: [PATCH v2 3/7] kvm/x86: Hyper-V unify stimer_start() and stimer_restart()

2016-01-07 Thread Paolo Bonzini
On 28/12/2015 16:27, Andrey Smetanin wrote: > This will be used in future to start Hyper-V SynIC timer > in several places by one logic in one function. > > Changes v2: > * drop stimer->count == 0 check inside stimer_start() > * comment stimer_start() assumptions Can you replace comments with

Re: QUESTION: mmu.gva_to_gpa versus nested_mmu.gva_to_gpa

2015-12-30 Thread Paolo Bonzini
On 29/12/2015 17:37, David Matlack wrote: >> > Yes, it's correct. s/it's/you're/ :) Paolo -- 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: Is kvm-kmod still supported?

2015-12-28 Thread Paolo Bonzini
On 28/12/2015 23:09, Estrada, Zachary J wrote: > I've been maintaining a fork for research and tinkering. Is the kvm-kmod > standalone module still supported or should I be using the full Linux > tree? I find kvm-kmod convenient to keep the source independent of the > kernel tree, but I also

Re: [PATCH v3 0/4] scsi: cleanup ioctl headers and provide UAPI versions

2015-12-28 Thread Paolo Bonzini
On 25/09/2015 11:27, Paolo Bonzini wrote: > This is v3 of the series to provide an "official" sg.h header (and > scsi_ioctl.h too, though it's basically obsolete) together with the other > userspace API definitions. The change from v2 to v3 is that defaults > for

Re: QUESTION: mmu.gva_to_gpa versus nested_mmu.gva_to_gpa

2015-12-28 Thread Paolo Bonzini
On 28/12/2015 23:23, David Matlack wrote: > I'm wondering if this comment in mmu.c:init_kvm_nested_mmu is correct (at > least in the context of Nested EPT): > > 4055 /* > 4056 * Note that arch.mmu.gva_to_gpa translates l2_gva to l1_gpa. The > 4057 * translation of

[GIT PULL] KVM fixes for v4.4-rc7

2015-12-22 Thread Paolo Bonzini
): KVM: x86: Reload pit counters for all channels when restoring state Christoffer Dall (1): KVM: arm/arm64: vgic: Fix kvm_vgic_map_is_active's dist check Haozhong Zhang (1): KVM: VMX: Fix host initiated access to guest MSR_TSC_AUX Paolo Bonzini (5): kvm: x86: move tracepoints

Re: [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit

2015-12-18 Thread Paolo Bonzini
On 18/12/2015 16:19, Pavel Fedin wrote: > As far as i understand this code, KVM_EXIT_HYPERV is called when one > of three MSRs are accessed. But, shouldn't we have implemented > instead something more generic, like KVM_EXIT_REG_IO, which would > work similar to KVM_EXIT_PIO or KVM_EXIT_MMIO,

Re: [PATCH] KVM: x86: MMU: Use clear_page() instead of init_shadow_page_table()

2015-12-18 Thread Paolo Bonzini
On 18/12/2015 10:54, Takuya Yoshikawa wrote: > Not just in order to clean up the code, but to make it faster by using > enhanced instructions: the initialization became 20-30% faster on our > testing machine. > > Signed-off-by: Takuya Yoshikawa Applied

Re: [PULL take #2] KVM/ARM fixes for v4.4-rc6

2015-12-18 Thread Paolo Bonzini
On 18/12/2015 15:05, Marc Zyngier wrote: > Hi Paolo, > > We have a one line fix for the VGIC this time around, fixing a patch > that went in -rc2. Oh well. Hopefully this is the last one for v4.4. > And yes, the right patch is following the pull-request this time... > > Please pull! Pulled,

Re: [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit

2015-12-18 Thread Paolo Bonzini
On 18/12/2015 19:10, Peter Hornyack wrote: > On brief inspection of Andrey's patch (I have not been following > closely) it looks like the kvm_hyperv_exit struct that's returned to > userspace contains more data (control, evt_page, and msg_page fields) > than simply the value of the MSR, so

Re: [RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability.

2015-12-18 Thread Paolo Bonzini
On 18/08/2015 20:46, Peter Hornyack wrote: > Define KVM_EXIT_MSR, a new exit reason for accesses to MSRs that kvm > does not handle. Define KVM_CAP_UNHANDLED_MSR_EXITS, a vm-wide > capability that guards the new exit reason and which can be enabled via > the KVM_ENABLE_CAP ioctl. > >

Re: [PATCH RESEND] kvm:x86:Fix error handling in the function kvm_write_wall_clock

2015-12-17 Thread Paolo Bonzini
On 17/12/2015 03:30, Nicholas Krause wrote: > This fixes error handling in the function kvm_write_wall_clock > by checking if any of the calls to kvm_write_guest have failed > inside this paricutlar function and if so print to the console > with pr_err that we are unable to write the data to the

Re: [PATCH 00/16] MIPS: KVM: Misc trivial cleanups

2015-12-17 Thread Paolo Bonzini
ction with other arch/mips/ code, I think it makes > sense for these to go via the MIPS tree. No objection. Acked-by: Paolo Bonzini <pbonz...@redhat.com> I think I'd use s8/u8 instead of int8_t/uint8_t in patch 15, but really that's just me. I'm fine either way, and that's really the onl

Re: [PATCH v2 0/3] KVM-UNIT-TESTS: Hyper-V SynIC timers test

2015-12-17 Thread Paolo Bonzini
dity of received expiration messages in appropriate >> ISR's. >> >> Changes v2: >> * Share generic Hyper-V tests code >> * Hyper-V SynIC timers test fixes to improve >> readability and output >> >> Signed-off-by: Andrey Smetanin <asmeta...@virtuozz

[PULL 17/45] target-i386/kvm: Hyper-V SynIC timers MSR's support

2015-12-17 Thread Paolo Bonzini
events. The state of Hyper-V SynIC timers are stored in corresponding MSR's. This patch seria implements such MSR's support and migration. Signed-off-by: Andrey Smetanin <asmeta...@virtuozzo.com> CC: Paolo Bonzini <pbonz...@redhat.com> CC: Richard Henderson <r...@twiddle.net> CC

[PULL 16/45] hw/misc: Hyper-V test device 'hyperv-testdev'

2015-12-17 Thread Paolo Bonzini
write operation data decoded into ctl code and parameters for Hyper-V test device. Signed-off-by: Andrey Smetanin <asmeta...@virtuozzo.com> Reviewed-by: Roman Kagan <rka...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> CC: Paolo Bonzini <pbonz...@redhat.co

[PULL 13/45] target-i386/kvm: Hyper-V SynIC MSR's support

2015-12-17 Thread Paolo Bonzini
ed-off-by: Denis V. Lunev <d...@openvz.org> CC: Paolo Bonzini <pbonz...@redhat.com> CC: Richard Henderson <r...@twiddle.net> CC: Eduardo Habkost <ehabk...@redhat.com> CC: "Andreas Färber" <afaer...@suse.de> CC: Marcelo Tosatti <mtosa...@redhat.com> CC: Roman

[PULL 15/45] target-i386/hyperv: Hyper-V SynIC SINT routing and vcpu exit

2015-12-17 Thread Paolo Bonzini
gt; Reviewed-by: Roman Kagan <rka...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> CC: Paolo Bonzini <pbonz...@redhat.com> CC: Richard Henderson <r...@twiddle.net> CC: Eduardo Habkost <ehabk...@redhat.com> CC: "Andreas Färber" <afaer...@suse.

[PULL 14/45] kvm: Hyper-V SynIC irq routing support

2015-12-17 Thread Paolo Bonzini
From: Andrey Smetanin <asmeta...@virtuozzo.com> Signed-off-by: Andrey Smetanin <asmeta...@virtuozzo.com> Reviewed-by: Roman Kagan <rka...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> CC: Paolo Bonzini <pbonz...@redhat.com> CC: Richard Henderson

Re: [PATCH 0/5] Threaded MSI interrupt for VFIO PCI device

2015-12-16 Thread Paolo Bonzini
Alex, can you take a look at the extension to the irq bypass interface in patch 2? I'm not sure I understand what is the case where you have multiple consumers for the same token. Paolo On 03/12/2015 19:22, Yunhong Jiang wrote: > When assigning a VFIO device to a KVM guest with low latency

Re: [GIT PULL 0/4] KVM: s390 features and fixes for 4.5 (kvm/next)

2015-12-16 Thread Paolo Bonzini
On 15/12/2015 20:23, Christian Borntraeger wrote: > Paolo, > > here is the 2nd part of the s390 queue for 4.5 > > The following changes since commit 460146348518a1c4e810d01baf81847f8c6a1c73: > > Merge tag 'kvm-s390-next-4.5-1' of >

Re: KVM with PCI forwarding really slow after 4.1

2015-12-16 Thread Paolo Bonzini
On 16/12/2015 18:55, Michael Büsch wrote: >>> On 01/12/2015 18:09, Michael Büsch wrote: > I use "-device pci-assign,host=00:1a.0" to forward a USB > host chip to a Win7 32 bit inside of qemu/kvm. That used to > work pretty well, but it broke horribly somewhere after > 4.1. With

Re: [Question] Switching VCPU CPL from the hypervisor ?

2015-12-16 Thread Paolo Bonzini
On 15/12/2015 18:02, Hebbal Yacine wrote: > What I want to do is: when a controlled process is in user mode, i > change its cpl to 0, force it to execute a code that is injected in the > VM, set back its cpl to 3 and let it run like if nothing happened Could you inject an SMI and place your

Re: [PATCH v1] kvm/x86: Remove Hyper-V SynIC timer stopping

2015-12-16 Thread Paolo Bonzini
On 14/12/2015 18:01, Andrey Smetanin wrote: > hostguest > start periodic stimer > start periodic timer > timer expires after 15ms > send expiration message into guest > restart periodic timer > doing something > timer expires

Re: [PATCH 0/5] Threaded MSI interrupt for VFIO PCI device

2015-12-16 Thread Paolo Bonzini
On 16/12/2015 20:15, Alex Williamson wrote: > The consumers would be, for instance, Intel PI + the threaded handler > added in this series. These run independently, the PI bypass simply > makes the interrupt disappear from the host when it catches it, but if > the vCPU isn't running in the

Re: [PATCH 0/5] target-i386: kvm: Increase MSR entry array limits, check for array overrun

2015-12-16 Thread Paolo Bonzini
o 236 MSRs[1]. > > This series changes the code to allocate a buffer once per VCPU, > increase buffer size to 4096 bytes (that can hold up to 255 MSR > entries), and check array limits before appending new entries. Thanks, it's a good improvement. Reviewed-by: Paolo Bonzini <pbonz..

Re: [PATCH kvm-unit-tests 1/4] lib: add setjmp header and x86 implementation

2015-12-15 Thread Paolo Bonzini
On 15/12/2015 17:43, Andrew Jones wrote: > How about making this a "real" test, i.e. > > report("longjmp", i == 10); > return report_summary(); > > I have patches that allow adding timeouts to tests, that I've been > thinking about posting upstream. With those we could add a short > timeout to

Re: [Question] Switching VCPU CPL from the hypervisor ?

2015-12-15 Thread Paolo Bonzini
On 15/12/2015 17:20, Yacine HEBBAL wrote: > Hi, > I working on an application in which I control an arbitrary process to > execute an a given code (injected code for example). I want the process I'm > controlling to execute my code with root privilege. Is it possible to > arbitrary switch vcpu

Re: kvmclock doesn't work, help?

2015-12-15 Thread Paolo Bonzini
On 14/12/2015 23:31, Andy Lutomirski wrote: > > RAW TSC NTP corrected TSC > > t0 10 10 > > t1 20 19.99 > > t2 30 29.98 > > t3 40 39.97 > > t4 50

Re: [PATCH kvm-unit-tests 0/6] Improve the output of test runners

2015-12-15 Thread Paolo Bonzini
On 14/12/2015 22:24, Radim Krčmář wrote: > This series is a mix of patches that change the output of run_tests.sh > and x86-run. The output of ./run_tests.sh now looks like this: I like the idea, thanks! I agree with Andrew about pretty much everything, except that I like having the summary

[PATCH kvm-unit-tests 1/4] lib: add setjmp header and x86 implementation

2015-12-15 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- config/config-i386.mak | 2 ++ config/config-x86-common.mak | 4 +++- config/config-x86_64.mak | 2 ++ lib/setjmp.h | 12 lib/x86/setjmp32.S | 25 + lib/x86/se

[PATCH kvm-unit-tests 2/4] x86: replace set_exception_return with longjmp-based implementation

2015-12-15 Thread Paolo Bonzini
---setjmp. Now that libcflat includes an implementation of setjmp, replace set_exception_return with a wrapper that takes care of restoring the processor flags as well. Reported-by: David Matlack <dmatl...@google.com> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- lib/x86

[PATCH kvm-unit-tests 4/4] x86: apic: cleanup

2015-12-15 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- x86/apic.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/x86/apic.c b/x86/apic.c index de19724..dfaea35 100644 --- a/x86/apic.c +++ b/x86/apic.c @@ -66,7 +66,7 @@ stati

[PATCH kvm-unit-tests 0/3] use setjmp/longjmp to catch exceptions

2015-12-15 Thread Paolo Bonzini
This is an attempt to fix David's reported problem with set_exception_return and make it more robust. Patch 1 introduces setjmp; patches 2 and 3 replace test_for_exception and set_exception_return with setjmp/longjmp. Patch 4 provides further cleanups. Paolo Paolo Bonzini (4): lib: add

[PATCH kvm-unit-tests 3/4] x86: remove test_for_exception

2015-12-15 Thread Paolo Bonzini
Test functions know whether an exception was generated simply by checking the last value returned by set_exception_jmpbuf. The exception number is passed to set_exception_jmpbuf so that it can set up the exception handler. Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- lib/x86/

Re: [PATCH] target-i386: check vcpu features before accessing MSR_TSC_AUX

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 12:07, Haozhong Zhang wrote: > This patch fix a bug that prevents VM rebooting on recent versions of > KVM (from commit 9dbe6cf). > > kvm_get_msrs() is called to save guest MSR_TSC_AUX and other MSRs across > rebooting. It only checks whether KVM exposes MSR_TSC_AUX to userspace.

Re: [PATCH v1] kvm/x86: Remove Hyper-V SynIC timer stopping

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 16:33, Andrey Smetanin wrote: > It's possible that guest send us Hyper-V EOM at the middle > of Hyper-V SynIC timer running, so we start processing of Hyper-V > SynIC timers in vcpu context and stop the Hyper-V SynIC timer > uncoditionally and lose time expiration which Windows

Re: [PATCH] KVM: MTRR: fix fixed MTRR segment look up

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 15:39, Alexis D...t wrote: > It fixes the slow-down of VM running with pci-passthrough, since some MTRR > range changed from MTRR_TYPE_WRBACK to MTRR_TYPE_UNCACHABLE. > > Fixes: fa61213746a ("KVM: MTRR: simplify kvm_mtrr_get_guest_memory_type") > Bugzilla:

Re: [PATCH] KVM: MTRR: fix fixed MTRR segment look up

2015-12-14 Thread Paolo Bonzini
Paolo > 2015-12-14 16:36 GMT+01:00 Paolo Bonzini <pbonz...@redhat.com>: >> > >> > >> > On 14/12/2015 15:39, Alexis D...t wrote: >>> >> It fixes the slow-down of VM running with pci-passthrough, since some >>> >> MTRR >>> &g

Re: kvmclock doesn't work, help?

2015-12-14 Thread Paolo Bonzini
On 11/12/2015 22:57, Andy Lutomirski wrote: > I'm still not seeing the issue. > > The formula is: > > (((rdtsc - pvti->tsc_timestamp) * pvti->tsc_to_system_mul) >> > pvti->tsc_shift) + pvti->system_time > > Obviously, if you reset pvti->tsc_timestamp to the current tsc value > after

Re: [PATCH] target-i386: check vcpu features before accessing MSR_TSC_AUX

2015-12-14 Thread Paolo Bonzini
On 14/12/2015 14:54, Haozhong Zhang wrote: >> > That commit is not in any released kernel. > Right, it's currently only in kvm next. But I assume it would finally come > into a released kernel. Yes, but until it is, it's easier (and better) to fix KVM instead of QEMU. > > It's better if we

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-11 Thread Paolo Bonzini
On 11/12/2015 11:22, Borislav Petkov wrote: > On Thu, Dec 10, 2015 at 07:15:19PM +0100, Paolo Bonzini wrote: >> Yeah, wait_lapic_expire also have to be moved before __kvm_guest_enter. > > Yeah, v2 doesn't splat on the Intel box anymore but the AMD box still > has, and it is a

Re: [GIT PULL] Please pull my kvm-ppc-fixes branch

2015-12-11 Thread Paolo Bonzini
On 10/12/2015 04:12, Paul Mackerras wrote: > git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git > kvm-ppc-fixes Pulled, thanks. Paolo -- 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

Re: [GIT PULL] Please pull my kvm-ppc-fixes branch

2015-12-11 Thread Paolo Bonzini
On 10/12/2015 04:12, Paul Mackerras wrote: > git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git > kvm-ppc-fixes Pulled, thanks. Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-11 Thread Paolo Bonzini
On 11/12/2015 12:41, Borislav Petkov wrote: > On Fri, Dec 11, 2015 at 11:41:30AM +0100, Paolo Bonzini wrote: >> It would be a kvm hypervisor page, not a kvm guest page, hence unrelated >> to the zapping thing. > > Ah right, guest pages should be userspace add

Re: [PATCH 01/11] qapi: Rename qjson.h to qobject-json.h

2015-12-11 Thread Paolo Bonzini
(qobject_type(obj) == QTYPE_QSTRING); > - > + > str = qobject_to_qstring(obj); > g_assert(strcmp(qstring_get_str(str), test_cases[i].decoded) == 0); > > @@ -106,7 +106,7 @@ static void simple_string(void) > g_assert(strcmp(qstring_get_str(str), test_c

Re: [PATCH 2/5] x86, vdso, pvclock: Simplify and speed up the vdso pvclock reader

2015-12-11 Thread Paolo Bonzini
On 11/12/2015 08:52, Ingo Molnar wrote: > > * Paolo Bonzini <pbonz...@redhat.com> wrote: > >> >> >> On 10/12/2015 00:12, Andy Lutomirski wrote: >>> From: Andy Lutomirski <l...@amacapital.net> >>> >>> The pvclock vdso code wa

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 19:09, Borislav Petkov wrote: > On Thu, Dec 10, 2015 at 06:38:57PM +0100, Paolo Bonzini wrote: >> Invoking tracepoints within kvm_guest_enter/kvm_guest_exit causes a >> lockdep splat. >> >> Cc: sta...@vger.kernel.org >> Reported-by: Borislav Petk

Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Paolo Bonzini
> Paolo Bonzini <pbonz...@redhat.com> writes: > > On 10/12/2015 18:58, Bandan Das wrote: > >>> > Allowing userspace to stop the guest with an emulation failure is a > >> This one I don't :) Userspace started the guest after all, there are other > >

Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Paolo Bonzini
On 09/12/2015 23:18, Bandan Das wrote: > Commit a2b9e6c1a35afcc09: > > KVM: x86: Don't report guest userspace emulation error to userspace > > Commit fc3a9157d314 ("KVM: X86: Don't report L2 emulation failures to > user-space") disabled the reporting of L2 (nested guest)

Re: [PATCH 3/5] x86/vdso: Get pvclock data from the vvar VMA instead of the fixmap

2015-12-10 Thread Paolo Bonzini
@@ -22,6 +22,7 @@ struct vdso_image { > > long sym_vvar_page; > long sym_hpet_page; > + long sym_pvclock_page; > long sym_VDSO32_NOTE_MASK; > long sym___kernel_sigreturn; > long sym___kernel_rt_sigreturn; > diff --git a/arch/x86/kernel/kvmclock.c b/a

Re: [PATCH 5/5] x86/vdso: Enable vdso pvclock access on all vdso variants

2015-12-10 Thread Paolo Bonzini
: "=a" (ret) > - : "0" (__NR_clock_gettime), "g" (clock), "c" (ts) > - : "memory", "edx"); > - return ret; > -} > - > -notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone

Re: [PATCH 4/5] x86/vdso: Remove pvclock fixmap machinery

2015-12-10 Thread Paolo Bonzini
> - > -int __init pvclock_init_vsyscall(struct pvclock_vsyscall_time_info *i, > - int size) > -{ > - int idx; > - > - WARN_ON (size != PVCLOCK_VSYSCALL_NR_PAGES*PAGE_SIZE); > - > - for (idx = 0; idx <= (PVCLOCK_FIXMAP_END

Re: [PATCH 2/5] x86, vdso, pvclock: Simplify and speed up the vdso pvclock reader

2015-12-10 Thread Paolo Bonzini
smp_rmb(); > + } while (unlikely((version & 1) || version != pvti->version)); > + > + delta = tsc - pvti_tsc; > + ret = pvti_system_time + > + pvclock_scale_delta(delta, pvti_tsc_to_system_mul, > + pvti_tsc_shift); > > /* refer to tsc.c read_tsc() comment for rationale */ > last = gtod->cycle_last; > Reviewed-by: Paolo Bonzini <pbonz...@redhat.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: freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 17:44, Borislav Petkov wrote: > Yap, > > this is clearly a qemu/kvm issue. Lemme remove ext4 folks from CC. So > here's what happens: > > I boot a kvm guest, connect to its monitor (qemu is started with > "-monitor pty") and on the monitor I issue a couple of times the "nmi" >

Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 18:58, Bandan Das wrote: >> > Allowing userspace to stop the guest with an emulation failure is a > This one I don't :) Userspace started the guest after all, there are other > ways for it to kill the guest if it wanted to. I mean allowing guest userspace to stop the guest. Paolo

Re: freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 17:53, Borislav Petkov wrote: > Just did, there it splats even when booting the guest, without even > injecting NMIs: > > [ 113.233992] === > [ 113.238192] [ INFO: suspicious RCU usage. ] > [ 113.242393] 4.4.0-rc4+ #1 Not tainted > [ 113.246056]

[PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-10 Thread Paolo Bonzini
Invoking tracepoints within kvm_guest_enter/kvm_guest_exit causes a lockdep splat. Cc: sta...@vger.kernel.org Reported-by: Borislav Petkov <b...@alien8.de> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kvm/svm.c | 4 ++-- arch/x86/kvm/vmx.c | 3 ++- arch/x86/kvm/x86

[PATCH v2] kvm: x86: move tracepoints outside extended quiescent state

2015-12-10 Thread Paolo Bonzini
Invoking tracepoints within kvm_guest_enter/kvm_guest_exit causes a lockdep splat. Cc: sta...@vger.kernel.org Reported-by: Borislav Petkov <b...@alien8.de> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kvm/svm.c | 4 ++-- arch/x86/kvm/vmx.c | 3 ++- arch/x86/k

Re: [PATCH kvm-unit-tests] x86: always inline functions called after set_exception_return

2015-12-09 Thread Paolo Bonzini
On 07/12/2015 21:36, David Matlack wrote: > set_exception_return forces exceptions handlers to return to a specific > address instead of returning to the instruction address pushed by the > CPU at the time of the exception. The unit tests apic.c and vmx.c use > this functionality to recover from

Re: kvmclock doesn't work, help?

2015-12-09 Thread Paolo Bonzini
On 09/12/2015 23:27, Andy Lutomirski wrote: > On Wed, Dec 9, 2015 at 2:12 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: >> On 09/12/2015 22:49, Andy Lutomirski wrote: >>> On Wed, Dec 9, 2015 at 1:16 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: >>&g

Re: kvmclock doesn't work, help?

2015-12-09 Thread Paolo Bonzini
On 09/12/2015 22:10, Andy Lutomirski wrote: > Can we please stop making kvmclock more complex? It's a beast right > now, and not in a good way. It's far too tangled with the vclock > machinery on both the host and guest sides, the pvclock stuff is not > well thought out (even in principle in

Re: kvmclock doesn't work, help?

2015-12-09 Thread Paolo Bonzini
On 09/12/2015 22:49, Andy Lutomirski wrote: > On Wed, Dec 9, 2015 at 1:16 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: >> >> >> On 09/12/2015 22:10, Andy Lutomirski wrote: >>> Can we please stop making kvmclock more complex? It's a beast right >>&

Re: [PATCH] kvm: Dump guest rIP when the guest tried something unsupported

2015-12-04 Thread Paolo Bonzini
On 20/11/2015 19:52, Borislav Petkov wrote: > From: Borislav Petkov > > It looks like this in action: > > kvm [5197]: vcpu0, guest rIP: 0x810187ba unhandled rdmsr: 0xc001102 > > and helps to pinpoint quickly where in the guest we did the unsupported > thing. > >

Re: [PATCH v2 1/9] drivers/hv: replace enum hv_message_type by u32

2015-12-04 Thread Paolo Bonzini
On 04/12/2015 15:33, Denis V. Lunev wrote: > On 12/02/2015 03:22 PM, Paolo Bonzini wrote: >> >> On 30/11/2015 17:22, Andrey Smetanin wrote: >>> enum hv_message_type inside struct hv_message, hv_post_message >>> is not size portable. Replace enum by u32. >>

[GIT PULL] KVM fixes for 4.4-rc4

2015-12-04 Thread Paolo Bonzini
between the sp and xzr register - A fix for the cache flush fix that went in -rc3 Ard Biesheuvel (1): ARM/arm64: KVM: correct PTE uncachedness check Paolo Bonzini (1): Merge tag 'kvm-arm-for-v4.4-rc4' of git

Re: [PATCH v2 1/9] drivers/hv: replace enum hv_message_type by u32

2015-12-04 Thread Paolo Bonzini
On 04/12/2015 17:55, Denis V. Lunev wrote: > On 12/04/2015 05:41 PM, Paolo Bonzini wrote: >> >> On 04/12/2015 15:33, Denis V. Lunev wrote: >>> On 12/02/2015 03:22 PM, Paolo Bonzini wrote: >>>> On 30/11/2015 17:22, Andrey Smetanin wrote: >>>>

Re: [GIT PULL] KVM/ARM fixes for 4.4-rc4

2015-12-04 Thread Paolo Bonzini
On 04/12/2015 18:17, Marc Zyngier wrote: > Hi Paolo, > > This pull request contains a number of fixes for 4.4-rc4 (or -rc5 if > we already missed the boat). > > The first part is a very nice catch from Pavel, who noticed that we > were not dealing very well (if at all) with the aliasing

Re: [PATCH v2 1/9] drivers/hv: replace enum hv_message_type by u32

2015-12-04 Thread Paolo Bonzini
> >> we are now comparing enum with enum which are the same type. > >> With the change you are proposing we will compare enum > >> with u32 which are different. > > This is only an issue in C++. > > > >> Original suggestion from Andrey was safe in this respect. > > Sure, but it makes code less

Re: [PATCH] KVM: VMX: fix the writing POSTED_INTR_NV

2015-12-03 Thread Paolo Bonzini
On 03/12/2015 06:29, roy.qing...@gmail.com wrote: > From: Li RongQing > > POSTED_INTR_NV is 16bit, should not use 64bit write function > > [ 5311.676074] vmwrite error: reg 3 value 0 (err 12) > [ 5311.680001] CPU: 49 PID: 4240 Comm: qemu-system-i38 Tainted: G I >

[PATCH] KVM: VMX: fix read/write sizes of VMCS fields

2015-12-03 Thread Paolo Bonzini
In theory this should have broken EPT on 32-bit kernels (due to reading the high part of natural-width field GUEST_CR3). Not sure if no one noticed or the processor behaves differently from the documentation. Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kvm/vmx

[PATCH] KVM: VMX: fix read/write sizes of VMCS fields in dump_vmcs

2015-12-03 Thread Paolo Bonzini
This was not printing the high parts of several 64-bit fields on 32-bit kernels. Separate from the previous one to make the patches easier to review. Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kvm/vmx.c | 39 --- 1 file chang

[PATCH] KVM: vmx: detect mismatched size in VMCS read/write

2015-12-03 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- I am sending this as RFC because the error messages it produces are very ugly. Because of inlining, the original line is lost. The alternative is to change vmcs_read/write/checkXX into macros, but th

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Paolo Bonzini
On 02/12/2015 12:06, Christian Borntraeger wrote: > + memcpy(>run->s.regs.gprs[14], >arch.sie_block->gg14, 16); This is preexisting but... boy it's ugly. :) Do you gain much over the simpler vcpu->run->s.regs.gprs[14] = vcpu->arch.sie_block->gg14;

Re: [PATCH v2 1/9] drivers/hv: replace enum hv_message_type by u32

2015-12-02 Thread Paolo Bonzini
On 30/11/2015 17:22, Andrey Smetanin wrote: > enum hv_message_type inside struct hv_message, hv_post_message > is not size portable. Replace enum by u32. It's only non-portable inside structs. Okay to apply just these: @@ -172,7 +174,7 @@ union hv_message_flags { /* Define synthetic

Re: [GIT PULL 00/23] KVM: s390 features, kvm_get_vcpu_by_id and stat for 4.5

2015-12-02 Thread Paolo Bonzini
On 02/12/2015 12:06, Christian Borntraeger wrote: > Paolo, > > here is the first s390 pull request for 4.5. It also contains the > remaining vcpu lookup changes and an improved cleanup of the kvm_stat > exit path. > I have deferred the kvm_stat per VM patches. > > The s390 changes are: > -

Re: [GIT PULL 04/23] KVM: s390: rewrite vcpu_post_run and drop out early

2015-12-02 Thread Paolo Bonzini
On 02/12/2015 14:04, Christian Borntraeger wrote: >> > Do you gain much over the simpler >> > >> >vcpu->run->s.regs.gprs[14] = vcpu->arch.sie_block->gg14; >> >vcpu->run->s.regs.gprs[15] = vcpu->arch.sie_block->gg15; >> > > Its just legacy code from the old days. > There is a

[PATCH kvm-unit-tests] x86: use asm volatile for flags and segment register read/writes

2015-12-02 Thread Paolo Bonzini
: u16 ss = read_ss(); // check for null segment load *mem = 0; asm volatile("mov %0, %%ss" : : "m"(*mem)); report("mov null, %%ss", read_ss() == 0); This caused a spurious failure of the test. Reported-by: Lucas Meneguel Rodrigues <l...@s

Re: gva_to_gpa function internals

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 19:30, Yacine HEBBAL wrote: > Hi all, > I'm trying to build some tools on top of kvm in order to debug, monitor and > reverse engineer the guest OS (ubuntu 12.04, 32 bits) > One of my tools walks through (and prints) the guest paging data structures > as following: cr3 -> pdpte ->

Re: [Qemu-devel] [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 18:20, Richard Henderson wrote: >> >> X86XSaveArea will be used only when loading/saving state using >> xsave, not for executing regular instructions. > > ... like the regular instruction xsave? > > https://patchwork.ozlabs.org/patch/493318/ Right, but that's a helper anyway.

Re: KVM with PCI forwarding really slow after 4.1

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 18:09, Michael Büsch wrote: > Hi, > > I use "-device pci-assign,host=00:1a.0" to forward a USB host chip > to a Win7 32 bit inside of qemu/kvm. That used to work pretty well, > but it broke horribly somewhere after 4.1. With recent kernels the > virtual machine boots, but is

Re: [PATCH 00/11] KVM: x86: track guest page access

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 19:26, Xiao Guangrong wrote: > This patchset introduces the feature which allows us to track page > access in guest. Currently, only write access tracking is implemented > in this version. > > Four APIs are introduces: > - kvm_page_track_add_page(kvm, gfn, mode), single guest page

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 18:34, Eduardo Habkost wrote: > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > uses offset macros and bit manipulation to access the xsave area. > This series changes both to use C structs for

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 18:34, Eduardo Habkost wrote: > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > uses offset macros and bit manipulation to access the xsave area. > This series changes both to use C structs for

Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 16:25, Eduardo Habkost wrote: > > I think it's easier to use small guests (i.e. kvm-unit-tests) to test > > this code. > > I agree it's easier, but how likely it is to catch bugs in the > save/load code? If the code corrupts a register, we need to > trigger a save/load cycle at the

Re: [PATCH v5 2/2] KVM: Make KVM_CAP_IRQFD dependent on KVM_CAP_IRQCHIP

2015-12-01 Thread Paolo Bonzini
On 30/11/2015 15:38, Cornelia Huck wrote: > It obviously > requires an irqchip; but if you need some configuration/enablement > beforehand, you'll get different values depending on when you retrieve > the cap. So does KVM_CAP_IRQFD mean "irqfds are available in principle" > or "everything has

Re: [PATCH 00/11] KVM: x86: track guest page access

2015-12-01 Thread Paolo Bonzini
On 01/12/2015 16:02, Andrea Arcangeli wrote: > > Applying your technique to non-leaf shadow pages actually makes this > > series quite interesting. :) Shadow paging is still in use for nested > > EPT, so it's always a good idea to speed it up. > > I don't have the full picture of how

Re: [for-2.6 PATCH 1/3] target-i386: Define structs for layout of xsave area

2015-11-30 Thread Paolo Bonzini
On 28/11/2015 20:56, Eduardo Habkost wrote: > +/* Ext. save area 2: AVX State */ > +typedef struct XSaveAVX { > +uint64_t ymmh[16][2]; > +} XSaveAVX; > + Because this is always little endian, I would write it as uint8_t[16][16]. > +/* Ext. save area 6: ZMM_Hi256 */ > +typedef struct

Re: [for-2.6 PATCH 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes

2015-11-30 Thread Paolo Bonzini
On 28/11/2015 20:56, Eduardo Habkost wrote: > I still need to figure out a way to write unit tests for the new > code. Maybe I will just copy and paste the new and old functions, > and test them locally (checking if they give the same results > when translating blobs of random bytes). Aren't

Re: [PATCH v1 0/5] KVM-UNIT-TESTS: Hyper-V SynIC timers test

2015-11-27 Thread Paolo Bonzini
> > Signed-off-by: Andrey Smetanin <asmeta...@virtuozzo.com> > Reviewed-by: Roman Kagan <rka...@virtuozzo.com> > CC: Paolo Bonzini <pbonz...@redhat.com> > CC: Marcelo Tosatti <mtosa...@redhat.com> > CC: Roman Kagan <rka...@virtuozzo.com> > CC: Denis

Re: [PATCH v1 5/5] x86: Hyper-V SynIC timers test

2015-11-27 Thread Paolo Bonzini
On 27/11/2015 12:30, Andrey Smetanin wrote: >>> >>> + >>> +static void stimer_test_cleanup(void *ctx) >>> +{ >>> +irq_enable(); >> >> Why enable again? > I'll remove it. I guess you can remove the one in stimer_test_prepare too. If the interrupts are disabled you don't get the IPI either,

Re: [PATCH v1 5/5] x86: Hyper-V SynIC timers test

2015-11-27 Thread Paolo Bonzini
ot timers (with period=1ms) and checks > validity of received expiration messages in appropriate > ISR's. > > Signed-off-by: Andrey Smetanin <asmeta...@virtuozzo.com> > Reviewed-by: Roman Kagan <rka...@virtuozzo.com> > CC: Paolo Bonzini <pbonz...@redhat.com> > CC: M

Re: [PATCH v1 2/7] drivers/hv: Move struct hv_message into UAPI Hyper-V x86 header

2015-11-27 Thread Paolo Bonzini
zo.com> > Reviewed-by: Roman Kagan <rka...@virtuozzo.com> > CC: Gleb Natapov <g...@kernel.org> > CC: Paolo Bonzini <pbonz...@redhat.com> > CC: "K. Y. Srinivasan" <k...@microsoft.com> > CC: Haiyang Zhang <haiya...@microsoft.com> > CC: Vital

  1   2   3   4   5   6   7   8   9   10   >