18 Mar, 2014

2 commits

  • syscore->resume() callback is expected to do not enable interrupts,
    it generates warning like below otherwise:

    [ 9386.365390] WARNING: CPU: 0 PID: 6733 at drivers/base/syscore.c:104 syscore_resume+0x9a/0xe0()
    [ 9386.365403] Interrupts enabled after xen_acpi_processor_resume+0x0/0x34 [xen_acpi_processor]
    ...
    [ 9386.365429] Call Trace:
    [ 9386.365434] [] dump_stack+0x45/0x56
    [ 9386.365437] [] warn_slowpath_common+0x7d/0xa0
    [ 9386.365439] [] warn_slowpath_fmt+0x4c/0x50
    [ 9386.365442] [] ? xen_upload_processor_pm_data+0x300/0x300 [xen_acpi_processor]
    [ 9386.365443] [] syscore_resume+0x9a/0xe0
    [ 9386.365445] [] suspend_devices_and_enter+0x402/0x470
    [ 9386.365447] [] pm_suspend+0x178/0x260

    On xen_acpi_processor_resume() we call various procedures, which are
    non atomic and can enable interrupts. To prevent the issue introduce
    separate resume notify called after we enable interrupts on resume
    and before we call other drivers resume callbacks.

    Signed-off-by: Stanislaw Gruszka
    Signed-off-by: Konrad Rzeszutek Wilk

    Stanislaw Gruszka
     
  • Add support for MSI message groups for Xen Dom0 using the
    MAP_PIRQ_TYPE_MULTI_MSI pirq map type.

    In order to keep track of which pirq is the first one in the group all
    pirqs in the MSI group except for the first one have the newly
    introduced PIRQ_MSI_GROUP flag set. This prevents calling
    PHYSDEVOP_unmap_pirq on them, since the unmap must be done with the
    first pirq in the group.

    Signed-off-by: Roger Pau Monné
    Signed-off-by: David Vrabel
    Cc: Boris Ostrovsky

    Roger Pau Monne
     

01 Mar, 2014

2 commits


15 Feb, 2014

1 commit

  • Pull block IO fixes from Jens Axboe:
    "Second round of updates and fixes for 3.14-rc2. Most of this stuff
    has been queued up for a while. The notable exception is the blk-mq
    changes, which are naturally a bit more in flux still.

    The pull request contains:

    - Two bug fixes for the new immutable vecs, causing crashes with raid
    or swap. From Kent.

    - Various blk-mq tweaks and fixes from Christoph. A fix for
    integrity bio's from Nic.

    - A few bcache fixes from Kent and Darrick Wong.

    - xen-blk{front,back} fixes from David Vrabel, Matt Rushton, Nicolas
    Swenson, and Roger Pau Monne.

    - Fix for a vec miscount with integrity vectors from Martin.

    - Minor annotations or fixes from Masanari Iida and Rashika Kheria.

    - Tweak to null_blk to do more normal FIFO processing of requests
    from Shlomo Pongratz.

    - Elevator switching bypass fix from Tejun.

    - Softlockup in blkdev_issue_discard() fix when !CONFIG_PREEMPT from
    me"

    * 'for-linus' of git://git.kernel.dk/linux-block: (31 commits)
    block: add cond_resched() to potentially long running ioctl discard loop
    xen-blkback: init persistent_purge_work work_struct
    blk-mq: pair blk_mq_start_request / blk_mq_requeue_request
    blk-mq: dont assume rq->errors is set when returning an error from ->queue_rq
    block: Fix cloning of discard/write same bios
    block: Fix type mismatch in ssize_t_blk_mq_tag_sysfs_show
    blk-mq: rework flush sequencing logic
    null_blk: use blk_complete_request and blk_mq_complete_request
    virtio_blk: use blk_mq_complete_request
    blk-mq: rework I/O completions
    fs: Add prototype declaration to appropriate header file include/linux/bio.h
    fs: Mark function as static in fs/bio-integrity.c
    block/null_blk: Fix completion processing from LIFO to FIFO
    block: Explicitly handle discard/write same segments
    block: Fix nr_vecs for inline integrity vectors
    blk-mq: Add bio_integrity setup to blk_mq_make_request
    blk-mq: initialize sg_reserved_size
    blk-mq: handle dma_drain_size
    blk-mq: divert __blk_put_request for MQ ops
    blk-mq: support at_head inserations for blk_execute_rq
    ...

    Linus Torvalds
     

