qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hendrik Wuethrich <whendrik@google.com>
To: qemu-devel@nongnu.org, eduardo@habkost.net,
	richard.henderson@linaro.org,  marcel.apfelbaum@gmail.com,
	mst@redhat.com, pbonzini@redhat.com,  zhao1.liu@intel.com,
	xiaoyao.li@intel.com, Jonathan.Cameron@huawei.com,
	 v6-0000-cover-letter.patch@google.com
Cc: peternewman@google.com, Hendrik Wuethrich <whendrik@google.com>
Subject: [PATCH v6 7/8] i386/cpu: Adjust CPUID level for RDT features
Date: Fri, 28 Feb 2025 20:04:52 +0000	[thread overview]
Message-ID: <20250228200453.45173-7-whendrik@google.com> (raw)
In-Reply-To: <20250228200453.45173-1-whendrik@google.com>

Adjust minimum CPUID level if RDT monitoring or allocation features are
enabled to ensure that CPUID will return them.

Signed-off-by: Hendrik Wuethrich <whendrik@google.com>
---
 target/i386/cpu.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6262665294..1ec3d88a65 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -7872,6 +7872,16 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
         if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_SGX) {
             x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x12);
         }
+
+        /* RDT monitoring requires CPUID[0xF] */
+        if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_PQM) {
+            x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0xF);
+        }
+
+        /* RDT allocation requires CPUID[0x10] */
+        if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_PQE) {
+            x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x10);
+        }
     }
 
     /* Set cpuid_*level* based on cpuid_min_*level, if not explicitly set */
-- 
2.48.1.711.g2feabab25a-goog



  parent reply	other threads:[~2025-02-28 20:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 20:04 [PATCH v6 1/8] i386: Add Intel RDT device and State to config Hendrik Wuethrich
2025-02-28 20:04 ` [PATCH v6 2/8] i386: Add init and realize functionality for RDT device Hendrik Wuethrich
2025-02-28 20:04 ` [PATCH v6 3/8] i386: Add RDT functionality Hendrik Wuethrich
2025-02-28 20:04 ` [PATCH v6 4/8] i386: Add RDT device interface through MSRs Hendrik Wuethrich
2025-02-28 20:04 ` [PATCH v6 5/8] i386: Add CPUID enumeration for RDT Hendrik Wuethrich
2025-02-28 20:04 ` [PATCH v6 6/8] i386: Add RDT feature flags Hendrik Wuethrich
2025-02-28 20:04 ` Hendrik Wuethrich [this message]
2025-02-28 20:04 ` [PATCH v6 8/8] i386/cpu: Adjust level for RDT on full_cpuid_auto_level Hendrik Wuethrich

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=20250228200453.45173-7-whendrik@google.com \
    --to=whendrik@google.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=eduardo@habkost.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peternewman@google.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=v6-0000-cover-letter.patch@google.com \
    --cc=xiaoyao.li@intel.com \
    --cc=zhao1.liu@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).