All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenzhong Duan <zhenzhong.duan@intel.com>
To: kvm@vger.kernel.org
Cc: chao.gao@intel.com, Xiaoyao.Li@intel.com, yuan.yao@intel.com
Subject: [kvm-unit-tests PATCH] x86: Remove invalid clwb test code
Date: Wed,  1 Dec 2021 17:26:19 +0800	[thread overview]
Message-ID: <20211201092619.60298-1-zhenzhong.duan@intel.com> (raw)

When X86_FEATURE_WAITPKG(CPUID.7.0:ECX.WAITPKG[bit 5]) supported,
".byte 0x66, 0x0f, 0xae, 0xf0" sequence no longer represents clwb
instruction with invalid operand but tpause instruction with %eax
as input register.

Execute tpause with invalid input triggers #GP with below customed
qemu command line:

qemu -kernel x86/memory.flat -overcommit cpu-pm=on ...

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 x86/memory.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/x86/memory.c b/x86/memory.c
index 8f61020..351e7c0 100644
--- a/x86/memory.c
+++ b/x86/memory.c
@@ -67,13 +67,6 @@ int main(int ac, char **av)
 	asm volatile(".byte 0x66, 0x0f, 0xae, 0x33" : : "b" (&target));
 	report(ud == expected, "clwb (%s)", expected ? "ABSENT" : "present");
 
-	ud = 0;
-	/* clwb requires a memory operand, the following is NOT a valid
-	 * CLWB instruction (modrm == 0xF0).
-	 */
-	asm volatile(".byte 0x66, 0x0f, 0xae, 0xf0");
-	report(ud, "invalid clwb");
-
 	expected = !this_cpu_has(X86_FEATURE_PCOMMIT); /* PCOMMIT */
 	ud = 0;
 	/* pcommit: */
-- 
2.25.1


             reply	other threads:[~2021-12-01  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01  9:26 Zhenzhong Duan [this message]
2021-12-03  5:54 ` [kvm-unit-tests PATCH] x86: Remove invalid clwb test code Xiaoyao Li
2021-12-14 12:12   ` Paolo Bonzini

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=20211201092619.60298-1-zhenzhong.duan@intel.com \
    --to=zhenzhong.duan@intel.com \
    --cc=Xiaoyao.Li@intel.com \
    --cc=chao.gao@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=yuan.yao@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.