13 Sep, 2018

5 commits

  • This adds the DSA driver for the GSWIP Switch found in the VRX200 SoC.
    This switch is integrated in the DSL SoC, this SoC uses a GSWIP version
    2.1, there are other SoCs using different versions of this IP block, but
    this driver was only tested with the version found in the VRX200.
    Currently only the basic features are implemented which will forward all
    packages to the CPU and let the CPU do the forwarding. The hardware also
    support Layer 2 offloading which is not yet implemented in this driver.

    The GPHY FW loaded is now done by this driver and not any more by the
    separate driver in drivers/soc/lantiq/gphy.c, I will remove this driver
    is a separate patch. to make use of the GPHY this switch driver is
    needed anyway. Other SoCs have more embedded GPHYs so this driver should
    support a variable number of GPHYs. After the firmware was loaded the
    GPHY can be probed on the MDIO bus and it behaves like an external GPHY,
    without the firmware it can not be probed on the MDIO bus.

    The clock names in the sysctrl.c file have to be changed because the
    clocks are now used by a different driver. This should be cleaned up and
    a real common clock driver should provide the clocks instead.

    Signed-off-by: Hauke Mehrtens
    Signed-off-by: David S. Miller

    Hauke Mehrtens
     
  • This drives the PMAC between the GSWIP Switch and the CPU in the VRX200
    SoC. This is currently only the very basic version of the Ethernet
    driver.

    When the DMA channel is activated we receive some packets which were
    send to the SoC while it was still in U-Boot, these packets have the
    wrong header. Resetting the IP cores did not work so we read out the
    extra packets at the beginning and discard them.

    This also adapts the clock code in sysctrl.c to use the default name of
    the device node so that the driver gets the correct clock. sysctrl.c
    should be replaced with a proper common clock driver later.

    Signed-off-by: Hauke Mehrtens
    Signed-off-by: David S. Miller

    Hauke Mehrtens
     
  • When a DMA channel is opened the IRQ should not get activated
    automatically, this allows it to pull data out manually without the help
    of interrupts. This is needed for a workaround in the vrx200 Ethernet
    driver.

    Signed-off-by: Hauke Mehrtens
    Acked-by: Paul Burton
    Signed-off-by: David S. Miller

    Hauke Mehrtens
     
  • Pull networking fixes from David Miller:

    1) Fix up several Kconfig dependencies in netfilter, from Martin Willi
    and Florian Westphal.

    2) Memory leak in be2net driver, from Petr Oros.

    3) Memory leak in E-Switch handling of mlx5 driver, from Raed Salem.

    4) mlx5_attach_interface needs to check for errors, from Huy Nguyen.

    5) tipc_release() needs to orphan the sock, from Cong Wang.

    6) Need to program TxConfig register after TX/RX is enabled in r8169
    driver, not beforehand, from Maciej S. Szmigiero.

    7) Handle 64K PAGE_SIZE properly in ena driver, from Netanel Belgazal.

    8) Fix crash regression in ip_do_fragment(), from Taehee Yoo.

    9) syzbot can create conditions where kernel log is flooded with
    synflood warnings due to creation of many listening sockets, fix
    that. From Willem de Bruijn.

    10) Fix RCU issues in rds socket layer, from Cong Wang.

    11) Fix vlan matching in nfp driver, from Pieter Jansen van Vuuren.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (59 commits)
    nfp: flower: reject tunnel encap with ipv6 outer headers for offloading
    nfp: flower: fix vlan match by checking both vlan id and vlan pcp
    tipc: check return value of __tipc_dump_start()
    s390/qeth: don't dump past end of unknown HW header
    s390/qeth: use vzalloc for QUERY OAT buffer
    s390/qeth: switch on SG by default for IQD devices
    s390/qeth: indicate error when netdev allocation fails
    rds: fix two RCU related problems
    r8169: Clear RTL_FLAG_TASK_*_PENDING when clearing RTL_FLAG_TASK_ENABLED
    erspan: fix error handling for erspan tunnel
    erspan: return PACKET_REJECT when the appropriate tunnel is not found
    tcp: rate limit synflood warnings further
    MIPS: lantiq: dma: add dev pointer
    netfilter: xt_hashlimit: use s->file instead of s->private
    netfilter: nfnetlink_queue: Solve the NFQUEUE/conntrack clash for NF_REPEAT
    netfilter: cttimeout: ctnl_timeout_find_get() returns incorrect pointer to type
    netfilter: conntrack: timeout interface depend on CONFIG_NF_CONNTRACK_TIMEOUT
    netfilter: conntrack: reset tcp maxwin on re-register
    qmi_wwan: Support dynamic config on Quectel EP06
    ethernet: renesas: convert to SPDX identifiers
    ...

    Linus Torvalds
     
  • …l/git/palmer/riscv-linux

    Pull RISC-V fix from Palmer Dabbelt:
    "This contains what I hope to be the last RISC-V patch for 4.19.

    It fixes a bug in our initramfs support by removing some broken and
    obselete code"

    * tag 'riscv-for-linus-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux:
    riscv: Do not overwrite initrd_start and initrd_end

    Linus Torvalds
     