13 Feb, 2014

1 commit

  • Pull Xen bugfixes from Konrad Rzeszutek Wilk:
    "This has an healthy amount of code being removed - which we do not use
    anymore (the only user of it was ia64 Xen which had been removed
    already). The other bug-fixes are to make Xen ARM be able to use the
    new event channel mechanism and proper export of header files to
    user-space.

    Summary:
    - Fix ARM and Xen FIFO not working.
    - Remove more Xen ia64 vestigates.
    - Fix UAPI missing Xen files"

    * tag 'stable/for-linus-3.14-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    ia64/xen: Remove Xen support for ia64 even more
    xen: install xen/gntdev.h and xen/gntalloc.h
    xen/events: bind all new interdomain events to VCPU0

    Linus Torvalds
     

11 Feb, 2014

3 commits

  • Commit d52eefb47d4e ("ia64/xen: Remove Xen support for ia64") removed
    the Kconfig symbol XEN_XENCOMM. But it didn't remove the code depending
    on that symbol. Remove that code now.

    Signed-off-by: Paul Bolle
    Acked-by: David Vrabel
    Signed-off-by: Konrad Rzeszutek Wilk

    Paul Bolle
     
  • xen/gntdev.h and xen/gntalloc.h both provide userspace ABIs so they
    should be installed.

    CC: stable@vger.kernel.org
    Signed-off-by: David Vrabel
    Signed-off-by: Konrad Rzeszutek Wilk

    David Vrabel
     
  • …/git/xen/tip into for-linus

    Konrad writes:

    Please git pull the following branch:

    git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git stable/for-jens-3.14

    which is based off v3.13-rc6. If you would like me to rebase it on
    a different branch/tag I would be more than happy to do so.

    The patches are all bug-fixes and hopefully can go in 3.14.

    They deal with xen-blkback shutdown and cause memory leaks
    as well as shutdown races. They should go to stable tree and if you
    are OK with I will ask them to backport those fixes.

    There is also a fix to xen-blkfront to deal with unexpected state
    transition. And lastly a fix to the header where it was using the
    __aligned__ unnecessarily.

    Jens Axboe
     

08 Feb, 2014

1 commit

  • This was wrongly introduced in commit 402b27f9, the only difference
    between blkif_request_segment_aligned and blkif_request_segment is
    that the former has a named padding, while both share the same
    memory layout.

    Also correct a few minor glitches in the description, including for it
    to no longer assume PAGE_SIZE == 4096.

    Signed-off-by: Roger Pau Monné
    [Description fix by Jan Beulich]
    Signed-off-by: Jan Beulich
    Reported-by: Jan Beulich
    Cc: Konrad Rzeszutek Wilk
    Cc: David Vrabel
    Cc: Boris Ostrovsky
    Tested-by: Matt Rushton
    Cc: Matt Wilson
    Signed-off-by: Konrad Rzeszutek Wilk

    Roger Pau Monne
     

06 Feb, 2014

1 commit


03 Feb, 2014

1 commit


01 Feb, 2014

1 commit

  • …inux/kernel/git/xen/tip

    Pull Xen bugfixes from Konrad Rzeszutek Wilk:
    "Bug-fixes for the new features that were added during this cycle.

    There are also two fixes for long-standing issues for which we have a
    solution: grant-table operations extra work that was not needed
    causing performance issues and the self balloon code was too
    aggressive causing OOMs.

    Details:
    - Xen ARM couldn't use the new FIFO events
    - Xen ARM couldn't use the SWIOTLB if compiled as 32-bit with 64-bit PCIe devices.
    - Grant table were doing needless M2P operations.
    - Ratchet down the self-balloon code so it won't OOM.
    - Fix misplaced kfree in Xen PVH error code paths"

    * tag 'stable/for-linus-3.14-rc0-late-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    xen/pvh: Fix misplaced kfree from xlated_setup_gnttab_pages
    drivers: xen: deaggressive selfballoon driver
    xen/grant-table: Avoid m2p_override during mapping
    xen/gnttab: Use phys_addr_t to describe the grant frame base address
    xen: swiotlb: handle sizeof(dma_addr_t) != sizeof(phys_addr_t)
    arm/xen: Initialize event channels earlier

    Linus Torvalds
     

