1. 07 Jun, 2019 9 commits
  2. 04 Jun, 2019 11 commits
  3. 03 Jun, 2019 7 commits
    • Eric Farman's avatar
      s390/cio: Remove vfio-ccw checks of command codes · 9b6e57e5
      Eric Farman authored
      If the CCW being processed is a No-Operation, then by definition no
      data is being transferred.  Let's fold those checks into the normal
      CCW processors, rather than skipping out early.
      
      Likewise, if the CCW being processed is a "test" (a category defined
      here as an opcode that contains zero in the lowest four bits) then no
      special processing is necessary as far as vfio-ccw is concerned.
      These command codes have not been valid since the S/370 days, meaning
      they are invalid in the same way as one that ends in an eight [1] or
      an otherwise valid command code that is undefined for the device type
      in question.  Considering that, let's just process "test" CCWs like
      any other CCW, and send everything to the hardware.
      
      [1] POPS states that a x08 is a TIC CCW, and that having any high-order
      bits enabled is invalid for format-1 CCWs.  For format-0 CCWs, the
      high-order bits are ignored.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Message-Id: <20190516161403.79053-4-farman@linux.ibm.com>
      Acked-by: default avatarFarhan Ali <alifm@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      9b6e57e5
    • Eric Farman's avatar
      s390/cio: Allow zero-length CCWs in vfio-ccw · 453eac31
      Eric Farman authored
      It is possible that a guest might issue a CCW with a length of zero,
      and will expect a particular response.  Consider this chain:
      
         Address   Format-1 CCW
         --------  -----------------
       0 33110EC0  346022CC 33177468
       1 33110EC8  CF200000 3318300C
      
      CCW[0] moves a little more than two pages, but also has the
      Suppress Length Indication (SLI) bit set to handle the expectation
      that considerably less data will be moved.  CCW[1] also has the SLI
      bit set, and has a length of zero.  Once vfio-ccw does its magic,
      the kernel issues a start subchannel on behalf of the guest with this:
      
         Address   Format-1 CCW
         --------  -----------------
       0 021EDED0  346422CC 021F0000
       1 021EDED8  CF240000 3318300C
      
      Both CCWs were converted to an IDAL and have the corresponding flags
      set (which is by design), but only the address of the first data
      address is converted to something the host is aware of.  The second
      CCW still has the address used by the guest, which happens to be (A)
      (probably) an invalid address for the host, and (B) an invalid IDAW
      address (doubleword boundary, etc.).
      
      While the I/O fails, it doesn't fail correctly.  In this example, we
      would receive a program check for an invalid IDAW address, instead of
      a unit check for an invalid command.
      
      To fix this, revert commit 4cebc5d6 ("vfio: ccw: validate the
      count field of a ccw before pinning") and allow the individual fetch
      routines to process them like anything else.  We'll make a slight
      adjustment to our allocation of the pfn_array (for direct CCWs) or
      IDAL (for IDAL CCWs) memory, so that we have room for at least one
      address even though no guest memory will be pinned and thus the
      IDAW will not be populated with a host address.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Message-Id: <20190516161403.79053-3-farman@linux.ibm.com>
      Acked-by: default avatarFarhan Ali <alifm@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      453eac31
    • Eric Farman's avatar
      s390/cio: Don't pin vfio pages for empty transfers · 5d87fbf7
      Eric Farman authored
      The skip flag of a CCW offers the possibility of data not being
      transferred, but is only meaningful for certain commands.
      Specifically, it is only applicable for a read, read backward, sense,
      or sense ID CCW and will be ignored for any other command code
      (SA22-7832-11 page 15-64, and figure 15-30 on page 15-75).
      
      (A sense ID is xE4, while a sense is x04 with possible modifiers in the
      upper four bits.  So we will cover the whole "family" of sense CCWs.)
      
      For those scenarios, since there is no requirement for the target
      address to be valid, we should skip the call to vfio_pin_pages() and
      rely on the IDAL address we have allocated/built for the channel
      program.  The fact that the individual IDAWs within the IDAL are
      invalid is fine, since they aren't actually checked in these cases.
      
      Set pa_nr to zero when skipping the pfn_array_pin() call, since it is
      defined as the number of pages pinned and is used to determine
      whether to call vfio_unpin_pages() upon cleanup.
      
      The pfn_array_pin() routine returns the number of pages that were
      pinned, but now might be skipped for some CCWs.  Thus we need to
      calculate the expected number of pages ourselves such that we are
      guaranteed to allocate a reasonable number of IDAWs, which will
      provide a valid address in CCW.CDA regardless of whether the IDAWs
      are filled in with pinned/translated addresses or not.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Message-Id: <20190516161403.79053-2-farman@linux.ibm.com>
      Acked-by: default avatarFarhan Ali <alifm@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      5d87fbf7
    • Eric Farman's avatar
      s390/cio: Initialize the host addresses in pfn_array · c34a12e6
      Eric Farman authored
      Let's initialize the host address to something that is invalid,
      rather than letting it default to zero.  This just makes it easier
      to notice when a pin operation has failed or been skipped.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Message-Id: <20190514234248.36203-5-farman@linux.ibm.com>
      Reviewed-by: default avatarFarhan Ali <alifm@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      c34a12e6
    • Eric Farman's avatar
      s390/cio: Split pfn_array_alloc_pin into pieces · e4f3f18b
      Eric Farman authored
      The pfn_array_alloc_pin routine is doing too much.  Today, it does the
      alloc of the pfn_array struct and its member arrays, builds the iova
      address lists out of a contiguous piece of guest memory, and asks vfio
      to pin the resulting pages.
      
      Let's effectively revert a significant portion of commit 5c1cfb1c
      ("vfio: ccw: refactor and improve pfn_array_alloc_pin()") such that we
      break pfn_array_alloc_pin() into its component pieces, and have one
      routine that allocates/populates the pfn_array structs, and another
      that actually pins the memory.  In the future, we will be able to
      handle scenarios where pinning memory isn't actually appropriate.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Message-Id: <20190514234248.36203-4-farman@linux.ibm.com>
      Reviewed-by: default avatarFarhan Ali <alifm@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      e4f3f18b
    • Eric Farman's avatar
      s390/cio: Set vfio-ccw FSM state before ioeventfd · 4e31d6ae
      Eric Farman authored
      Otherwise, the guest can believe it's okay to start another I/O
      and bump into the non-idle state.  This results in a cc=2 (with
      the asynchronous CSCH/HSCH code) returned to the guest, which is
      unfortunate since everything is otherwise working normally.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Reviewed-by: default avatarPierre Morel <pmorel@linux.ibm.com>
      Message-Id: <20190514234248.36203-3-farman@linux.ibm.com>
      Reviewed-by: default avatarFarhan Ali <alifm@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      4e31d6ae
    • Eric Farman's avatar
      s390/cio: Update SCSW if it points to the end of the chain · 15f0eb3d
      Eric Farman authored
      Per the POPs [1], when processing an interrupt the SCSW.CPA field of an
      IRB generally points to 8 bytes after the last CCW that was executed
      (there are exceptions, but this is the most common behavior).
      
      In the case of an error, this points us to the first un-executed CCW
      in the chain.  But in the case of normal I/O, the address points beyond
      the end of the chain.  While the guest generally only cares about this
      when possibly restarting a channel program after error recovery, we
      should convert the address even in the good scenario so that we provide
      a consistent, valid, response upon I/O completion.
      
      [1] Figure 16-6 in SA22-7832-11.  The footnotes in that table also state
      that this is true even if the resulting address is invalid or protected,
      but moving to the end of the guest chain should not be a surprise.
      Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
      Message-Id: <20190514234248.36203-2-farman@linux.ibm.com>
      Reviewed-by: default avatarFarhan Ali <alifm@linux.ibm.com>
      Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
      15f0eb3d
  4. 02 Jun, 2019 13 commits
    • Linus Torvalds's avatar
      Linux 5.2-rc3 · f2c7c76c
      Linus Torvalds authored
      f2c7c76c
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7bd1d5ed
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Two fixes: a quirk for KVM guests running on certain AMD CPUs, and a
        KASAN related build fix"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor
        x86/boot: Provide KASAN compatible aliases for string routines
      7bd1d5ed
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6751b8d9
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "On the kernel side there's a bunch of ring-buffer ordering fixes for a
        reproducible bug, plus a PEBS constraints regression fix.
      
        Plus tooling fixes"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        tools headers UAPI: Sync kvm.h headers with the kernel sources
        perf record: Fix s390 missing module symbol and warning for non-root users
        perf machine: Read also the end of the kernel
        perf test vmlinux-kallsyms: Ignore aliases to _etext when searching on kallsyms
        perf session: Add missing swap ops for namespace events
        perf namespace: Protect reading thread's namespace
        tools headers UAPI: Sync drm/drm.h with the kernel
        tools headers UAPI: Sync drm/i915_drm.h with the kernel
        tools headers UAPI: Sync linux/fs.h with the kernel
        tools headers UAPI: Sync linux/sched.h with the kernel
        tools arch x86: Sync asm/cpufeatures.h with the with the kernel
        tools include UAPI: Update copy of files related to new fspick, fsmount, fsconfig, fsopen, move_mount and open_tree syscalls
        perf arm64: Fix mksyscalltbl when system kernel headers are ahead of the kernel
        perf data: Fix 'strncat may truncate' build failure with recent gcc
        perf/ring-buffer: Use regular variables for nesting
        perf/ring-buffer: Always use {READ,WRITE}_ONCE() for rb->user_page data
        perf/ring_buffer: Add ordering to rb->nest increment
        perf/ring_buffer: Fix exposing a temporarily decreased data_head
        perf/x86/intel/ds: Fix EVENT vs. UEVENT PEBS constraints
      6751b8d9
    • Linus Torvalds's avatar
      Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · af042452
      Linus Torvalds authored
      Pull EFI fixes from Ingo Molnar:
       "Two EFI fixes: a quirk for weird systabs, plus add more robust error
        handling in the old 1:1 mapping code"
      
      * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        efi: Allow the number of EFI configuration tables entries to be zero
        efi/x86/Add missing error handling to old_memmap 1:1 mapping code
      af042452
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4fb5741c
      Linus Torvalds authored
      Pull stacktrace fix from Ingo Molnar:
       "Fix a stack_trace_save_tsk_reliable() regression"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        stacktrace: Unbreak stack_trace_save_tsk_reliable()
      4fb5741c
    • Linus Torvalds's avatar
      Merge tag 'spdx-5.2-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · a68dc618
      Linus Torvalds authored
      Pull SPDX fixes from Greg KH:
       "Here are just two small patches, that fix up some found SPDX
        identifier issues.
      
        The first patch fixes an error in a previous SPDX fixup patch, that
        causes build errors when doing 'make clean' on the tree (the fact that
        almost no one noticed it reflects the fact that kernel developers
        don't like doing that option very often...)
      
        The second patch fixes up a number of places in the tree where people
        mistyped the string "SPDX-License-Identifier". Given that people can
        not even type their own name all the time without mistakes, this was
        bound to happen, and odds are, we will have to add some type of check
        for this to checkpatch.pl to catch this happening in the future.
      
        Both of these have passed testing by 0-day"
      
      * tag 'spdx-5.2-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        treewide: fix typos of SPDX-License-Identifier
        crypto: ux500 - fix license comment syntax error
      a68dc618
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 460b48a0
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "A minor fix to our IMC PMU code to print a less confusing error
        message when the driver can't initialise properly.
      
        A fix for a bug where a user requesting an unsupported branch sampling
        filter can corrupt PMU state, preventing the PMU from counting
        properly.
      
        And finally a fix for a bug in our support for kexec_file_load(),
        which prevented loading a kernel and initramfs. Most versions of kexec
        don't yet use kexec_file_load().
      
        Thanks to: Anju T Sudhakar, Dave Young, Madhavan Srinivasan, Ravi
        Bangoria, Thiago Jung Bauermann"
      
      * tag 'powerpc-5.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/kexec: Fix loading of kernel + initramfs with kexec_file_load()
        powerpc/perf: Fix MMCRA corruption by bhrb_filter
        powerpc/powernv: Return for invalid IMC domain
      460b48a0
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · b44a1dd3
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "Fixes for PPC and s390"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: PPC: Book3S HV: Restore SPRG3 in kvmhv_p9_guest_entry()
        KVM: PPC: Book3S HV: Fix lockdep warning when entering guest on POWER9
        KVM: PPC: Book3S HV: XIVE: Fix page offset when clearing ESB pages
        KVM: PPC: Book3S HV: XIVE: Take the srcu read lock when accessing memslots
        KVM: PPC: Book3S HV: XIVE: Do not clear IRQ data of passthrough interrupts
        KVM: PPC: Book3S HV: XIVE: Introduce a new mutex for the XIVE device
        KVM: PPC: Book3S HV: XIVE: Fix the enforced limit on the vCPU identifier
        KVM: PPC: Book3S HV: XIVE: Do not test the EQ flag validity when resetting
        KVM: PPC: Book3S HV: XIVE: Clear file mapping when device is released
        KVM: PPC: Book3S HV: Don't take kvm->lock around kvm_for_each_vcpu
        KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list
        KVM: PPC: Book3S HV: Use new mutex to synchronize MMU setup
        KVM: PPC: Book3S HV: Avoid touching arch.mmu_ready in XIVE release functions
        KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID
        kvm: fix compile on s390 part 2
      b44a1dd3
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 38baf0bb
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "A memleak fix for the core, two driver bugfixes, as well as fixing
        missing file patterns to MAINTAINERS"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        MAINTAINERS: add I2C DT bindings to ARM platforms
        MAINTAINERS: add DT bindings to i2c drivers
        i2c: synquacer: fix synquacer_i2c_doxfer() return value
        i2c: mlxcpld: Fix wrong initialization order in probe
        i2c: dev: fix potential memory leak in i2cdev_ioctl_rdwr
      38baf0bb
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal · 378e853f
      Linus Torvalds authored
      Pull thermal SoC fix from Eduardo Valentin:
       "A single revert, detected to cause issues on the tsens driver"
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal:
        Revert "drivers: thermal: tsens: Add new operation to check if a sensor is enabled"
      378e853f
    • Linus Torvalds's avatar
      Merge tag 'led-fixes-for-5.2-rc3' of... · f58c356e
      Linus Torvalds authored
      Merge tag 'led-fixes-for-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds
      
      Pull LED fix from Jacek Anaszewski:
       "Fix for a recent change in LED core, that didn't take into account the
        possibility of calling led_blink_setup() from atomic context"
      
      * tag 'led-fixes-for-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
        leds: avoid flush_work in atomic context
      f58c356e
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20190601' of git://git.kernel.dk/linux-block · 9221dced
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - A set of patches fixing code comments / kerneldoc (Bart)
      
       - Don't allow loop file change for exclusive open (Jan)
      
       - Fix revalidate of hidden genhd (Jan)
      
       - Init queue failure memory free fix (Jes)
      
       - Improve rq limits failure print (John)
      
       - Fixup for queue removal/addition (Ming)
      
       - Missed error progagation for io_uring buffer registration (Pavel)
      
      * tag 'for-linus-20190601' of git://git.kernel.dk/linux-block:
        block: print offending values when cloned rq limits are exceeded
        blk-mq: Document the blk_mq_hw_queue_to_node() arguments
        blk-mq: Fix spelling in a source code comment
        block: Fix bsg_setup_queue() kernel-doc header
        block: Fix rq_qos_wait() kernel-doc header
        block: Fix blk_mq_*_map_queues() kernel-doc headers
        block: Fix throtl_pending_timer_fn() kernel-doc header
        block: Convert blk_invalidate_devt() header into a non-kernel-doc header
        block/partitions/ldm: Convert a kernel-doc header into a non-kernel-doc header
        blk-mq: Fix memory leak in error handling
        block: don't protect generic_make_request_checks with blk_queue_enter
        block: move blk_exit_queue into __blk_release_queue
        block: Don't revalidate bdev of hidden gendisk
        loop: Don't change loop device under exclusive opener
        io_uring: Fix __io_uring_register() false success
      9221dced
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 1975b337
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Six minor fixes to device drivers and one to the multipath alua
        handler.
      
        The most extensive fix is the zfcp port remove prevention one, but
        it's impact is only s390"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: libsas: delete sas port if expander discover failed
        scsi: libsas: only clear phy->in_shutdown after shutdown event done
        scsi: scsi_dh_alua: Fix possible null-ptr-deref
        scsi: smartpqi: properly set both the DMA mask and the coherent DMA mask
        scsi: zfcp: fix to prevent port_remove with pure auto scan LUNs (only sdevs)
        scsi: zfcp: fix missing zfcp_port reference put on -EBUSY from port_remove
        scsi: libcxgbi: add a check for NULL pointer in cxgbi_check_route()
      1975b337