Make the vmm code compile with gcc too. Not entirely sure things are

correct for the pirbase test (since I'd have thought we'd need to do
something even when the offset is 0 and that test looks like a
misguided attempt to not use an uninitialized variable), but it is at
least the same as today.
This commit is contained in:
imp 2014-04-05 22:43:23 +00:00
parent 7081aab77a
commit e8da9ba992
4 changed files with 9 additions and 24 deletions

View File

@ -1048,6 +1048,7 @@ vmx_set_pcpu_defaults(struct vmx *vmx, int vcpu, pmap_t pmap)
invvpid_desc._res1 = 0;
invvpid_desc._res2 = 0;
invvpid_desc.vpid = vmxstate->vpid;
invvpid_desc.linear_addr = 0;
invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc);
} else {
/*
@ -2742,7 +2743,7 @@ vmx_inject_pir(struct vlapic *vlapic)
struct pir_desc *pir_desc;
struct LAPIC *lapic;
uint64_t val, pirval;
int rvi, pirbase;
int rvi, pirbase = -1;
uint16_t intr_status_old, intr_status_new;
vlapic_vtx = (struct vlapic_vtx *)vlapic;
@ -2787,6 +2788,11 @@ vmx_inject_pir(struct vlapic *vlapic)
pirbase = 192;
pirval = val;
}
if (pirbase == -1) {
VCPU_CTR0(vlapic->vm, vlapic->vcpuid, "vmx_inject_pir: "
"no posted interrupt found");
return;
}
VLAPIC_CTR_IRR(vlapic, "vmx_inject_pir");
/*

View File

@ -473,7 +473,7 @@ vatpic_master_handler(void *vm, int vcpuid, struct vm_exit *vmexit)
{
struct vatpic *vatpic;
struct atpic *atpic;
int error;
int error = 0;;
uint8_t val;
vatpic = vm_atpic(vm);

View File

@ -234,28 +234,6 @@ vatpit_update_mode(struct vatpit *vatpit, uint8_t val)
return (0);
}
static int
vatpit_get_out(struct vatpit *vatpit, int channel)
{
struct channel *c;
sbintime_t delta_ticks;
int out;
c = &vatpit->channel[channel];
switch (c->mode) {
case TIMER_INTTC:
delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt;
out = ((c->initial - delta_ticks) <= 0);
break;
default:
out = 0;
break;
}
return (out);
}
int
vatpit_handler(void *vm, int vcpuid, struct vm_exit *vmexit)
{

View File

@ -231,6 +231,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag,
break;
default:
error = EINVAL;
break;
}