From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 1/4] stubs for xsavec support Date: Mon, 09 Feb 2015 14:44:30 +0100 Message-ID: <54D8B9BE.7000704@siemens.com> References: <1420713159-25947-1-git-send-email-pbonzini@redhat.com> <1420713159-25947-2-git-send-email-pbonzini@redhat.com> <54CF2160.1010305@siemens.com> <54CF3DCD.6010607@redhat.com> <54D518B6.9070101@siemens.com> <54D8B37B.2020509@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 goliath.siemens.de ([192.35.17.28]:39709 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932666AbbBINoj (ORCPT ); Mon, 9 Feb 2015 08:44:39 -0500 In-Reply-To: <54D8B37B.2020509@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2015-02-09 14:17, Paolo Bonzini wrote: > > > On 06/02/2015 20:40, Jan Kiszka wrote: >> On 2015-02-02 10:05, Paolo Bonzini wrote: >>> >>> >>> On 02/02/2015 08:04, Jan Kiszka wrote: >>>>>> +#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? >>> >>> The plan was to match the kernel's definition, which however has a space: >>> >>> #define X86_FEATURE_XSAVEOPT (10*32+ 0) >>> >>> But putting the define before the #endif also works. >> >> Finally got my buildbot working again: There are some open issues, maybe >> you can have a look at http://buildbot.kiszka.org/kvm-kmod/waterfall, >> next branch. At least the 3.17 thing requires fixing but may require >> more than a #define. > > Why is APICv crippled in kvm-kmod even for newer kernels? No idea. Maybe the patcher runs amok? I didn't look into details yet. > > If all that's needed is "make it compile with 3.9 and earlier", > you can do something like this: > > diff --git a/sync b/sync > index 3086b70..36bed39 100755 > --- a/sync > +++ b/sync > @@ -341,13 +341,18 @@ def hack_content(fname, data): > if line == '\tif (!cpu_has_vmx_apicv())': > w('#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)') > w(line) > + w('#else') > + w('if (1)') > line = '#endif' > if line == '#if IS_ENABLED(CONFIG_KVM)': > line = '#if 1' > - if line == '\t\tapic->send_IPI_mask(get_cpu_mask(vcpu->cpu),': > - line = '\t\t;' > - if line == '\t\t\t\tPOSTED_INTR_VECTOR);': > - line = '' > + if match(r'^\t+apic->send_IPI_mask\(get_cpu_mask\(vcpu->cpu\),$'): > + w('#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)') > + w('\t\t;') > + w('#else') > + if match(r'^\t+POSTED_INTR_VECTOR\);$'): > + w(line) > + line = '#endif' > if line == '\tif (!static_cpu_has_bug(X86_BUG_AMD_TLB_MMATCH))': > w('#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)') > w(line) Tested already? If so, please provide it as patch. If not: I can run it later through buildbot here. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux