From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 1/4] stubs for xsavec support Date: Mon, 09 Feb 2015 14:17:47 +0100 Message-ID: <54D8B37B.2020509@redhat.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> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit To: Jan Kiszka , kvm@vger.kernel.org Return-path: Received: from mail-wg0-f54.google.com ([74.125.82.54]:57086 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759865AbbBINRx (ORCPT ); Mon, 9 Feb 2015 08:17:53 -0500 Received: by mail-wg0-f54.google.com with SMTP id y19so614201wgg.13 for ; Mon, 09 Feb 2015 05:17:51 -0800 (PST) In-Reply-To: <54D518B6.9070101@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: 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? 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) Paolo