Author: neel
Date: Thu Oct 31 05:44:45 2013
New Revision: 257423
URL: http://svnweb.freebsd.org/changeset/base/257423

Log:
  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

Modified:
  head/share/examples/bhyve/vmrun.sh
  head/usr.sbin/bhyve/acpi.c
  head/usr.sbin/bhyve/acpi.h
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/mptbl.c
  head/usr.sbin/bhyve/mptbl.h

Modified: head/share/examples/bhyve/vmrun.sh
==============================================================================
--- head/share/examples/bhyve/vmrun.sh  Thu Oct 31 05:20:11 2013        
(r257422)
+++ head/share/examples/bhyve/vmrun.sh  Thu Oct 31 05:44:45 2013        
(r257423)
@@ -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                                              \

Modified: head/usr.sbin/bhyve/acpi.c
==============================================================================
--- head/usr.sbin/bhyve/acpi.c  Thu Oct 31 05:20:11 2013        (r257422)
+++ head/usr.sbin/bhyve/acpi.c  Thu Oct 31 05:44:45 2013        (r257423)
@@ -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, 
        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

Modified: head/usr.sbin/bhyve/acpi.h
==============================================================================
--- head/usr.sbin/bhyve/acpi.h  Thu Oct 31 05:20:11 2013        (r257422)
+++ head/usr.sbin/bhyve/acpi.h  Thu Oct 31 05:44:45 2013        (r257423)
@@ -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_ */

Modified: head/usr.sbin/bhyve/bhyverun.c
==============================================================================
--- head/usr.sbin/bhyve/bhyverun.c      Thu Oct 31 05:20:11 2013        
(r257422)
+++ head/usr.sbin/bhyve/bhyverun.c      Thu Oct 31 05:44:45 2013        
(r257423)
@@ -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 *c
 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,8 +663,7 @@ main(int argc, char *argv[])
        if (init_pci(ctx) != 0)
                exit(1);
 
-       if (ioapic)
-               ioapic_init(0);
+       ioapic_init(0);
 
        if (gdb_port != 0)
                init_dbgport(gdb_port);
@@ -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);
        }
 

Modified: head/usr.sbin/bhyve/mptbl.c
==============================================================================
--- head/usr.sbin/bhyve/mptbl.c Thu Oct 31 05:20:11 2013        (r257422)
+++ head/usr.sbin/bhyve/mptbl.c Thu Oct 31 05:44:45 2013        (r257423)
@@ -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 ncp
        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++;
-       }
+       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);

Modified: head/usr.sbin/bhyve/mptbl.h
==============================================================================
--- head/usr.sbin/bhyve/mptbl.h Thu Oct 31 05:20:11 2013        (r257422)
+++ head/usr.sbin/bhyve/mptbl.h Thu Oct 31 05:44:45 2013        (r257423)
@@ -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_ */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to