From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Wei Liu" <wl@xen.org>, "Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH] x86/gen-cpuid: Distinguish default vs max in feature annotations
Date: Fri, 8 May 2020 16:27:29 +0100 [thread overview]
Message-ID: <20200508152729.14295-1-andrew.cooper3@citrix.com> (raw)
Allow lowercase a/s/h to be used to annotate a non-default feature.
However, until the toolstack migration logic is fixed, it is not safe to
activate yet. Tolerate the annotations, but ignore them for now.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
This patch has been pending the toolstack work for several months now, and we
want to start using the max tags for x86 emul work.
---
xen/include/public/arch-x86/cpufeatureset.h | 2 ++
xen/tools/gen-cpuid.py | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index e2749245f3..0ffab6c57b 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -87,6 +87,8 @@ enum {
* 'A' = All guests.
* 'S' = All HVM guests (not PV guests).
* 'H' = HVM HAP guests (not PV or HVM Shadow guests).
+ * Upper case => Available by default
+ * Lower case => Can be opted-in to, but not available by default.
*/
/* Intel-defined CPU features, CPUID level 0x00000001.edx, word 0 */
diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py
index af5610a5e6..d90a2d85c7 100755
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -23,6 +23,7 @@ def __init__(self, input, output):
self.raw = {
'!': set(),
'A': set(), 'S': set(), 'H': set(),
+ 'a': set(), 's': set(), 'h': set(),
}
# State calculated
@@ -133,9 +134,13 @@ def crunch_numbers(state):
state.hvm_shadow_def = state.pv_def | state.raw['S']
state.hvm_hap_def = state.hvm_shadow_def | state.raw['H']
+ # TODO: Ignore def/max split until the toolstack migration logic is fixed
state.pv_max = state.pv_def
state.hvm_shadow_max = state.hvm_shadow_def
state.hvm_hap_max = state.hvm_hap_def
+ # state.pv_max = state.raw['A'] | state.raw['a']
+ # state.hvm_shadow_max = state.pv_max | state.raw['S'] | state.raw['s']
+ # state.hvm_hap_max = state.hvm_shadow_max | state.raw['H'] | state.raw['h']
#
# Feature dependency information.
--
2.11.0
next reply other threads:[~2020-05-08 15:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-08 15:27 Andrew Cooper [this message]
2020-05-11 7:43 ` [PATCH] x86/gen-cpuid: Distinguish default vs max in feature annotations Jan Beulich
2020-05-15 13:19 ` 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=20200508152729.14295-1-andrew.cooper3@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.