06 Oct, 2020

1 commit

  • Split out all the bits that are purely for dma_map_ops implementations
    and related code into a new header so that they
    don't get pulled into all the drivers. That also means the architecture
    specific is not pulled in by
    any more, which leads to a missing includes that were pulled in by the
    x86 or arm versions in a few not overly portable drivers.

    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

29 May, 2020

1 commit


14 May, 2019

1 commit


09 May, 2019

1 commit

  • Replace dev_printk(KERN_DEBUG) with dev_info(), etc to be more consistent
    with other logging and avoid checkpatch warnings.

    The KERN_DEBUG messages could be converted to dev_dbg(), but that depends
    on CONFIG_DYNAMIC_DEBUG and DEBUG, and we want most of these messages to
    *always* be in the dmesg log.

    Link: https://lore.kernel.org/lkml/1555733240-19875-1-git-send-email-mohankumar718@gmail.com
    Signed-off-by: Mohan Kumar
    [bhelgaas: commit log]
    Signed-off-by: Bjorn Helgaas

    Mohan Kumar
     

21 Mar, 2019

1 commit

  • In preparation to enabling -Wimplicit-fallthrough, mark switch
    cases where we are expecting to fall through.

    This patch fixes the following warnings:

    drivers/pci/proc.c: In function ‘proc_bus_pci_ioctl’:
    drivers/pci/proc.c:216:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (arch_can_pci_mmap_wc()) {
    ^
    drivers/pci/proc.c:225:2: note: here
    default:
    ^~~~~~~

    drivers/pci/xen-pcifront.c: In function ‘pcifront_backend_changed’:
    drivers/pci/xen-pcifront.c:1105:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    if (xdev->state == XenbusStateClosed)
    ^
    drivers/pci/xen-pcifront.c:1108:2: note: here
    case XenbusStateClosing:
    ^~~~

    Notice that, in this particular case, the /* fall through */
    comment is placed at the very bottom of the case statement,
    which is what GCC is expecting to find.

    Warning level 3 was used: -Wimplicit-fallthrough=3

    This patch is part of the ongoing efforts to enable
    -Wimplicit-fallthrough.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Bjorn Helgaas

    Gustavo A. R. Silva
     

20 Mar, 2018

1 commit

  • Remove pointless comments that tell us the file name, remove blank line
    comments, follow multi-line comment conventions. No functional change
    intended.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     

02 Feb, 2018

1 commit

  • * pci/spdx:
    PCI: Add SPDX GPL-2.0+ to replace implicit GPL v2 or later statement
    PCI: Add SPDX GPL-2.0+ to replace GPL v2 or later boilerplate
    PCI: Add SPDX GPL-2.0 to replace COPYING boilerplate
    PCI: Add SPDX GPL-2.0 to replace GPL v2 boilerplate
    PCI: Add SPDX GPL-2.0 when no license was specified

    Bjorn Helgaas
     

01 Feb, 2018

1 commit

  • * pci/misc:
    PCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build
    PCI: Add wrappers for dev_printk()
    PCI: Remove unnecessary messages for memory allocation failures
    PCI: Add #defines for Completion Timeout Disable feature
    hinic: Replace PCI pool old API
    net: e100: Replace PCI pool old API
    block: DAC960: Replace PCI pool old API
    MAINTAINERS: Include more PCI files
    PCI: Remove unneeded kallsyms include
    powerpc/pci: Unroll two pass loop when scanning bridges
    powerpc/pci: Use for_each_pci_bridge() helper

    Bjorn Helgaas
     

27 Jan, 2018

1 commit

  • b24413180f56 ("License cleanup: add SPDX GPL-2.0 license identifier to
    files with no license") added SPDX GPL-2.0 to several PCI files that
    previously contained no license information.

    Add SPDX GPL-2.0 to all other PCI files that did not contain any license
    information and hence were under the default GPL version 2 license of the
    kernel.

    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Greg Kroah-Hartman

    Bjorn Helgaas
     

19 Jan, 2018

1 commit


17 Jan, 2018

1 commit

  • pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
    where a PCI device is present. This restricts the device drivers to be
    reused for other domain numbers.

    Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
    extract the domain number. Other places, use the actual domain number from
    the device.

    Signed-off-by: Sinan Kaya
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Juergen Gross

    Sinan Kaya
     

07 Nov, 2016

1 commit

  • Use xenbus_read_unsigned() instead of xenbus_scanf() when possible.
    This requires to change the type of the read from int to unsigned,
    but this case has been wrong before: negative values are not allowed
    for the modified case.

    Cc: bhelgaas@google.com
    Cc: linux-pci@vger.kernel.org

    Signed-off-by: Juergen Gross
    Acked-by: Bjorn Helgaas
    Acked-by: David Vrabel

    Juergen Gross
     

03 Aug, 2016

1 commit

  • There was only one use of __initdata_refok and __exit_refok

    __init_refok was used 46 times against 82 for __ref.

    Those definitions are obsolete since commit 312b1485fb50 ("Introduce new
    section reference annotations tags: __ref, __refdata, __refconst")

    This patch removes the following compatibility definitions and replaces
    them treewide.

    /* compatibility defines */
    #define __init_refok __ref
    #define __initdata_refok __refdata
    #define __exit_refok __ref

    I can also provide separate patches if necessary.
    (One patch per tree and check in 1 month or 2 to remove old definitions)

    [akpm@linux-foundation.org: coding-style fixes]
    Link: http://lkml.kernel.org/r/1466796271-3043-1-git-send-email-fabf@skynet.be
    Signed-off-by: Fabian Frederick
    Cc: Ingo Molnar
    Cc: Sam Ravnborg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabian Frederick
     

15 Feb, 2016

1 commit

  • Occasionaly PV guests would crash with:

    pciback 0000:00:00.1: Xen PCI mapped GSI0 to IRQ16
    BUG: unable to handle kernel paging request at 0000000d1a8c0be0
    .. snip..
    ] find_next_bit+0xb/0x10
    [] cpumask_next_and+0x22/0x40
    [] pci_device_probe+0xb8/0x120
    [] ? driver_sysfs_add+0x77/0xa0
    [] driver_probe_device+0x1a4/0x2d0
    [] ? pci_match_device+0xdd/0x110
    [] __device_attach_driver+0xa7/0xb0
    [] ? __driver_attach+0xa0/0xa0
    [] bus_for_each_drv+0x62/0x90
    [] __device_attach+0xbd/0x110
    [] device_attach+0xb/0x10
    [] pci_bus_add_device+0x3c/0x70
    [] pci_bus_add_devices+0x38/0x80
    [] pcifront_scan_root+0x13e/0x1a0
    [] pcifront_backend_changed+0x262/0x60b
    [] ? xenbus_gather+0xd6/0x160
    [] ? put_object+0x2f/0x50
    [] xenbus_otherend_changed+0x9d/0xa0
    [] backend_changed+0xe/0x10
    [] xenwatch_thread+0xc8/0x190
    [] ? woken_wake_function+0x10/0x10

    which was the result of two things:

    When we call pci_scan_root_bus we would pass in 'sd' (sysdata)
    pointer which was an 'pcifront_sd' structure. However in the
    pci_device_add it expects that the 'sd' is 'struct sysdata' and
    sets the dev->node to what is in sd->node (offset 4):

    set_dev_node(&dev->dev, pcibus_to_node(bus));

    __pcibus_to_node(const struct pci_bus *bus)
    {
    const struct pci_sysdata *sd = bus->sysdata;

    return sd->node;
    }

    However our structure was pcifront_sd which had nothing at that
    offset:

    struct pcifront_sd {
    int domain; /* 0 4 */
    /* XXX 4 bytes hole, try to pack */
    struct pcifront_device * pdev; /* 8 8 */
    }

    That is an hole - filled with garbage as we used kmalloc instead of
    kzalloc (the second problem).

    This patch fixes the issue by:
    1) Use kzalloc to initialize to a well known state.
    2) Put 'struct pci_sysdata' at the start of 'pcifront_sd'. That
    way access to the 'node' will access the right offset.

    Signed-off-by: Konrad Rzeszutek Wilk
    Cc:
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: David Vrabel

    Konrad Rzeszutek Wilk
     