12 Sep, 2018

1 commit

  • dma_zalloc_coherent() now crashes if no dev pointer is given.
    Add a dev pointer to the ltq_dma_channel structure and fill it in the
    driver using it.

    This fixes a bug introduced in kernel 4.19.

    Signed-off-by: Hauke Mehrtens
    Signed-off-by: David S. Miller

    Hauke Mehrtens
     

09 Sep, 2018

4 commits

  • Pull x86 fixes from Thomas Gleixner:
    "A set of fixes for x86:

    - Prevent multiplication result truncation on 32bit. Introduced with
    the early timestamp reworrk.

    - Ensure microcode revision storage to be consistent under all
    circumstances

    - Prevent write tearing of PTEs

    - Prevent confusion of user and kernel reegisters when dumping fatal
    signals verbosely

    - Make an error return value in a failure path of the vector
    allocation negative. Returning EINVAL might the caller assume
    success and causes further wreckage.

    - A trivial kernel doc warning fix"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/mm: Use WRITE_ONCE() when setting PTEs
    x86/apic/vector: Make error return value negative
    x86/process: Don't mix user/kernel regs in 64bit __show_regs()
    x86/tsc: Prevent result truncation on 32bit
    x86: Fix kernel-doc atomic.h warnings
    x86/microcode: Update the new microcode revision unconditionally
    x86/microcode: Make sure boot_cpu_data.microcode is up-to-date

    Linus Torvalds
     
  • Pull KVM fixes from Radim Krčmář:
    "ARM:
    - Fix a VFP corruption in 32-bit guest
    - Add missing cache invalidation for CoW pages
    - Two small cleanups

    s390:
    - Fallout from the hugetlbfs support: pfmf interpretion and locking
    - VSIE: fix keywrapping for nested guests

    PPC:
    - Fix a bug where pages might not get marked dirty, causing guest
    memory corruption on migration
    - Fix a bug causing reads from guest memory to use the wrong guest
    real address for very large HPT guests (>256G of memory), leading
    to failures in instruction emulation.

    x86:
    - Fix out of bound access from malicious pv ipi hypercalls
    (introduced in rc1)
    - Fix delivery of pending interrupts when entering a nested guest,
    preventing arbitrarily late injection
    - Sanitize kvm_stat output after destroying a guest
    - Fix infinite loop when emulating a nested guest page fault and
    improve the surrounding emulation code
    - Two minor cleanups"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (28 commits)
    KVM: LAPIC: Fix pv ipis out-of-bounds access
    KVM: nVMX: Fix loss of pending IRQ/NMI before entering L2
    arm64: KVM: Remove pgd_lock
    KVM: Remove obsolete kvm_unmap_hva notifier backend
    arm64: KVM: Only force FPEXC32_EL2.EN if trapping FPSIMD
    KVM: arm/arm64: Clean dcache to PoC when changing PTE due to CoW
    KVM: s390: Properly lock mm context allow_gmap_hpage_1m setting
    KVM: s390: vsie: copy wrapping keys to right place
    KVM: s390: Fix pfmf and conditional skey emulation
    tools/kvm_stat: re-animate display of dead guests
    tools/kvm_stat: indicate dead guests as such
    tools/kvm_stat: handle guest removals more gracefully
    tools/kvm_stat: don't reset stats when setting PID filter for debugfs
    tools/kvm_stat: fix updates for dead guests
    tools/kvm_stat: fix handling of invalid paths in debugfs provider
    tools/kvm_stat: fix python3 issues
    KVM: x86: Unexport x86_emulate_instruction()
    KVM: x86: Rename emulate_instruction() to kvm_emulate_instruction()
    KVM: x86: Do not re-{try,execute} after failed emulation in L2
    KVM: x86: Default to not allowing emulation retry in kvm_mmu_page_fault
    ...

    Linus Torvalds
     
  • Pull ARM SoC fixes from Olof Johansson:
    "A few more fixes who have trickled in:

    - MMC bus width fixup for some Allwinner platforms

    - Fix for NULL deref in ti-aemif when no platform data is passed in

    - Fix div by 0 in SCMI code

    - Add a missing module alias in a new RPi driver"

    * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    memory: ti-aemif: fix a potential NULL-pointer dereference
    firmware: arm_scmi: fix divide by zero when sustained_perf_level is zero
    hwmon: rpi: add module alias to raspberrypi-hwmon
    arm64: allwinner: dts: h6: fix Pine H64 MMC bus width

    Linus Torvalds
     
  • …git/sunxi/linux into fixes

    Allwinner fixes for 4.19

    Just one fix for H6 mmc on the Pine H64: the mmc bus width was missing
    from the device tree. This was added in 4.19-rc1.

    * tag 'sunxi-fixes-for-4.19' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
    arm64: allwinner: dts: h6: fix Pine H64 MMC bus width

    Signed-off-by: Olof Johansson <olof@lixom.net>

    Olof Johansson
     

