From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
kvm-devel <kvm@vger.kernel.org>,
Marcelo Tosatti <mtosatti@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PULL 07/28] x86/cpu: use standard-headers/asm-x86.kvm_para.h
Date: Fri, 25 May 2018 15:18:02 +0300 [thread overview]
Message-ID: <20180525151719-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAFEAcA9mAMCznsf1hao2PFziXnATrCxa8Of33NckUGXxFU6yEQ@mail.gmail.com>
On Fri, May 25, 2018 at 12:53:44PM +0100, Peter Maydell wrote:
> On 25 May 2018 at 12:06, Peter Maydell <peter.maydell@linaro.org> wrote:
> > On 23 May 2018 at 15:43, Michael S. Tsirkin <mst@redhat.com> wrote:
> >> Switch to the header we imported from Linux,
> >> this allows us to drop a hack in kvm_i386.h.
> >> More code will be dropped in the next patch.
> >>
> >> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >
> >> --- a/target/i386/cpu.h
> >> +++ b/target/i386/cpu.h
> >> @@ -688,8 +688,6 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
> >> #define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) /* Speculation Control */
> >> #define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31) /* Speculative Store Bypass Disable */
> >>
> >> -#define KVM_HINTS_DEDICATED (1U << 0)
> >> -
> >> #define CPUID_8000_0008_EBX_IBPB (1U << 12) /* Indirect Branch Prediction Barrier */
> >>
> >> #define CPUID_XSAVE_XSAVEOPT (1U << 0)
> >
> > Hi -- this seems like it will break compilation when we next
> > update our copy of the Linux kernel headers, because (as of
> > 4.17-rc6, at least), asm-x86/kvm_para.h doesn't define
> > KVM_HINTS_DEDICATED.
>
> For the moment I'm using this workaround (I wanted to do a header
> update for something else I'm working on):
>
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -48,6 +48,11 @@
> #include "exec/memattrs.h"
> #include "trace.h"
>
> +/* Work around this kernel header constant changing its name */
> +#ifndef KVM_HINTS_REALTIME
> +#define KVM_HINTS_REALTIME KVM_HINTS_DEDICATED
> +#endif
> +
> //#define DEBUG_KVM
>
> #ifdef DEBUG_KVM
I don't think we need this chunk.
> @@ -387,7 +392,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s,
> uint32_t function,
> ret &= ~(1U << KVM_FEATURE_PV_UNHALT);
> }
> } else if (function == KVM_CPUID_FEATURES && reg == R_EDX) {
> - ret |= 1U << KVM_HINTS_DEDICATED;
> + ret |= 1U << KVM_HINTS_REALTIME;
> found = 1;
> }
That's the right change when we update this header.
> thanks
> -- PMM
next prev parent reply other threads:[~2018-05-25 12:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1527086545-68024-1-git-send-email-mst@redhat.com>
2018-05-23 14:43 ` [PULL 07/28] x86/cpu: use standard-headers/asm-x86.kvm_para.h Michael S. Tsirkin
2018-05-25 11:06 ` Peter Maydell
2018-05-25 11:53 ` Peter Maydell
2018-05-25 12:18 ` Michael S. Tsirkin [this message]
2018-05-25 12:21 ` Peter Maydell
2018-05-25 12:27 ` Michael S. Tsirkin
2018-05-25 12:30 ` Peter Maydell
2018-05-25 12:35 ` Michael S. Tsirkin
2018-05-25 12:38 ` Peter Maydell
2018-05-25 12:19 ` Michael S. Tsirkin
2018-05-25 14:13 ` 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=20180525151719-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=ehabkost@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox