Make the virtual ioapic available unconditionally in a bhyve virtual machine.

This is in preparation for moving the ioapic device model from userspace to
vmm.ko.

Reviewed by:	grehan
This commit is contained in:
neel 2013-10-31 05:44:45 +00:00
parent 74368cc42d
commit 5acef51277
6 changed files with 20 additions and 24 deletions

View File

@ -173,7 +173,7 @@ while [ 1 ]; do
break
fi
${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P \
${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -A -H -P \
-g ${gdbport} \
-s 0:0,hostbridge \
-s 1:0,lpc \

View File

@ -806,7 +806,7 @@ static struct {
};
int
acpi_build(struct vmctx *ctx, int ncpu, int ioapic)
acpi_build(struct vmctx *ctx, int ncpu)
{
int err;
int i;
@ -814,11 +814,6 @@ acpi_build(struct vmctx *ctx, int ncpu, int ioapic)
err = 0;
basl_ncpu = ncpu;
if (!ioapic) {
fprintf(stderr, "ACPI tables require an ioapic\n");
return (EINVAL);
}
/*
* For debug, allow the user to have iasl compiler output sent
* to stdout rather than /dev/null

View File

@ -29,6 +29,6 @@
#ifndef _ACPI_H_
#define _ACPI_H_
int acpi_build(struct vmctx *ctx, int ncpu, int ioapic);
int acpi_build(struct vmctx *ctx, int ncpu);
#endif /* _ACPI_H_ */

View File

@ -132,7 +132,6 @@ usage(int code)
" -c: # cpus (default 1)\n"
" -p: pin vcpu 'n' to host cpu 'pincpu + n'\n"
" -H: vmexit from the guest on hlt\n"
" -I: present an ioapic to the guest\n"
" -P: vmexit from the guest on pause\n"
" -W: force virtio to use single-vector MSI\n"
" -e: exit on unhandled I/O access\n"
@ -543,7 +542,7 @@ fbsdrun_set_capabilities(struct vmctx *ctx, int cpu)
int
main(int argc, char *argv[])
{
int c, error, gdb_port, err, ioapic, bvmcons;
int c, error, gdb_port, err, bvmcons;
int max_vcpus;
struct vmctx *ctx;
uint64_t rip;
@ -553,7 +552,6 @@ main(int argc, char *argv[])
progname = basename(argv[0]);
gdb_port = 0;
guest_ncpus = 1;
ioapic = 0;
memsize = 256 * MB;
while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:l:")) != -1) {
@ -601,7 +599,13 @@ main(int argc, char *argv[])
guest_vmexit_on_hlt = 1;
break;
case 'I':
ioapic = 1;
/*
* The "-I" option was used to add an ioapic to the
* virtual machine.
*
* An ioapic is now provided unconditionally for each
* virtual machine and this option is now deprecated.
*/
break;
case 'P':
guest_vmexit_on_pause = 1;
@ -659,7 +663,6 @@ main(int argc, char *argv[])
if (init_pci(ctx) != 0)
exit(1);
if (ioapic)
ioapic_init(0);
if (gdb_port != 0)
@ -674,10 +677,10 @@ main(int argc, char *argv[])
/*
* build the guest tables, MP etc.
*/
mptable_build(ctx, guest_ncpus, ioapic);
mptable_build(ctx, guest_ncpus);
if (acpi) {
error = acpi_build(ctx, guest_ncpus, ioapic);
error = acpi_build(ctx, guest_ncpus);
assert(error == 0);
}

View File

@ -242,7 +242,7 @@ mptable_add_oemtbl(void *tbl, int tblsz)
}
int
mptable_build(struct vmctx *ctx, int ncpu, int ioapic)
mptable_build(struct vmctx *ctx, int ncpu)
{
mpcth_t mpch;
bus_entry_ptr mpeb;
@ -278,12 +278,10 @@ mptable_build(struct vmctx *ctx, int ncpu, int ioapic)
curraddr += sizeof(*mpeb) * MPE_NUM_BUSES;
mpch->entry_count += MPE_NUM_BUSES;
if (ioapic) {
mpei = (io_apic_entry_ptr)curraddr;
mpt_build_ioapic_entries(mpei, ncpu + 1);
curraddr += sizeof(*mpei);
mpch->entry_count++;
}
mpie = (int_entry_ptr) curraddr;
mpt_build_ioint_entries(mpie, MPEII_MAX_IRQ, ncpu + 1);

View File

@ -29,7 +29,7 @@
#ifndef _MPTBL_H_
#define _MPTBL_H_
int mptable_build(struct vmctx *ctx, int ncpu, int ioapic);
int mptable_build(struct vmctx *ctx, int ncpu);
void mptable_add_oemtbl(void *tbl, int tblsz);
#endif /* _MPTBL_H_ */