08 Sep, 2018

8 commits

  • When page-table entries are set, the compiler might optimize their
    assignment by using multiple instructions to set the PTE. This might
    turn into a security hazard if the user somehow manages to use the
    interim PTE. L1TF does not make our lives easier, making even an interim
    non-present PTE a security hazard.

    Using WRITE_ONCE() to set PTEs and friends should prevent this potential
    security hazard.

    I skimmed the differences in the binary with and without this patch. The
    differences are (obviously) greater when CONFIG_PARAVIRT=n as more
    code optimizations are possible. For better and worse, the impact on the
    binary with this patch is pretty small. Skimming the code did not cause
    anything to jump out as a security hazard, but it seems that at least
    move_soft_dirty_pte() caused set_pte_at() to use multiple writes.

    Signed-off-by: Nadav Amit
    Signed-off-by: Thomas Gleixner
    Acked-by: Peter Zijlstra (Intel)
    Cc: Dave Hansen
    Cc: Andi Kleen
    Cc: Josh Poimboeuf
    Cc: Michal Hocko
    Cc: Vlastimil Babka
    Cc: Sean Christopherson
    Cc: Andy Lutomirski
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180902181451.80520-1-namit@vmware.com

    Nadav Amit
     
  • activate_managed() returns EINVAL instead of -EINVAL in case of
    error. While this is unlikely to happen, the positive return value would
    cause further malfunction at the call site.

    Fixes: 2db1f959d9dc ("x86/vector: Handle managed interrupts proper")
    Signed-off-by: Thomas Gleixner
    Cc: stable@vger.kernel.org

    Thomas Gleixner
     
  • Pull ARC updates from Vineet Gupta:

    - Fix for atomic_fetch_#op [Will Deacon]

    - Enable per device IOC [Eugeniy Paltsev]

    - Remove redundant gcc version checks [Masahiro Yamada]

    - Miscll platform config/DT updates [Alexey Brodkin]

    * tag 'arc-4.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
    ARC: don't check for HIGHMEM pages in arch_dma_alloc
    ARC: IOC: panic if both IOC and ZONE_HIGHMEM enabled
    ARC: dma [IOC] Enable per device io coherency
    ARC: dma [IOC]: mark DMA devices connected as dma-coherent
    ARC: atomics: unbork atomic_fetch_##op()
    arc: remove redundant GCC version checks
    ARC: sort Kconfig
    ARC: cleanup show_faulting_vma()
    ARC: [plat-axs*]: Enable SWAP
    ARC: [plat-axs*/plat-hsdk]: Allow U-Boot to pass MAC-address to the kernel
    ARC: configs: cleanup

    Linus Torvalds
     
  • Pull arm64 fix from Will Deacon:
    "Just one small fix here, preventing a VM_WARN_ON when a !present
    PMD/PUD is "freed" as part of a huge ioremap() operation.

    The correct behaviour is to skip the free silently in this case, which
    is a little weird (the function is a bit of a misnomer), but it
    follows the x86 implementation"

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64: fix erroneous warnings in page freeing functions

    Linus Torvalds
     
  • Dan Carpenter reported that the untrusted data returns from kvm_register_read()
    results in the following static checker warning:
    arch/x86/kvm/lapic.c:576 kvm_pv_send_ipi()
    error: buffer underflow 'map->phys_map' 's32min-s32max'

    KVM guest can easily trigger this by executing the following assembly sequence
    in Ring0:

    mov $10, %rax
    mov $0xFFFFFFFF, %rbx
    mov $0xFFFFFFFF, %rdx
    mov $0, %rsi
    vmcall

    As this will cause KVM to execute the following code-path:
    vmx_handle_exit() -> handle_vmcall() -> kvm_emulate_hypercall() -> kvm_pv_send_ipi()
    which will reach out-of-bounds access.

    This patch fixes it by adding a check to kvm_pv_send_ipi() against map->max_apic_id,
    ignoring destinations that are not present and delivering the rest. We also check
    whether or not map->phys_map[min + i] is NULL since the max_apic_id is set to the
    max apic id, some phys_map maybe NULL when apic id is sparse, especially kvm
    unconditionally set max_apic_id to 255 to reserve enough space for any xAPIC ID.

    Reported-by: Dan Carpenter
    Reviewed-by: Liran Alon
    Cc: Paolo Bonzini
    Cc: Radim Krčmář
    Cc: Liran Alon
    Cc: Dan Carpenter
    Signed-off-by: Wanpeng Li
    [Add second "if (min > map->max_apic_id)" to complete the fix. -Radim]
    Signed-off-by: Radim Krčmář

    Wanpeng Li
     
  • Consider the case L1 had a IRQ/NMI event until it executed
    VMLAUNCH/VMRESUME which wasn't delivered because it was disallowed
    (e.g. interrupts disabled). When L1 executes VMLAUNCH/VMRESUME,
    L0 needs to evaluate if this pending event should cause an exit from
    L2 to L1 or delivered directly to L2 (e.g. In case L1 don't intercept
    EXTERNAL_INTERRUPT).

    Usually this would be handled by L0 requesting a IRQ/NMI window
    by setting VMCS accordingly. However, this setting was done on
    VMCS01 and now VMCS02 is active instead. Thus, when L1 executes
    VMLAUNCH/VMRESUME we force L0 to perform pending event evaluation by
    requesting a KVM_REQ_EVENT.

    Note that above scenario exists when L1 KVM is about to enter L2 but
    requests an "immediate-exit". As in this case, L1 will
    disable-interrupts and then send a self-IPI before entering L2.

    Reviewed-by: Nikita Leshchenko
    Co-developed-by: Sean Christopherson
    Signed-off-by: Sean Christopherson
    Signed-off-by: Liran Alon
    Signed-off-by: Radim Krčmář

    Liran Alon
     
  • …nel/git/kvmarm/kvmarm

    Fixes for KVM/ARM for Linux v4.19 v2:

    - Fix a VFP corruption in 32-bit guest
    - Add missing cache invalidation for CoW pages
    - Two small cleanups

    Radim Krčmář
     
  • KVM: s390: Fixes for 4.19

    - Fallout from the hugetlbfs support: pfmf interpretion and locking
    - VSIE: fix keywrapping for nested guests

    Radim Krčmář
     

