diff mbox

[PULL,07/28] x86/cpu: use standard-headers/asm-x86.kvm_para.h

Message ID CAFEAcA9JwWR29YSBKGS1fmmOE=wrSQY+OeJxQc4kmAEHRXUzWQ@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Maydell May 25, 2018, 11:06 a.m. UTC
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. Here's the diff I get as part of
my attempt to run update-linux-headers:


I'm not sure what's going on here -- commit 633711e8287 in
the kernel just renames the constant, but doesn't that
break userspace API ?

thanks
-- PMM

Comments

Michael S. Tsirkin May 25, 2018, 12:19 p.m. UTC | #1
On Fri, May 25, 2018 at 12:06:17PM +0100, Peter Maydell 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,

That just means we'll need to update kvm.c when we do it.

> because (as of
> 4.17-rc6, at least), asm-x86/kvm_para.h doesn't define
> KVM_HINTS_DEDICATED. Here's the diff I get as part of
> my attempt to run update-linux-headers:
> 
> --- a/include/standard-headers/asm-x86/kvm_para.h
> +++ b/include/standard-headers/asm-x86/kvm_para.h
> @@ -29,7 +29,7 @@
>  #define KVM_FEATURE_PV_TLB_FLUSH       9
>  #define KVM_FEATURE_ASYNC_PF_VMEXIT    10
> 
> -#define KVM_HINTS_DEDICATED      0
> +#define KVM_HINTS_REALTIME      0
> 
>  /* The last 8 bits are used to indicate how to interpret the flags field
>   * in pvclock structure. If no bits are set, all flags are ignored.
> 
> I'm not sure what's going on here -- commit 633711e8287 in
> the kernel just renames the constant, but doesn't that
> break userspace API ?
> 
> thanks
> -- PMM
Paolo Bonzini May 25, 2018, 2:13 p.m. UTC | #2
On 25/05/2018 13:06, Peter Maydell wrote:
> --- a/include/standard-headers/asm-x86/kvm_para.h
> +++ b/include/standard-headers/asm-x86/kvm_para.h
> @@ -29,7 +29,7 @@
>  #define KVM_FEATURE_PV_TLB_FLUSH       9
>  #define KVM_FEATURE_ASYNC_PF_VMEXIT    10
> 
> -#define KVM_HINTS_DEDICATED      0
> +#define KVM_HINTS_REALTIME      0
> 
>  /* The last 8 bits are used to indicate how to interpret the flags field
>   * in pvclock structure. If no bits are set, all flags are ignored.
> 
> I'm not sure what's going on here -- commit 633711e8287 in
> the kernel just renames the constant, but doesn't that
> break userspace API ?

No, but only because the constant with the old name was not in any
released version.  It was added in 4.17-rc1.

Thanks,

Paolo
diff mbox

Patch

--- a/include/standard-headers/asm-x86/kvm_para.h
+++ b/include/standard-headers/asm-x86/kvm_para.h
@@ -29,7 +29,7 @@ 
 #define KVM_FEATURE_PV_TLB_FLUSH       9
 #define KVM_FEATURE_ASYNC_PF_VMEXIT    10

-#define KVM_HINTS_DEDICATED      0
+#define KVM_HINTS_REALTIME      0

 /* The last 8 bits are used to indicate how to interpret the flags field
  * in pvclock structure. If no bits are set, all flags are ignored.