27 Sep, 2019

1 commit

  • "unlikely(WARN(x))" is excessive. WARN() already uses unlikely()
    internally.

    Link: http://lkml.kernel.org/r/20190829165025.15750-4-efremov@linux.com
    Signed-off-by: Denis Efremov
    Cc: Boris Ostrovsky
    Cc: Joe Perches
    Reviewed-by: Juergen Gross
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denis Efremov
     

17 Jul, 2019

1 commit

  • When binding an interdomain event channel to a vcpu via
    IOCTL_EVTCHN_BIND_INTERDOMAIN not only the event channel needs to be
    bound, but the affinity of the associated IRQi must be changed, too.
    Otherwise the IRQ and the event channel won't be moved to another vcpu
    in case the original vcpu they were bound to is going offline.

    Cc: # 4.13
    Fixes: c48f64ab472389df ("xen-evtchn: Bind dyn evtchn:qemu-dm interrupt to next online VCPU")
    Signed-off-by: Juergen Gross
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: Juergen Gross

    Juergen Gross
     

24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this source code is licensed under the gnu general public license
    version 2 or later see the file copying for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Reviewed-by: Richard Fontana
    Reviewed-by: Armijn Hemel
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520075211.129205147@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

2 commits

  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

17 Apr, 2019

1 commit

  • irq_ctx_init() is invoked from native_init_IRQ() or from xen_init_IRQ()
    code. There is no reason to have this split. The interrupt stacks must be
    allocated no matter what.

    Invoke it from init_IRQ() before invoking the native or XEN init
    implementation.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Borislav Petkov
    Reviewed-by: Juergen Gross
    Cc: Andy Lutomirski
    Cc: Boris Ostrovsky
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Josh Abraham
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Mike Rapoport
    Cc: Nicolai Stange
    Cc: Sean Christopherson
    Cc: Stefano Stabellini
    Cc: Stephen Rothwell
    Cc: x86-ml
    Cc: xen-devel@lists.xenproject.org
    Link: https://lkml.kernel.org/r/20190414160146.001162606@linutronix.de

    Thomas Gleixner
     

17 Jan, 2019

