13 Nov, 2018

1 commit


29 Oct, 2018

1 commit


03 Mar, 2018

1 commit

  • [ Upstream commit b3cf8528bb21febb650a7ecbf080d0647be40b9f ]

    Commit f5775e0b6116 ("x86/xen: discard RAM regions above the maximum
    reservation") left host memory not assigned to dom0 as available for
    memory hotplug.

    Unfortunately this also meant that those regions could be used by
    others. Specifically, commit fa564ad96366 ("x86/PCI: Enable a 64bit BAR
    on AMD Family 15h (Models 00-1f, 30-3f, 60-7f)") may try to map those
    addresses as MMIO.

    To prevent this mark unallocated host memory as E820_TYPE_UNUSABLE (thus
    effectively reverting f5775e0b6116) and keep track of that region as
    a hostmem resource that can be used for the hotplug.

    Signed-off-by: Boris Ostrovsky
    Reviewed-by: Juergen Gross
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Boris Ostrovsky
     

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
     

19 Sep, 2017

1 commit


31 Aug, 2017

2 commits

  • The macros for testing domain types are more complicated then they
    need to. Simplify them.

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

    Juergen Gross
     
  • Introduce the C header file which defines the PV Calls interface. It is
    imported from xen/include/public/io/pvcalls.h.

    Signed-off-by: Stefano Stabellini
    Reviewed-by: Boris Ostrovsky
    Reviewed-by: Juergen Gross
    CC: konrad.wilk@oracle.com
    CC: boris.ostrovsky@oracle.com
    CC: jgross@suse.com
    Signed-off-by: Boris Ostrovsky

    Stefano Stabellini
     

23 Jul, 2017

1 commit

  • When setting up the Xenstore watch for the memory target size the new
    watch will fire at once. Don't try to reach the configured target size
    by onlining new memory in this case, as the current memory size will
    be smaller in almost all cases due to e.g. BIOS reserved pages.

    Onlining new memory will lead to more problems e.g. undesired conflicts
    with NVMe devices meant to be operated as block devices.

    Instead remember the difference between target size and current size
    when the watch fires for the first time and apply it to any further
    size changes, too.

    In order to avoid races between balloon.c and xen-balloon.c init calls
    do the xen-balloon.c initialization from balloon.c.

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

    Juergen Gross
     

07 Jul, 2017

1 commit

  • Pull dma-mapping infrastructure from Christoph Hellwig:
    "This is the first pull request for the new dma-mapping subsystem

    In this new subsystem we'll try to properly maintain all the generic
    code related to dma-mapping, and will further consolidate arch code
    into common helpers.

    This pull request contains:

    - removal of the DMA_ERROR_CODE macro, replacing it with calls to
    ->mapping_error so that the dma_map_ops instances are more self
    contained and can be shared across architectures (me)

    - removal of the ->set_dma_mask method, which duplicates the
    ->dma_capable one in terms of functionality, but requires more
    duplicate code.

    - various updates for the coherent dma pool and related arm code
    (Vladimir)

    - various smaller cleanups (me)"

    * tag 'dma-mapping-4.13' of git://git.infradead.org/users/hch/dma-mapping: (56 commits)
    ARM: dma-mapping: Remove traces of NOMMU code
    ARM: NOMMU: Set ARM_DMA_MEM_BUFFERABLE for M-class cpus
    ARM: NOMMU: Introduce dma operations for noMMU
    drivers: dma-mapping: allow dma_common_mmap() for NOMMU
    drivers: dma-coherent: Introduce default DMA pool
    drivers: dma-coherent: Account dma_pfn_offset when used with device tree
    dma: Take into account dma_pfn_offset
    dma-mapping: replace dmam_alloc_noncoherent with dmam_alloc_attrs
    dma-mapping: remove dmam_free_noncoherent
    crypto: qat - avoid an uninitialized variable warning
    au1100fb: remove a bogus dma_free_nonconsistent call
    MAINTAINERS: add entry for dma mapping helpers
    powerpc: merge __dma_set_mask into dma_set_mask
    dma-mapping: remove the set_dma_mask method
    powerpc/cell: use the dma_supported method for ops switching
    powerpc/cell: clean up fixed mapping dma_ops initialization
    tile: remove dma_supported and mapping_error methods
    xen-swiotlb: remove xen_swiotlb_set_dma_mask
    arm: implement ->dma_supported instead of ->set_dma_mask
    mips/loongson64: implement ->dma_supported instead of ->set_dma_mask
    ...

    Linus Torvalds
     

20 Jun, 2017

1 commit

  • ARM and x86 had duplicated versions of the dma_ops structure, the
    only difference is that x86 hasn't wired up the set_dma_mask,
    mmap, and get_sgtable ops yet. On x86 all of them are identical
    to the generic version, so they aren't needed but harmless.

    All the symbols used only for xen_swiotlb_dma_ops can now be marked
    static as well.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Konrad Rzeszutek Wilk

    Christoph Hellwig
     

15 Jun, 2017

1 commit


13 Jun, 2017

2 commits

  • When Xen restores a PVHVM or PVH guest, its shared_info only holds
    up to 32 CPUs. The hypercall VCPUOP_register_vcpu_info allows
    us to setup per-page areas for VCPUs. This means we can boot
    PVH* guests with more than 32 VCPUs. During restore the per-cpu
    structure is allocated freshly by the hypervisor (vcpu_info_mfn is
    set to INVALID_MFN) so that the newly restored guest can make a
    VCPUOP_register_vcpu_info hypercall.

    However, we end up triggering this condition in Xen:
    /* Run this command on yourself or on other offline VCPUS. */
    if ( (v != current) && !test_bit(_VPF_down, &v->pause_flags) )

    which means we are unable to setup the per-cpu VCPU structures
    for running VCPUS. The Linux PV code paths makes this work by
    iterating over cpu_possible in xen_vcpu_restore() with:

    1) is target CPU up (VCPUOP_is_up hypercall?)
    2) if yes, then VCPUOP_down to pause it
    3) VCPUOP_register_vcpu_info
    4) if it was down, then VCPUOP_up to bring it back up

    With Xen commit 192df6f9122d ("xen/x86: allow HVM guests to use
    hypercalls to bring up vCPUs") this is available for non-PV guests.
    As such first check if VCPUOP_is_up is actually possible before
    trying this dance.

    As most of this dance code is done already in xen_vcpu_restore()
    let's make it callable on PV, PVH and PVHVM.

    Based-on-patch-by: Konrad Wilk
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: Ankur Arora
    Signed-off-by: Juergen Gross

    Ankur Arora
     
  • 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
     

09 Jun, 2017

1 commit

  • Change the third parameter to be the required struct xen_dm_op_buf *
    instead of a generic void * (which blindly accepts any pointer).

    Signed-off-by: Sergey Dyasli
    Reviewed-by: Juergen Gross
    Reviewed-by: Stefano Stabellini
    Signed-off-by: Juergen Gross

    Sergey Dyasli
     

02 May, 2017

12 commits

  • When rebooting DOM0 with ACPI on ARM64, the kernel is crashing with the stack
    trace [1].

    This is happening because when EFI runtimes are enabled, the reset code
    (see machine_restart) will first try to use EFI restart method.

    However, the EFI restart code is expecting the reset_system callback to
    be always set. This is not the case for Xen and will lead to crash.

    The EFI restart helper is used in multiple places and some of them don't
    not have fallback (see machine_power_off). So implement reset_system
    callback as a call to xen_reboot when using EFI Xen.

    [ 36.999270] reboot: Restarting system
    [ 37.002921] Internal error: Attempting to execute userspace memory: 86000004 [#1] PREEMPT SMP
    [ 37.011460] Modules linked in:
    [ 37.014598] CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 4.11.0-rc1-00003-g1e248b60a39b-dirty #506
    [ 37.023903] Hardware name: (null) (DT)
    [ 37.027734] task: ffff800902068000 task.stack: ffff800902064000
    [ 37.033739] PC is at 0x0
    [ 37.036359] LR is at efi_reboot+0x94/0xd0
    [ 37.040438] pc : [] lr : [] pstate: 404001c5
    [ 37.047920] sp : ffff800902067cf0
    [ 37.051314] x29: ffff800902067cf0 x28: ffff800902068000
    [ 37.056709] x27: ffff000008992000 x26: 000000000000008e
    [ 37.062104] x25: 0000000000000123 x24: 0000000000000015
    [ 37.067499] x23: 0000000000000000 x22: ffff000008e6e250
    [ 37.072894] x21: ffff000008e6e000 x20: 0000000000000000
    [ 37.078289] x19: ffff000008e5d4c8 x18: 0000000000000010
    [ 37.083684] x17: 0000ffffa7c27470 x16: 00000000deadbeef
    [ 37.089079] x15: 0000000000000006 x14: ffff000088f42bef
    [ 37.094474] x13: ffff000008f42bfd x12: ffff000008e706c0
    [ 37.099870] x11: ffff000008e70000 x10: 0000000005f5e0ff
    [ 37.105265] x9 : ffff800902067a50 x8 : 6974726174736552
    [ 37.110660] x7 : ffff000008cc6fb8 x6 : ffff000008cc6fb0
    [ 37.116055] x5 : ffff000008c97dd8 x4 : 0000000000000000
    [ 37.121453] x3 : 0000000000000000 x2 : 0000000000000000
    [ 37.126845] x1 : 0000000000000000 x0 : 0000000000000000
    [ 37.132239]
    [ 37.133808] Process systemd-shutdow (pid: 1, stack limit = 0xffff800902064000)
    [ 37.141118] Stack: (0xffff800902067cf0 to 0xffff800902068000)
    [ 37.146949] 7ce0: ffff800902067d40 ffff000008085334
    [ 37.154869] 7d00: 0000000000000000 ffff000008f3b000 ffff800902067d40 ffff0000080852e0
    [ 37.162787] 7d20: ffff000008cc6fb0 ffff000008cc6fb8 ffff000008c7f580 ffff000008c97dd8
    [ 37.170706] 7d40: ffff800902067d60 ffff0000080e2c2c 0000000000000000 0000000001234567
    [ 37.178624] 7d60: ffff800902067d80 ffff0000080e2ee8 0000000000000000 ffff0000080e2df4
    [ 37.186544] 7d80: 0000000000000000 ffff0000080830f0 0000000000000000 00008008ff1c1000
    [ 37.194462] 7da0: ffffffffffffffff 0000ffffa7c4b1cc 0000000000000000 0000000000000024
    [ 37.202380] 7dc0: ffff800902067dd0 0000000000000005 0000fffff24743c8 0000000000000004
    [ 37.210299] 7de0: 0000fffff2475f03 0000000000000010 0000fffff2474418 0000000000000005
    [ 37.218218] 7e00: 0000fffff2474578 000000000000000a 0000aaaad6b722c0 0000000000000001
    [ 37.226136] 7e20: 0000000000000123 0000000000000038 ffff800902067e50 ffff0000081e7294
    [ 37.234055] 7e40: ffff800902067e60 ffff0000081e935c ffff800902067e60 ffff0000081e9388
    [ 37.241973] 7e60: ffff800902067eb0 ffff0000081ea388 0000000000000000 00008008ff1c1000
    [ 37.249892] 7e80: ffffffffffffffff 0000ffffa7c4a79c 0000000000000000 ffff000000020000
    [ 37.257810] 7ea0: 0000010000000004 0000000000000000 0000000000000000 ffff0000080830f0
    [ 37.265729] 7ec0: fffffffffee1dead 0000000028121969 0000000001234567 0000000000000000
    [ 37.273651] 7ee0: ffffffffffffffff 8080000000800000 0000800000008080 feffa9a9d4ff2d66
    [ 37.281567] 7f00: 000000000000008e feffa9a9d5b60e0f 7f7fffffffff7f7f 0101010101010101
    [ 37.289485] 7f20: 0000000000000010 0000000000000008 000000000000003a 0000ffffa7ccf588
    [ 37.297404] 7f40: 0000aaaad6b87d00 0000ffffa7c4b1b0 0000fffff2474be0 0000aaaad6b88000
    [ 37.305326] 7f60: 0000fffff2474fb0 0000000001234567 0000000000000000 0000000000000000
    [ 37.313240] 7f80: 0000000000000000 0000000000000001 0000aaaad6b70d4d 0000000000000000
    [ 37.321159] 7fa0: 0000000000000001 0000fffff2474ea0 0000aaaad6b5e2e0 0000fffff2474e80
    [ 37.329078] 7fc0: 0000ffffa7c4b1cc 0000000000000000 fffffffffee1dead 000000000000008e
    [ 37.336997] 7fe0: 0000000000000000 0000000000000000 9ce839cffee77eab fafdbf9f7ed57f2f
    [ 37.344911] Call trace:
    [ 37.347437] Exception stack(0xffff800902067b20 to 0xffff800902067c50)
    [ 37.353970] 7b20: ffff000008e5d4c8 0001000000000000 0000000080f82000 0000000000000000
    [ 37.361883] 7b40: ffff800902067b60 ffff000008e17000 ffff000008f44c68 00000001081081b4
    [ 37.369802] 7b60: ffff800902067bf0 ffff000008108478 0000000000000000 ffff000008c235b0
    [ 37.377721] 7b80: ffff800902067ce0 0000000000000000 0000000000000000 0000000000000015
    [ 37.385643] 7ba0: 0000000000000123 000000000000008e ffff000008992000 ffff800902068000
    [ 37.393557] 7bc0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    [ 37.401477] 7be0: 0000000000000000 ffff000008c97dd8 ffff000008cc6fb0 ffff000008cc6fb8
    [ 37.409396] 7c00: 6974726174736552 ffff800902067a50 0000000005f5e0ff ffff000008e70000
    [ 37.417318] 7c20: ffff000008e706c0 ffff000008f42bfd ffff000088f42bef 0000000000000006
    [ 37.425234] 7c40: 00000000deadbeef 0000ffffa7c27470
    [ 37.430190] [< (null)>] (null)
    [ 37.434982] [] machine_restart+0x6c/0x70
    [ 37.440550] [] kernel_restart+0x6c/0x78
    [ 37.446030] [] SyS_reboot+0x130/0x228
    [ 37.451337] [] el0_svc_naked+0x24/0x28
    [ 37.456737] Code: bad PC value
    [ 37.459891] ---[ end trace 76e2fc17e050aecd ]---

    Signed-off-by: Julien Grall

    --

    Cc: Boris Ostrovsky
    Cc: Juergen Gross
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: x86@kernel.org

    The x86 code has theoritically a similar issue, altought EFI does not
    seem to be the preferred method. I have only built test it on x86.

    This should also probably be fixed in stable tree.

    Changes in v2:
    - Implement xen_efi_reset_system using xen_reboot
    - Move xen_efi_reset_system in drivers/xen/efi.c
    Signed-off-by: Juergen Gross

    Julien Grall
     
  • The helper xen_reboot will be called by the EFI code in a later patch.

    Note that the ARM version does not yet exist and will be added in a
    later patch too.

    Signed-off-by: Julien Grall
    Signed-off-by: Juergen Gross

    Julien Grall
     
  • Now that __generic_dma_ops is a xen specific function, rename it to
    xen_get_dma_ops. Change all the call sites appropriately.

    Signed-off-by: Stefano Stabellini
    Reviewed-by: Boris Ostrovsky
    Acked-by: Konrad Rzeszutek Wilk
    CC: linux@armlinux.org.uk
    CC: catalin.marinas@arm.com
    CC: will.deacon@arm.com
    CC: boris.ostrovsky@oracle.com
    CC: jgross@suse.com
    CC: Julien Grall

    Stefano Stabellini
     
  • The following commit:

    commit 815dd18788fe0d41899f51b91d0560279cf16b0d
    Author: Bart Van Assche
    Date: Fri Jan 20 13:04:04 2017 -0800

    treewide: Consolidate get_dma_ops() implementations

    rearranges get_dma_ops in a way that xen_dma_ops are not returned when
    running on Xen anymore, dev->dma_ops is returned instead (see
    arch/arm/include/asm/dma-mapping.h:get_arch_dma_ops and
    include/linux/dma-mapping.h:get_dma_ops).

    Fix the problem by storing dev->dma_ops in dev_archdata, and setting
    dev->dma_ops to xen_dma_ops. This way, xen_dma_ops is returned naturally
    by get_dma_ops. The Xen code can retrieve the original dev->dma_ops from
    dev_archdata when needed. It also allows us to remove __generic_dma_ops
    from common headers.

    Signed-off-by: Stefano Stabellini
    Tested-by: Julien Grall
    Suggested-by: Catalin Marinas
    Reviewed-by: Catalin Marinas
    Cc: [4.11+]
    CC: linux@armlinux.org.uk
    CC: catalin.marinas@arm.com
    CC: will.deacon@arm.com
    CC: boris.ostrovsky@oracle.com
    CC: jgross@suse.com
    CC: Julien Grall

    Stefano Stabellini
     
  • This is the ABI for the two halves of a para-virtualized
    display driver.

    This protocol aims to provide a unified protocol which fits more
    sophisticated use-cases than a framebuffer device can handle. At the
    moment basic functionality is supported with the intention to extend:
    o multiple dynamically allocated/destroyed framebuffers
    o buffers of arbitrary sizes
    o better configuration options including multiple display support

    Note: existing fbif can be used together with displif running at the
    same time, e.g. on Linux one provides framebuffer and another DRM/KMS

    Future extensions to the existing protocol may include:
    o allow display/connector cloning
    o allow allocating objects other than display buffers
    o add planes/overlays support
    o support scaling
    o support rotation

    Note, that this protocol doesn't use ring macros for
    bi-directional exchange (PV calls/9pfs) bacause:
    o it statically defines the use of a single page
    for the ring buffer
    o it uses direct memory access to ring's contents
    w/o memory copying
    o re-uses the same idea that kbdif/fbif use
    which for this use-case seems to be appropriate

    ==================================================
    Rationale for introducing this protocol instead of
    using the existing fbif:
    ==================================================

    1. In/out event sizes
    o fbif - 40 octets
    o displif - 40 octets
    This is only the initial version of the displif protocol
    which means that there could be requests which will not fit
    (WRT introducing some GPU related functionality
    later on). In that case we cannot alter fbif sizes as we need to
    be backward compatible an will be forced to handle those
    apart of fbif.

    2. Shared page
    Displif doesn't use anything like struct xenfb_page, but
    DEFINE_RING_TYPES(xen_displif, struct xendispl_req, struct
    xendispl_resp) which is a better and more common way.
    Output events use a shared page which only has in_cons and in_prod
    and all the rest is used for incoming events. Here struct xenfb_page
    could probably be used as is despite the fact that it only has a half
    of a page for incoming events which is only 50 events. (consider
    something like 60Hz display)

    3. Amount of changes.
    fbif only provides XENFB_TYPE_UPDATE and XENFB_TYPE_RESIZE
    events, so it looks like it is easier to get fb support into displif
    than vice versa. displif at the moment has 6 requests and 1 event,
    multiple connector support, etc.

    Signed-off-by: Oleksandr Grytsov
    Signed-off-by: Oleksandr Andrushchenko
    Acked-by: Juergen Gross
    Signed-off-by: Juergen Gross

    Oleksandr Andrushchenko
     
  • Add ABI for the two halves of a para-virtualized
    sound driver to communicate with each other.

    The ABI allows implementing audio playback and capture as
    well as volume control and possibility to mute/unmute
    audio sources.

    Note: depending on the use-case backend can expose more sound
    cards and PCM devices/streams than the underlying HW physically
    has by employing SW mixers, configuring virtual sound streams,
    channels etc. Thus, allowing fine tunned configurations per
    frontend.

    Signed-off-by: Oleksandr Andrushchenko
    Signed-off-by: Oleksandr Grytsov
    Signed-off-by: Oleksandr Dmytryshyn
    Signed-off-by: Iurii Konovalenko
    Acked-by: Juergen Gross
    Signed-off-by: Juergen Gross

    Oleksandr Andrushchenko
     
  • Multi-touch fields re-use the page that is used by the other features
    which means that you can interleave multi-touch, motion, and key
    events.

    Signed-off-by: Oleksandr Andrushchenko
    Acked-by: Juergen Gross
    Signed-off-by: Juergen Gross

    Oleksandr Andrushchenko
     
  • The patch clarifies the protocol that is used by the PV keyboard
    drivers.

    Signed-off-by: Oleksandr Andrushchenko
    Acked-by: Juergen Gross
    Signed-off-by: Juergen Gross

    Oleksandr Andrushchenko
     
  • It uses the new ring.h macros to declare rings and interfaces.

    CC: konrad.wilk@oracle.com
    CC: boris.ostrovsky@oracle.com
    CC: jgross@suse.com
    CC: groug@kaod.org

    Signed-off-by: Stefano Stabellini
    Acked-by: Juergen Gross
    Signed-off-by: Juergen Gross

    Stefano Stabellini
     
  • Sync the ring.h file with upstream Xen, to introduce the new ring macros.
    They will be used by the Xen transport for 9pfs.

    CC: konrad.wilk@oracle.com
    CC: boris.ostrovsky@oracle.com
    CC: jgross@suse.com
    CC: groug@kaod.org

    Signed-off-by: Stefano Stabellini
    Acked-by: Juergen Gross
    Signed-off-by: Juergen Gross

    Stefano Stabellini
     
  • xen_create_contiguous_region()/xen_create_contiguous_region() are PV-only,
    they both contain xen_feature(XENFEAT_auto_translated_physmap) check and
    bail in the very beginning.

    Signed-off-by: Vitaly Kuznetsov
    Reviewed-by: Juergen Gross
    Signed-off-by: Juergen Gross

    Vitaly Kuznetsov
     
  • Pull x86 boot updates from Ingo Molnar:
    "The biggest changes in this cycle were:

    - reworking of the e820 code: separate in-kernel and boot-ABI data
    structures and apply a whole range of cleanups to the kernel side.

    No change in functionality.

    - enable KASLR by default: it's used by all major distros and it's
    out of the experimental stage as well.

    - ... misc fixes and cleanups"

    * 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (63 commits)
    x86/KASLR: Fix kexec kernel boot crash when KASLR randomization fails
    x86/reboot: Turn off KVM when halting a CPU
    x86/boot: Fix BSS corruption/overwrite bug in early x86 kernel startup
    x86: Enable KASLR by default
    boot/param: Move next_arg() function to lib/cmdline.c for later reuse
    x86/boot: Fix Sparse warning by including required header file
    x86/boot/64: Rename start_cpu()
    x86/xen: Update e820 table handling to the new core x86 E820 code
    x86/boot: Fix pr_debug() API braindamage
    xen, x86/headers: Add dependency to
    x86/boot/e820: Simplify e820__update_table()
    x86/boot/e820: Separate the E820 ABI structures from the in-kernel structures
    x86/boot/e820: Fix and clean up e820_type switch() statements
    x86/boot/e820: Rename the remaining E820 APIs to the e820__*() prefix
    x86/boot/e820: Remove unnecessary #include's
    x86/boot/e820: Rename e820_mark_nosave_regions() to e820__register_nosave_regions()
    x86/boot/e820: Rename e820_reserve_resources*() to e820__reserve_resources*()
    x86/boot/e820: Use bool in query APIs
    x86/boot/e820: Document e820__reserve_setup_data()
    x86/boot/e820: Clean up __e820__update_table() et al
    ...

    Linus Torvalds
     

08 Mar, 2017

1 commit


01 Mar, 2017

1 commit


28 Feb, 2017

1 commit


26 Feb, 2017

1 commit

  • Pull rdma DMA mapping updates from Doug Ledford:
    "Drop IB DMA mapping code and use core DMA code instead.

    Bart Van Assche noted that the ib DMA mapping code was significantly
    similar enough to the core DMA mapping code that with a few changes it
    was possible to remove the IB DMA mapping code entirely and switch the
    RDMA stack to use the core DMA mapping code.

    This resulted in a nice set of cleanups, but touched the entire tree
    and has been kept separate for that reason."

    * tag 'for-next-dma_ops' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (37 commits)
    IB/rxe, IB/rdmavt: Use dma_virt_ops instead of duplicating it
    IB/core: Remove ib_device.dma_device
    nvme-rdma: Switch from dma_device to dev.parent
    RDS: net: Switch from dma_device to dev.parent
    IB/srpt: Modify a debug statement
    IB/srp: Switch from dma_device to dev.parent
    IB/iser: Switch from dma_device to dev.parent
    IB/IPoIB: Switch from dma_device to dev.parent
    IB/rxe: Switch from dma_device to dev.parent
    IB/vmw_pvrdma: Switch from dma_device to dev.parent
    IB/usnic: Switch from dma_device to dev.parent
    IB/qib: Switch from dma_device to dev.parent
    IB/qedr: Switch from dma_device to dev.parent
    IB/ocrdma: Switch from dma_device to dev.parent
    IB/nes: Remove a superfluous assignment statement
    IB/mthca: Switch from dma_device to dev.parent
    IB/mlx5: Switch from dma_device to dev.parent
    IB/mlx4: Switch from dma_device to dev.parent
    IB/i40iw: Remove a superfluous assignment statement
    IB/hns: Switch from dma_device to dev.parent
    ...

    Linus Torvalds
     

15 Feb, 2017

1 commit

  • Recently a new dm_op[1] hypercall was added to Xen to provide a mechanism
    for restricting device emulators (such as QEMU) to a limited set of
    hypervisor operations, and being able to audit those operations in the
    kernel of the domain in which they run.

    This patch adds IOCTL_PRIVCMD_DM_OP as gateway for __HYPERVISOR_dm_op.

    NOTE: There is no requirement for user-space code to bounce data through
    locked memory buffers (as with IOCTL_PRIVCMD_HYPERCALL) since
    privcmd has enough information to lock the original buffers
    directly.

    [1] http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=524a98c2

    Signed-off-by: Paul Durrant
    Acked-by: Stefano Stabellini
    Signed-off-by: Boris Ostrovsky

    Paul Durrant
     

14 Feb, 2017

2 commits


10 Feb, 2017

2 commits

  • Today a Xenstore watch event is delivered via a callback function
    declared as:

    void (*callback)(struct xenbus_watch *,
    const char **vec, unsigned int len);

    As all watch events only ever come with two parameters (path and token)
    changing the prototype to:

    void (*callback)(struct xenbus_watch *,
    const char *path, const char *token);

    is the natural thing to do.

    Apply this change and adapt all users.

    Cc: konrad.wilk@oracle.com
    Cc: roger.pau@citrix.com
    Cc: wei.liu2@citrix.com
    Cc: paul.durrant@citrix.com
    Cc: netdev@vger.kernel.org

    Signed-off-by: Juergen Gross
    Reviewed-by: Paul Durrant
    Reviewed-by: Wei Liu
    Reviewed-by: Roger Pau Monné
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: Boris Ostrovsky

    Juergen Gross
     
  • The xenbus driver has an awful mixture of internally and globally
    visible headers: some of the internally used only stuff is defined in
    the global header include/xen/xenbus.h while some stuff defined in
    internal headers is used by other drivers, too.

    Clean this up by moving the externally used symbols to
    include/xen/xenbus.h and the symbols used internally only to a new
    header drivers/xen/xenbus/xenbus.h replacing xenbus_comms.h and
    xenbus_probe.h

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

    Juergen Gross
     

07 Feb, 2017

3 commits

  • Start PVH guest at XEN_ELFNOTE_PHYS32_ENTRY address. Setup hypercall
    page, initialize boot_params, enable early page tables.

    Since this stub is executed before kernel entry point we cannot use
    variables in .bss which is cleared by kernel. We explicitly place
    variables that are initialized here into .data.

    While adjusting xen_hvm_init_shared_info() make it use cpuid_e?x()
    instead of cpuid() (wherever possible).

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

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

    Boris Ostrovsky
     
  • 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
     

29 Jan, 2017

1 commit

  • We've got a number of defines related to the E820 table and its size:

    E820MAP
    E820NR
    E820_X_MAX
    E820MAX

    The first two denote byte offsets into the zeropage (struct boot_params),
    and can are not used in the kernel and can be removed.

    The E820_*_MAX values have an inconsistent structure and it's unclear in any
    case what they mean. 'X' presuably goes for extended - but it's not very
    expressive altogether.

    Change these over to:

    E820_MAX_ENTRIES_ZEROPAGE
    E820_MAX_ENTRIES

    ... which are self-explanatory names.

    No change in functionality.

    Cc: Alex Thorlton
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dan Williams
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Huang, Ying
    Cc: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: Linus Torvalds
    Cc: Paul Jackson
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Tejun Heo
    Cc: Thomas Gleixner
    Cc: Wei Yang
    Cc: Yinghai Lu
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

25 Jan, 2017

1 commit

  • Most dma_map_ops structures are never modified. Constify these
    structures such that these can be write-protected. This patch
    has been generated as follows:

    git grep -l 'struct dma_map_ops' |
    xargs -d\\n sed -i \
    -e 's/struct dma_map_ops/const struct dma_map_ops/g' \
    -e 's/const struct dma_map_ops {/struct dma_map_ops {/g' \
    -e 's/^const struct dma_map_ops;$/struct dma_map_ops;/' \
    -e 's/const const struct dma_map_ops /const struct dma_map_ops /g';
    sed -i -e 's/const \(struct dma_map_ops intel_dma_ops\)/\1/' \
    $(git grep -l 'struct dma_map_ops intel_dma_ops');
    sed -i -e 's/const \(struct dma_map_ops dma_iommu_ops\)/\1/' \
    $(git grep -l 'struct dma_map_ops' | grep ^arch/powerpc);
    sed -i -e '/^struct vmd_dev {$/,/^};$/ s/const \(struct dma_map_ops[[:blank:]]dma_ops;\)/\1/' \
    -e '/^static void vmd_setup_dma_ops/,/^}$/ s/const \(struct dma_map_ops \*dest\)/\1/' \
    -e 's/const \(struct dma_map_ops \*dest = \&vmd->dma_ops\)/\1/' \
    drivers/pci/host/*.c
    sed -i -e '/^void __init pci_iommu_alloc(void)$/,/^}$/ s/dma_ops->/intel_dma_ops./' arch/ia64/kernel/pci-dma.c
    sed -i -e 's/static const struct dma_map_ops sn_dma_ops/static struct dma_map_ops sn_dma_ops/' arch/ia64/sn/pci/pci_dma.c
    sed -i -e 's/(const struct dma_map_ops \*)//' drivers/misc/mic/bus/vop_bus.c

    Signed-off-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Cc: Benjamin Herrenschmidt
    Cc: Boris Ostrovsky
    Cc: David Woodhouse
    Cc: Juergen Gross
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: linux-arch@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: Russell King
    Cc: x86@kernel.org
    Signed-off-by: Doug Ledford

    Bart Van Assche