23 Jul, 2015

1 commit

  • Use accessor for_each_pci_msi_entry() to access MSI device list, so we
    could easily move msi_list from struct pci_dev into struct device
    later.

    Signed-off-by: Jiang Liu
    Reviewed-by: Yijing Wang
    Acked-by: Bjorn Helgaas
    Acked-by: Konrad Rzeszutek Wilk
    Cc: Tony Luck
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: xen-devel@lists.xenproject.org
    Cc: Grant Likely
    Cc: Marc Zyngier
    Cc: Stuart Yoder
    Cc: Borislav Petkov
    Cc: Boris Ostrovsky
    Cc: David Vrabel
    Link: http://lkml.kernel.org/r/1436428847-8886-7-git-send-email-jiang.liu@linux.intel.com
    Signed-off-by: Thomas Gleixner

    Jiang Liu
     

02 Jul, 2015

1 commit

  • Pull xen updates from David Vrabel:
    "Xen features and cleanups for 4.2-rc0:

    - add "make xenconfig" to assist in generating configs for Xen guests

    - preparatory cleanups necessary for supporting 64 KiB pages in ARM
    guests

    - automatically use hvc0 as the default console in ARM guests"

    * tag 'for-linus-4.2-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    block/xen-blkback: s/nr_pages/nr_segs/
    block/xen-blkfront: Remove invalid comment
    block/xen-blkfront: Remove unused macro MAXIMUM_OUTSTANDING_BLOCK_REQS
    arm/xen: Drop duplicate define mfn_to_virt
    xen/grant-table: Remove unused macro SPP
    xen/xenbus: client: Fix call of virt_to_mfn in xenbus_grant_ring
    xen: Include xen/page.h rather than asm/xen/page.h
    kconfig: add xenconfig defconfig helper
    kconfig: clarify kvmconfig is for kvm
    xen/pcifront: Remove usage of struct timeval
    xen/tmem: use BUILD_BUG_ON() in favor of BUG_ON()
    hvc_xen: avoid uninitialized variable warning
    xenbus: avoid uninitialized variable warning
    xen/arm: allow console=hvc0 to be omitted for guests
    arm,arm64/xen: move Xen initialization earlier
    arm/xen: Correctly check if the event channel interrupt is present

    Linus Torvalds
     

