From: Aaron Lewis <aaronlewis@google.com>
To: kvm@vger.kernel.org
Cc: Aaron Lewis <aaronlewis@google.com>, Jim Mattson <jmattson@google.com>
Subject: [PATCH] x86: Fix the register order to match struct regs
Date: Thu, 24 Oct 2019 15:27:26 -0700 [thread overview]
Message-ID: <20191024222725.160835-1-aaronlewis@google.com> (raw)
Fix the order the registers show up in SAVE_GPR and SAVE_GPR_C to ensure
the correct registers get the correct values. Previously, the registers
were being written to (and read from) the wrong fields.
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Aaron Lewis <aaronlewis@google.com>
---
x86/vmx.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/x86/vmx.h b/x86/vmx.h
index 8496be7..8527997 100644
--- a/x86/vmx.h
+++ b/x86/vmx.h
@@ -492,9 +492,9 @@ enum vm_instruction_error_number {
#define SAVE_GPR \
"xchg %rax, regs\n\t" \
- "xchg %rbx, regs+0x8\n\t" \
- "xchg %rcx, regs+0x10\n\t" \
- "xchg %rdx, regs+0x18\n\t" \
+ "xchg %rcx, regs+0x8\n\t" \
+ "xchg %rdx, regs+0x10\n\t" \
+ "xchg %rbx, regs+0x18\n\t" \
"xchg %rbp, regs+0x28\n\t" \
"xchg %rsi, regs+0x30\n\t" \
"xchg %rdi, regs+0x38\n\t" \
@@ -511,9 +511,9 @@ enum vm_instruction_error_number {
#define SAVE_GPR_C \
"xchg %%rax, regs\n\t" \
- "xchg %%rbx, regs+0x8\n\t" \
- "xchg %%rcx, regs+0x10\n\t" \
- "xchg %%rdx, regs+0x18\n\t" \
+ "xchg %%rcx, regs+0x8\n\t" \
+ "xchg %%rdx, regs+0x10\n\t" \
+ "xchg %%rbx, regs+0x18\n\t" \
"xchg %%rbp, regs+0x28\n\t" \
"xchg %%rsi, regs+0x30\n\t" \
"xchg %%rdi, regs+0x38\n\t" \
--
2.24.0.rc0.303.g954a862665-goog
next reply other threads:[~2019-10-24 22:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 22:27 Aaron Lewis [this message]
2019-10-25 16:47 ` [PATCH] x86: Fix the register order to match struct regs Jim Mattson
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=20191024222725.160835-1-aaronlewis@google.com \
--to=aaronlewis@google.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
/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