summaryrefslogtreecommitdiffstats
path: root/sys/amd64/vmm
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-09-16 04:01:55 +0000
committerneel <neel@FreeBSD.org>2014-09-16 04:01:55 +0000
commit16169f746d3710b2943f893dbddcad4b605027ac (patch)
tree3d4cbd668cb5b6555c87269492993498fd3a56b5 /sys/amd64/vmm
parent97bffd44f67b710ce5f834be181e1edf14fcd978 (diff)
downloadFreeBSD-src-16169f746d3710b2943f893dbddcad4b605027ac.zip
FreeBSD-src-16169f746d3710b2943f893dbddcad4b605027ac.tar.gz
Minor cleanup.
Get rid of unused 'svm_feature' from the softc. Get rid of the redundant 'vcpu_cnt' checks in svm.c. There is a similar check in vmm.c against 'vm->active_cpus' before the AMD-specific code is called. Submitted by: Anish Gupta (akgupt3@gmail.com)
Diffstat (limited to 'sys/amd64/vmm')
-rw-r--r--sys/amd64/vmm/amd/svm.c12
-rw-r--r--sys/amd64/vmm/amd/svm_softc.h4
2 files changed, 1 insertions, 15 deletions
diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c
index 2de59ac..70c2e71 100644
--- a/sys/amd64/vmm/amd/svm.c
+++ b/sys/amd64/vmm/amd/svm.c
@@ -564,8 +564,6 @@ svm_vminit(struct vm *vm, pmap_t pmap)
M_SVM, M_WAITOK | M_ZERO);
svm_sc->vm = vm;
- svm_sc->svm_feature = svm_feature;
- svm_sc->vcpu_cnt = VM_MAXCPU;
svm_sc->nptp = (vm_offset_t)vtophys(pmap->pm_pml4);
/*
@@ -603,7 +601,7 @@ svm_vminit(struct vm *vm, pmap_t pmap)
msrpm_pa = vtophys(svm_sc->msr_bitmap);
pml4_pa = svm_sc->nptp;
- for (i = 0; i < svm_sc->vcpu_cnt; i++) {
+ for (i = 0; i < VM_MAXCPU; i++) {
vcpu = svm_get_vcpu(svm_sc, i);
vcpu->lastcpu = NOCPU;
vcpu->vmcb_pa = vtophys(&vcpu->vmcb);
@@ -1905,8 +1903,6 @@ svm_getreg(void *arg, int vcpu, int ident, uint64_t *val)
register_t *reg;
svm_sc = arg;
- KASSERT(vcpu < svm_sc->vcpu_cnt, ("Guest doesn't have VCPU%d", vcpu));
-
vmcb = svm_get_vmcb(svm_sc, vcpu);
if (vmcb_read(vmcb, ident, val) == 0) {
@@ -1936,8 +1932,6 @@ svm_setreg(void *arg, int vcpu, int ident, uint64_t val)
register_t *reg;
svm_sc = arg;
- KASSERT(vcpu < svm_sc->vcpu_cnt, ("Guest doesn't have VCPU%d", vcpu));
-
vmcb = svm_get_vmcb(svm_sc, vcpu);
if (vmcb_write(vmcb, ident, val) == 0) {
return (0);
@@ -1973,8 +1967,6 @@ svm_setdesc(void *arg, int vcpu, int type, struct seg_desc *desc)
uint16_t attrib;
svm_sc = arg;
- KASSERT(vcpu < svm_sc->vcpu_cnt, ("Guest doesn't have VCPU%d", vcpu));
-
vmcb = svm_get_vmcb(svm_sc, vcpu);
VCPU_CTR1(svm_sc->vm, vcpu, "SVM:set_desc: Type%d\n", type);
@@ -2006,8 +1998,6 @@ svm_getdesc(void *arg, int vcpu, int type, struct seg_desc *desc)
struct vmcb_segment *seg;
svm_sc = arg;
- KASSERT(vcpu < svm_sc->vcpu_cnt, ("Guest doesn't have VCPU%d", vcpu));
-
VCPU_CTR1(svm_sc->vm, vcpu, "SVM:get_desc: Type%d\n", type);
seg = vmcb_seg(svm_get_vmcb(svm_sc, vcpu), type);
diff --git a/sys/amd64/vmm/amd/svm_softc.h b/sys/amd64/vmm/amd/svm_softc.h
index 0cf163f..ed368df 100644
--- a/sys/amd64/vmm/amd/svm_softc.h
+++ b/sys/amd64/vmm/amd/svm_softc.h
@@ -77,10 +77,6 @@ struct svm_softc {
/* Guest VCPU h/w and s/w context. */
struct svm_vcpu vcpu[VM_MAXCPU];
-
- uint32_t svm_feature; /* SVM features from CPUID.*/
-
- int vcpu_cnt; /* number of VCPUs for this guest.*/
} __aligned(PAGE_SIZE);
CTASSERT((offsetof(struct svm_softc, nptp) & PAGE_MASK) == 0);
OpenPOWER on IntegriCloud