13 Jun, 2015

1 commit


08 Jun, 2015

1 commit

  • struct timeval uses a 32-bit field for representing seconds, which
    will overflow in the year 2038 and beyond. Replace struct timeval with
    64-bit ktime_t which is 2038 safe. This is part of a larger effort to
    remove instances of 32-bit timekeeping variables (timeval, time_t and
    timespec) from the kernel.

    Signed-off-by: Tina Ruchandani
    Suggested-by: Arnd Bergmann
    Reviewed-by: Boris Ostrovsky
    Reviewed-by: Arnd Bergmann
    Acked-by: Bjorn Helgaas
    Signed-off-by: David Vrabel

    Tina Ruchandani
     

15 Apr, 2015

1 commit

  • Originally Xen PV drivers only use single-page ring to pass along
    information. This might limit the throughput between frontend and
    backend.

    The patch extends Xenbus driver to support multi-page ring, which in
    general should improve throughput if ring is the bottleneck. Changes to
    various frontend / backend to adapt to the new interface are also
    included.

    Affected Xen drivers:
    * blkfront/back
    * netfront/back
    * pcifront/back
    * scsifront/back
    * vtpmfront

    The interface is documented, as before, in xenbus_client.c.

    Signed-off-by: Wei Liu
    Signed-off-by: Paul Durrant
    Signed-off-by: Bob Liu
    Cc: Konrad Wilk
    Cc: Boris Ostrovsky
    Signed-off-by: David Vrabel

    Wei Liu
     

