MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nrip_valid

Function nrip_valid

freebsd/amd64/vmm/amd/svm.c:1303–1320  ·  view source on GitHub ↗

* From section "State Saved on Exit" in APMv2: nRIP is saved for all #VMEXITs * that are due to instruction intercepts as well as MSR and IOIO intercepts * and exceptions caused by INT3, INTO and BOUND instructions. * * Return 1 if the nRIP is valid and 0 otherwise. */

Source from the content-addressed store, hash-verified

1301 * Return 1 if the nRIP is valid and 0 otherwise.
1302 */
1303static int
1304nrip_valid(uint64_t exitcode)
1305{
1306 switch (exitcode) {
1307 case 0x00 ... 0x0F: /* read of CR0 through CR15 */
1308 case 0x10 ... 0x1F: /* write of CR0 through CR15 */
1309 case 0x20 ... 0x2F: /* read of DR0 through DR15 */
1310 case 0x30 ... 0x3F: /* write of DR0 through DR15 */
1311 case 0x43: /* INT3 */
1312 case 0x44: /* INTO */
1313 case 0x45: /* BOUND */
1314 case 0x65 ... 0x7C: /* VMEXIT_CR0_SEL_WRITE ... VMEXIT_MSR */
1315 case 0x80 ... 0x8D: /* VMEXIT_VMRUN ... VMEXIT_XSETBV */
1316 return (1);
1317 default:
1318 return (0);
1319 }
1320}
1321
1322static int
1323svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct vm_exit *vmexit)

Callers 1

svm_vmexitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected