qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] /target/i386: fix gdbstub k_gs_base issue
@ 2019-12-27  2:41 Marek Dolata - mkdolata@us.ibm.com
  2019-12-27 19:14 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Dolata - mkdolata@us.ibm.com @ 2019-12-27  2:41 UTC (permalink / raw)
  To: qemu-devel@nongnu.org
  Cc: qemu-trivial@nongnu.org, Paolo Bonzini, Doug Gale,
	Markus Armbruster

[-- Attachment #1: Type: text/plain, Size: 974 bytes --]

Fixes: corrects clobbering of registers appearing after k_gs_base
Buglink: https://bugs.launchpad.net/qemu/+bug/1857640

Signed-off-by: Marek Dolata <mkdolata@us.ibm.com>
---
target/i386/gdbstub.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c
index aef25b70f1..7228d20674 100644
--- a/target/i386/gdbstub.c
+++ b/target/i386/gdbstub.c
@@ -350,14 +350,16 @@ int x86_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
             env->segs[R_GS].base = ldl_p(mem_buf);
             return 4;
-#ifdef TARGET_X86_64
         case IDX_SEG_REGS + 8:
+#ifdef TARGET_X86_64
             if (env->hflags & HF_CS64_MASK) {
                 env->kernelgsbase = ldq_p(mem_buf);
                 return 8;
             }
             env->kernelgsbase = ldl_p(mem_buf);
             return 4;
+#else
+            return 4;
#endif
         case IDX_FP_REGS + 8:
--
2.21.0



[-- Attachment #2: Type: text/html, Size: 6650 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-27 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-27  2:41 [PATCH] /target/i386: fix gdbstub k_gs_base issue Marek Dolata - mkdolata@us.ibm.com
2019-12-27 19:14 ` Philippe Mathieu-Daudé

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).