20 Nov, 2014

1 commit

  • …/virtualization' into next

    * pci/enumeration:
    PCI: Remove fixed parameter in pci_iov_resource_bar()
    PCI: Add informational printk for invalid BARs
    PCI: Shrink decoding-disabled window while sizing BARs
    PCI: Restore detection of read-only BARs

    * pci/hotplug:
    PCI: Remove unused and broken to_hotplug_slot()

    * pci/misc:
    PCI: Make FLR and AF FLR reset warning messages different
    PCI: Simplify if-return sequences
    PCI: Delete unnecessary NULL pointer checks

    * pci/numa:
    PCI: Allow numa_node override via sysfs

    * pci/virtualization:
    xen/pcifront: Process failure for pcifront_(re)scan_root()

    Bjorn Helgaas
     

11 Nov, 2014

1 commit

  • The functions pci_dev_put(), pci_pme_wakeup_bus(), and put_device() return
    immediately if their argument is NULL. Thus the test before the call is
    not needed.

    Remove these unnecessary tests.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring
    Signed-off-by: Bjorn Helgaas

    Markus Elfring
     

06 Nov, 2014

1 commit

  • 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: Chen Gang
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Konrad Rzeszutek Wilk

    Chen Gang
     

06 Oct, 2014

1 commit


18 Apr, 2014

1 commit

  • Mostly scripted conversion of the smp_mb__* barriers.

    Signed-off-by: Peter Zijlstra
    Acked-by: Paul E. McKenney
    Link: http://lkml.kernel.org/n/tip-55dhyhocezdw1dg7u19hmh1u@git.kernel.org
    Cc: Linus Torvalds
    Cc: linux-arch@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

23 Jan, 2014

