From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 1/4] stubs for xsavec support Date: Mon, 02 Feb 2015 08:04:00 +0100 Message-ID: <54CF2160.1010305@siemens.com> References: <1420713159-25947-1-git-send-email-pbonzini@redhat.com> <1420713159-25947-2-git-send-email-pbonzini@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit To: Paolo Bonzini , kvm@vger.kernel.org Return-path: Received: from thoth.sbs.de ([192.35.17.2]:38947 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932199AbbBBHEI (ORCPT ); Mon, 2 Feb 2015 02:04:08 -0500 In-Reply-To: <1420713159-25947-2-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2015-01-08 11:32, Paolo Bonzini wrote: > These are needed for KVM changes in 3.18. > > Recent kernels added a separate feature word for XSAVE features, and KVM's > CPUID code is relying on the new definition. Except for cpu_has_xsaves, > it's never accessing the feature itself: wrap cpu_has_xsaves with > kvm_cpu_has_xsaves, and then there is no problem with out-of-bounds > accesses. > > Signed-off-by: Paolo Bonzini > --- > external-module-compat-comm.h | 4 ++++ > external-module-compat.c | 11 +++++++++++ > sync | 14 ++++++++++++-- > x86/external-module-compat.h | 37 +++++++++++++++++++++++++++++++++++++ > 4 files changed, 64 insertions(+), 2 deletions(-) > ... > diff --git a/x86/external-module-compat.h b/x86/external-module-compat.h > index dec53b6..87cf76a 100644 > --- a/x86/external-module-compat.h > +++ b/x86/external-module-compat.h > @@ -428,6 +428,23 @@ static inline int rdmsrl_safe(unsigned msr, unsigned long long *p) > #define X86_FEATURE_MPX (9*32+14) /* Memory Protection Extension */ > #endif > > +#if X86_FEATURE_XSAVEOPT < 10 * 32 > +#undef X86_FEATURE_XSAVEOPT > +#endif > +#define X86_FEATURE_XSAVEOPT (10*32+0) /* XSAVEOPT instruction */ This causes redefinition warnings if the condition is not met. Was the plan to put the define before the #endif? Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux