Author: jhb
Date: Mon Jan 27 22:26:15 2014
New Revision: 261217
URL: http://svnweb.freebsd.org/changeset/base/261217

Log:
  Remove support for legacy PCI devices.  These haven't been needed since
  support for LPC uart devices was added and it conflicts with upcoming
  patches to add PCI INTx support.
  
  Reviewed by:  neel

Modified:
  head/usr.sbin/bhyve/bhyve.8
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/pci_emul.c
  head/usr.sbin/bhyve/pci_emul.h
  head/usr.sbin/bhyve/pci_uart.c

Modified: head/usr.sbin/bhyve/bhyve.8
==============================================================================
--- head/usr.sbin/bhyve/bhyve.8 Mon Jan 27 19:49:52 2014        (r261216)
+++ head/usr.sbin/bhyve/bhyve.8 Mon Jan 27 22:26:15 2014        (r261217)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 12, 2013
+.Dd January 27, 2014
 .Dt BHYVE 8
 .Os
 .Sh NAME
@@ -37,7 +37,6 @@
 .Op Fl g Ar gdbport
 .Op Fl p Ar pinnedcpu
 .Op Fl s Ar slot,emulation Ns Op , Ns Ar conf
-.Op Fl S Ar slot,emulation Ns Op , Ns Ar conf
 .Op Fl l Ar lpcdev Ns Op , Ns Ar conf
 .Ar vmname
 .Sh DESCRIPTION
@@ -202,13 +201,6 @@ The host device must have been reserved 
 loader variable as described in
 .Xr vmm 4 .
 .El
-.It Fl S Ar slot , Ns Ar emulation Ns Op , Ns Ar conf
-Identical to the -s option except the device is instructed to use legacy
-ISA addresses if possible.
-Currently this only has an effect with the
-.Li uart
-device emulation.
-This option will be deprecated in a future version.
 .It Fl l Ar lpcdev Ns Op , Ns Ar conf
 Allow devices behind the LPC PCI-ISA bridge to be configured.
 The only supported devices are the TTY-class devices,

