Skip to content

Commit

Permalink
HBSD: hide the Silicon Debug CPU capability from bhyve
Browse files Browse the repository at this point in the history
There is no place for a strongly hardware related and risky
feature in bhyve's vmm, so filter out this capability. So
disable them by default and set the lock bit to disallow
further changes to them.

MFC-to: 10-STABLE 11-STABLE
Signed-off-by: Oliver Pinter <oliver.pinter@hardenedbsd.org>
  • Loading branch information
opntr committed Jan 25, 2017
1 parent e76fcb7 commit cc91b57
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions usr.sbin/bhyve/xmsr.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ emulate_wrmsr(struct vmctx *ctx, int vcpu, uint32_t num, uint64_t val)
return (0);
case MSR_BIOS_SIGN:
return (0);
case MSR_IA32_DEBUG_INTERFACE:
return (0);
default:
break;
}
Expand Down Expand Up @@ -120,6 +122,13 @@ emulate_rdmsr(struct vmctx *ctx, int vcpu, uint32_t num, uint64_t *val)
*/
*val = 0x000a1003;
break;
case MSR_IA32_DEBUG_INTERFACE:
/*
* Mark the Silicon Debug feature as disabled
* and lock the configuration.
*/
*val = 0 | IA32_DEBUG_INTERFACE_LOCK;
return (0);
default:
error = -1;
break;
Expand Down

0 comments on commit cc91b57

Please sign in to comment.