07 Sep, 2018

6 commits

  • The lock has never been used and the page tables are protected by
    mmu_lock in struct kvm.

    Reviewed-by: Suzuki K Poulose
    Signed-off-by: Steven Price
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Steven Price
     
  • kvm_unmap_hva is long gone, and we only have kvm_unmap_hva_range to
    deal with. Drop the now obsolete code.

    Fixes: fb1522e099f0 ("KVM: update to new mmu_notifier semantic v2")
    Cc: James Hogan
    Reviewed-by: Paolo Bonzini
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • If trapping FPSIMD in the context of an AArch32 guest, it is critical
    to set FPEXC32_EL2.EN to 1 so that the trapping is taken to EL2 and
    not EL1.

    Conversely, it is just as critical *not* to set FPEXC32_EL2.EN to 1
    if we're not going to trap FPSIMD, as we then corrupt the existing
    VFP state.

    Moving the call to __activate_traps_fpsimd32 to the point where we
    know for sure that we are going to trap ensures that we don't set that
    bit spuriously.

    Fixes: e6b673b741ea ("KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing")
    Cc: stable@vger.kernel.org # v4.18
    Cc: Dave Martin
    Reported-by: Alexander Graf
    Tested-by: Alexander Graf
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • Pull m68knommu fix from Greg Ungerer:
    "A single change to fix booting on ColdFire platforms that have RAM
    starting at a non-0 address"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
    m68k: fix early memory reservation for ColdFire MMU systems

    Linus Torvalds
     
  • Pull MIPS fix from Paul Burton:
    "A single fix for v4.19-rc3, resolving a problem with our VDSO data
    page for systems with dcache aliasing. Those systems could previously
    observe stale data, causing clock_gettime() & gettimeofday() to return
    incorrect values"

    * tag 'mips_fixes_4.19_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
    MIPS: VDSO: Match data page cache colouring when D$ aliases

    Linus Torvalds
     
  • In pmd_free_pte_page() and pud_free_pmd_page() we try to warn if they
    hit a present non-table entry. In both cases we'll warn for non-present
    entries, as the VM_WARN_ON() only checks the entry is not a table entry.

    This has been observed to result in warnings when booting a v4.19-rc2
    kernel under qemu.

    Fix this by bailing out earlier for non-present entries.

    Fixes: ec28bb9c9b0826d7 ("arm64: Implement page table free interfaces")
    Signed-off-by: Mark Rutland
    Cc: Will Deacon
    Cc: Catalin Marinas
    Signed-off-by: Will Deacon

    Mark Rutland
     