31 Jan, 2014

1 commit

  • The grant mapping API does m2p_override unnecessarily: only gntdev needs it,
    for blkback and future netback patches it just cause a lock contention, as
    those pages never go to userspace. Therefore this series does the following:
    - the original functions were renamed to __gnttab_[un]map_refs, with a new
    parameter m2p_override
    - based on m2p_override either they follow the original behaviour, or just set
    the private flag and call set_phys_to_machine
    - gnttab_[un]map_refs are now a wrapper to call __gnttab_[un]map_refs with
    m2p_override false
    - a new function gnttab_[un]map_refs_userspace provides the old behaviour

    It also removes a stray space from page.h and change ret to 0 if
    XENFEAT_auto_translated_physmap, as that is the only possible return value
    there.

    v2:
    - move the storing of the old mfn in page->index to gnttab_map_refs
    - move the function header update to a separate patch

    v3:
    - a new approach to retain old behaviour where it needed
    - squash the patches into one

    v4:
    - move out the common bits from m2p* functions, and pass pfn/mfn as parameter
    - clear page->private before doing anything with the page, so m2p_find_override
    won't race with this

    v5:
    - change return value handling in __gnttab_[un]map_refs
    - remove a stray space in page.h
    - add detail why ret = 0 now at some places

    v6:
    - don't pass pfn to m2p* functions, just get it locally

    Signed-off-by: Zoltan Kiss
    Suggested-by: David Vrabel
    Acked-by: David Vrabel
    Acked-by: Stefano Stabellini
    Signed-off-by: Konrad Rzeszutek Wilk

    Zoltan Kiss
     

30 Jan, 2014

1 commit

  • On ARM, address size can be 32 bits or 64 bits (if CONFIG_ARCH_PHYS_ADDR_T_64BIT
    is enabled).
    We can't assume that the grant frame base address will always fits in an
    unsigned long. Use phys_addr_t instead of unsigned long as argument for
    gnttab_setup_auto_xlat_frames.

    Signed-off-by: Julien Grall
    Signed-off-by: Stefano Stabellini
    Acked-by: Ian Campbell
    Reviewed-by: David Vrabel

    Julien Grall
     

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
     

21 Jan, 2014

1 commit


06 Jan, 2014

