qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Newman <peternewman@google.com>
To: Hendrik Wuethrich <whendrik@google.com>
Cc: qemu-devel@nongnu.org, Jonathan.Cameron@huawei.com,
	eduardo@habkost.net,  richard.henderson@linaro.org,
	marcel.apfelbaum@gmail.com, mst@redhat.com,  pbonzini@redhat.com
Subject: Re: [PATCH v2 5/8] i386: Add CPUID enumeration for RDT
Date: Tue, 12 Nov 2024 11:28:05 +0100	[thread overview]
Message-ID: <CALPaoCjtrn=EcuYxqH7rT5tn5u_EPJeQMx1gq1+5gdVuUvAJhg@mail.gmail.com> (raw)
In-Reply-To: <20240905112237.3586972-6-whendrik@google.com>

Hi Hendrik,

On Thu, Sep 5, 2024 at 1:22 PM Hendrik Wuethrich <whendrik@google.com> wrote:
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index 4688d140c2..a5c4e3c463 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -42,6 +42,7 @@
>  #include "hw/boards.h"
>  #include "hw/i386/sgx-epc.h"
>  #endif
> +#include "hw/i386/rdt.h"
>
>  #include "disas/capstone.h"
>  #include "cpu-internal.h"
> @@ -6629,6 +6630,68 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
>          assert(!(*eax & ~0x1f));
>          *ebx &= 0xffff; /* The count doesn't need to be reliable. */
>          break;
> +#ifndef CONFIG_USER_ONLY
> +    case 0xF:
> +        /* Shared Resource Monitoring Enumeration Leaf */
> +        *eax = 0;
> +        *ebx = 0;
> +        *ecx = 0;
> +        *edx = 0;
> +        if (!(env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_PQM))
> +            break;
> +        assert(cpu->rdt);

If I just add the command line from the cover-letter: "-cpu
Skylake-Server,+l3-cmt,+rdt-m,+rdt-a,+mba", this assertion fires. I
needed to add "-device rdt" to the command-line as well.

Would it be friendlier to warn the user that there's no rdt device and break?

Thanks!
-Peter


  reply	other threads:[~2024-11-12 13:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 11:22 [PATCH v2 0/8] target:386/ Emulate Intel RDT features needed to mount ResCtrl in Linux Hendrik Wuethrich
2024-09-05 11:22 ` [PATCH v2 1/8] i386: Add Intel RDT device and State to config Hendrik Wuethrich
2024-09-05 11:22 ` [PATCH v2 2/8] i386: Add init and realize functionality for RDT device Hendrik Wuethrich
2024-09-05 11:22 ` [PATCH v2 3/8] i386: Add RDT functionality Hendrik Wuethrich
2024-09-05 11:22 ` [PATCH v2 4/8] i386: Add RDT device interface through MSRs Hendrik Wuethrich
2024-09-05 11:22 ` [PATCH v2 5/8] i386: Add CPUID enumeration for RDT Hendrik Wuethrich
2024-11-12 10:28   ` Peter Newman [this message]
2024-09-05 11:22 ` [PATCH v2 6/8] i386: Add RDT feature flags Hendrik Wuethrich
2024-09-05 11:22 ` [PATCH v2 7/8] i386/cpu: Adjust CPUID level for RDT features Hendrik Wuethrich
2024-09-05 11:22 ` [PATCH v2 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='CALPaoCjtrn=EcuYxqH7rT5tn5u_EPJeQMx1gq1+5gdVuUvAJhg@mail.gmail.com' \
    --to=peternewman@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=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=whendrik@google.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).