Re: [PATCH v1 7/7] kvm/x86: Hyper-V SynIC timers

2015-11-27 Thread Paolo Bonzini
On 27/11/2015 09:12, Roman Kagan wrote: >> > + n = div64_u64(time_now - stimer->exp_time, stimer->count) + 1; >> > + stimer->exp_time += n * stimer->count; > This is actually just a reminder calculation so I'd rather do it > directly with div64_u64_rem(). It took me a while to understand why

Re: Is KVM support single step execution

2015-11-26 Thread Paolo Bonzini
On 26/11/2015 06:46, Wu, Feng wrote: > Hi Paolo, > > Do you know whether KVM supports single step execution? If it is, > could you please give me some information about it. Really appreciate > it! Yes, it does. See KVM_SET_GUEST_DEBUG documentation in Documentation/virtual/kvm/api.txt. Paolo

Re: [PATCH V4 0/3] KVM: x86: MMU: Clean up x86's mmu code for future work - part2

2015-11-26 Thread Paolo Bonzini
On 26/11/2015 13:13, Takuya Yoshikawa wrote: > Guests worked normally in shadow paging mode (ept=0) on my test machine. > > Please check if the first two patches reflect what you meant correctly. Yes, they do! Thanks, Paolo > Takuya Yoshikawa (3): > [1] KVM: x86: MMU: Move parent_pte

Re: [PATCH v1 6/7] kvm/x86: Hyper-V SynIC message slot pending clearing at SINT ack

2015-11-26 Thread Paolo Bonzini
On 26/11/2015 10:06, Andrey Smetanin wrote: > > > On 11/25/2015 08:14 PM, Paolo Bonzini wrote: >> >> >> On 25/11/2015 17:55, Andrey Smetanin wrote: >>>> >>>> +gpa = synic->msg_page & PAGE_MASK; >>>> +page = kvm_vcpu_

Re: [PATCH v1 6/7] kvm/x86: Hyper-V SynIC message slot pending clearing at SINT ack

2015-11-26 Thread Paolo Bonzini
On 26/11/2015 16:53, Andrey Smetanin wrote: >> Then the patches look good, I think. With a testcase I can try them out >> and hopefully merge them for Linux 4.5 / QEMU 2.6. > > Thank you! > > We already have a working Hyper-V SynIC timers kvm-unit-tests test case. > We are going to send

Re: [PATCH 09/10] KVM: x86: MMU: Move parent_pte handling from kvm_mmu_get_page() to link_shadow_page()