7 commits

  • PVH allows PV linux guest to utilize hardware extended capabilities,
    such as running MMU updates in a HVM container.

    The Xen side defines PVH as (from docs/misc/pvh-readme.txt,
    with modifications):

    "* the guest uses auto translate:
    - p2m is managed by Xen
    - pagetables are owned by the guest
    - mmu_update hypercall not available
    * it uses event callback and not vlapic emulation,
    * IDT is native, so set_trap_table hcall is also N/A for a PVH guest.

    For a full list of hcalls supported for PVH, see pvh_hypercall64_table
    in arch/x86/hvm/hvm.c in xen. From the ABI prespective, it's mostly a
    PV guest with auto translate, although it does use hvm_op for setting
    callback vector."

    Use .ascii and .asciz to define xen feature string. Note, the PVH
    string must be in a single line (not multiple lines with \) to keep the
    assembler from putting null char after each string before \.
    This patch allows it to be configured and enabled.

    We also use introduce the 'XEN_ELFNOTE_SUPPORTED_FEATURES' ELF note to
    tell the hypervisor that 'hvm_callback_vector' is what the kernel
    needs. We can not put it in 'XEN_ELFNOTE_FEATURES' as older hypervisor
    parse fields they don't understand as errors and refuse to load
    the kernel. This work-around fixes the problem.

    Signed-off-by: Mukesh Rathor
    Signed-off-by: Konrad Rzeszutek Wilk
    Acked-by: Stefano Stabellini

    Mukesh Rathor
     
  • The 'xen_hvm_resume_frames' used to be an 'unsigned long'
    and contain the virtual address of the grants. That was OK
    for most architectures (PVHVM, ARM) were the grants are contiguous
    in memory. That however is not the case for PVH - in which case
    we will have to do a lookup for each virtual address for the PFN.

    Instead of doing that, lets make it a structure which will contain
    the array of PFNs, the virtual address and the count of said PFNs.

    Also provide a generic functions: gnttab_setup_auto_xlat_frames and
    gnttab_free_auto_xlat_frames to populate said structure with
    appropriate values for PVHVM and ARM.

    To round it off, change the name from 'xen_hvm_resume_frames' to
    a more descriptive one - 'xen_auto_xlat_grant_frames'.

    For PVH, in patch "xen/pvh: Piggyback on PVHVM for grant driver"
    we will populate the 'xen_auto_xlat_grant_frames' by ourselves.

    v2 moves the xen_remap in the gnttab_setup_auto_xlat_frames
    and also introduces xen_unmap for gnttab_free_auto_xlat_frames.

    Suggested-by: Stefano Stabellini
    Signed-off-by: Konrad Rzeszutek Wilk
    [v3: Based on top of 'asm/xen/page.h: remove redundant semicolon']
    Acked-by: Stefano Stabellini

    Konrad Rzeszutek Wilk
     
  • Which is a PV guest with auto page translation enabled
    and with vector callback. It is a cross between PVHVM and PV.

    The Xen side defines PVH as (from docs/misc/pvh-readme.txt,
    with modifications):

    "* the guest uses auto translate:
    - p2m is managed by Xen
    - pagetables are owned by the guest
    - mmu_update hypercall not available
    * it uses event callback and not vlapic emulation,
    * IDT is native, so set_trap_table hcall is also N/A for a PVH guest.

    For a full list of hcalls supported for PVH, see pvh_hypercall64_table
    in arch/x86/hvm/hvm.c in xen. From the ABI prespective, it's mostly a
    PV guest with auto translate, although it does use hvm_op for setting
    callback vector."

    Also we use the PV cpuid, albeit we can use the HVM (native) cpuid.
    However, we do have a fair bit of filtering in the xen_cpuid and
    we can piggyback on that until the hypervisor/toolstack filters
    the appropiate cpuids. Once that is done we can swap over to
    use the native one.

    We setup a Kconfig entry that is disabled by default and
    cannot be enabled.

    Note that on ARM the concept of PVH is non-existent. As Ian
    put it: "an ARM guest is neither PV nor HVM nor PVHVM.
    It's a bit like PVH but is different also (it's further towards
    the H end of the spectrum than even PVH).". As such these
    options (PVHVM, PVH) are never enabled nor seen on ARM
    compilations.

    Signed-off-by: Mukesh Rathor
    Signed-off-by: Konrad Rzeszutek Wilk

    Mukesh Rathor
     
  • Add xen_irq_set_priority() to set an event channels priority. This function
    will only work with event channel ABIs that support priority (i.e., the
    FIFO-based ABI).

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

    David Vrabel
     
  • Add the hypercall sub-ops and the structures for the shared data used
    in the FIFO-based event channel ABI.

    The design document for this new ABI is available here:

    http://xenbits.xen.org/people/dvrabel/event-channels-H.pdf

    In summary, events are reported using a per-domain shared event array
    of event words. Each event word has PENDING, LINKED and MASKED bits
    and a LINK field for pointing to the next event in the event queue.

    There are 16 event queues (with different priorities) per-VCPU.

    Key advantages of this new ABI include:

    - Support for over 100,000 events (2^17).
    - 16 different event priorities.
    - Improved fairness in event latency through the use of FIFOs.

    The ABI is available in Xen 4.4 and later.

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

    David Vrabel
     
  • Remove the check during unbind for NR_EVENT_CHANNELS as this limits
    support to less than 4096 ports.

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

    David Vrabel
     
  • In preparation for alternative event channel ABIs, move all the
    functions accessing the shared data structures into their own file.

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

    David Vrabel
     

