diff mbox series

x86emul/test: use MSR constants

Message ID 73ab4821-c3e7-4d0a-84d0-f37f578be350@suse.com (mailing list archive)
State New
Headers show
Series x86emul/test: use MSR constants | expand

Commit Message

Jan Beulich Sept. 6, 2024, 10:39 a.m. UTC
msr-index.h has been in use for a while, so use the identifiers it
provides in place of raw numbers plus comments.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Andrew Cooper Sept. 6, 2024, 10:40 a.m. UTC | #1
On 06/09/2024 11:39 am, Jan Beulich wrote:
> msr-index.h has been in use for a while, so use the identifiers it
> provides in place of raw numbers plus comments.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -689,11 +689,11 @@  static int read_msr(
 {
     switch ( reg )
     {
-    case 0xc0000080: /* EFER */
-        *val = ctxt->addr_size > 32 ? 0x500 /* LME|LMA */ : 0;
+    case MSR_EFER:
+        *val = ctxt->addr_size > 32 ? EFER_LME | EFER_LMA : 0;
         return X86EMUL_OKAY;
 
-    case 0xc0000103: /* TSC_AUX */
+    case MSR_TSC_AUX:
 #define TSC_AUX_VALUE 0xCACACACA
         *val = TSC_AUX_VALUE;
         return X86EMUL_OKAY;