1 commit

  • Pull Xen updates from Konrad Rzeszutek Wilk:
    "Two major features that Xen community is excited about:

    The first is event channel scalability by David Vrabel - we switch
    over from an two-level per-cpu bitmap of events (IRQs) - to an FIFO
    queue with priorities. This lets us be able to handle more events,
    have lower latency, and better scalability. Good stuff.

    The other is PVH by Mukesh Rathor. In short, PV is a mode where the
    kernel lets the hypervisor program page-tables, segments, etc. With
    EPT/NPT capabilities in current processors, the overhead of doing this
    in an HVM (Hardware Virtual Machine) container is much lower than the
    hypervisor doing it for us.

    In short we let a PV guest run without doing page-table, segment,
    syscall, etc updates through the hypervisor - instead it is all done
    within the guest container. It is a "hybrid" PV - hence the 'PVH'
    name - a PV guest within an HVM container.

    The major benefits are less code to deal with - for example we only
    use one function from the the pv_mmu_ops (which has 39 function
    calls); faster performance for syscall (no context switches into the
    hypervisor); less traps on various operations; etc.

    It is still being baked - the ABI is not yet set in stone. But it is
    pretty awesome and we are excited about it.

    Lastly, there are some changes to ARM code - you should get a simple
    conflict which has been resolved in #linux-next.

    In short, this pull has awesome features.

    Features:
    - FIFO event channels. Key advantages: support for over 100,000
    events (2^17), 16 different event priorities, improved fairness in
    event latency through the use of FIFOs.
    - Xen PVH support. "It’s a fully PV kernel mode, running with
    paravirtualized disk and network, paravirtualized interrupts and
    timers, no emulated devices of any kind (and thus no qemu), no BIOS
    or legacy boot — but instead of requiring PV MMU, it uses the HVM
    hardware extensions to virtualize the pagetables, as well as system
    calls and other privileged operations." (from "The
    Paravirtualization Spectrum, Part 2: From poles to a spectrum")

    Bug-fixes:
    - Fixes in balloon driver (refactor and make it work under ARM)
    - Allow xenfb to be used in HVM guests.
    - Allow xen_platform_pci=0 to work properly.
    - Refactors in event channels"

    * tag 'stable/for-linus-3.14-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (52 commits)
    xen/pvh: Set X86_CR0_WP and others in CR0 (v2)
    MAINTAINERS: add git repository for Xen
    xen/pvh: Use 'depend' instead of 'select'.
    xen: delete new instances of __cpuinit usage
    xen/fb: allow xenfb initialization for hvm guests
    xen/evtchn_fifo: fix error return code in evtchn_fifo_setup()
    xen-platform: fix error return code in platform_pci_init()
    xen/pvh: remove duplicated include from enlighten.c
    xen/pvh: Fix compile issues with xen_pvh_domain()
    xen: Use dev_is_pci() to check whether it is pci device
    xen/grant-table: Force to use v1 of grants.
    xen/pvh: Support ParaVirtualized Hardware extensions (v3).
    xen/pvh: Piggyback on PVHVM XenBus.
    xen/pvh: Piggyback on PVHVM for grant driver (v4)
    xen/grant: Implement an grant frame array struct (v3).
    xen/grant-table: Refactor gnttab_init
    xen/grants: Remove gnttab_max_grant_frames dependency on gnttab_init.
    xen/pvh: Piggyback on PVHVM for event channels (v2)
    xen/pvh: Update E820 to work with PVH (v2)
    xen/pvh: Secondary VCPU bringup (non-bootup CPUs)
    ...

    Linus Torvalds
     

16 Jan, 2014

1 commit

  • Multiple race conditions are possible between the Xen pcifront device
    addition and removal and the generic PCI device addition and removal that
    can be triggered via sysfs.

    To avoid those race conditions make the Xen pcifront code use global PCI
    rescan-remove locking.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Bjorn Helgaas

    Rafael J. Wysocki
     

04 Jan, 2014