06 Sep, 2018

3 commits

  • When the kernel.print-fatal-signals sysctl has been enabled, a simple
    userspace crash will cause the kernel to write a crash dump that contains,
    among other things, the kernel gsbase into dmesg.

    As suggested by Andy, limit output to pt_regs, FS_BASE and KERNEL_GS_BASE
    in this case.

    This also moves the bitness-specific logic from show_regs() into
    process_{32,64}.c.

    Fixes: 45807a1df9f5 ("vdso: print fatal signals")
    Signed-off-by: Jann Horn
    Signed-off-by: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Greg Kroah-Hartman
    Cc: stable@vger.kernel.org
    Link: https://lkml.kernel.org/r/20180831194151.123586-1-jannh@google.com

    Jann Horn
     
  • Loops per jiffy is calculated by multiplying tsc_khz with 1e3 and then
    dividing it by HZ.

    Both tsc_khz and the temporary variable holding the multiplication result
    are of type unsigned long, so on 32bit the result is truncated to the lower
    32bit.

    Use u64 as type for the temporary variable and cast tsc_khz to it before
    multiplying.

    [ tglx: Massaged changelog and removed pointless braces ]

    Fixes: cf7a63ef4e02 ("x86/tsc: Calibrate tsc only once")
    Signed-off-by: Chuanhua Lei
    Signed-off-by: Thomas Gleixner
    Cc: yixin.zhu@linux.intel.com
    Cc: "H. Peter Anvin"
    Cc: Peter Zijlstra
    Cc: Len Brown
    Cc: Pavel Tatashin
    Cc: Rajvi Jingar
    Cc: Dou Liyang
    Link: https://lkml.kernel.org/r/1536228203-18701-1-git-send-email-chuanhua.lei@linux.intel.com

    Chuanhua Lei
     
  • …el/git/greentime/linux

    Pull nds32 updates from Greentime Hu:
    "Contained in here are the bug fixes, building error fixes and ftrace
    support for nds32"

    * tag 'nds32-for-linus-4.19-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux:
    nds32: linker script: GCOV kernel may refers data in __exit
    nds32: fix build error because of wrong semicolon
    nds32: Fix a kernel panic issue because of wrong frame pointer access.
    nds32: Only print one page of stack when die to prevent printing too much information.
    nds32: Add macro definition for offset of lp register on stack
    nds32: Remove the deprecated ABI implementation
    nds32/stack: Get real return address by using ftrace_graph_ret_addr
    nds32/ftrace: Support dynamic function graph tracer
    nds32/ftrace: Support dynamic function tracer
    nds32/ftrace: Add RECORD_MCOUNT support
    nds32/ftrace: Support static function graph tracer
    nds32/ftrace: Support static function tracer
    nds32: Extract the checking and getting pointer to a macro
    nds32: Clean up the coding style
    nds32: Fix get_user/put_user macro expand pointer problem
    nds32: Fix empty call trace
    nds32: add NULL entry to the end of_device_id array
    nds32: fix logic for module

    Linus Torvalds
     

