All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 1/4] stubs for xsavec support
Date: Mon, 09 Feb 2015 14:17:47 +0100	[thread overview]
Message-ID: <54D8B37B.2020509@redhat.com> (raw)
In-Reply-To: <54D518B6.9070101@siemens.com>



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

  reply	other threads:[~2015-02-09 13:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 10:32 [PATCH kvm-kmod 0/4] Update to 3.19-rc1 Paolo Bonzini
2015-01-08 10:32 ` [PATCH 1/4] stubs for xsavec support Paolo Bonzini
2015-02-02  7:04   ` Jan Kiszka
2015-02-02  9:05     ` Paolo Bonzini
2015-02-06 19:40       ` Jan Kiszka
2015-02-09 13:17         ` Paolo Bonzini [this message]
2015-02-09 13:44           ` Jan Kiszka
2015-02-09 13:45             ` Paolo Bonzini
2015-01-08 10:32 ` [PATCH 2/4] fixes for changes in the iommu and PCI APIs Paolo Bonzini
2015-01-08 10:32 ` [PATCH 3/4] fixes for changes in the percpu counter API Paolo Bonzini
2015-01-08 10:32 ` [PATCH 4/4] add trace_seq_buffer_ptr Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54D8B37B.2020509@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.