All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 4/9] x86: Merge struct msr_policy into struct cpu_policy
Date: Thu, 30 Mar 2023 12:11:17 +0100	[thread overview]
Message-ID: <bacda91d-a371-ae30-5ea8-19a452e54381@citrix.com> (raw)
In-Reply-To: <885610de-aea4-6aec-af73-28ee9147fb65@suse.com>

On 30/03/2023 10:30 am, Jan Beulich wrote:
> On 29.03.2023 22:51, Andrew Cooper wrote:
>> --- a/xen/include/xen/lib/x86/cpu-policy.h
>> +++ b/xen/include/xen/lib/x86/cpu-policy.h
>> @@ -3,7 +3,6 @@
>>  #define XEN_LIB_X86_POLICIES_H
>>  
>>  #include <xen/lib/x86/cpuid-autogen.h>
>> -#include <xen/lib/x86/msr.h>
>>  
>>  #define FEATURESET_1d     0 /* 0x00000001.edx      */
>>  #define FEATURESET_1c     1 /* 0x00000001.ecx      */
>> @@ -107,6 +106,9 @@ const char *x86_cpuid_vendor_to_str(unsigned int vendor);
>>       CPUID_GUEST_NR_XSTATE - !!CPUID_GUEST_NR_XSTATE +  \
>>       CPUID_GUEST_NR_EXTD + 2 /* hv_limit and hv2_limit */ )
>>  
>> +/* Maximum number of MSRs written when serialising msr_policy. */
>> +#define MSR_MAX_SERIALISED_ENTRIES 2
> The comment better wouldn't refer to msr_policy anymore, I think.

Ah yes.  (There's so much comment and library cleanup still to do)

>  I also
> wonder whether the comment wouldn't better move ...
>
>> @@ -324,6 +326,44 @@ struct cpu_policy
>>          };
>>      } extd;
>>  
>> +    /*
>> +     * 0x000000ce - MSR_INTEL_PLATFORM_INFO
> ... e.g. above here, to increase the chance of it being spotted that
> it needs updating if another MSR is added here.

I'm not sure about that.  In its current position, it's next to it's
CPUID partner.

The unit tests in test-cpu-policy cross-check that we never get -ENOBUFS
for a MSR_MAX_* sized destination, so I'm not worried about it actually
getting stale.


But, with the new merged policies, I need to change the serialising
behaviour anyway.

Right now we serialise everything unconditionally because that's the
only way that merging incremental deltas could be made to work, but now
the MSR enumeration bits are in the same structure we can use those
instead, along with the various "clear" passes we already have.

~Andrew


  reply	other threads:[~2023-03-30 11:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 20:51 [PATCH RFC 0/9] x86: Merge cpuid and msr policy Andrew Cooper
2023-03-29 20:51 ` [PATCH 1/9] x86: Rename struct cpu_policy to struct old_cpuid_policy Andrew Cooper
2023-03-29 20:51 ` [PATCH 2/9] x86: Rename {domctl,sysctl}.cpu_policy.{cpuid,msr_policy} fields Andrew Cooper
2023-03-29 20:51 ` [PATCH 3/9] x86: Rename struct cpuid_policy to struct cpu_policy Andrew Cooper
2023-03-29 20:51 ` [PATCH 4/9] x86: Merge struct msr_policy into " Andrew Cooper
2023-03-30  9:30   ` Jan Beulich
2023-03-30 11:11     ` Andrew Cooper [this message]
2023-03-30 11:15       ` Jan Beulich
2023-03-29 20:51 ` [PATCH 5/9] x86: Merge the system {cpuid,msr} policy objects Andrew Cooper
2023-03-30  9:40   ` Jan Beulich
2023-03-30 11:19     ` Andrew Cooper
2023-03-29 20:51 ` [PATCH 6/9] x86: Merge a domain's " Andrew Cooper
2023-03-30 10:00   ` Jan Beulich
2023-03-30 11:14     ` Andrew Cooper
2023-03-29 20:51 ` [PATCH 7/9] x86: Merge xc_cpu_policy's cpuid and msr objects Andrew Cooper
2023-03-30 10:04   ` Jan Beulich
2023-03-30 11:56     ` Andrew Cooper
2023-03-29 20:51 ` [PATCH 8/9] x86: Drop struct old_cpu_policy Andrew Cooper
2023-03-30 10:08   ` Jan Beulich
2023-03-30 11:57     ` Andrew Cooper
2023-03-29 20:51 ` [PATCH 9/9] RFC: Everything else Andrew Cooper
2023-03-30 10:16   ` Jan Beulich
2023-03-30 12:01     ` Andrew Cooper
2023-03-30 12:06       ` Jan Beulich
2023-03-30 12:31         ` Andrew Cooper
2023-03-30 12:55           ` Jan Beulich
2023-03-30 10:18 ` [PATCH RFC 0/9] x86: Merge cpuid and msr policy Jan Beulich
2023-03-30 12:08   ` Andrew Cooper
2023-03-30 11:07 ` Roger Pau Monné
2023-03-30 12:59   ` Andrew Cooper
2023-03-30 14:43     ` Roger Pau Monné
2023-04-03 10:55       ` Andrew Cooper
2023-04-03 11:47         ` Roger Pau Monné
2023-04-03 11:48           ` Andrew Cooper

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=bacda91d-a371-ae30-5ea8-19a452e54381@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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.