05 Sep, 2018

6 commits

  • This patch is used to fix nds32 allmodconfig/allyesconfig build error
    because GCOV kernel embeds counters in the kernel for each line
    and a part of that embed in __exit text. So we need to keep the
    EXIT_TEXT and EXIT_DATA if CONFIG_GCOV_KERNEL=y.

    Link: https://lkml.org/lkml/2018/9/1/125
    Signed-off-by: Greentime Hu
    Reviewed-by: Masami Hiramatsu

    Greentime Hu
     
  • setup_initrd() overwrites initrd_start and initrd_end if __initramfs_size
    is larger than 0, which is always true even if there is no embedded
    initramfs. This prevents booting qemu with "-initrd" parameter.
    Overwriting initrd_start and initrd_end is not necessary since
    __initramfs_start and __initramfs_size are used directly in
    populate_rootfs() to load the built-in initramfs, so just drop
    that code.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Palmer Dabbelt

    Guenter Roeck
     
  • __GFP_HIGHMEM flag is cleared by upper layer functions
    (in include/linux/dma-mapping.h) so we'll never get a
    __GFP_HIGHMEM flag in arch_dma_alloc gfp argument.
    That's why alloc_pages will never return highmem page
    here.

    Get rid of highmem pages handling and cleanup arch_dma_alloc
    and arch_dma_free functions.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Eugeniy Paltsev
    Signed-off-by: Vineet Gupta

    Eugeniy Paltsev
     
  • Signed-off-by: Eugeniy Paltsev
    Signed-off-by: Vineet Gupta

    Eugeniy Paltsev
     
  • So far the IOC treatment was global on ARC, being turned on (or off)
    for all devices in the system. With this patch, this can now be done
    per device using the "dma-coherent" DT property; IOW with this patch
    we can use both HW-coherent and regular DMA peripherals simultaneously.

    The changes involved are too many so enlisting the summary below:

    1. common code calls ARC arch_setup_dma_ops() per device.

    2. For coherent dma (IOC) it plugs in generic @dma_direct_ops which
    doesn't need any arch specific backend: No need for any explicit
    cache flushes or MMU mappings to provide for uncached access

    - dma_(map|sync)_single* return early as corresponding dma ops callbacks
    are NULL in generic code.
    So arch_sync_dma_*() -> dma_cache_*() need not handle the coherent
    dma case, hence drop ARC __dma_cache_*_ioc() which were no-op anyways

    3. For noncoherent dma (non IOC) generic @dma_noncoherent_ops is used
    which in turns calls ARC specific routines

    - arch_dma_alloc() no longer checks for @ioc_enable since this is
    called only for !IOC case.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Eugeniy Paltsev
    Signed-off-by: Vineet Gupta
    [vgupta: rewrote changelog]

    Eugeniy Paltsev
     
  • PPC KVM fixes for 4.19

    Two small fixes for KVM on POWER machines; one fixes a bug where pages
    might not get marked dirty, causing guest memory corruption on migration,
    and the other fixes a bug causing reads from guest memory to use the
    wrong guest real address for very large HPT guests (>256G of memory),
    leading to failures in instruction emulation.

    Radim Krčmář
     