2015-11-25 Thread Paolo Bonzini
On 20/11/2015 09:57, Xiao Guangrong wrote: > > > You can move this patch to the front of > [PATCH 08/10] KVM: x86: MMU: Use for_each_rmap_spte macro instead of > pte_list_walk() > > By moving kvm_mmu_mark_parents_unsync() to the behind of mmu_spte_set() > (then the parent > spte is present

[GIT PULL] KVM fixes for 4.4-rc3

2015-11-25 Thread Paolo Bonzini
is split Paolo Bonzini (2): Merge tag 'kvm-s390-master-4.4-1' of git://git.kernel.org/.../kvms390/linux into kvm-master Merge tag 'kvm-arm-for-v4.4-rc3' of git://git.kernel.org/.../kvmarm/kvmarm into kvm-master arch/arm/kvm/arm.c | 7 + arch/arm/kvm/mmu.c

Re: [PATCH 1/3] target-i386: kvm: Abort if MCE bank count is not supported by host

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 18:26, Eduardo Habkost wrote: >> > Yoda conditions? >> > >> > if (banks < MCE_BANKS_DEF) { >> > error_report("kvm: Unsupported MCE bank count (QEMU = %d, KVM >> > = %d)", >> > MCE_BANKS_DEF, banks); > This was on purpose, because

Re: [PATCH 3/3] target-i386: kvm: Print warning when clearing mcg_cap bits

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 18:29, Eduardo Habkost wrote: >>> > > >>> > > +unsupported_caps = env->mcg_cap & ~(mcg_cap | >>> > > MCG_CAP_BANKS_MASK); >>> > > +if (unsupported_caps) { >>> > > +error_report("warning: Unsupported MCG_CAP bits: 0x%" >>> > > PRIx64 "\n", >> > >> >

Re: [PATCH 3/3] target-i386: kvm: Print warning when clearing mcg_cap bits

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 16:49, Eduardo Habkost wrote: > Instead of silently clearing mcg_cap bits when the host doesn't > support them, print a warning when doing that. > > Signed-off-by: Eduardo Habkost > --- > target-i386/kvm.c | 8 +++- > 1 file changed, 7 insertions(+), 1

Re: [PATCH v1 6/7] kvm/x86: Hyper-V SynIC message slot pending clearing at SINT ack

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 16:20, Andrey Smetanin wrote: > +static void synic_clear_sint_msg_pending(struct kvm_vcpu_hv_synic *synic, > + u32 sint) > +{ > + struct kvm_vcpu *vcpu = synic_to_vcpu(synic); > + struct page *page; > + gpa_t gpa; > + struct

Re: [PATCH 08/10] KVM: x86: MMU: Use for_each_rmap_spte macro instead of pte_list_walk()

2015-11-25 Thread Paolo Bonzini
On 20/11/2015 09:47, Takuya Yoshikawa wrote: > kvm_mmu_mark_parents_unsync() alone uses pte_list_walk(), witch does > nearly the same as the for_each_rmap_spte macro. The only difference > is that is_shadow_present_pte() checks cannot be placed there because > kvm_mmu_mark_parents_unsync() can

Re: [PATCH 3/3] target-i386: kvm: Print warning when clearing mcg_cap bits

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 18:21, Borislav Petkov wrote: >> Instead of silently clearing mcg_cap bits when the host doesn't >> > support them, print a warning when doing that. > Why the host? Why would we want there to be any relation between the MCA > capabilities of the host and what qemu is emulating? He

Re: [PATCH 1/3] target-i386: kvm: Abort if MCE bank count is not supported by host

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 16:49, Eduardo Habkost wrote: > Instead of silently changing the number of banks in mcg_cap based > on kvm_get_mce_cap_supported(), abort initialization if the host > doesn't support MCE_BANKS_DEF banks. > > Note that MCE_BANKS_DEF was always 10 since it was introduced in > QEMU,

Re: [PATCH v1 6/7] kvm/x86: Hyper-V SynIC message slot pending clearing at SINT ack

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 17:55, Andrey Smetanin wrote: >> >> +gpa = synic->msg_page & PAGE_MASK; >> +page = kvm_vcpu_gfn_to_page(vcpu, gpa >> PAGE_SHIFT); >> +if (is_error_page(page)) { >> +vcpu_err(vcpu, "Hyper-V SynIC can't get msg page, gpa 0x%llx\n", >> + gpa); >> +

Re: [PATCH] KVM: nVMX: remove incorrect vpid check in nested invvpid emulation

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 16:45, Bandan Das wrote: > Haozhong Zhang writes: > >> This patch removes the vpid check when emulating nested invvpid >> instruction of type all-contexts invalidation. The existing code is >> incorrect because: >> (1) According to Intel SDM Vol 3,

Re: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 02:58, Wu, Feng wrote: > Okay, let me try to understand this clearly: > - We will have a new KVM command line parameter to indicate whether > vector hashing is enabled. > - If it is not enabled, for PI, we can only support single destination lowest > priority interrupts, for

Re: [PATCH] KVM: x86: don't expose syscall/sysret to intel 32-bit guest

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 13:45, Wanpeng Li wrote: > 2015-11-19 19:05 GMT+08:00 Paolo Bonzini <pbonz...@redhat.com>: >> >> 1) Clear F(SYSCALL) in kvm_update_cpuid, like you are doing here but >> only if F(LM) is already clear (in addition to the vendor being Intel). > >

Re: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 15:12, Radim Krcmár wrote: > I think it's ok to pick any algorithm we like. It's unlikely that > software would recognize and take advantage of the hardware algorithm > without adding a special treatment for KVM. > (I'd vote for the simple pick-first-APIC lowest priority algorithm

Re: [PULL 0/8] KVM/ARM Fixes for v4.4-rc3

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 18:35, Christoffer Dall wrote: > Hi Paolo, > > Here's a set of fixes for KVM/ARM for v4.4-rc3 based on v4.4-rc2, because the > errata fixes don't apply on v4.4-rc1. Let me know if you can pull this > anyhow. Sure, pulled. Paolo > Thanks, > -Christoffer > > The following

Re: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 15:35, Radim Krcmár wrote: > > Thanks for your guys' review. Yes, we can introduce a module option > > for it. According to Radim's comments above, we need use the > > same policy for PI and non-PI lowest-priority interrupts, so here is the > > question: for vector hashing, it is

Re: Trying to switch EPTP for execute-protecting guest pages

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 15:51, Estrada, Zachary J wrote: > 2) Got it. Let's say I want to work with a copy of the extended page > tables instead of the original, what would be the best way to do so? Why would you want that? It's difficult to give an answer without understanding what you're doing.

Re: Trying to switch EPTP for execute-protecting guest pages

2015-11-24 Thread Paolo Bonzini
On 23/11/2015 18:11, Estrada, Zachary J wrote: > I'm playing around with EPTs and kvm to track execution in the guest. > I've created a separate set of EPTs (and copied the last level entries > from the real tables, minus execute permissions) but I'm not getting > exits where I expect. I also

Re: Trying to switch EPTP for execute-protecting guest pages

2015-11-24 Thread Paolo Bonzini
On 24/11/2015 16:52, Estrada, Zachary J wrote: >> I'm not sure if this is your problem, but perhaps you want to record in >> the role whether the page comes from your version or the original? The >> role is like the hash key, if the role is the same you get the same PTE. > > This is extremely

Re: [PATCH] target-i386: Do not set MCG_SER_P by default

2015-11-23 Thread Paolo Bonzini
On 23/11/2015 14:22, Eduardo Habkost wrote: > > Software Error Recovery, i.e. SER, is purely an Intel feature and it > > shouldn't be set by default. Enable it only on Intel. > > What happens when SER is enabled on an AMD CPU? If it really > should't be enabled, why is KVM returning it on >

Re: [PATCH V3 00/10] KVM: x86: MMU: Clean up x86's mmu code for future work

2015-11-20 Thread Paolo Bonzini
On 20/11/2015 09:40, Takuya Yoshikawa wrote: > About patch 03: There was a comment on the usage of braces for a single line > else-if statement from Xiao. As I answered, checkpatch did not complain > about > this, and when the corresponding if block has multiple lines, some > developers

Re: [PATCH 0/4] Preview: vcpu lookup by id changes

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 09:37, Christian Borntraeger wrote: > > some more patches for review before I add them in my next pull request. > Can you review the common code changes and Ack/Nack? > > Alex, Paul, > can you review the power changes and Ack/Nack? > > As I want to have patch 2 in 4.4, I

Re: [PATCH 0/4] Preview: vcpu lookup by id changes

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 09:37, Christian Borntraeger wrote: > > some more patches for review before I add them in my next pull request. > Can you review the common code changes and Ack/Nack? > > Alex, Paul, > can you review the power changes and Ack/Nack? > > As I want to have patch 2 in 4.4, I

Re: [PATCH 0/4] Preview: vcpu lookup by id changes

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 10:51, Christian Borntraeger wrote: > > I can apply patch 1 and 2 now to kvm/master. By the time kvm/next forks > > from Linus's tree (sometime next week, since kvm/queue is already > > largish) they will be in. > > I have 2or 3 more patches for 4.4 and I will prepare a pull

Re: [PATCH 0/4] Preview: vcpu lookup by id changes

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 10:51, Christian Borntraeger wrote: > > I can apply patch 1 and 2 now to kvm/master. By the time kvm/next forks > > from Linus's tree (sometime next week, since kvm/queue is already > > largish) they will be in. > > I have 2or 3 more patches for 4.4 and I will prepare a pull

Re: [RFC PATCH 1/3] x86/cpu: Unify CPU family, model, stepping calculation

2015-11-19 Thread Paolo Bonzini
On 18/11/2015 19:50, Borislav Petkov wrote: > On Wed, Nov 18, 2015 at 12:35:24PM +0100, Paolo Bonzini wrote: >> Yes, exactly. I'm suggesting that the same applies to x86_vendor(). I >> also prefer x86_cpuid_* to x86_*_cpuid because, once you add two >> functions in the

Re: [Qemu-devel] [PATCH v3 1/3] target-i386: add pkeys support for cpuid handling

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 07:36, Han, Huaitong wrote: > I understand it has always been that QEMU considers the feature of > cpuid_7_0_ecx_feature_name as migratable. If the feature is > unmigratable, it will been added to unmigratable_flags. > > A series of patches do complete a full function, moving >

Re: [PATCH] KVM: x86: don't expose syscall/sysret to intel 32-bit guest

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 13:01, Wanpeng Li wrote: > > This is not correct. As far as I know, the SYSCALL bit is always > > present in CPUID, even if the machine is running in 32-bit mode; CPUID > > documentation (SDM Volume 2) explicitly documents bit 11 as "Bit 11: > > SYSCALL/SYSRET available in 64-bit

Re: [PATCH] KVM: x86: don't expose syscall/sysret to intel 32-bit guest

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 11:45, Wanpeng li wrote: > Intel cpu doesn't support syscall/sysret in non 64-bit mode which > is different from AMD. Expose syscall/sysret to intel 32-bit guest > just makes no sense and leads to #UD which will confuse the users. > > This patch disable expose syscall/sysret to

Re: [GIT PULL 0/5] KVM: s390: Fixes for 4.4

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 15:09, Christian Borntraeger wrote: > Paolo, > > The following changes since commit 8005c49d9aea74d382f474ce11afbbc7d7130bec: > > Linux 4.4-rc1 (2015-11-15 17:00:27 -0800) > > are available in the git repository at: > >

Re: [PATCH 1/4] KVM: Provide function for VCPU lookup by id

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 13:55, David Hildenbrand wrote: >> > >> > I'm pretty sure this will cause confusion in the future! >> > ==> Could you maybe name the new function something like >> > "kvm_lookup_vcpu_by_id" or "kvm_get_vcpu_by_id" instead? > Had that in a previous version but decided to name it

Re: [PATCH 1/4] KVM: Provide function for VCPU lookup by id

2015-11-19 Thread Paolo Bonzini
On 19/11/2015 13:55, David Hildenbrand wrote: >> > >> > I'm pretty sure this will cause confusion in the future! >> > ==> Could you maybe name the new function something like >> > "kvm_lookup_vcpu_by_id" or "kvm_get_vcpu_by_id" instead? > Had that in a previous version but decided to name it

Re: [PATCH v3 7/7] KVM, pkeys: disable PKU feature without ept

2015-11-18 Thread Paolo Bonzini
On 18/11/2015 06:44, Huaitong Han wrote: > This patch disables CPUID:PKU without ept, becase pkeys is not supported > with softmmu. Sure, but _what_ makes it impossible to support pkeys with shadow pages? Is it enough to add the pkey bits to the role (and then to kvm_get_mmu_page,

Re: [PATCH] KVM: powerpc: kvmppc_visible_gpa can be boolean

2015-11-18 Thread Paolo Bonzini
On 16/11/2015 04:10, Yaowei Bai wrote: > In another patch kvm_is_visible_gfn is maken return bool due to this > function only returns zero or one as its return value, let's also make > kvmppc_visible_gpa return bool to keep consistent. > > No functional change. > > Signed-off-by: Yaowei Bai

Re: [PATCH] KVM-async_pf: Delete an unnecessary check before the function call "kmem_cache_destroy"

2015-11-18 Thread Paolo Bonzini
On 15/11/2015 10:45, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 15 Nov 2015 10:40:36 +0100 > > The kmem_cache_destroy() function tests whether its argument is NULL > and then returns immediately. Thus the test around the call is not needed. > >

Re: [PATCH] KVM: powerpc: kvmppc_visible_gpa can be boolean

2015-11-18 Thread Paolo Bonzini
On 16/11/2015 04:10, Yaowei Bai wrote: > In another patch kvm_is_visible_gfn is maken return bool due to this > function only returns zero or one as its return value, let's also make > kvmppc_visible_gpa return bool to keep consistent. > > No functional change. > > Signed-off-by: Yaowei Bai

Re: [RFC PATCH 1/3] x86/cpu: Unify CPU family, model, stepping calculation

2015-11-18 Thread Paolo Bonzini
On 18/11/2015 12:28, Borislav Petkov wrote: >> On 14/11/2015 11:37, Borislav Petkov wrote: >>> > > vendor = x86_vendor(); >>> > > - family = x86_family(); >>> > > + family = x86_family_cpuid(); >> > >> > What about renaming x86_vendor() so that this looks like >> > >> > -

Re: [RFC PATCH 1/3] x86/cpu: Unify CPU family, model, stepping calculation

2015-11-18 Thread Paolo Bonzini
On 14/11/2015 11:37, Borislav Petkov wrote: > vendor = x86_vendor(); > - family = x86_family(); > + family = x86_family_cpuid(); What about renaming x86_vendor() so that this looks like - vendor = x86_vendor(); - family = x86_family(); + vendor =

Re: [PATCH v3 0/7] KVM, pkeys: add memory protection-key support

2015-11-18 Thread Paolo Bonzini
On 18/11/2015 06:43, Huaitong Han wrote: > Changes in v3: > *Add comments for patch that disable PKU feature without ept. > > Changes in v2: > *Add pku.c for kvm-unit-tests. > *Optimize permission_fault codes for patch4. > *Delete is_long_mode and PK for patch5. > *Squash cpuid and cr4 patches.

Re: [kvm-unit-test RFC] x86: Memory instructions test case

2015-11-18 Thread Paolo Bonzini
On 04/11/2015 22:21, Eduardo Habkost wrote: > Quickly hacked test case for memory instructions (clflush, mfence, > sfence, lfence, clflushopt, clwb, pcommit), that simply checks for #UD > exceptions. > > This was useful to test TCG handling of those instructions. > > The "fake clwb" part will

Re: [RFC PATCH 2/3] kvm: Add accessors for guest CPU's family, model, stepping

2015-11-18 Thread Paolo Bonzini
On 14/11/2015 11:37, Borislav Petkov wrote: > From: Borislav Petkov <b...@suse.de> > > Those give the family, model and stepping of the guest vcpu. > > Signed-off-by: Borislav Petkov <b...@suse.de> > Cc: Paolo Bonzini <pbonz...@redhat.com>

Re: [RFC PATCH 3/3] x86/cpu/amd, kvm: Satisfy guest kernel reads of IC_CFG MSR

2015-11-18 Thread Paolo Bonzini
msr_info->data = 0; > + > + if (family == 0x15 && > + (model >= 0x2 && model < 0x20)) > + msr_info->data = 0x1E; > + } > + break; > default: > return kvm_get_msr_common(vcpu, msr_info); > } > 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: [PATCH 07/10] KVM: x86: MMU: Encapsulate the type of rmap-chain head in a new struct

2015-11-18 Thread Paolo Bonzini
On 18/11/2015 04:21, Xiao Guangrong wrote: > > > On 11/12/2015 07:55 PM, Takuya Yoshikawa wrote: >> @@ -1720,7 +1724,7 @@ static struct kvm_mmu_page >> *kvm_mmu_alloc_page(struct kvm_vcpu *vcpu, >>* this feature. See the comments in kvm_zap_obsolete_pages(). >>*/ >>

Re: [Qemu-devel] [PATCH v3 0/3] target-i386: add memory protection-key support

2015-11-18 Thread Paolo Bonzini
On 18/11/2015 18:51, Eduardo Habkost wrote: > Is every CPU supporting PKU guaranteed to have > CPUID.(EAX=0DH,ECX=9):EBX = 0xa80? We asked Intel a while ago when reorganizing XSAVE support in KVM and QEMU. Unfortunately, Intel is not listing the offsets anymore in the documentation, but they

Re: [PATCH] kvm/vmx: EPTP switching test

2015-11-17 Thread Paolo Bonzini
On 17/11/2015 11:44, Wang, Wei W wrote: > On 17/11/2015 18:18, Paolo Bonzini wrote: >> On 17/11/2015 02:45, Zhang, Yang Z wrote: >>> We have a different version in hand which is using separate >>> EPTP. >> >> Can you say in advance what you are using EPTP

Re: [kvm-unit-tests] x86: pkeys: add test for PKEYS

2015-11-17 Thread Paolo Bonzini
On 16/11/2015 08:53, Huaitong Han wrote: > Signed-off-by: Huaitong Han > > diff --git a/config/config-x86-common.mak b/config/config-x86-common.mak > index c2f9908..2ef98cc 100644 > --- a/config/config-x86-common.mak > +++ b/config/config-x86-common.mak > @@ -36,7 +36,8

Re: [kvm-unit-tests] x86: smap: add smap check to unittests.cfg

2015-11-17 Thread Paolo Bonzini
On 16/11/2015 08:53, Huaitong Han wrote: > Signed-off-by: Huaitong Han > > diff --git a/x86/unittests.cfg b/x86/unittests.cfg > index 14e36a4..6d3dc89 100644 > --- a/x86/unittests.cfg > +++ b/x86/unittests.cfg > @@ -72,6 +72,10 @@ groups = vmexit > file = access.flat >

Re: [PATCH v2 3/4] KVM: x86: request interrupt window when IRQ chip is split

2015-11-17 Thread Paolo Bonzini
On 17/11/2015 00:26, Matt Gingell wrote: > Before this patch, we incorrectly enter the guest without requesting an > interrupt window if the IRQ chip is split between user space and the > kernel. > > Because lapic_in_kernel no longer implies the PIC is in the kernel, this > patch tests

Re: [PATCH V2 1/3] target-i386: add pkeys support for cpuid handling

2015-11-17 Thread Paolo Bonzini
On 16/11/2015 08:52, Huaitong Han wrote: > This patch adds pkeys support for cpuid handling. > > Signed-off-by: Huaitong Han > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index 4d1b085..2ff73ee 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c > @@

Re: [PATCH 05/10] KVM: x86: MMU: Use for_each_rmap_spte macro instead of pte_list_walk()

2015-11-17 Thread Paolo Bonzini
On 16/11/2015 03:51, Takuya Yoshikawa wrote: > What kvm_mmu_mark_parents_unsync() does is: > > for each p_i in sp->parent_ptes rmap chain > mark_unsync(p_i); > > Then, mark_unsync() finds the parent sp including that p_i to > set ->unsync_child_bitmap and increment ->unsync_children if >

Re: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts

2015-11-17 Thread Paolo Bonzini
On 16/11/2015 20:03, Radim Krčmář wrote: > 2015-11-09 10:46+0800, Feng Wu: >> Use vector-hashing to handle lowest-priority interrupts for >> posted-interrupts. As an example, modern Intel CPUs use this >> method to handle lowest-priority interrupts. > > (I don't think it's a good idea that the

Re: [PATCH] kvm/vmx: EPTP switching test

2015-11-17 Thread Paolo Bonzini
On 17/11/2015 02:45, Zhang, Yang Z wrote: > We have a different version in hand which is using separate EPTP. Can you say in advance what you are using EPTP switching for? Offlist if necessary. Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to

Re: [PATCH] kvm/vmx: EPTP switching test

2015-11-17 Thread Paolo Bonzini
On 16/11/2015 19:18, =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= wrote: >> > No idea how would I even test it, so I'm not interested in #VE at this >> > point. If you are - go ahead and post a patch for that on top though, >> > why not. > I thought that it's going to be simpler to provide

Re: [PATCH V2 7/7] KVM, pkeys: disable PKU feature without ept

2015-11-16 Thread Paolo Bonzini
On 16/11/2015 08:51, Huaitong Han wrote: > This patch disables CPUID:PKU without ept. The commit message and probably the code too should say why. Paolo > Signed-off-by: Huaitong Han > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index

[PATCH] KVM: x86: always set accessed bit in shadow PTEs

2015-11-13 Thread Paolo Bonzini
Takuya Yoshikawa <yoshikawa_takuya...@lab.ntt.co.jp> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kvm/mmu.c | 9 +++-- arch/x86/kvm/paging_tmpl.h | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/

Re: [PATCH 2/3] KVM: x86: request interrupt window when IRQ chip is split

2015-11-13 Thread Paolo Bonzini
On 12/11/2015 20:08, Matt Gingell wrote: > + bool req_int_win = !pic_in_kernel(vcpu->kvm) && > vcpu->run->request_interrupt_window; Hey, this is the new form of dm_request_for_irq_injection I have just written about, in the review to patch 3. So it's probably best to swap

Re: [PATCH 1/3] KVM: x86: set KVM_REQ_EVENT on local interupt request from user space

2015-11-13 Thread Paolo Bonzini
->arch.pending_external_vector = irq->irq; > + kvm_make_request(KVM_REQ_EVENT, vcpu); > return 0; > } > > 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: [PATCH 3/3] KVM: x86: fix ready_for_interrupt reporting in split IRQ chip case

2015-11-13 Thread Paolo Bonzini
On 12/11/2015 20:07, Matt Gingell wrote: > This patch adds a call to kvm_arch_interrupt_allowed to ensure ready for > interrupt is reported to user space correctly. This addresses a problem > observed in QEMU when kvm->ready_for_interrupt is set but the x86 > interrupt flag is clear. > >

Re: [PATCH kvm-unit-tests] x86: tsc: add test for RDTSCP

2015-11-13 Thread Paolo Bonzini
On 13/11/2015 02:48, Wanpeng Li wrote: > > diff --git a/x86/unittests.cfg b/x86/unittests.cfg > > index ac652fc..fd7e9b2 100644 > > --- a/x86/unittests.cfg > > +++ b/x86/unittests.cfg > > @@ -114,6 +114,7 @@ file = sieve.flat > > > > [tsc] > > file = tsc.flat > > +extra_params = -cpu

Re: [PATCH] KVM: x86: expose MSR_TSC_AUX to userspace

2015-11-13 Thread Paolo Bonzini
> Paolo, under what circumstances (which versions of Windows? Anything > special running in the guest?) has this failure happened? I'd like to repro > this, I'm not sure if we've observed it before. We saw it with migration under Windows 10, nothing special running in the guest. It's very hard

Re: [PATCH 09/10 RFC] KVM: x86: MMU: Move parent_pte handling from kvm_mmu_get_page() to link_shadow_page()

2015-11-13 Thread Paolo Bonzini
On 13/11/2015 03:15, Takuya Yoshikawa wrote: > Actually, I don't understand why this is named kvm_mmu_put_page() for > just removing parent_pte pointer from the sp->parent_ptes pointer chain. Because it undoes kvm_mmu_get_page, I guess. :) > >> On to kvm_mmu_get_page... >> >> if

Re: [PATCH v2 3/4] KVM: X86: Migration is supported

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 08:06, Jian Zhou wrote: >> >> I think you can just do this in kvm_x86_ops->set_msr. The old >> implementation for DEBUGCTL MSR can be moved to svm.c. > > I think you mean "moved to vmx.c"? No, the old implementation is moved from x86.c to svm.c. The new implementation you

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

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 06:35, Paul Mackerras wrote: > Paolo, > > I have two fixes for HV KVM which I would like to have included in > v4.4-rc1. The first one is a fix for a bug identified by Red Hat > which causes occasional guest crashes. The second one fixes a bug > which causes host stalls and

[GIT PULL] Second batch of KVM changes for 4.4 (v2)

2015-11-12 Thread Paolo Bonzini
for guest readings of MSR_IA32_TSC KVM: VMX: Dump TSC multiplier in dump_vmcs() Paolo Bonzini (7): KVM: x86: merge handle_mmio_page_fault and handle_mmio_page_fault_common KVM: x86: declare a few variables as __read_mostly context_tracking: remove duplicate enabled check

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

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 06:35, Paul Mackerras wrote: > Paolo, > > I have two fixes for HV KVM which I would like to have included in > v4.4-rc1. The first one is a fix for a bug identified by Red Hat > which causes occasional guest crashes. The second one fixes a bug > which causes host stalls and

Re: Shut up unhandled MSR warnings

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 11:13, Borislav Petkov wrote: > Hey Paolo, > > do we apply stuff like that below? If we really need to, we do. > When booting guests all the time here, dmesg gets filled up with those > "unhandled rdmsr" useless warnings. The patch below shuts them up. > > The only problem is

[PATCH kvm-unit-tests] x86: tsc: add test for RDTSCP

2015-11-12 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- lib/x86/processor.h | 16 x86/tsc.c | 23 +++ x86/unittests.cfg | 1 + 3 files changed, 40 insertions(+) diff --git a/lib/x86/processor.h b/lib/x86/processor.h index 7973879..b9cb753

Re: Shut up unhandled MSR warnings

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 13:16, Borislav Petkov wrote: >>> > > Yes, see guest_cpuid_has_* for an example of reading the CPUID values. >>> > > >>> > > But if it's defined for _all_ models starting at family 21, we can just >>> > > do it unconditionally. >> > >> > The thing is, those bits are Reserved

Re: [PATCH 00/10 V2] KVM: x86: MMU: Clean up x86's mmu code for future work

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 12:48, Takuya Yoshikawa wrote: > v1->v2: > Patch 5 and 7 are added based on Paolo's suggestions. > Patch 8-10 are new. > > Patch 1/2/3/4: no change. > Patch 5: Needed a bit more work than I had expected. > Patch 6: Removed extra comment of v1 (patch 5 made it inappropriate). >

Re: [PATCH 09/10 RFC] KVM: x86: MMU: Move parent_pte handling from kvm_mmu_get_page() to link_shadow_page()

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 12:56, Takuya Yoshikawa wrote: > diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h > index 9d21b44..f414ca6 100644 > --- a/arch/x86/kvm/paging_tmpl.h > +++ b/arch/x86/kvm/paging_tmpl.h > @@ -598,7 +598,7 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t

[PATCH] KVM: svm: add support for RDTSCP

2015-11-12 Thread Paolo Bonzini
RDTSCP was never supported for AMD CPUs, which nobody noticed because Linux does not use it. But exactly the fact that Linux does not use it makes the implementation very simple; we can freely trash MSR_TSC_AUX while running the guest. Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by:

Re: [PATCH 0/3] Infinite loops in microcode while running guests

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 15:08, Jan Kiszka wrote: > On 2015-11-11 14:12, Austin S Hemmelgarn wrote: >> On 2015-11-11 08:07, Paolo Bonzini wrote: >>> >>> >>> On 11/11/2015 13:47, Austin S Hemmelgarn wrote: >>>>> >>>> I just finished running a

[PATCH] KVM: x86: expose MSR_TSC_AUX to userspace

2015-11-12 Thread Paolo Bonzini
If we do not do this, it is not properly saved and restored across migration. Windows notices due to its self-protection mechanisms, and is very upset about it (blue screen of death). Cc: Radim Krcmar <rkrc...@redhat.com> Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini

[PATCH] KVM: x86: correctly print #AC in traces

2015-11-12 Thread Paolo Bonzini
Poor #AC was so unimportant until a few days ago that we were not even tracing its name correctly. But now it's all over the place. Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kvm/trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH 09/10 RFC] KVM: x86: MMU: Move parent_pte handling from kvm_mmu_get_page() to link_shadow_page()

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 15:27, Paolo Bonzini wrote: > Here I think you can remove completely the > > if (sp) > kvm_mmu_put_page(sp, it.sptep); > > later in FNAME(fetch). Apart from this nit, it's okay. Removing this is of course not possible anymore if the othe

Re: [PATCH] KVM: svm: add support for RDTSCP

2015-11-12 Thread Paolo Bonzini
On 12/11/2015 15:45, Joerg Roedel wrote: > Hi Paolo, > > On Thu, Nov 12, 2015 at 02:49:16PM +0100, Paolo Bonzini wrote: >> RDTSCP was never supported for AMD CPUs, which nobody noticed because >> Linux does not use it. But exactly the fact that Linux does not >> use

Re: [PATCH v3 2/5] target-i386/kvm: Hyper-V SynIC MSR's support

2015-11-11 Thread Paolo Bonzini
t; > 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: &qu

Re: [PATCH v2 2/5] target-i386/kvm: Hyper-V SynIC MSR's support

2015-11-11 Thread Paolo Bonzini
On 11/11/2015 10:25, Andrey Smetanin wrote: > In this case I'll remove migration of msr_hv_synic_version and make > first time initialization inside kvm_arch_init_vcpu() - inside section > where SynIC availability cpuid bit is set. Thanks! Paolo -- To unsubscribe from this list: send the line

Re: [PATCH v2 2/5] target-i386/kvm: Hyper-V SynIC MSR's support

2015-11-11 Thread Paolo Bonzini
On 11/11/2015 10:09, Andrey Smetanin wrote: >> >> I would prefer to put this in kvm_arch_init_vcpu, if possible. >> > Ok. I think the kvm_arch_init_vcpu() is called after migration restores > cpu->env->msr_hv_synic_* values, so unconditional initialization of > cpu->env->msr_hv_synic_* values

Re: [kvm-unit-tests PATCH] vpid test case

2015-11-11 Thread Paolo Bonzini
On 10/11/2015 13:55, Wanpeng Li wrote: > VPID test case for invvpid single and invvpid all. > > Signed-off-by: Wanpeng Li > --- > x86/vmx.c | 17 > x86/vmx.h | 17 > x86/vmx_tests.c | 63 >

Re: [PATCH 0/3] MIPS: KVM: Misc fixes

2015-11-11 Thread Paolo Bonzini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 11/11/2015 15:57, James Hogan wrote: > Okay, no problem. As long as they can make v4.4. > > For the record do you prefer not to receive patches during merge > window? It's okay, at worst I won't process them for a few days or weeks. Paolo

Re: [PATCH v2 3/4] KVM: X86: Migration is supported

2015-11-11 Thread Paolo Bonzini
On 23/10/2015 11:15, Jian Zhou wrote: > data *msr_info) > } > break; > case MSR_IA32_DEBUGCTLMSR: > - if (!data) { > - /* We support the non-activated case already */ > - break; > - } else if (data

Re: [PATCH v2 0/4] KVM: VMX: enable LBR virtualization

2015-11-11 Thread Paolo Bonzini
On 23/10/2015 11:15, Jian Zhou wrote: > Changelog in v2: > (1) move the implementation into vmx.c > (2) migraton is supported > (3) add arrays in kvm_vcpu_arch struct to save/restore > LBR MSRs at vm exit/entry time. > (4) add a parameter of kvm_intel module to permanently >

Re: [PATCH 0/3] MIPS: KVM: Misc fixes

2015-11-11 Thread Paolo Bonzini
IPS: KVM: Uninit VCPU in vcpu_create error path > > arch/mips/kvm/emulate.c | 2 +- > arch/mips/kvm/locore.S | 16 ++-- > arch/mips/kvm/mips.c| 5 - > 3 files changed, 15 insertions(+), 8 deletions(-) > > Cc: Ralf Baechle <r...@linux-mips.org> > Cc: Pao

Re: [PATCH 0/3] Infinite loops in microcode while running guests

2015-11-11 Thread Paolo Bonzini
On 11/11/2015 13:47, Austin S Hemmelgarn wrote: >> > I just finished running a couple of tests in a KVM instance running > nested on a Xen HVM instance, and found no issues, so for the set as a > whole: > > Tested-by: Austin S. Hemmelgarn > > Now to hope the equivalent

Re: [PATCH 0/3] Infinite loops in microcode while running guests

2015-11-10 Thread Paolo Bonzini
On 10/11/2015 16:38, Jan Kiszka wrote: > On 2015-11-10 13:22, Paolo Bonzini wrote: >> Yes, these can happen. The issue is that benign exceptions are >> delivered serially, but two of them (#DB and #AC) can also happen >> during exception delivery itself. The subse

Re: [kvm-unit-tests PATCH 06/18] README: add some CONTRIBUTING notes

2015-11-10 Thread Paolo Bonzini
On 06/11/2015 01:24, Andrew Jones wrote: > From: Alex Bennée > > Signed-off-by: Alex Bennée > Reviewed-by: Andrew Jones > --- > README | 26 ++ > 1 file changed, 26 insertions(+) > > diff --git

Re: [kvm-unit-tests PATCH 08/18] run_tests: pass test name to run script

2015-11-10 Thread Paolo Bonzini
On 06/11/2015 01:24, Andrew Jones wrote: > With this $TEST_DIR/run can output test specific error messages. > > Signed-off-by: Andrew Jones > --- > run_tests.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/run_tests.sh b/run_tests.sh > index

Re: [kvm-unit-tests PATCH v2 02/19] trivial: lib: fail hard on failed mallocs

2015-11-10 Thread Paolo Bonzini
On 09/11/2015 21:53, Andrew Jones wrote: > It's pretty safe to not even bother checking for NULL when > using malloc and friends, but if we do check, then fail > hard. > > Signed-off-by: Andrew Jones > --- > v2: no code in asserts [Thomas Huth] > > lib/virtio-mmio.c | 6

Re: [kvm-unit-tests PATCH 01/18] makefiles: use bash

2015-11-10 Thread Paolo Bonzini
On 10/11/2015 17:37, Andrew Jones wrote: > On Tue, Nov 10, 2015 at 05:22:41PM +0100, Paolo Bonzini wrote: >> >> >> On 06/11/2015 01:24, Andrew Jones wrote: >>> Use bash in the makefiles, like we do in the scripts. Without >>> this some platforms

Re: [PATCH] kvm-all: PAGE_SIZE should be real host page size

2015-11-10 Thread Paolo Bonzini
On 10/11/2015 01:23, Andrew Jones wrote: > Just noticed this while grepping TARGET_PAGE_SIZE for an unrelated > reason. I didn't use qemu_real_host_page_size as kvm_set_phys_mem() > does, because we'd need to make sure page_size_init() has run first. > > Signed-off-by: Andrew Jones

Re: [kvm-unit-tests PATCH 07/18] configure: emit HOST=$host to config.mak

2015-11-10 Thread Paolo Bonzini
On 06/11/2015 01:24, Andrew Jones wrote: > From: Alex Bennée > > This is useful information for the run scripts to know, especially if > they want to drop to using TCG. > > Signed-off-by: Alex Bennée > Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH 13/18] arm: Fail on unknown subtest

2015-11-10 Thread Paolo Bonzini
On 06/11/2015 01:24, Andrew Jones wrote: > From: Christopher Covington > > Signed-off-by: Christopher Covington > Reviewed-by: Andrew Jones > --- > arm/selftest.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git

Re: [kvm-unit-tests PATCH 12/18] lib/arm: add flush_tlb_page mmu function

2015-11-10 Thread Paolo Bonzini
On 06/11/2015 01:24, Andrew Jones wrote: > From: Alex Bennée > > This introduces a new flush_tlb_page function which does exactly what > you expect. It's going to be useful for the future TLB torture test. > > Signed-off-by: Alex Bennée >

Re: [kvm-unit-tests PATCH 11/18] lib/printf: support the %u unsigned fmt field

2015-11-10 Thread Paolo Bonzini
On 06/11/2015 01:24, Andrew Jones wrote: > From: Alex Bennée > > Signed-off-by: Alex Bennée > Reviewed-by: Andrew Jones > --- > lib/printf.c | 13 + > 1 file changed, 13 insertions(+) > > diff --git

<    1   2   3   4   5   6   7   8   9   10   >