1. 15 4月, 2015 1 次提交
  2. 11 11月, 2014 1 次提交
  3. 06 11月, 2014 1 次提交
    • C
      xen/pcifront: Process failure for pcifront_(re)scan_root() · 23cf1d00
      Chen Gang 提交于
      When pcifront_try_connect() finds no PCI roots, it falls back to calling
      pcifront_scan_root() for 0000:00.  If that fails, it used to switch to
      XenbusStateConnected and return success (because xenbus_switch_state()
      currently always succeeds).
      
      If pcifront_scan_root() fails, leave the XenbusState unchanged and return
      an error code.
      
      Similarly, pcifront_attach_devices() falls back to calling
      pcifront_rescan_root() for 0000:00.  If that fails, it used to switch to
      XenbusStateConnected and return an error code.
      
      If pcifront_rescan_root() fails, leave the XenbusState unchanged and return
      the error code.
      
      [bhelgaas: changelog]
      Signed-off-by: NChen Gang <gang.chen.5i5j@gmail.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      23cf1d00
  4. 06 10月, 2014 1 次提交
  5. 18 4月, 2014 1 次提交
  6. 16 1月, 2014 1 次提交
  7. 04 1月, 2014 1 次提交
    • K
      xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4). · 51c71a3b
      Konrad Rzeszutek Wilk 提交于
      The user has the option of disabling the platform driver:
      00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
      
      which is used to unplug the emulated drivers (IDE, Realtek 8169, etc)
      and allow the PV drivers to take over. If the user wishes
      to disable that they can set:
      
        xen_platform_pci=0
        (in the guest config file)
      
      or
        xen_emul_unplug=never
        (on the Linux command line)
      
      except it does not work properly. The PV drivers still try to
      load and since the Xen platform driver is not run - and it
      has not initialized the grant tables, most of the PV drivers
      stumble upon:
      
      input: Xen Virtual Keyboard as /devices/virtual/input/input5
      input: Xen Virtual Pointer as /devices/virtual/input/input6M
      ------------[ cut here ]------------
      kernel BUG at /home/konrad/ssd/konrad/linux/drivers/xen/grant-table.c:1206!
      invalid opcode: 0000 [#1] SMP
      Modules linked in: xen_kbdfront(+) xenfs xen_privcmd
      CPU: 6 PID: 1389 Comm: modprobe Not tainted 3.13.0-rc1upstream-00021-ga6c892b-dirty #1
      Hardware name: Xen HVM domU, BIOS 4.4-unstable 11/26/2013
      RIP: 0010:[<ffffffff813ddc40>]  [<ffffffff813ddc40>] get_free_entries+0x2e0/0x300
      Call Trace:
       [<ffffffff8150d9a3>] ? evdev_connect+0x1e3/0x240
       [<ffffffff813ddd0e>] gnttab_grant_foreign_access+0x2e/0x70
       [<ffffffffa0010081>] xenkbd_connect_backend+0x41/0x290 [xen_kbdfront]
       [<ffffffffa0010a12>] xenkbd_probe+0x2f2/0x324 [xen_kbdfront]
       [<ffffffff813e5757>] xenbus_dev_probe+0x77/0x130
       [<ffffffff813e7217>] xenbus_frontend_dev_probe+0x47/0x50
       [<ffffffff8145e9a9>] driver_probe_device+0x89/0x230
       [<ffffffff8145ebeb>] __driver_attach+0x9b/0xa0
       [<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
       [<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
       [<ffffffff8145cf1c>] bus_for_each_dev+0x8c/0xb0
       [<ffffffff8145e7d9>] driver_attach+0x19/0x20
       [<ffffffff8145e260>] bus_add_driver+0x1a0/0x220
       [<ffffffff8145f1ff>] driver_register+0x5f/0xf0
       [<ffffffff813e55c5>] xenbus_register_driver_common+0x15/0x20
       [<ffffffff813e76b3>] xenbus_register_frontend+0x23/0x40
       [<ffffffffa0015000>] ? 0xffffffffa0014fff
       [<ffffffffa001502b>] xenkbd_init+0x2b/0x1000 [xen_kbdfront]
       [<ffffffff81002049>] do_one_initcall+0x49/0x170
      
      .. snip..
      
      which is hardly nice. This patch fixes this by having each
      PV driver check for:
       - if running in PV, then it is fine to execute (as that is their
         native environment).
       - if running in HVM, check if user wanted 'xen_emul_unplug=never',
         in which case bail out and don't load any PV drivers.
       - if running in HVM, and if PCI device 5853:0001 (xen_platform_pci)
         does not exist, then bail out and not load PV drivers.
       - (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=ide-disks',
         then bail out for all PV devices _except_ the block one.
         Ditto for the network one ('nics').
       - (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=unnecessary'
         then load block PV driver, and also setup the legacy IDE paths.
         In (v3) make it actually load PV drivers.
      
      Reported-by: Sander Eikelenboom <linux@eikelenboom.it
      Reported-by: NAnthony PERARD <anthony.perard@citrix.com>
      Reported-and-Tested-by: NFabio Fantoni <fabio.fantoni@m2r.biz>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      [v2: Add extra logic to handle the myrid ways 'xen_emul_unplug'
      can be used per Ian and Stefano suggestion]
      [v3: Make the unnecessary case work properly]
      [v4: s/disks/ide-disks/ spotted by Fabio]
      Reviewed-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> [for PCI parts]
      CC: stable@vger.kernel.org
      51c71a3b
  8. 15 6月, 2013 1 次提交
    • K
      xen/pcifront: Deal with toolstack missing 'XenbusStateClosing' state. · 098b1aea
      Konrad Rzeszutek Wilk 提交于
      There are two tool-stack that can instruct the Xen PCI frontend
      and backend to change states: 'xm' (Python code with a daemon),
      and 'xl' (C library - does not keep state changes).
      
      With the 'xm', the path to disconnect a single PCI device (xm pci-detach
      <guest> <BDF>) is:
      
      4(Connected)->7(Reconfiguring*)-> 8(Reconfigured)-> 4(Connected)->5(Closing*).
      
      The * is for states that the tool-stack sets. For 'xl', it is similar:
      
      4(Connected)->7(Reconfiguring*)-> 8(Reconfigured)-> 4(Connected)
      
      Both of them also tear down the XenBus structure, so the backend
      state ends up going in the 3(Initialised) and calls pcifront_xenbus_remove.
      
      When a PCI device is plugged back in (xm pci-attach <guest> <BDF>)
      both of them follow the same pattern:
      
      2(InitWait*), 3(Initialized*), 4(Connected*)->4(Connected).
      
      [xen-pcifront ignores the 2,3 state changes and only acts when
      4 (Connected) has been reached]
      
      Note that this is for a _single_ PCI device. If there were two
      PCI devices and only one was disconnected 'xm' would show the same
      state changes.
      
      The problem is that git commit 3d925320
      ("xen/pcifront: Use Xen-SWIOTLB when initting if required") introduced
      a mechanism to initialize the SWIOTLB when the Xen PCI front moves to
      Connected state. It also had some aggressive seatbelt code check that
      would warn the user if one tried to change to Connected state without
      hitting first the Closing state:
      
       pcifront pci-0: PCI frontend already installed!
      
      However, that code can be relaxed and we can continue on working
      even if the frontend is instructed to be the 'Connected' state with
      no devices and then gets tickled to be in 'Connected' state again.
      
      In other words, this 4(Connected)->5(Closing)->4(Connected) state
      was expected, while 4(Connected)->.... anything but 5(Closing)->4(Connected)
      was not. This patch removes that aggressive check and allows
      Xen pcifront to work with the 'xl' toolstack (for one or more
      PCI devices) and with 'xm' toolstack (for more than two PCI
      devices).
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: linux-pci@vger.kernel.org
      Cc: stable@vger.kernel.org
      [v2: Added in the description about two PCI devices]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      098b1aea
  9. 01 12月, 2012 1 次提交
  10. 29 11月, 2012 1 次提交
  11. 18 9月, 2012 1 次提交
    • K
      xen/pcifront: Use Xen-SWIOTLB when initting if required. · 3d925320
      Konrad Rzeszutek Wilk 提交于
      We piggyback on "xen/swiotlb: Use the swiotlb_late_init_with_tbl to init
      Xen-SWIOTLB late when PV PCI is used." functionality to start up
      the Xen-SWIOTLB if we are hot-plugged. This allows us to bypass
      the need to supply 'iommu=soft' on the Linux command line (mostly).
      With this patch, if a user forgot 'iommu=soft' on the command line,
      and hotplug a PCI device they will get:
      
      pcifront pci-0: Installing PCI frontend
      Warning: only able to allocate 4 MB for software IO TLB
      software IO TLB [mem 0x2a000000-0x2a3fffff] (4MB) mapped at [ffff88002a000000-ffff88002a3fffff]
      pcifront pci-0: Creating PCI Frontend Bus 0000:00
      pcifront pci-0: PCI host bridge to bus 0000:00
      pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
      pci_bus 0000:00: root bus resource [mem 0x00000000-0xfffffffff]
      pci 0000:00:00.0: [8086:10d3] type 00 class 0x020000
      pci 0000:00:00.0: reg 10: [mem 0xfe5c0000-0xfe5dffff]
      pci 0000:00:00.0: reg 14: [mem 0xfe500000-0xfe57ffff]
      pci 0000:00:00.0: reg 18: [io  0xe000-0xe01f]
      pci 0000:00:00.0: reg 1c: [mem 0xfe5e0000-0xfe5e3fff]
      pcifront pci-0: claiming resource 0000:00:00.0/0
      pcifront pci-0: claiming resource 0000:00:00.0/1
      pcifront pci-0: claiming resource 0000:00:00.0/2
      pcifront pci-0: claiming resource 0000:00:00.0/3
      e1000e: Intel(R) PRO/1000 Network Driver - 2.0.0-k
      e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
      e1000e 0000:00:00.0: Disabling ASPM L0s L1
      e1000e 0000:00:00.0: enabling device (0000 -> 0002)
      e1000e 0000:00:00.0: Xen PCI mapped GSI16 to IRQ34
      e1000e 0000:00:00.0: (unregistered net_device): Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode
      e1000e 0000:00:00.0: eth0: (PCI Express:2.5GT/s:Width x1) 00:1b:21:ab:c6:13
      e1000e 0000:00:00.0: eth0: Intel(R) PRO/1000 Network Connection
      e1000e 0000:00:00.0: eth0: MAC: 3, PHY: 8, PBA No: E46981-005
      
      The "Warning only" will go away if one supplies 'iommu=soft' instead
      as we have a higher chance of being able to allocate large swaths of
      memory.
      Acked-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      3d925320
  12. 13 9月, 2012 1 次提交
  13. 22 8月, 2012 1 次提交
  14. 07 4月, 2012 1 次提交
  15. 28 2月, 2012 1 次提交
  16. 04 2月, 2012 1 次提交
  17. 28 1月, 2012 1 次提交
  18. 25 1月, 2012 1 次提交
    • A
      Remove useless get_driver()/put_driver() calls · f3ff9247
      Alan Stern 提交于
      As part of the removal of get_driver()/put_driver(), this patch
      (as1512) gets rid of various useless and unnecessary calls in several
      drivers.  In some cases it may be desirable to pin the driver by
      calling try_module_get(), but that can be done later.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      CC: Michael Buesch <m@bues.ch>
      CC: Joerg Roedel <joerg.roedel@amd.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f3ff9247
  19. 05 1月, 2012 1 次提交
    • J
      Xen: consolidate and simplify struct xenbus_driver instantiation · 73db144b
      Jan Beulich 提交于
      The 'name', 'owner', and 'mod_name' members are redundant with the
      identically named fields in the 'driver' sub-structure. Rather than
      switching each instance to specify these fields explicitly, introduce
      a macro to simplify this.
      
      Eliminate further redundancy by allowing the drvname argument to
      DEFINE_XENBUS_DRIVER() to be blank (in which case the first entry from
      the ID table will be used for .driver.name).
      
      Also eliminate the questionable xenbus_register_{back,front}end()
      wrappers - their sole remaining purpose was the checking of the
      'owner' field, proper setting of which shouldn't be an issue anymore
      when the macro gets used.
      
      v2: Restore DRV_NAME for the driver name in xen-pciback.
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      73db144b
  20. 27 8月, 2011 1 次提交
    • K
      xen-pcifront: Update warning comment to use 'e820_host' option. · 917e3e65
      Konrad Rzeszutek Wilk 提交于
      With Xen changeset 23428 "libxl: Add 'e820_host' option to config file"
      the E820 as seen from the host can now be passed into the guest.
      This means that a PV guest can now:
       - Use the correct PCI I/O gap. Before these patches, Linux guest would
         boot up and would tell:
         [    0.000000] Allocating PCI resources starting at 40000000 (gap: 40000000:c0000000)
         while in actuality the PCI I/O gap should have been:
         [    0.000000] Allocating PCI resources starting at b0000000 (gap: b0000000:4c000000)
      
       - The PV domain with PCI devices was limited to 3GB. It now can be booted
         with 4GB, 8GB, or whatever number you want. The PCI devices will now _not_ conflict
         with System RAM. Meaning the drivers can load.
      
      CC: Jesse Barnes <jbarnes@virtuousgeek.org>
      CC: linux-pci@vger.kernel.org
      CC: stable@kernel.org
      [v2: Made the string less broken up. Suggested by Joe Perches]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      917e3e65
  21. 27 7月, 2011 1 次提交
  22. 19 2月, 2011 1 次提交
  23. 18 2月, 2011 2 次提交
  24. 09 11月, 2010 2 次提交
  25. 18 10月, 2010 1 次提交