Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140097526
D43665.id133605.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D43665.id133605.diff
View Options
diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h
--- a/sys/amd64/include/vmm.h
+++ b/sys/amd64/include/vmm.h
@@ -98,6 +98,10 @@
VM_REG_GUEST_DR3,
VM_REG_GUEST_DR6,
VM_REG_GUEST_ENTRY_INST_LENGTH,
+ VM_REG_GUEST_FS_BASE,
+ VM_REG_GUEST_GS_BASE,
+ VM_REG_GUEST_KGS_BASE,
+ VM_REG_GUEST_TPR,
VM_REG_LAST
};
diff --git a/sys/amd64/vmm/amd/vmcb.c b/sys/amd64/vmm/amd/vmcb.c
--- a/sys/amd64/vmm/amd/vmcb.c
+++ b/sys/amd64/vmm/amd/vmcb.c
@@ -39,6 +39,7 @@
#include "vmm_ktr.h"
+#include "vlapic.h"
#include "vmcb.h"
#include "svm.h"
#include "svm_softc.h"
@@ -231,6 +232,22 @@
*retval = seg->selector;
break;
+ case VM_REG_GUEST_FS_BASE:
+ case VM_REG_GUEST_GS_BASE:
+ seg = vmcb_segptr(vmcb, ident == VM_REG_GUEST_FS_BASE ?
+ VM_REG_GUEST_FS : VM_REG_GUEST_GS);
+ KASSERT(seg != NULL, ("%s: unable to get segment %d from VMCB",
+ __func__, ident));
+ *retval = seg->base;
+ break;
+ case VM_REG_GUEST_KGS_BASE:
+ *retval = state->kernelgsbase;
+ break;
+
+ case VM_REG_GUEST_TPR:
+ *retval = vlapic_get_cr8(vm_lapic(vcpu->vcpu));
+ break;
+
case VM_REG_GUEST_GDTR:
case VM_REG_GUEST_IDTR:
/* GDTR and IDTR don't have segment selectors */
diff --git a/sys/amd64/vmm/intel/vmcs.c b/sys/amd64/vmm/intel/vmcs.c
--- a/sys/amd64/vmm/intel/vmcs.c
+++ b/sys/amd64/vmm/intel/vmcs.c
@@ -119,10 +119,13 @@
return (VMCS_GUEST_PDPTE3);
case VM_REG_GUEST_ENTRY_INST_LENGTH:
return (VMCS_ENTRY_INST_LENGTH);
+ case VM_REG_GUEST_FS_BASE:
+ return (VMCS_GUEST_FS_BASE);
+ case VM_REG_GUEST_GS_BASE:
+ return (VMCS_GUEST_GS_BASE);
default:
return (-1);
}
-
}
static int
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -3404,8 +3404,16 @@
panic("vmx_getreg: %s%d is running", vm_name(vmx->vm),
vcpu->vcpuid);
- if (reg == VM_REG_GUEST_INTR_SHADOW)
+ switch (reg) {
+ case VM_REG_GUEST_INTR_SHADOW:
return (vmx_get_intr_shadow(vcpu, running, retval));
+ case VM_REG_GUEST_KGS_BASE:
+ *retval = vcpu->guest_msrs[IDX_MSR_KGSBASE];
+ return (0);
+ case VM_REG_GUEST_TPR:
+ *retval = vlapic_get_cr8(vm_lapic(vcpu->vcpu));
+ return (0);
+ }
if (vmxctx_getreg(&vcpu->ctx, reg, retval) == 0)
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 21, 4:51 AM (1 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27107423
Default Alt Text
D43665.id133605.diff (2 KB)
Attached To
Mode
D43665: vmm: Add some more registers
Attached
Detach File
Event Timeline
Log In to Comment