diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2017-03-19 03:42:39 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2017-03-19 03:42:39 +0000 |
commit | 4bb0275f35127285e882164f5c27ef872f8eeb98 (patch) | |
tree | 1f0db0654dad671fa2a37e081358390b284be84d /sys/arch/amd64 | |
parent | ee89493bc3de6d6729008aefa4f47d6bf1d894a2 (diff) |
Handle master/slave PIC vector base properly. OpenBSD uses 0x20/0x28
(respectively). Seabios uses 0x8/0x78 and linux uses 0x30/0x38. Respond
properly to PIC vector base assignment and calculate VMX injection
vectors based on current values, instead of always assuming OpenBSD
defaults.
Needed for both seabios serial console support as well as linux guest
support. Tested on -current as is, does not break existing OpenBSD
guest support.
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r-- | sys/arch/amd64/amd64/vmm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index 856c03db129..7c70c940401 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.119 2017/03/02 07:26:31 mlarkin Exp $ */ +/* $OpenBSD: vmm.c,v 1.120 2017/03/19 03:42:38 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> * @@ -3467,8 +3467,6 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp) } /* Handle vmd(8) injected interrupts */ - /* XXX - 0x20 should be changed to PIC's vector base */ - /* Is there an interrupt pending injection? */ if (irq != 0xFFFF) { if (!vcpu->vc_irqready) { @@ -3478,7 +3476,7 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp) break; } - eii = (irq & 0xFF) + 0x20; + eii = (irq & 0xFF); eii |= (1ULL << 31); /* Valid */ eii |= (0ULL << 8); /* Hardware Interrupt */ if (vmwrite(VMCS_ENTRY_INTERRUPTION_INFO, eii)) { |