1 commit

  • Commit f94c8d11699759 ("sched/clock, x86/tsc: Rework the x86 'unstable'
    sched_clock() interface") broke Xen guest time handling across
    migration:

    [ 187.249951] Freezing user space processes ... (elapsed 0.001 seconds) done.
    [ 187.251137] OOM killer disabled.
    [ 187.251137] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    [ 187.252299] suspending xenstore...
    [ 187.266987] xen:grant_table: Grant tables using version 1 layout
    [18446743811.706476] OOM killer enabled.
    [18446743811.706478] Restarting tasks ... done.
    [18446743811.720505] Setting capacity to 16777216

    Fix that by setting xen_sched_clock_offset at resume time to ensure a
    monotonic clock value.

    [boris: replaced pr_info() with pr_info_once() in xen_callback_vector()
    to avoid printing with incorrect timestamp during resume (as we
    haven't re-adjusted the clock yet)]

    Fixes: f94c8d11699759 ("sched/clock, x86/tsc: Rework the x86 'unstable' sched_clock() interface")
    Cc: # 4.11
    Reported-by: Hans van Kranenburg
    Signed-off-by: Juergen Gross
    Tested-by: Hans van Kranenburg
    Signed-off-by: Boris Ostrovsky

    Juergen Gross
     

31 Oct, 2018

1 commit

  • Move remaining definitions and declarations from include/linux/bootmem.h
    into include/linux/memblock.h and remove the redundant header.

    The includes were replaced with the semantic patch below and then
    semi-automated removal of duplicated '#include

    @@
    @@
    - #include
    + #include

    [sfr@canb.auug.org.au: dma-direct: fix up for the removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181002185342.133d1680@canb.auug.org.au
    [sfr@canb.auug.org.au: powerpc: fix up for removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181005161406.73ef8727@canb.auug.org.au
    [sfr@canb.auug.org.au: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal]
    Link: http://lkml.kernel.org/r/20181008190341.5e396491@canb.auug.org.au
    Link: http://lkml.kernel.org/r/1536927045-23536-30-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Stephen Rothwell
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

14 Sep, 2018

1 commit


22 Jun, 2018

1 commit

  • Commit 910f8befdf5b ("xen/pirq: fix error path cleanup when binding
    MSIs") fixed a couple of errors in error cleanup path of
    xen_bind_pirq_msi_to_irq(). This cleanup allowed a call to
    __unbind_from_irq() with an unbound irq, which would result in
    triggering the BUG_ON there.

    Since there is really no reason for the BUG_ON (xen_free_irq() can
    operate on unbound irqs) we can remove it.

    Reported-by: Ben Hutchings
    Signed-off-by: Boris Ostrovsky
    Cc: stable@vger.kernel.org
    Reviewed-by: Juergen Gross
    Signed-off-by: Juergen Gross

    Boris Ostrovsky
     

01 Mar, 2018

1 commit

  • Current cleanup in the error path of xen_bind_pirq_msi_to_irq is
    wrong. First of all there's an off-by-one in the cleanup loop, which
    can lead to unbinding wrong IRQs.

    Secondly IRQs not bound won't be freed, thus leaking IRQ numbers.

    Note that there's no need to differentiate between bound and unbound
    IRQs when freeing them, __unbind_from_irq will deal with both of them
    correctly.

    Fixes: 4892c9b4ada9f9 ("xen: add support for MSI message groups")
    Reported-by: Hooman Mirhadi
    Signed-off-by: Roger Pau Monné
    Reviewed-by: Amit Shah
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: Juergen Gross

    Roger Pau Monne
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

08 Sep, 2017

1 commit

  • Pull xen updates from Juergen Gross:

    - the new pvcalls backend for routing socket calls from a guest to dom0

    - some cleanups of Xen code

    - a fix for wrong usage of {get,put}_cpu()

    * tag 'for-linus-4.14b-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (27 commits)
    xen/mmu: set MMU_NORMAL_PT_UPDATE in remap_area_mfn_pte_fn
    xen: Don't try to call xen_alloc_p2m_entry() on autotranslating guests
    xen/events: events_fifo: Don't use {get,put}_cpu() in xen_evtchn_fifo_init()
    xen/pvcalls: use WARN_ON(1) instead of __WARN()
    xen: remove not used trace functions
    xen: remove unused function xen_set_domain_pte()
    xen: remove tests for pvh mode in pure pv paths
    xen-platform: constify pci_device_id.
    xen: cleanup xen.h
    xen: introduce a Kconfig option to enable the pvcalls backend
    xen/pvcalls: implement write
    xen/pvcalls: implement read
    xen/pvcalls: implement the ioworker functions
    xen/pvcalls: disconnect and module_exit
    xen/pvcalls: implement release command
    xen/pvcalls: implement poll command
    xen/pvcalls: implement accept command
    xen/pvcalls: implement listen command
    xen/pvcalls: implement bind command
    xen/pvcalls: implement connect command
    ...

    Linus Torvalds
     

31 Aug, 2017

1 commit

  • When booting Linux as Xen guest with CONFIG_DEBUG_ATOMIC, the following
    splat appears:

    [ 0.002323] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
    [ 0.019717] ASID allocator initialised with 65536 entries
    [ 0.020019] xen:grant_table: Grant tables using version 1 layout
    [ 0.020051] Grant table initialized
    [ 0.020069] BUG: sleeping function called from invalid context at /data/src/linux/mm/page_alloc.c:4046
    [ 0.020100] in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper/0
    [ 0.020123] no locks held by swapper/0/1.
    [ 0.020143] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc5 #598
    [ 0.020166] Hardware name: FVP Base (DT)
    [ 0.020182] Call trace:
    [ 0.020199] [] dump_backtrace+0x0/0x270
    [ 0.020222] [] show_stack+0x24/0x30
    [ 0.020244] [] dump_stack+0xb8/0xf0
    [ 0.020267] [] ___might_sleep+0x1c8/0x1f8
    [ 0.020291] [] __might_sleep+0x58/0x90
    [ 0.020313] [] __alloc_pages_nodemask+0x1c0/0x12e8
    [ 0.020338] [] alloc_page_interleave+0x38/0x88
    [ 0.020363] [] alloc_pages_current+0xdc/0xf0
    [ 0.020387] [] __get_free_pages+0x28/0x50
    [ 0.020411] [] evtchn_fifo_alloc_control_block+0x2c/0xa0
    [ 0.020437] [] xen_evtchn_fifo_init+0x38/0xb4
    [ 0.020461] [] xen_init_IRQ+0x44/0xc8
    [ 0.020484] [] xen_guest_init+0x250/0x300
    [ 0.020507] [] do_one_initcall+0x44/0x130
    [ 0.020531] [] kernel_init_freeable+0x120/0x288
    [ 0.020556] [] kernel_init+0x18/0x110
    [ 0.020578] [] ret_from_fork+0x10/0x40
    [ 0.020606] xen:events: Using FIFO-based ABI
    [ 0.020658] Xen: initializing cpu0
    [ 0.027727] Hierarchical SRCU implementation.
    [ 0.036235] EFI services will not be available.
    [ 0.043810] smp: Bringing up secondary CPUs ...

    This is because get_cpu() in xen_evtchn_fifo_init() will disable
    preemption, but __get_free_page() might sleep (GFP_ATOMIC is not set).

    xen_evtchn_fifo_init() will always be called before SMP is initialized,
    so {get,put}_cpu() could be replaced by a simple smp_processor_id().

    This also avoid to modify evtchn_fifo_alloc_control_block that will be
    called in other context.

    Signed-off-by: Julien Grall
    Reported-by: Andre Przywara
    Reviewed-by: Boris Ostrovsky
    Fixes: 1fe565517b57 ("xen/events: use the FIFO-based ABI if available")
    Signed-off-by: Boris Ostrovsky

    Julien Grall
     

29 Aug, 2017

1 commit

  • The only users of alloc_intr_gate() are hypervisors, which both check the
    used_vectors bitmap whether they have allocated the gate already. Move that
    check into alloc_intr_gate() and simplify the users.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Juergen Gross
    Reviewed-by: K. Y. Srinivasan
    Cc: Andy Lutomirski
    Cc: Boris Ostrovsky
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Stephen Hemminger
    Cc: Steven Rostedt
    Link: http://lkml.kernel.org/r/20170828064959.580830286@linutronix.de
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     

11 Aug, 2017

1 commit

  • Here is a device has xen-pirq-MSI interrupt. Dom0 might lost interrupt
    during driver irq_disable/irq_enable. Here is the scenario,
    1. irq_disable -> disable_dynirq -> mask_evtchn(irq channel)
    2. dev interrupt raised by HW and Xen mark its evtchn as pending
    3. irq_enable -> startup_pirq -> eoi_pirq ->
    clear_evtchn(channel of irq) -> clear pending status
    4. consume_one_event process the irq event without pending bit assert
    which result in interrupt lost once
    5. No HW interrupt raising anymore.

    Now use enable_dynirq for enable_pirq of xen_pirq_chip to remove
    eoi_pirq when irq_enable.

    Signed-off-by: Liu Shuo
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: Juergen Gross

    Liu Shuo
     

28 Jul, 2017

1 commit


07 Jul, 2017

1 commit

  • Pull xen updates from Juergen Gross:
    "Other than fixes and cleanups it contains:

    - support > 32 VCPUs at domain restore

    - support for new sysfs nodes related to Xen

    - some performance tuning for Linux running as Xen guest"

    * tag 'for-linus-4.13-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    x86/xen: allow userspace access during hypercalls
    x86: xen: remove unnecessary variable in xen_foreach_remap_area()
    xen: allocate page for shared info page from low memory
    xen: avoid deadlock in xenbus driver
    xen: add sysfs node for hypervisor build id
    xen: sync include/xen/interface/version.h
    xen: add sysfs node for guest type
    doc,xen: document hypervisor sysfs nodes for xen
    xen/vcpu: Handle xen_vcpu_setup() failure at boot
    xen/vcpu: Handle xen_vcpu_setup() failure in hotplug
    xen/pv: Fix OOPS on restore for a PV, !SMP domain
    xen/pvh*: Support > 32 VCPUs at domain restore
    xen/vcpu: Simplify xen_vcpu related code
    xen-evtchn: Bind dyn evtchn:qemu-dm interrupt to next online VCPU
    xen: avoid type warning in xchg_xen_ulong
    xen: fix HYPERVISOR_dm_op() prototype
    xen: don't print error message in case of missing Xenstore entry
    arm/xen: Adjust one function call together with a variable assignment
    arm/xen: Delete an error message for a failed memory allocation in __set_phys_to_machine_multi()
    arm/xen: Improve a size determination in __set_phys_to_machine_multi()

    Linus Torvalds
     

23 Jun, 2017

1 commit

  • Update the effective affinity mask when an interrupt was successfully
    targeted to a CPU.

    Signed-off-by: Thomas Gleixner
    Cc: Jens Axboe
    Cc: Marc Zyngier
    Cc: Michael Ellerman
    Cc: Keith Busch
    Cc: Peter Zijlstra
    Cc: Christoph Hellwig
    Link: http://lkml.kernel.org/r/20170619235446.799944725@linutronix.de

    Thomas Gleixner
     

13 Jun, 2017

1 commit

  • A HVM domian booting generates around 200K (evtchn:qemu-dm xen-dyn)
    interrupts,in a short period of time. All these evtchn:qemu-dm are bound
    to VCPU 0, until irqbalance sees these IRQ and moves it to a different VCPU.
    In one configuration, irqbalance runs every 10 seconds, which means
    irqbalance doesn't get to see these burst of interrupts and doesn't
    re-balance interrupts most of the time, making all evtchn:qemu-dm to be
    processed by VCPU0. This cause VCPU0 to spend most of time processing
    hardirq and very little time on softirq. Moreover, if dom0 kernel PREEMPTION
    is disabled, VCPU0 never runs watchdog (process context), triggering a
    softlockup detection code to panic.

    Binding evtchn:qemu-dm to next online VCPU, will spread hardirq
    processing evenly across different CPU. Later, irqbalance will try to balance
    evtchn:qemu-dm, if required.

    Signed-off-by: Anoob Soman
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: Juergen Gross

    Anoob Soman
     

02 May, 2017

1 commit

  • Recent discussion (http://marc.info/?l=xen-devel&m=149192184523741)
    established that commit 72a9b186292d ("xen: Remove event channel
    notification through Xen PCI platform device") (and thus commit
    da72ff5bfcb0 ("partially revert "xen: Remove event channel
    notification through Xen PCI platform device"")) are unnecessary and,
    in fact, prevent HVM guests from booting on Xen releases prior to 4.0

    Therefore we revert both of those commits.

    The summary of that discussion is below:

    Here is the brief summary of the current situation:

    Before the offending commit (72a9b186292):

    1) INTx does not work because of the reset_watches path.
    2) The reset_watches path is only taken if you have Xen > 4.0
    3) The Linux Kernel by default will use vector inject if the hypervisor
    support. So even INTx does not work no body running the kernel with
    Xen > 4.0 would notice. Unless he explicitly disabled this feature
    either in the kernel or in Xen (and this can only be disabled by
    modifying the code, not user-supported way to do it).

    After the offending commit (+ partial revert):

    1) INTx is no longer support for HVM (only for PV guests).
    2) Any HVM guest The kernel will not boot on Xen < 4.0 which does
    not have vector injection support. Since the only other mode
    supported is INTx which.

    So based on this summary, I think before commit (72a9b186292) we were
    in much better position from a user point of view.

    Signed-off-by: Boris Ostrovsky
    Reviewed-by: Juergen Gross
    Signed-off-by: Juergen Gross

    Boris Ostrovsky
     

07 Feb, 2017

1 commit

  • We are replacing existing PVH guests with new implementation.

    We are keeping xen_pvh_domain() macro (for now set to zero) because
    when we introduce new PVH implementation later in this series we will
    reuse current PVH-specific code (xen_pvh_gnttab_setup()), and that
    code is conditioned by 'if (xen_pvh_domain())'. (We will also need
    a noop xen_pvh_domain() for !CONFIG_XEN_PVH).

    Signed-off-by: Boris Ostrovsky
    Reviewed-by: Juergen Gross
    Reviewed-by: Konrad Rzeszutek Wilk

    Boris Ostrovsky
     

06 Jan, 2017

1 commit

  • Pull xen fixes and cleanups from Juergen Gross:

    - small fixes for xenbus driver

    - one fix for xen dom0 boot on huge system

    - small cleanups

    * tag 'for-linus-4.10-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    Xen: ARM: Zero reserved fields of xatp before making hypervisor call
    xen: events: Replace BUG() with BUG_ON()
    xen: remove stale xs_input_avail() from header
    xen: return xenstore command failures via response instead of rc
    xen: xenbus driver must not accept invalid transaction ids
    xen/evtchn: use rb_entry()
    xen/setup: Don't relocate p2m over existing one

    Linus Torvalds
     

03 Jan, 2017

1 commit


25 Dec, 2016

1 commit

  • When the state names got added a script was used to add the extra argument
    to the calls. The script basically converted the state constant to a
    string, but the cleanup to convert these strings into meaningful ones did
    not happen.

    Replace all the useless strings with 'subsys/xxx/yyy:state' strings which
    are used in all the other places already.

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Sebastian Siewior
    Link: http://lkml.kernel.org/r/20161221192112.085444152@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

14 Dec, 2016

1 commit

  • Pull xen updates from Juergen Gross:
    "Xen features and fixes for 4.10

    These are some fixes, a move of some arm related headers to share them
    between arm and arm64 and a series introducing a helper to make code
    more readable.

    The most notable change is David stepping down as maintainer of the
    Xen hypervisor interface. This results in me sending you the pull
    requests for Xen related code from now on"

    * tag 'for-linus-4.10-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (29 commits)
    xen/balloon: Only mark a page as managed when it is released
    xenbus: fix deadlock on writes to /proc/xen/xenbus
    xen/scsifront: don't request a slot on the ring until request is ready
    xen/x86: Increase xen_e820_map to E820_X_MAX possible entries
    x86: Make E820_X_MAX unconditionally larger than E820MAX
    xen/pci: Bubble up error and fix description.
    xen: xenbus: set error code on failure
    xen: set error code on failures
    arm/xen: Use alloc_percpu rather than __alloc_percpu
    arm/arm64: xen: Move shared architecture headers to include/xen/arm
    xen/events: use xen_vcpu_id mapping for EVTCHNOP_status
    xen/gntdev: Use VM_MIXEDMAP instead of VM_IO to avoid NUMA balancing
    xen-scsifront: Add a missing call to kfree
    MAINTAINERS: update XEN HYPERVISOR INTERFACE
    xenfs: Use proc_create_mount_point() to create /proc/xen
    xen-platform: use builtin_pci_driver
    xen-netback: fix error handling output
    xen: make use of xenbus_read_unsigned() in xenbus
    xen: make use of xenbus_read_unsigned() in xen-pciback
    xen: make use of xenbus_read_unsigned() in xen-fbfront
    ...

    Linus Torvalds
     

10 Dec, 2016

1 commit

  • One include less is always a good thing(tm). Good riddance.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Borislav Petkov
    Cc: Jiri Olsa
    Link: http://lkml.kernel.org/r/20161209182912.2726-6-bp@alien8.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

30 Nov, 2016

1 commit


18 Nov, 2016

1 commit

  • Upon removal of the is_idle flag, these routines became NOPs.

    Signed-off-by: Len Brown
    Acked-by: Ingo Molnar
    Acked-by: Peter Zijlstra (Intel)
    Link: http://lkml.kernel.org/r/822f2c22cc5890f7b8ea0eeec60277eb44505b4e.1479449716.git.len.brown@intel.com
    Signed-off-by: Thomas Gleixner

    Len Brown
     

30 Sep, 2016

2 commits

  • Ever since commit 254d1a3f02eb ("xen/pv-on-hvm kexec: shutdown watches
    from old kernel") using the INTx interrupt from Xen PCI platform
    device for event channel notification would just lockup the guest
    during bootup. postcore_initcall now calls xs_reset_watches which
    will eventually try to read a value from XenStore and will get stuck
    on read_reply at XenBus forever since the platform driver is not
    probed yet and its INTx interrupt handler is not registered yet. That
    means that the guest can not be notified at this moment of any pending
    event channels and none of the per-event handlers will ever be invoked
    (including the XenStore one) and the reply will never be picked up by
    the kernel.

    The exact stack where things get stuck during xenbus_init:

    -xenbus_init
    -xs_init
    -xs_reset_watches
    -xenbus_scanf
    -xenbus_read
    -xs_single
    -xs_single
    -xs_talkv

    Vector callbacks have always been the favourite event notification
    mechanism since their introduction in commit 38e20b07efd5 ("x86/xen:
    event channels delivery on HVM.") and the vector callback feature has
    always been advertised for quite some time by Xen that's why INTx was
    broken for several years now without impacting anyone.

    Luckily this also means that event channel notification through INTx
    is basically dead-code which can be safely removed without impacting
    anybody since it has been effectively disabled for more than 4 years
    with nobody complaining about it (at least as far as I'm aware of).

    This commit removes event channel notification through Xen PCI
    platform device.

    Cc: Boris Ostrovsky
    Cc: David Vrabel
    Cc: Juergen Gross
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: x86@kernel.org
    Cc: Konrad Rzeszutek Wilk
    Cc: Bjorn Helgaas
    Cc: Stefano Stabellini
    Cc: Julien Grall
    Cc: Vitaly Kuznetsov
    Cc: Paul Gortmaker
    Cc: Ross Lagerwall
    Cc: xen-devel@lists.xenproject.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-pci@vger.kernel.org
    Cc: Anthony Liguori
    Signed-off-by: KarimAllah Ahmed
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: David Vrabel

    KarimAllah Ahmed
     
  • Install the callbacks via the state machine.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Boris Ostrovsky
    Signed-off-by: David Vrabel

    Sebastian Andrzej Siewior
     

25 Jul, 2016

3 commits

  • EVTCHNOP_init_control has vCPU id as a parameter and Xen's idea of
    vCPU id should be used. Use the newly introduced xen_vcpu_id mapping
    to convert it from Linux's id.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: David Vrabel

    Vitaly Kuznetsov
     
  • EVTCHNOP_bind_ipi and EVTCHNOP_bind_virq pass vCPU id as a parameter
    and Xen's idea of vCPU id should be used. Use the newly introduced
    xen_vcpu_id mapping to convert it from Linux's id.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: David Vrabel

    Vitaly Kuznetsov
     
  • HYPERVISOR_vcpu_op() passes Linux's idea of vCPU id as a parameter
    while Xen's idea is expected. In some cases these ideas diverge so we
    need to do remapping.

    Convert all callers of HYPERVISOR_vcpu_op() to use xen_vcpu_nr().

    Leave xen_fill_possible_map() and xen_filter_cpu_maps() intact as
    they're only being called by PV guests before perpu areas are
    initialized. While the issue could be solved by switching to
    early_percpu for xen_vcpu_id I think it's not worth it: PV guests will
    probably never get to the point where their idea of vCPU id diverges
    from Xen's.

    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: David Vrabel

    Vitaly Kuznetsov
     

24 May, 2016

1 commit

  • Commit ff1e22e7a638 ("xen/events: Mask a moving irq") open-coded
    irq_move_irq() but left out checking if the IRQ is disabled. This broke
    resuming from suspend since it tries to move a (disabled) irq without
    holding the IRQ's desc->lock. Fix it by adding in a check for disabled
    IRQs.

    The resulting stacktrace was:
    kernel BUG at /build/linux-UbQGH5/linux-4.4.0/kernel/irq/migration.c:31!
    invalid opcode: 0000 [#1] SMP
    Modules linked in: xenfs xen_privcmd ...
    CPU: 0 PID: 9 Comm: migration/0 Not tainted 4.4.0-22-generic #39-Ubuntu
    Hardware name: Xen HVM domU, BIOS 4.6.1-xs125180 05/04/2016
    task: ffff88003d75ee00 ti: ffff88003d7bc000 task.ti: ffff88003d7bc000
    RIP: 0010:[] [] irq_move_masked_irq+0xd2/0xe0
    RSP: 0018:ffff88003d7bfc50 EFLAGS: 00010046
    RAX: 0000000000000000 RBX: ffff88003d40ba00 RCX: 0000000000000001
    RDX: 0000000000000001 RSI: 0000000000000100 RDI: ffff88003d40bad8
    RBP: ffff88003d7bfc68 R08: 0000000000000000 R09: ffff88003d000000
    R10: 0000000000000000 R11: 000000000000023c R12: ffff88003d40bad0
    R13: ffffffff81f3a4a0 R14: 0000000000000010 R15: 00000000ffffffff
    FS: 0000000000000000(0000) GS:ffff88003da00000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007fd4264de624 CR3: 0000000037922000 CR4: 00000000003406f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Stack:
    ffff88003d40ba38 0000000000000024 0000000000000000 ffff88003d7bfca0
    ffffffff814c8d92 00000010813ef89d 00000000805ea732 0000000000000009
    0000000000000024 ffff88003cc39b80 ffff88003d7bfce0 ffffffff814c8f66
    Call Trace:
    [] eoi_pirq+0xb2/0xf0
    [] __startup_pirq+0xe6/0x150
    [] xen_irq_resume+0x319/0x360
    [] xen_suspend+0xb5/0x180
    [] multi_cpu_stop+0xb5/0xe0
    [] ? cpu_stop_queue_work+0x80/0x80
    [] cpu_stopper_thread+0xb0/0x140
    [] ? finish_task_switch+0x76/0x220
    [] ? __raw_callee_save___pv_queued_spin_unlock+0x11/0x20
    [] smpboot_thread_fn+0x105/0x160
    [] ? sort_range+0x30/0x30
    [] kthread+0xd8/0xf0
    [] ? kthread_create_on_node+0x1e0/0x1e0
    [] ret_from_fork+0x3f/0x70
    [] ? kthread_create_on_node+0x1e0/0x1e0

    Signed-off-by: Ross Lagerwall
    Reviewed-by: Boris Ostrovsky
    Cc:
    Signed-off-by: David Vrabel

    Ross Lagerwall
     

04 Apr, 2016

1 commit

  • Moving an unmasked irq may result in irq handler being invoked on both
    source and target CPUs.

    With 2-level this can happen as follows:

    On source CPU:
    evtchn_2l_handle_events() ->
    generic_handle_irq() ->
    handle_edge_irq() ->
    eoi_pirq():
    irq_move_irq(data);

    /***** WE ARE HERE *****/

    if (VALID_EVTCHN(evtchn))
    clear_evtchn(evtchn);

    If at this moment target processor is handling an unrelated event in
    evtchn_2l_handle_events()'s loop it may pick up our event since target's
    cpu_evtchn_mask claims that this event belongs to it *and* the event is
    unmasked and still pending. At the same time, source CPU will continue
    executing its own handle_edge_irq().

    With FIFO interrupt the scenario is similar: irq_move_irq() may result
    in a EVTCHNOP_unmask hypercall which, in turn, may make the event
    pending on the target CPU.

    We can avoid this situation by moving and clearing the event while
    keeping event masked.

    Signed-off-by: Boris Ostrovsky
    Cc: stable@vger.kernel.org
    Signed-off-by: David Vrabel

    Boris Ostrovsky
     

23 Mar, 2016

1 commit

  • Pull xen updates from David Vrabel:
    "Features and fixes for 4.6:

    - Make earlyprintk=xen work for HVM guests

    - Remove module support for things never built as modules"

    * tag 'for-linus-4.6-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    drivers/xen: make platform-pci.c explicitly non-modular
    drivers/xen: make sys-hypervisor.c explicitly non-modular
    drivers/xen: make xenbus_dev_[front/back]end explicitly non-modular
    drivers/xen: make [xen-]ballon explicitly non-modular
    xen: audit usages of module.h ; remove unnecessary instances
    xen/x86: Drop mode-selecting ifdefs in startup_xen()
    xen/x86: Zero out .bss for PV guests
    hvc_xen: make early_printk work with HVM guests
    hvc_xen: fix xenboot for DomUs
    hvc_xen: add earlycon support

    Linus Torvalds
     

21 Mar, 2016

1 commit

  • Code that uses no modular facilities whatsoever should not be
    sourcing module.h at all, since that header drags in a bunch
    of other headers with it.

    Similarly, code that is not explicitly using modular facilities
    like module_init() but only is declaring module_param setup
    variables should be using moduleparam.h and not the larger
    module.h file for that.

    In making this change, we also uncover an implicit use of BUG()
    in inline fcns within arch/arm/include/asm/xen/hypercall.h so
    we explicitly source for that file now.

    Signed-off-by: Paul Gortmaker
    Reviewed-by: Stefano Stabellini
    Signed-off-by: David Vrabel

    Paul Gortmaker
     

16 Mar, 2016

1 commit

  • $ make tags
    GEN tags
    ctags: Warning: drivers/acpi/processor_idle.c:64: null expansion of name pattern "\1"
    ctags: Warning: drivers/xen/events/events_2l.c:41: null expansion of name pattern "\1"
    ctags: Warning: kernel/locking/lockdep.c:151: null expansion of name pattern "\1"
    ctags: Warning: kernel/rcu/rcutorture.c:133: null expansion of name pattern "\1"
    ctags: Warning: kernel/rcu/rcutorture.c:135: null expansion of name pattern "\1"
    ctags: Warning: kernel/workqueue.c:323: null expansion of name pattern "\1"
    ctags: Warning: net/ipv4/syncookies.c:53: null expansion of name pattern "\1"
    ctags: Warning: net/ipv6/syncookies.c:44: null expansion of name pattern "\1"
    ctags: Warning: net/rds/page.c:45: null expansion of name pattern "\1"

    Which are all the result of the DEFINE_PER_CPU pattern:

    scripts/tags.sh:200: '/\
    Acked-by: David S. Miller
    Acked-by: Rafael J. Wysocki
    Cc: Tejun Heo
    Cc: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

13 Jan, 2016

1 commit

  • drivers/xen/events/events_fifo.c uses rmb() to communicate with the
    other side.

    For guests compiled with CONFIG_SMP, smp_rmb would be sufficient, so
    rmb() here is only needed if a non-SMP guest runs on an SMP host.

    Switch to the virt_rmb barrier which serves this exact purpose.

    Pull in asm/barrier.h here to make sure the file is self-contained.

    Suggested-by: David Vrabel
    Signed-off-by: Michael S. Tsirkin
    Acked-by: David Vrabel
    Acked-by: Peter Zijlstra (Intel)

    Michael S. Tsirkin