All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Yang Zhong <yang.zhong@intel.com>
Subject: [PULL 03/29] target/i386: Fix wrong count setting
Date: Mon,  6 Jun 2022 16:36:18 +0200	[thread overview]
Message-ID: <20220606143644.1151112-4-pbonzini@redhat.com> (raw)
In-Reply-To: <20220606143644.1151112-1-pbonzini@redhat.com>

From: Yang Zhong <yang.zhong@intel.com>

The previous patch used wrong count setting with index value, which got wrong
value from CPUID(EAX=12,ECX=0):EAX. So the SGX1 instruction can't be exposed
to VM and the SGX decice can't work in VM.

Fixes: d19d6ffa0710 ("target/i386: introduce helper to access supported CPUID")

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20220530131834.1222801-1-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index bb6a5dd498..9fdfec9d8b 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5559,7 +5559,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
          * supports.  Features can be further restricted by userspace, but not
          * made more permissive.
          */
-        x86_cpu_get_supported_cpuid(0x12, index, eax, ebx, ecx, edx);
+        x86_cpu_get_supported_cpuid(0x12, count, eax, ebx, ecx, edx);
 
         if (count == 0) {
             *eax &= env->features[FEAT_SGX_12_0_EAX];
-- 
2.36.1




  parent reply	other threads:[~2022-06-06 14:44 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 14:36 [PULL 00/29] Misc patches for 2022-06-06 Paolo Bonzini
2022-06-06 14:36 ` [PULL 01/29] target/i386/tcg: Fix masking of real-mode addresses with A20 bit Paolo Bonzini
2022-06-06 14:36 ` [PULL 02/29] build: add a "make modules" target Paolo Bonzini
2022-06-06 14:36 ` Paolo Bonzini [this message]
2022-06-06 14:36 ` [PULL 04/29] modules: introduces module_kconfig directive Paolo Bonzini
2022-06-06 14:36 ` [PULL 05/29] modules: generates per-target modinfo Paolo Bonzini
2022-06-06 14:36 ` [PULL 06/29] replay: fix event queue flush for qemu shutdown Paolo Bonzini
2022-06-06 14:36 ` [PULL 07/29] replay: notify vCPU when BH is scheduled Paolo Bonzini
2022-06-06 14:36 ` [PULL 08/29] replay: rewrite async event handling Paolo Bonzini
2022-06-06 14:36 ` [PULL 09/29] replay: simplify async event processing Paolo Bonzini
2022-06-06 14:36 ` [PULL 10/29] docs: convert docs/devel/replay page to rst Paolo Bonzini
2022-06-06 14:36 ` [PULL 11/29] docs: move replay docs to docs/system/replay.rst Paolo Bonzini
2022-06-06 14:36 ` [PULL 12/29] tests/avocado: update replay_linux test Paolo Bonzini
2022-06-06 14:36 ` [PULL 13/29] tests/avocado: add replay Linux tests for virtio machine Paolo Bonzini
2022-06-06 14:36 ` [PULL 14/29] tests/avocado: add replay Linux test for Aarch64 machines Paolo Bonzini
2022-06-06 14:36 ` [PULL 15/29] tests/Makefile.include: Fix 'make check-help' output Paolo Bonzini
2022-06-06 14:36 ` [PULL 16/29] x86: cpu: make sure number of addressable IDs for processor cores meets the spec Paolo Bonzini
2022-06-06 14:36 ` [PULL 17/29] x86: cpu: fixup number of addressable IDs for logical processors sharing cache Paolo Bonzini
2022-06-06 14:36 ` [PULL 18/29] python: update for mypy 0.950 Paolo Bonzini
2022-06-06 14:36 ` [PULL 19/29] tests: add "TESTS_PYTHON" variable to Makefile Paolo Bonzini
2022-06-06 14:36 ` [PULL 20/29] tests: use python3 as the python executable name Paolo Bonzini
2022-06-06 14:36 ` [PULL 21/29] tests: silence pip upgrade warnings during venv creation Paolo Bonzini
2022-06-06 14:36 ` [PULL 22/29] tests: add quiet-venv-pip macro Paolo Bonzini
2022-06-06 14:36 ` [PULL 23/29] tests: install "qemu" namespace package into venv Paolo Bonzini
2022-06-06 14:36 ` [PULL 24/29] tests: use tests/venv to run basevm.py-based scripts Paolo Bonzini
2022-06-06 14:36 ` [PULL 25/29] tests: add python3-venv to debian10.docker Paolo Bonzini
2022-06-06 14:36 ` [PULL 26/29] tests: run 'device-crash-test' from tests/venv Paolo Bonzini
2022-06-06 14:36 ` [PULL 27/29] regenerate meson-buildoptions.sh Paolo Bonzini
2022-06-06 14:36 ` [PULL 28/29] configure: remove reference to removed option Paolo Bonzini
2022-06-06 14:36 ` [PULL 29/29] meson: qga: do not use deprecated meson.build_root() Paolo Bonzini
2022-06-06 17:06 ` [PULL 00/29] Misc patches for 2022-06-06 Richard Henderson

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=20220606143644.1151112-4-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yang.zhong@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 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.