Modified: head/usr.sbin/bhyve/bhyverun.c
==============================================================================
--- head/usr.sbin/bhyve/bhyverun.c      Mon Jan 27 19:49:52 2014        
(r261216)
+++ head/usr.sbin/bhyve/bhyverun.c      Mon Jan 27 22:26:15 2014        
(r261217)
@@ -124,7 +124,7 @@ usage(int code)
 {
 
         fprintf(stderr,
-                "Usage: %s [-aehwAHIPW] [-g <gdb port>] [-s <pci>] [-S 
<pci>]\n"
+                "Usage: %s [-aehwAHIPW] [-g <gdb port>] [-s <pci>]\n"
                "       %*s [-c vcpus] [-p pincpu] [-m mem] [-l <lpc>] <vm>\n"
                "       -a: local apic is in XAPIC mode (default is X2APIC)\n"
                "       -A: create an ACPI table\n"
@@ -137,7 +137,6 @@ usage(int code)
                "       -e: exit on unhandled I/O access\n"
                "       -h: help\n"
                "       -s: <slot,driver,configinfo> PCI slot config\n"
-               "       -S: <slot,driver,configinfo> legacy PCI slot config\n"
                "       -l: LPC device configuration\n"
                "       -m: memory size in MB\n"
                "       -w: ignore unimplemented MSRs\n",
@@ -599,7 +598,7 @@ main(int argc, char *argv[])
        guest_ncpus = 1;
        memsize = 256 * MB;
 
-       while ((c = getopt(argc, argv, "abehwAHIPWp:g:c:s:S:m:l:")) != -1) {
+       while ((c = getopt(argc, argv, "abehwAHIPWp:g:c:s:m:l:")) != -1) {
                switch (c) {
                case 'a':
                        disable_x2apic = 1;
@@ -626,12 +625,7 @@ main(int argc, char *argv[])
                        }
                        break;
                case 's':
-                       if (pci_parse_slot(optarg, 0) != 0)
-                               exit(1);
-                       else
-                               break;
-               case 'S':
-                       if (pci_parse_slot(optarg, 1) != 0)
+                       if (pci_parse_slot(optarg) != 0)
                                exit(1);
                        else
                                break;

Modified: head/usr.sbin/bhyve/pci_emul.c
==============================================================================
--- head/usr.sbin/bhyve/pci_emul.c      Mon Jan 27 19:49:52 2014        
(r261216)
+++ head/usr.sbin/bhyve/pci_emul.c      Mon Jan 27 22:26:15 2014        
(r261217)
@@ -75,7 +75,6 @@ static struct slotinfo {
        char    *si_name;
        char    *si_param;
        struct pci_devinst *si_devi;
-       int     si_legacy;
 } pci_slotinfo[MAXSLOTS][MAXFUNCS];
 
 SET_DECLARE(pci_devemu_set, struct pci_devemu);
@@ -123,7 +122,7 @@ pci_parse_slot_usage(char *aopt)
 }
 
 int
-pci_parse_slot(char *opt, int legacy)
+pci_parse_slot(char *opt)
 {
        char *slot, *func, *emul, *config;
        char *str, *cpy;
@@ -170,7 +169,6 @@ pci_parse_slot(char *opt, int legacy)
        error = 0;
        pci_slotinfo[snum][fnum].si_name = emul;
        pci_slotinfo[snum][fnum].si_param = config;
-       pci_slotinfo[snum][fnum].si_legacy = legacy;
 
 done:
        if (error)
@@ -521,13 +519,7 @@ pci_emul_alloc_pbar(struct pci_devinst *
                addr = mask = lobits = 0;
                break;
        case PCIBAR_IO:
-               if (hostbase &&
-                   pci_slotinfo[pdi->pi_slot][pdi->pi_func].si_legacy) {
-                       assert(hostbase < PCI_EMUL_IOBASE);
-                       baseptr = &hostbase;
-               } else {
-                       baseptr = &pci_emul_iobase;
-               }
+               baseptr = &pci_emul_iobase;
                limit = PCI_EMUL_IOLIMIT;
                mask = PCIM_BAR_IO_BASE;
                lobits = PCIM_BAR_IO_SPACE;
@@ -1185,13 +1177,6 @@ pci_generate_msi(struct pci_devinst *pi,
 }
 
 int
-pci_is_legacy(struct pci_devinst *pi)
-{
-
-       return (pci_slotinfo[pi->pi_slot][pi->pi_func].si_legacy);
-}
-
-int
 pci_lintr_request(struct pci_devinst *pi, int req)
 {
        int irq;

Modified: head/usr.sbin/bhyve/pci_emul.h
==============================================================================
--- head/usr.sbin/bhyve/pci_emul.h      Mon Jan 27 19:49:52 2014        
(r261216)
+++ head/usr.sbin/bhyve/pci_emul.h      Mon Jan 27 22:26:15 2014        
(r261217)
@@ -199,7 +199,6 @@ int pci_emul_alloc_pbar(struct pci_devin
            uint64_t hostbase, enum pcibar_type type, uint64_t size);
 int    pci_emul_add_msicap(struct pci_devinst *pi, int msgnum);
 int    pci_emul_add_pciecap(struct pci_devinst *pi, int pcie_device_type);
-int    pci_is_legacy(struct pci_devinst *pi);
 void   pci_generate_msi(struct pci_devinst *pi, int msgnum);
 void   pci_generate_msix(struct pci_devinst *pi, int msgnum);
 void   pci_lintr_assert(struct pci_devinst *pi);
@@ -210,7 +209,7 @@ int pci_msix_enabled(struct pci_devinst 
 int    pci_msix_table_bar(struct pci_devinst *pi);
 int    pci_msix_pba_bar(struct pci_devinst *pi);
 int    pci_msi_msgnum(struct pci_devinst *pi);
-int    pci_parse_slot(char *opt, int legacy);
+int    pci_parse_slot(char *opt);
 void   pci_populate_msicap(struct msicap *cap, int msgs, int nextptr);
 int    pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum);
 int    pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size,

Modified: head/usr.sbin/bhyve/pci_uart.c
==============================================================================
--- head/usr.sbin/bhyve/pci_uart.c      Mon Jan 27 19:49:52 2014        
(r261216)
+++ head/usr.sbin/bhyve/pci_uart.c      Mon Jan 27 22:26:15 2014        
(r261217)
@@ -85,28 +85,13 @@ pci_uart_read(struct vmctx *ctx, int vcp
        return (val);
 }
 
-static int pci_uart_nldevs;    /* number of legacy uart ports allocated */
-
 static int
 pci_uart_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
 {
        struct uart_softc *sc;
-       int ioaddr, ivec;
 
-       if (pci_is_legacy(pi)) {
-               if (uart_legacy_alloc(pci_uart_nldevs, &ioaddr, &ivec) != 0) {
-                       fprintf(stderr, "Unable to allocate resources for "
-                           "legacy COM%d port at pci device %d:%d\n",
-                           pci_uart_nldevs + 1, pi->pi_slot, pi->pi_func);
-                       return (-1);
-               }
-               pci_uart_nldevs++;
-               pci_emul_alloc_pbar(pi, 0, ioaddr, PCIBAR_IO, UART_IO_BAR_SIZE);
-       } else {
-               ivec = -1;
-               pci_emul_alloc_bar(pi, 0, PCIBAR_IO, UART_IO_BAR_SIZE);
-       }
-       pci_lintr_request(pi, ivec);
+       pci_emul_alloc_bar(pi, 0, PCIBAR_IO, UART_IO_BAR_SIZE);
+       pci_lintr_request(pi, -1);
 
        /* initialize config space */
        pci_set_cfgdata16(pi, PCIR_DEVICE, COM_DEV);
_______________________________________________
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