04 Sep, 2018

7 commits

  • We have to do down_write on the mm semaphore to set a bitfield in the
    mm context.

    Signed-off-by: Janosch Frank
    Fixes: a4499382 ("KVM: s390: Add huge page enablement control")
    Reviewed-by: Christian Borntraeger
    Signed-off-by: Christian Borntraeger

    Janosch Frank
     
  • Copy the key mask to the right offset inside the shadow CRYCB

    Fixes: bbeaa58b3 ("KVM: s390: vsie: support aes dea wrapping keys")
    Signed-off-by: Pierre Morel
    Reviewed-by: David Hildenbrand
    Reviewed-by: Cornelia Huck
    Reviewed-by: Janosch Frank
    Cc: stable@vger.kernel.org # v4.8+
    Message-Id:
    Signed-off-by: Janosch Frank
    Signed-off-by: Christian Borntraeger

    Pierre Morel
     
  • We should not return with a lock.
    We also have to increase the address when we do page clearing.

    Fixes: bd096f644319 ("KVM: s390: Add skey emulation fault handling")
    Signed-off-by: Janosch Frank
    Message-Id:
    Reviewed-by: David Hildenbrand
    Signed-off-by: Christian Borntraeger

    Janosch Frank
     
  • It shall be removed in the define usage. We shall not put a semicolon there.

    /kisskb/src/arch/nds32/include/asm/elf.h:126:29: error: expected '}' before ';' token
    #define ELF_DATA ELFDATA2LSB;
    ^
    /kisskb/src/fs/proc/kcore.c:318:17: note: in expansion of macro 'ELF_DATA'
    [EI_DATA] = ELF_DATA,
    ^~~~~~~~
    /kisskb/src/fs/proc/kcore.c:312:15: note: to match this '{'
    .e_ident = {
    ^
    /kisskb/src/scripts/Makefile.build:307: recipe for target 'fs/proc/kcore.o' failed

    Signed-off-by: Greentime Hu

    Greentime Hu
     
  • It can make sure that trace_hardirqs_off/trace_hardirqs_on can get a correct
    return address by frame pointer through __builtin_return_address() in this fix.

    Unable to handle kernel paging request at virtual address fffffffc
    pgd = 3c42e9cf
    [fffffffc] *pgd=02a9c000

    Internal error: Oops: 1 [#1]
    Modules linked in:
    CPU: 0
    PC is at trace_hardirqs_off+0x78/0xec
    LP is at common_exception_handler+0xda/0xf4
    pc : [] lp : [] Tainted: G W
    sp : ada60ab0 fp : efcaff48 gp : 3a020490
    r25: efcb0000 r24: 00000000
    r23: 00000000 r22: 00000000 r21: 00000000 r20: 000700c1
    r19: 000700ca r18: 3a21b018 r17: 00000001 r16: 00000002
    r15: 00000001 r14: 0000002a r13: 3a00a804 r12: ada60ab0
    r11: 3a113af8 r10: 3a01c530 r9 : 3a124404 r8 : 00120f9c
    r7 : b2352eba r6 : 00000000 r5 : 3a126b58 r4 : 00000000
    r3 : 3a1726a8 r2 : b2921000 r1 : 00000000 r0 : 00000000
    IRQs off Segment user
    Process init (pid: 1, stack limit = 0x069d7f15)
    Stack: (0xada60ab0 to 0xada61000)
    Stack: 0aa0: 00000000 00000003 3a110000 0011f000
    Stack: 0ac0: 00000005 00000000 00000000 00000000 ada60b10 3a01fe68 ada60b0c ada60b08
    Stack: 0ae0: 00000000 ada60ab8 ada60b30 3a020550 00000000 00000001 3a11c2f8 3a01c6e8
    Stack: 0b00: 3a01cb80 fffffba8 3a113af8 3a21b018 3a122c28 00003ec4 00000165 00000000
    Stack: 0b20: 3a126aec 0000006c 00000000 00000001 3a01fe68 00000000 00000003 00000000
    Stack: 0b40: 00000001 000003f8 3a020930 3a01c530 00000008 ada60c18 3a020490 3a003120
    Stack: 0b60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0b80: 00000000 00000000 00000000 00000000 ffff8000 00000000 00000000 00000000
    Stack: 0ba0: 00000000 00000001 3a020550 00000000 3a01d020 00000000 fffff000 fffff000
    Stack: 0bc0: 00000000 00000000 00000000 00000000 ada60f2c 00000000 00000001 00000000
    Stack: 0be0: 00000000 00000000 3a01fe68 fffffab0 00008034 00000008 3a0010cc 3a01fe68
    Stack: 0c00: 00000000 00000000 00000001 ada60c88 3a020490 3a0139d4 0009dc6f 00000000
    Stack: 0c20: 00000000 00000000 ada60fce fffff000 00000000 0000ebe0 3a020038 3a020550
    Stack: 0c40: ada60f20 ada60c90 3a0007f0 3a0002a8 ada60c8c 00000000 00000000 ada60c88
    Stack: 0c60: 3a020490 3a004570 00000000 00000000 ada60f20 3a0007f0 3a000000 00000000
    Stack: 0c80: 3a020490 3a004850 00000000 3a013f24 3a000000 00000000 3a01ff44 00000000
    Stack: 0ca0: 00000000 00000000 00000000 00000000 00000000 00000000 3a01ff84 3a01ff7c
    Stack: 0cc0: 3a01ff4c 3a01ff5c 3a01ff64 3a01ff9c 3a01ffa4 3a01ffac 3a01ff6c 3a01ff74
    Stack: 0ce0: 00000000 00000000 3a01ff44 00000000 00000000 00000000 00000000 00000000
    Stack: 0d00: 3a01ff8c 00000000 00000000 3a01ff94 00000000 00000000 00000000 00000000
    Stack: 0d20: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0d40: 3a01ffbc 3a01ffb4 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0d60: 00000000 00000000 00000000 00000000 00000000 3a01ffc4 00000000 00000000
    Stack: 0d80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0da0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0dc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 3a01ff54
    Stack: 0de0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0e00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0e20: 00000000 00000004 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0e40: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0e60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0e80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0ea0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    Stack: 0ec0: 00000000 00000000 00000000 00000000 ffffffff 00000000 00000000 00000000
    Stack: 0ee0: 00000000 00000000 00000000 00000000 ada60f20 00000000 00000000 00000000
    Stack: 0f00: 00000000 00000000 00000000 00000000 00000000 00000000 3a020490 3a000b24
    Stack: 0f20: 00000001 ada60fde 00000000 ada60fe4 ada60feb 00000000 00000021 3a038000
    Stack: 0f40: 00000010 0009dc6f 00000006 00001000 00000011 00000064 00000003 00008034
    Stack: 0f60: 00000004 00000020 00000005 00000008 00000007 3a000000 00000008 00000000
    Stack: 0f80: 00000009 0000ebe0 0000000b 00000000 0000000c 00000000 0000000d 00000000
    Stack: 0fa0: 0000000e 00000000 00000017 00000000 00000019 ada60fce 0000001f ada60ff6
    Stack: 0fc0: 00000000 00000000 00000000 b5010000 fa839914 23b5dd89 a2aea540 692fc82e
    Stack: 0fe0: 0074696e 454d4f48 54002f3d 3d4d5245 756e696c 692f0078 0074696e 00000000
    CPU: 0 PID: 1 Comm: init Tainted: G W 4.18.0-00015-g1888b64a2558-dirty #112
    Hardware name: andestech,ae3xx (DT)
    Call Trace:
    [] dump_stack+0x2c/0x38
    [] die+0x128/0x18c
    [] do_page_fault+0x3b8/0x4e0
    [] ret_from_exception+0x0/0x10
    [] common_exception_handler+0xda/0xf4

    Signed-off-by: Greentime Hu

    Greentime Hu
     
  • It may print too much information sometimes if the stack is wrong or
    too big. This patch can limit the debug information in a page of stack.

    Signed-off-by: Greentime Hu

    Greentime Hu
     
  • Use macro to replace the magic number.

    Signed-off-by: Zong Li
    Acked-by: Greentime Hu
    Signed-off-by: Greentime Hu

    Zong Li