1 commit

  • 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:[] [] get_free_entries+0x2e0/0x300
    Call Trace:
    [] ? evdev_connect+0x1e3/0x240
    [] gnttab_grant_foreign_access+0x2e/0x70
    [] xenkbd_connect_backend+0x41/0x290 [xen_kbdfront]
    [] xenkbd_probe+0x2f2/0x324 [xen_kbdfront]
    [] xenbus_dev_probe+0x77/0x130
    [] xenbus_frontend_dev_probe+0x47/0x50
    [] driver_probe_device+0x89/0x230
    [] __driver_attach+0x9b/0xa0
    [] ? driver_probe_device+0x230/0x230
    [] ? driver_probe_device+0x230/0x230
    [] bus_for_each_dev+0x8c/0xb0
    [] driver_attach+0x19/0x20
    [] bus_add_driver+0x1a0/0x220
    [] driver_register+0x5f/0xf0
    [] xenbus_register_driver_common+0x15/0x20
    [] xenbus_register_frontend+0x23/0x40
    [] ? 0xffffffffa0014fff
    [] xenkbd_init+0x2b/0x1000 [xen_kbdfront]
    [] 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
    Reported-and-Tested-by: Fabio Fantoni
    Signed-off-by: Konrad Rzeszutek Wilk
    [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: Stefano Stabellini
    Acked-by: Bjorn Helgaas [for PCI parts]
    CC: stable@vger.kernel.org

    Konrad Rzeszutek Wilk
     

15 Jun, 2013

1 commit

  • 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
    ) 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 )
    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 3d925320e9e2de162bd138bf97816bda8c3f71be
    ("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: Bjorn Helgaas
    Cc: linux-pci@vger.kernel.org
    Cc: stable@vger.kernel.org
    [v2: Added in the description about two PCI devices]
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

14 Dec, 2012

1 commit

  • Pull PCI update from Bjorn Helgaas:
    "Host bridge hotplug:
    - Untangle _PRT from struct pci_bus (Bjorn Helgaas)
    - Request _OSC control before scanning root bus (Taku Izumi)
    - Assign resources when adding host bridge (Yinghai Lu)
    - Remove root bus when removing host bridge (Yinghai Lu)
    - Remove _PRT during hot remove (Yinghai Lu)

    SRIOV
    - Add sysfs knobs to control numVFs (Don Dutile)

    Power management
    - Notify devices when power resource turned on (Huang Ying)

    Bug fixes
    - Work around broken _SEG on HP xw9300 (Bjorn Helgaas)
    - Keep runtime PM enabled for unbound PCI devices (Huang Ying)
    - Fix Optimus dual-GPU runtime D3 suspend issue (Dave Airlie)
    - Fix xen frontend shutdown issue (David Vrabel)
    - Work around PLX PCI 9050 BAR alignment erratum (Ian Abbott)

    Miscellaneous
    - Add GPL license for drivers/pci/ioapic (Andrew Cooks)
    - Add standard PCI-X, PCIe ASPM register #defines (Bjorn Helgaas)
    - NumaChip remote PCI support (Daniel Blueman)
    - Fix PCIe Link Capabilities Supported Link Speed definition (Jingoo
    Han)
    - Convert dev_printk() to dev_info(), etc (Joe Perches)
    - Add support for non PCI BAR ROM data (Matthew Garrett)
    - Add x86 support for host bridge translation offset (Mike Yoknis)
    - Report success only when every driver supports AER (Vijay
    Pandarathil)"

    Fix up trivial conflicts.

    * tag 'for-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (48 commits)
    PCI: Use phys_addr_t for physical ROM address
    x86/PCI: Add NumaChip remote PCI support
    ath9k: Use standard #defines for PCIe Capability ASPM fields
    iwlwifi: Use standard #defines for PCIe Capability ASPM fields
    iwlwifi: collapse wrapper for pcie_capability_read_word()
    iwlegacy: Use standard #defines for PCIe Capability ASPM fields
    iwlegacy: collapse wrapper for pcie_capability_read_word()
    cxgb3: Use standard #defines for PCIe Capability ASPM fields
    PCI: Add standard PCIe Capability Link ASPM field names
    PCI/portdrv: Use PCI Express Capability accessors
    PCI: Use standard PCIe Capability Link register field names
    x86: Use PCI setup data
    PCI: Add support for non-BAR ROMs
    PCI: Add pcibios_add_device
    EFI: Stash ROMs if they're not in the PCI BAR
    PCI: Add and use standard PCI-X Capability register names
    PCI/PM: Keep runtime PM enabled for unbound PCI devices
    xen-pcifront: Handle backend CLOSED without CLOSING
    PCI: SRIOV control and status via sysfs (documentation)
    PCI/AER: Report success only when every device has AER-aware driver
    ...

    Linus Torvalds
     

01 Dec, 2012

1 commit

  • Backend drivers shouldn't transition to CLOSED unless the frontend is
    CLOSED. If a backend does transition to CLOSED too soon then the
    frontend may not see the CLOSING state and will not properly shutdown.

    So, treat an unexpected backend CLOSED state the same as CLOSING.

    Signed-off-by: David Vrabel
    Signed-off-by: Bjorn Helgaas
    Acked-by: Konrad Rzeszutek Wilk

    David Vrabel
     

29 Nov, 2012

1 commit

  • CONFIG_HOTPLUG is going away as an option so __devexit_p, __devint,
    __devinitdata, __devinitconst, and _devexit are no longer needed.

    Signed-off-by: Bill Pemberton
    Acked-by: Bjorn Helgaas
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

03 Oct, 2012

1 commit

  • Pull Xen update from Konrad Rzeszutek Wilk:
    "Features:
    - When hotplugging PCI devices in a PV guest we can allocate
    Xen-SWIOTLB later.
    - Cleanup Xen SWIOTLB.
    - Support pages out grants from HVM domains in the backends.
    - Support wild cards in xen-pciback.hide=(BDF) arguments.
    - Update grant status updates with upstream hypervisor.
    - Boot PV guests with more than 128GB.
    - Cleanup Xen MMU code/add comments.
    - Obtain XENVERS using a preferred method.
    - Lay out generic changes to support Xen ARM.
    - Allow privcmd ioctl for HVM (used to do only PV).
    - Do v2 of mmap_batch for privcmd ioctls.
    - If hypervisor saves the LED keyboard light - we will now instruct
    the kernel about its state.
    Fixes:
    - More fixes to Xen PCI backend for various calls/FLR/etc.
    - With more than 4GB in a 64-bit PV guest disable native SWIOTLB.
    - Fix up smatch warnings.
    - Fix up various return values in privmcmd and mm."

    * tag 'stable/for-linus-3.7-x86-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: (48 commits)
    xen/pciback: Restore the PCI config space after an FLR.
    xen-pciback: properly clean up after calling pcistub_device_find()
    xen/vga: add the xen EFI video mode support
    xen/x86: retrieve keyboard shift status flags from hypervisor.
    xen/gndev: Xen backend support for paged out grant targets V4.
    xen-pciback: support wild cards in slot specifications
    xen/swiotlb: Fix compile warnings when using plain integer instead of NULL pointer.
    xen/swiotlb: Remove functions not needed anymore.
    xen/pcifront: Use Xen-SWIOTLB when initting if required.
    xen/swiotlb: For early initialization, return zero on success.
    xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used.
    xen/swiotlb: Move the error strings to its own function.
    xen/swiotlb: Move the nr_tbl determination in its own function.
    xen/arm: compile and run xenbus
    xen: resynchronise grant table status codes with upstream
    xen/privcmd: return -EFAULT on error
    xen/privcmd: Fix mmap batch ioctl error status copy back.
    xen/privcmd: add PRIVCMD_MMAPBATCH_V2 ioctl
    xen/mm: return more precise error from xen_remap_domain_range()
    xen/mmu: If the revector fails, don't attempt to revector anything else.
    ...

    Linus Torvalds
     

23 Sep, 2012

1 commit

  • * stable/late-swiotlb.v3.3:
    xen/swiotlb: Fix compile warnings when using plain integer instead of NULL pointer.
    xen/swiotlb: Remove functions not needed anymore.
    xen/pcifront: Use Xen-SWIOTLB when initting if required.
    xen/swiotlb: For early initialization, return zero on success.
    xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used.
    xen/swiotlb: Move the error strings to its own function.
    xen/swiotlb: Move the nr_tbl determination in its own function.
    swiotlb: add the late swiotlb initialization function with iotlb memory
    xen/swiotlb: With more than 4GB on 64-bit, disable the native SWIOTLB.
    xen/swiotlb: Simplify the logic.

    Conflicts:
    arch/x86/xen/pci-swiotlb-xen.c

    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

18 Sep, 2012

1 commit

  • 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: Stefano Stabellini
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

13 Sep, 2012

1 commit

  • Following code has a race window between pci_find_bus() and pci_get_slot()
    if PCI hotplug operation happens between them which removes the pci_bus.
    So use PCI hotplug safe interface pci_get_domain_bus_and_slot() instead,
    which also reduces code complexity.

    struct pci_bus *pci_bus = pci_find_bus(domain, busno);
    struct pci_dev *pci_dev = pci_get_slot(pci_bus, devfn);

    Tested-by: Konrad Rzeszutek Wilk
    Signed-off-by: Jiang Liu
    Signed-off-by: Bjorn Helgaas
    Acked-by: Konrad Rzeszutek Wilk

    Jiang Liu
     

22 Aug, 2012

1 commit


07 Apr, 2012

2 commits

  • Pull xen fixes from Konrad Rzeszutek Wilk:
    "Two fixes for regressions:
    * one is a workaround that will be removed in v3.5 with proper fix in
    the tip/x86 tree,
    * the other is to fix drivers to load on PV (a previous patch made
    them only load in PVonHVM mode).

    The rest are just minor fixes in the various drivers and some cleanup
    in the core code."

    * tag 'stable/for-linus-3.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen/pcifront: avoid pci_frontend_enable_msix() falsely returning success
    xen/pciback: fix XEN_PCI_OP_enable_msix result
    xen/smp: Remove unnecessary call to smp_processor_id()
    xen/x86: Workaround 'x86/ioapic: Add register level checks to detect bogus io-apic entries'
    xen: only check xen_platform_pci_unplug if hvm

    Linus Torvalds
     
  • The original XenoLinux code has always had things this way, and for
    compatibility reasons (in particular with a subsequent pciback
    adjustment) upstream Linux should behave the same way (allowing for two
    distinct error indications to be returned by the backend).

    Signed-off-by: Jan Beulich
    Signed-off-by: Konrad Rzeszutek Wilk

    Jan Beulich
     

24 Mar, 2012

1 commit

  • Pull PCI changes (including maintainer change) from Jesse Barnes:
    "This pull has some good cleanups from Bjorn and Yinghai, as well as
    some more code from Yinghai to better handle resource re-allocation
    when enabled.

    There's also a new initcall_debug feature from Arjan which will print
    out quirk timing information to help identify slow quirks for fixing
    or refinement (Yinghai sent in a few patches to do just that once the
    new debug code landed).

    Beyond that, I'm handing off PCI maintainership to Bjorn Helgaas.
    He's been a core PCI and Linux contributor for some time now, and has
    kindly volunteered to take over. I just don't feel I have the time
    for PCI review and work that it deserves lately (I've taken on some
    other projects), and haven't been as responsive lately as I'd like, so
    I approached Bjorn asking if he'd like to manage things. He's going
    to give it a try, and I'm confident he'll do at least as well as I
    have in keeping the tree managed, patches flowing, and keeping things
    stable."

    Fix up some fairly trivial conflicts due to other cleanups (mips device
    resource fixup cleanups clashing with list handling cleanup, ppc iseries
    removal clashing with pci_probe_only cleanup etc)

    * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (112 commits)
    PCI: Bjorn gets PCI hotplug too
    PCI: hand PCI maintenance over to Bjorn Helgaas
    unicore32/PCI: move include to asm/pci.h
    sparc/PCI: convert devtree and arch-probed bus addresses to resource
    powerpc/PCI: allow reallocation on PA Semi
    powerpc/PCI: convert devtree bus addresses to resource
    powerpc/PCI: compute I/O space bus-to-resource offset consistently
    arm/PCI: don't export pci_flags
    PCI: fix bridge I/O window bus-to-resource conversion
    x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()'
    PCI / PCIe: Introduce command line option to disable ARI
    PCI: make acpihp use __pci_remove_bus_device instead
    PCI: export __pci_remove_bus_device
    PCI: Rename pci_remove_behind_bridge to pci_stop_and_remove_behind_bridge
    PCI: Rename pci_remove_bus_device to pci_stop_and_remove_bus_device
    PCI: print out PCI device info along with duration
    PCI: Move "pci reassigndev resource alignment" out of quirks.c
    PCI: Use class for quirk for usb host controller fixup
    PCI: Use class for quirk for ti816x class fixup
    PCI: Use class for quirk for intel e100 interrupt fixup
    ...

    Linus Torvalds