04 Jan, 2014

2 commits

  • Since we have xen_has_pv_devices,xen_has_pv_disk_devices,
    xen_has_pv_nic_devices, and xen_has_pv_and_legacy_disk_devices
    to figure out the different 'unplug' behaviors - lets
    use those instead of this single int.

    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     
  • The user has the option of disabling the platform driver:
    00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)

    which is used to unplug the emulated drivers (IDE, Realtek 8169, etc)
    and allow the PV drivers to take over. If the user wishes
    to disable that they can set:

    xen_platform_pci=0
    (in the guest config file)

    or
    xen_emul_unplug=never
    (on the Linux command line)

    except it does not work properly. The PV drivers still try to
    load and since the Xen platform driver is not run - and it
    has not initialized the grant tables, most of the PV drivers
    stumble upon:

    input: Xen Virtual Keyboard as /devices/virtual/input/input5
    input: Xen Virtual Pointer as /devices/virtual/input/input6M
    ------------[ cut here ]------------
    kernel BUG at /home/konrad/ssd/konrad/linux/drivers/xen/grant-table.c:1206!
    invalid opcode: 0000 [#1] SMP
    Modules linked in: xen_kbdfront(+) xenfs xen_privcmd
    CPU: 6 PID: 1389 Comm: modprobe Not tainted 3.13.0-rc1upstream-00021-ga6c892b-dirty #1
    Hardware name: Xen HVM domU, BIOS 4.4-unstable 11/26/2013
    RIP: 0010:[] [] 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
     

21 Dec, 2013

1 commit

  • Pull Xen bugfixes from Konrad Rzeszutek Wilk:
    - Fix balloon driver for auto-translate guests (PVHVM, ARM) to not use
    scratch pages.
    - Fix block API header for ARM32 and ARM64 to have proper layout
    - On ARM when mapping guests, stick on PTE_SPECIAL
    - When using SWIOTLB under ARM, don't call swiotlb functions twice
    - When unmapping guests memory and if we fail, don't return pages which
    failed to be unmapped.
    - Grant driver was using the wrong address on ARM.

    * tag 'stable/for-linus-3.13-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    xen/balloon: Seperate the auto-translate logic properly (v2)
    xen/block: Correctly define structures in public headers on ARM32 and ARM64
    arm: xen: foreign mapping PTEs are special.
    xen/arm64: do not call the swiotlb functions twice
    xen: privcmd: do not return pages which we have failed to unmap
    XEN: Grant table address, xen_hvm_resume_frames, is a phys_addr not a pfn

    Linus Torvalds
     

13 Dec, 2013

1 commit

  • On ARM (32 bits and 64 bits), the double-word is 8-bytes aligned. This will
    result on different structure from Xen and Linux repositories.

    As Linux is using __packed__ attribute, it must have a 4-bytes padding before
    each "id" field.

    This change breaks guest block support with older kernel. IMHO, it's acceptable
    because Xen on ARM is still on Tech Preview and the hypercall ABI is not yet
    freezed.

    Only one architecture (x86_32) doesn't have 64-bit ABI for the block interface.
    Don't add padding if Linux is compiled for this architecture.

    Signed-off-by: Julien Grall
    Acked-by: Roger Pau Monne
    Acked-by: David Vrabel
    Cc: Boris Ostrovsky
    Cc: Ian Campbell
    Acked-by: Stefano Stabellini
    [I had asked for confirmation that it did not break x86 and Ian went
    beyound the call of duty to confirm it. Also a internal regression
    bucket with 32/64 dom0 with 32/64 domU (PV and HVM) confirmed no
    regressions. ABI changes are a drag..]
    Signed-off-by: Konrad Rzeszutek Wilk

    Julien Grall
     

11 Dec, 2013

1 commit


15 Nov, 2013

1 commit

  • Pull Xen updates from Konrad Rzeszutek Wilk:
    "This has tons of fixes and two major features which are concentrated
    around the Xen SWIOTLB library.

    The short is that the tracing facility (just one function) has
    been added to SWIOTLB to make it easier to track I/O progress.
    Additionally under Xen and ARM (32 & 64) the Xen-SWIOTLB driver
    "is used to translate physical to machine and machine to physical
    addresses of foreign[guest] pages for DMA operations" (Stefano) when
    booting under hardware without proper IOMMU.

    There are also bug-fixes, cleanups, compile warning fixes, etc.

    The commit times for some of the commits is a bit fresh - that is b/c
    we wanted to make sure we have the Ack's from the ARM folks - which
    with the string of back-to-back conferences took a bit of time. Rest
    assured - the code has been stewing in #linux-next for some time.

    Features:
    - SWIOTLB has tracing added when doing bounce buffer.
    - Xen ARM/ARM64 can use Xen-SWIOTLB. This work allows Linux to
    safely program real devices for DMA operations when running as a
    guest on Xen on ARM, without IOMMU support. [*1]
    - xen_raw_printk works with PVHVM guests if needed.

    Bug-fixes:
    - Make memory ballooning work under HVM with large MMIO region.
    - Inform hypervisor of MCFG regions found in ACPI DSDT.
    - Remove deprecated IRQF_DISABLED.
    - Remove deprecated __cpuinit.

    [*1]:
    "On arm and arm64 all Xen guests, including dom0, run with second
    stage translation enabled. As a consequence when dom0 programs a
    device for a DMA operation is going to use (pseudo) physical
    addresses instead machine addresses. This work introduces two trees
    to track physical to machine and machine to physical mappings of
    foreign pages. Local pages are assumed mapped 1:1 (physical address
    == machine address). It enables the SWIOTLB-Xen driver on ARM and
    ARM64, so that Linux can translate physical addresses to machine
    addresses for dma operations when necessary. " (Stefano)"

    * tag 'stable/for-linus-3.13-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (32 commits)
    xen/arm: pfn_to_mfn and mfn_to_pfn return the argument if nothing is in the p2m
    arm,arm64/include/asm/io.h: define struct bio_vec
    swiotlb-xen: missing include dma-direction.h
    pci-swiotlb-xen: call pci_request_acs only ifdef CONFIG_PCI
    arm: make SWIOTLB available
    xen: delete new instances of added __cpuinit
    xen/balloon: Set balloon's initial state to number of existing RAM pages
    xen/mcfg: Call PHYSDEVOP_pci_mmcfg_reserved for MCFG areas.
    xen: remove deprecated IRQF_DISABLED
    x86/xen: remove deprecated IRQF_DISABLED
    swiotlb-xen: fix error code returned by xen_swiotlb_map_sg_attrs
    swiotlb-xen: static inline xen_phys_to_bus, xen_bus_to_phys, xen_virt_to_bus and range_straddles_page_boundary
    grant-table: call set_phys_to_machine after mapping grant refs
    arm,arm64: do not always merge biovec if we are running on Xen
    swiotlb: print a warning when the swiotlb is full
    swiotlb-xen: use xen_dma_map/unmap_page, xen_dma_sync_single_for_cpu/device
    xen: introduce xen_dma_map/unmap_page and xen_dma_sync_single_for_cpu/device
    tracing/events: Fix swiotlb tracepoint creation
    swiotlb-xen: use xen_alloc/free_coherent_pages
    xen: introduce xen_alloc/free_coherent_pages
    ...

    Linus Torvalds
     

09 Nov, 2013

3 commits

  • * stefano/swiotlb-xen-9.1:
    swiotlb-xen: fix error code returned by xen_swiotlb_map_sg_attrs
    swiotlb-xen: static inline xen_phys_to_bus, xen_bus_to_phys, xen_virt_to_bus and range_straddles_page_boundary
    grant-table: call set_phys_to_machine after mapping grant refs
    arm,arm64: do not always merge biovec if we are running on Xen
    swiotlb: print a warning when the swiotlb is full
    swiotlb-xen: use xen_dma_map/unmap_page, xen_dma_sync_single_for_cpu/device
    xen: introduce xen_dma_map/unmap_page and xen_dma_sync_single_for_cpu/device
    swiotlb-xen: use xen_alloc/free_coherent_pages
    xen: introduce xen_alloc/free_coherent_pages
    arm64/xen: get_dma_ops: return xen_dma_ops if we are running as xen_initial_domain
    arm/xen: get_dma_ops: return xen_dma_ops if we are running as xen_initial_domain
    swiotlb-xen: introduce xen_swiotlb_set_dma_mask
    xen/arm,arm64: enable SWIOTLB_XEN
    xen: make xen_create_contiguous_region return the dma address
    xen/x86: allow __set_phys_to_machine for autotranslate guests
    arm/xen,arm64/xen: introduce p2m
    arm64: define DMA_ERROR_CODE
    arm: make SWIOTLB available

    Signed-off-by: Konrad Rzeszutek Wilk

    Conflicts:
    arch/arm/include/asm/dma-mapping.h
    drivers/xen/swiotlb-xen.c

    [Conflicts arose b/c "arm: make SWIOTLB available" v8 was in Stefano's
    branch, while I had v9 + Ack from Russel. I also fixed up white-space
    issues]

    Konrad Rzeszutek Wilk
     
  • Signed-off-by: Stefano Stabellini
    Acked-by: Konrad Rzeszutek Wilk

    Stefano Stabellini
     
  • The PCI MMCONFIG area is usually reserved via the E820 so the Xen hypervisor
    is aware of these regions. But they can also be enumerated in the ACPI
    DSDT which means the hypervisor won't know of them until the initial
    domain informs it of via PHYSDEVOP_pci_mmcfg_reserved.

    This is what this patch does for all of the MCFG regions that the
    initial domain is aware of (E820 enumerated and ACPI).

    Reported-by: Santosh Jodh
    CC: Jan Beulich
    Reviewed-by: Boris Ostrovsky
    CC: David Vrabel
    CC: Mukesh Rathor
    Signed-off-by: Konrad Rzeszutek Wilk
    [v1: Redid it a bit]
    [v2: Dropped the P2M 1-1 setting]
    [v3: Check for Xen in-case we are running under baremetal]
    [v4: Wrap with CONFIG_PCI_MMCONFIG]

    Konrad Rzeszutek Wilk
     

18 Oct, 2013

3 commits

  • This patch adds code to handle SKB_GSO_TCPV6 skbs and construct appropriate
    extra or prefix segments to pass the large packet to the frontend. New
    xenstore flags, feature-gso-tcpv6 and feature-gso-tcpv6-prefix, are sampled
    to determine if the frontend is capable of handling such packets.

    Signed-off-by: Paul Durrant
    Cc: Wei Liu
    Cc: David Vrabel
    Cc: Ian Campbell
    Signed-off-by: David S. Miller

    Paul Durrant
     
  • This patch adds a xenstore feature flag, festure-gso-tcpv6, to advertise
    that netback can handle IPv6 TCP GSO packets. It creates SKB_GSO_TCPV6 skbs
    if the frontend passes an extra segment with the new type
    XEN_NETIF_GSO_TYPE_TCPV6 added to netif.h.

    Signed-off-by: Paul Durrant
    Cc: Wei Liu
    Cc: David Vrabel
    Acked-by: Ian Campbell
    Signed-off-by: David S. Miller

    Paul Durrant
     
  • Check xenstore flag feature-ipv6-csum-offload to determine if a
    guest is happy to accept IPv6 packets with only partial checksum.

    Signed-off-by: Paul Durrant
    Cc: Wei Liu
    Cc: David Vrabel
    Cc: Ian Campbell
    Signed-off-by: David S. Miller

    Paul Durrant
     

10 Oct, 2013

3 commits

  • Use xen_alloc_coherent_pages and xen_free_coherent_pages to allocate or
    free coherent pages.

    We need to be careful handling the pointer returned by
    xen_alloc_coherent_pages, because on ARM the pointer is not equal to
    phys_to_virt(*dma_handle). In fact virt_to_phys only works for kernel
    direct mapped RAM memory.
    In ARM case the pointer could be an ioremap address, therefore passing
    it to virt_to_phys would give you another physical address that doesn't
    correspond to it.

    Make xen_create_contiguous_region take a phys_addr_t as start parameter to
    avoid the virt_to_phys calls which would be incorrect.

    Changes in v6:
    - remove extra spaces.

    Signed-off-by: Stefano Stabellini
    Reviewed-by: Konrad Rzeszutek Wilk

    Stefano Stabellini
     
  • Implement xen_swiotlb_set_dma_mask, use it for set_dma_mask on arm.

    Signed-off-by: Stefano Stabellini

    Stefano Stabellini
     
  • Modify xen_create_contiguous_region to return the dma address of the
    newly contiguous buffer.

    Signed-off-by: Stefano Stabellini
    Acked-by: Konrad Rzeszutek Wilk
    Reviewed-by: David Vrabel

    Changes in v4:
    - use virt_to_machine instead of virt_to_bus.

    Stefano Stabellini
     

05 Sep, 2013

1 commit

  • Pull Xen updates from Konrad Rzeszutek Wilk:
    "A couple of features and a ton of bug-fixes. There is also some
    maintership changes. Jeremy is enjoying the full-time work at the
    startup and as much as he would love to help - he can't find the time.
    I have a bunch of other things that I promised to work on - paravirt
    diet, get SWIOTLB working everywhere, etc, but haven't been able to
    find the time.

    As such both David Vrabel and Boris Ostrovsky have graciously
    volunteered to help with the maintership role. They will keep the lid
    on regressions, bug-fixes, etc. I will be in the background to help -
    but eventually there will be less of me doing the Xen GIT pulls and
    more of them. Stefano is still doing the ARM/ARM64 and will continue
    on doing so.

    Features:
    - Xen Trusted Platform Module (TPM) frontend driver - with the
    backend in MiniOS.
    - Scalability improvements in event channel.
    - Two extra Xen co-maintainers (David, Boris) and one going away (Jeremy)

    Bug-fixes:
    - Make the 1:1 mapping work during early bootup on selective regions.
    - Add scratch page to balloon driver to deal with unexpected code
    still holding on stale pages.
    - Allow NMIs on PV guests (64-bit only)
    - Remove unnecessary TLB flush in M2P code.
    - Fixes duplicate callbacks in Xen granttable code.
    - Fixes in PRIVCMD_MMAPBATCH ioctls to allow retries
    - Fix for events being lost due to rescheduling on different VCPUs.
    - More documentation"

    * tag 'stable/for-linus-3.12-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: (23 commits)
    hvc_xen: Remove unnecessary __GFP_ZERO from kzalloc
    drivers/xen-tpmfront: Fix compile issue with missing option.
    xen/balloon: don't set P2M entry for auto translated guest
    xen/evtchn: double free on error
    Xen: Fix retry calls into PRIVCMD_MMAPBATCH*.
    xen/pvhvm: Initialize xen panic handler for PVHVM guests
    xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping
    xen: fix ARM build after 6efa20e4
    MAINTAINERS: Remove Jeremy from the Xen subsystem.
    xen/events: document behaviour when scanning the start word for events
    x86/xen: during early setup, only 1:1 map the ISA region
    x86/xen: disable premption when enabling local irqs
    swiotlb-xen: replace dma_length with sg_dma_len() macro
    swiotlb: replace dma_length with sg_dma_len() macro
    xen/balloon: set a mapping for ballooned out pages
    xen/evtchn: improve scalability by using per-user locks
    xen/p2m: avoid unneccesary TLB flush in m2p_remove_override()
    MAINTAINERS: Add in two extra co-maintainers of the Xen tree.
    MAINTAINERS: Update the Xen subsystem's with proper mailing list.
    xen: replace strict_strtoul() with kstrtoul()
    ...

    Linus Torvalds