Skip to contentSkip to conversation

X86/HMP: Expose x86 model specific registers via human monitor

PATCH Julian Kirsch 2 participants 3 messages Apr 4, 2017 – Apr 18, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

ping

I kindly request your comments.

Quoted 40 lines · Julian Kirsch

Provide read/write access to x86 model specific registers (MSRs) by means of two new HMP commands "msr_get" and "msr_set". The rationale behind this is to improve introspection capabilities for system virtualization mode. For instance, many modern x86-64 operating systems maintain access to internal data structures via the MSR_GSBASE/MSR_KERNELGSBASE MSRs. Giving introspection utilities (such as a remotely attached gdb via "monitor msr_get") a way of accessing these registers improves analysis results drastically.

This iteration addresses Eduardo's comments of splitting the patch up into movement, reordering and addition of new MSRs.

Changes v3 -> v4:
* Split up x86-related parts of the patch into three distinct patches performing movement, reordering and addition of new MSRs.

Changes v2 -> v3:
* Rename HMP commands to "msr_get" and "msr_set"

Changes v1 -> v2:
* Rename HMP commands to "msr-get" and "msr-set"
* HMP commands Operate on the current default CPU only (removes need for cpu_index argument)
* Remove QMP command alltogether
* Implement HMP command in target/i386/monitor.c
* Add #ifdef TARGET_I386 around msr-get/msr-set in hmp-commands.hx

Julian Kirsch (4):
X86: Move rdmsr/wrmsr functionality to standalone functions
X86: Reorder MSRs in rdmsr/wrmsr to follow the order used by KVM
X86: Add MSRs supported by KVM to rdmsr/wrmsr
HMP: Introduce msr_get and msr_set HMP commands

 hmp-commands.hx              |  38 ++++
 include/monitor/hmp-target.h |   2 +
 target/i386/cpu.h            |   3 +
 target/i386/helper.c         | 524 +++++++++++++++++++++++++++++++++++++++++++
 target/i386/misc_helper.c    | 297 +-----------------------
 target/i386/monitor.c        |  76 +++++++
 6 files changed, 654 insertions(+), 286 deletions(-)
#2 lore raw
Quoted 3 lines · Julian Kirsch

ping

I kindly request your comments.

Hi Julian,

Sorry for taking so long to reply.

I can't find the original series on either qemu-devel archives, or on my own mail archive.

Searching for the Message-Id you were replying to, I can't find any matches:
https://www.mail-archive.com/search?l=mid&q=20170329183017.14026-1-git%40kirschju.re

Can you resend?

Quoted 44 lines · Julian Kirsch
Quoted 40 lines

Provide read/write access to x86 model specific registers (MSRs) by means of two new HMP commands "msr_get" and "msr_set". The rationale behind this is to improve introspection capabilities for system virtualization mode. For instance, many modern x86-64 operating systems maintain access to internal data structures via the MSR_GSBASE/MSR_KERNELGSBASE MSRs. Giving introspection utilities (such as a remotely attached gdb via "monitor msr_get") a way of accessing these registers improves analysis results drastically.

This iteration addresses Eduardo's comments of splitting the patch up into movement, reordering and addition of new MSRs.

Changes v3 -> v4:
* Split up x86-related parts of the patch into three distinct patches performing movement, reordering and addition of new MSRs.

Changes v2 -> v3:
* Rename HMP commands to "msr_get" and "msr_set"

Changes v1 -> v2:
* Rename HMP commands to "msr-get" and "msr-set"
* HMP commands Operate on the current default CPU only (removes need for cpu_index argument)
* Remove QMP command alltogether
* Implement HMP command in target/i386/monitor.c
* Add #ifdef TARGET_I386 around msr-get/msr-set in hmp-commands.hx

Julian Kirsch (4):
X86: Move rdmsr/wrmsr functionality to standalone functions
X86: Reorder MSRs in rdmsr/wrmsr to follow the order used by KVM
X86: Add MSRs supported by KVM to rdmsr/wrmsr
HMP: Introduce msr_get and msr_set HMP commands

 hmp-commands.hx              |  38 ++++
 include/monitor/hmp-target.h |   2 +
 target/i386/cpu.h            |   3 +
 target/i386/helper.c         | 524 +++++++++++++++++++++++++++++++++++++++++++
 target/i386/misc_helper.c    | 297 +-----------------------
 target/i386/monitor.c        |  76 +++++++
 6 files changed, 654 insertions(+), 286 deletions(-)
Signature · 1 line
Eduardo
#3 lore raw

Hi Eduardo,

don't worry, it's not urgent anyway. I'll resend the patches right away. (No idea why they don't show up in the archives, though.)

Best,
Julian

Quoted 59 lines · Eduardo Habkost

Hi Julian,

Sorry for taking so long to reply.

I can't find the original series on either qemu-devel archives, or on my own mail archive.

Searching for the Message-Id you were replying to, I can't find any matches:
https://www.mail-archive.com/search?l=mid&q=20170329183017.14026-1-git%40kirschju.re

Can you resend?

Quoted 44 lines · Julian Kirsch
Quoted 40 lines

Provide read/write access to x86 model specific registers (MSRs) by means of two new HMP commands "msr_get" and "msr_set". The rationale behind this is to improve introspection capabilities for system virtualization mode. For instance, many modern x86-64 operating systems maintain access to internal data structures via the MSR_GSBASE/MSR_KERNELGSBASE MSRs. Giving introspection utilities (such as a remotely attached gdb via "monitor msr_get") a way of accessing these registers improves analysis results drastically.

This iteration addresses Eduardo's comments of splitting the patch up into movement, reordering and addition of new MSRs.

Changes v3 -> v4:
* Split up x86-related parts of the patch into three distinct patches performing movement, reordering and addition of new MSRs.

Changes v2 -> v3:
* Rename HMP commands to "msr_get" and "msr_set"

Changes v1 -> v2:
* Rename HMP commands to "msr-get" and "msr-set"
* HMP commands Operate on the current default CPU only (removes need for cpu_index argument)
* Remove QMP command alltogether
* Implement HMP command in target/i386/monitor.c
* Add #ifdef TARGET_I386 around msr-get/msr-set in hmp-commands.hx

Julian Kirsch (4):
X86: Move rdmsr/wrmsr functionality to standalone functions
X86: Reorder MSRs in rdmsr/wrmsr to follow the order used by KVM
X86: Add MSRs supported by KVM to rdmsr/wrmsr
HMP: Introduce msr_get and msr_set HMP commands

 hmp-commands.hx              |  38 ++++
 include/monitor/hmp-target.h |   2 +
 target/i386/cpu.h            |   3 +
 target/i386/helper.c         | 524 +++++++++++++++++++++++++++++++++++++++++++
 target/i386/misc_helper.c    | 297 +-----------------------
 target/i386/monitor.c        |  76 +++++++
 6 files changed, 654 insertions(+), 286 deletions(-)