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

Function svm_getreg

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

Source from the content-addressed store, hash-verified

2194}
2195
2196static int
2197svm_getreg(void *arg, int vcpu, int ident, uint64_t *val)
2198{
2199 struct svm_softc *svm_sc;
2200 register_t *reg;
2201
2202 svm_sc = arg;
2203
2204 if (ident == VM_REG_GUEST_INTR_SHADOW) {
2205 return (svm_get_intr_shadow(svm_sc, vcpu, val));
2206 }
2207
2208 if (vmcb_read(svm_sc, vcpu, ident, val) == 0) {
2209 return (0);
2210 }
2211
2212 reg = swctx_regptr(svm_get_guest_regctx(svm_sc, vcpu), ident);
2213
2214 if (reg != NULL) {
2215 *val = *reg;
2216 return (0);
2217 }
2218
2219 VCPU_CTR1(svm_sc->vm, vcpu, "svm_getreg: unknown register %#x", ident);
2220 return (EINVAL);
2221}
2222
2223static int
2224svm_setreg(void *arg, int vcpu, int ident, uint64_t val)

Callers 1

svm_snapshot_regFunction · 0.85

Calls 4

svm_get_intr_shadowFunction · 0.85
vmcb_readFunction · 0.85
swctx_regptrFunction · 0.85
svm_get_guest_regctxFunction · 0.85

Tested by

no test coverage detected