13 Jan, 2021

1 commit

  • [ Upstream commit 87dbc209ea04645fd2351981f09eff5d23f8e2e9 ]

    Make mandatory in include/asm-generic/Kbuild and
    remove all arch/*/include/asm/local64.h arch-specific files since they
    only #include .

    This fixes build errors on arch/c6x/ and arch/nios2/ for
    block/blk-iocost.c.

    Build-tested on 21 of 25 arch-es. (tools problems on the others)

    Yes, we could even rename to
    and change all #includes to use
    instead.

    Link: https://lkml.kernel.org/r/20201227024446.17018-1-rdunlap@infradead.org
    Signed-off-by: Randy Dunlap
    Suggested-by: Christoph Hellwig
    Reviewed-by: Masahiro Yamada
    Cc: Jens Axboe
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Aurelien Jacquiot
    Cc: Peter Zijlstra
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds
    Signed-off-by: Sasha Levin

    Randy Dunlap
     

16 Nov, 2020

1 commit

  • Stefan Agner reported a bug when using zsram on 32-bit Arm machines
    with RAM above the 4GB address boundary:

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    pgd = a27bd01c
    [00000000] *pgd=236a0003, *pmd=1ffa64003
    Internal error: Oops: 207 [#1] SMP ARM
    Modules linked in: mdio_bcm_unimac(+) brcmfmac cfg80211 brcmutil raspberrypi_hwmon hci_uart crc32_arm_ce bcm2711_thermal phy_generic genet
    CPU: 0 PID: 123 Comm: mkfs.ext4 Not tainted 5.9.6 #1
    Hardware name: BCM2711
    PC is at zs_map_object+0x94/0x338
    LR is at zram_bvec_rw.constprop.0+0x330/0xa64
    pc : [] lr : [] psr: 60000013
    sp : e376bbe0 ip : 00000000 fp : c1e2921c
    r10: 00000002 r9 : c1dda730 r8 : 00000000
    r7 : e8ff7a00 r6 : 00000000 r5 : 02f9ffa0 r4 : e3710000
    r3 : 000fdffe r2 : c1e0ce80 r1 : ebf979a0 r0 : 00000000
    Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    Control: 30c5383d Table: 235c2a80 DAC: fffffffd
    Process mkfs.ext4 (pid: 123, stack limit = 0x495a22e6)
    Stack: (0xe376bbe0 to 0xe376c000)

    As it turns out, zsram needs to know the maximum memory size, which
    is defined in MAX_PHYSMEM_BITS when CONFIG_SPARSEMEM is set, or in
    MAX_POSSIBLE_PHYSMEM_BITS on the x86 architecture.

    The same problem will be hit on all 32-bit architectures that have a
    physical address space larger than 4GB and happen to not enable sparsemem
    and include asm/sparsemem.h from asm/pgtable.h.

    After the initial discussion, I suggested just always defining
    MAX_POSSIBLE_PHYSMEM_BITS whenever CONFIG_PHYS_ADDR_T_64BIT is
    set, or provoking a build error otherwise. This addresses all
    configurations that can currently have this runtime bug, but
    leaves all other configurations unchanged.

    I looked up the possible number of bits in source code and
    datasheets, here is what I found:

    - on ARC, CONFIG_ARC_HAS_PAE40 controls whether 32 or 40 bits are used
    - on ARM, CONFIG_LPAE enables 40 bit addressing, without it we never
    support more than 32 bits, even though supersections in theory allow
    up to 40 bits as well.
    - on MIPS, some MIPS32r1 or later chips support 36 bits, and MIPS32r5
    XPA supports up to 60 bits in theory, but 40 bits are more than
    anyone will ever ship
    - On PowerPC, there are three different implementations of 36 bit
    addressing, but 32-bit is used without CONFIG_PTE_64BIT
    - On RISC-V, the normal page table format can support 34 bit
    addressing. There is no highmem support on RISC-V, so anything
    above 2GB is unused, but it might be useful to eventually support
    CONFIG_ZRAM for high pages.

    Fixes: 61989a80fb3a ("staging: zsmalloc: zsmalloc memory allocation library")
    Fixes: 02390b87a945 ("mm/zsmalloc: Prepare to variable MAX_PHYSMEM_BITS")
    Acked-by: Thomas Bogendoerfer
    Reviewed-by: Stefan Agner
    Tested-by: Stefan Agner
    Acked-by: Mike Rapoport
    Link: https://lore.kernel.org/linux-mm/bdfa44bf1c570b05d6c70898e2bbb0acf234ecdf.1604762181.git.stefan@agner.ch/
    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

26 Oct, 2020

1 commit

  • Use a more generic form for __section that requires quotes to avoid
    complications with clang and gcc differences.

    Remove the quote operator # from compiler_attributes.h __section macro.

    Convert all unquoted __section(foo) uses to quoted __section("foo").
    Also convert __attribute__((section("foo"))) uses to __section("foo")
    even if the __attribute__ has multiple list entry forms.

    Conversion done using the script at:

    https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/2-convert_section.pl

    Signed-off-by: Joe Perches
    Reviewed-by: Nick Desaulniers
    Reviewed-by: Miguel Ojeda
    Signed-off-by: Linus Torvalds

    Joe Perches
     

24 Oct, 2020

1 commit

  • Pull KVM updates from Paolo Bonzini:
    "For x86, there is a new alternative and (in the future) more scalable
    implementation of extended page tables that does not need a reverse
    map from guest physical addresses to host physical addresses.

    For now it is disabled by default because it is still lacking a few of
    the existing MMU's bells and whistles. However it is a very solid
    piece of work and it is already available for people to hammer on it.

    Other updates:

    ARM:
    - New page table code for both hypervisor and guest stage-2
    - Introduction of a new EL2-private host context
    - Allow EL2 to have its own private per-CPU variables
    - Support of PMU event filtering
    - Complete rework of the Spectre mitigation

    PPC:
    - Fix for running nested guests with in-kernel IRQ chip
    - Fix race condition causing occasional host hard lockup
    - Minor cleanups and bugfixes

    x86:
    - allow trapping unknown MSRs to userspace
    - allow userspace to force #GP on specific MSRs
    - INVPCID support on AMD
    - nested AMD cleanup, on demand allocation of nested SVM state
    - hide PV MSRs and hypercalls for features not enabled in CPUID
    - new test for MSR_IA32_TSC writes from host and guest
    - cleanups: MMU, CPUID, shared MSRs
    - LAPIC latency optimizations ad bugfixes"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (232 commits)
    kvm: x86/mmu: NX largepage recovery for TDP MMU
    kvm: x86/mmu: Don't clear write flooding count for direct roots
    kvm: x86/mmu: Support MMIO in the TDP MMU
    kvm: x86/mmu: Support write protection for nesting in tdp MMU
    kvm: x86/mmu: Support disabling dirty logging for the tdp MMU
    kvm: x86/mmu: Support dirty logging for the TDP MMU
    kvm: x86/mmu: Support changed pte notifier in tdp MMU
    kvm: x86/mmu: Add access tracking for tdp_mmu
    kvm: x86/mmu: Support invalidate range MMU notifier for TDP MMU
    kvm: x86/mmu: Allocate struct kvm_mmu_pages for all pages in TDP MMU
    kvm: x86/mmu: Add TDP MMU PF handler
    kvm: x86/mmu: Remove disallowed_hugepage_adjust shadow_walk_iterator arg
    kvm: x86/mmu: Support zapping SPTEs in the TDP MMU
    KVM: Cache as_id in kvm_memory_slot
    kvm: x86/mmu: Add functions to handle changed TDP SPTEs
    kvm: x86/mmu: Allocate and free TDP MMU roots
    kvm: x86/mmu: Init / Uninit the TDP MMU
    kvm: x86/mmu: Introduce tdp_iter
    KVM: mmu: extract spte.h and spte.c
    KVM: mmu: Separate updating a PTE from kvm_set_pte_rmapp
    ...

    Linus Torvalds
     

17 Oct, 2020

1 commit

  • Pull MIPS updates from Thomas Bogendoerfer:

    - removed support for PNX833x alias NXT_STB22x

    - included Ingenic SoC support into generic MIPS kernels

    - added support for new Ingenic SoCs

    - converted workaround selection to use Kconfig

    - replaced old boot mem functions by memblock_*

    - enabled COP2 usage in kernel for Loongson64 to make use
    of 16byte load/stores possible

    - cleanups and fixes

    * tag 'mips_5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (92 commits)
    MIPS: DEC: Restore bootmem reservation for firmware working memory area
    MIPS: dec: fix section mismatch
    bcm963xx_tag.h: fix duplicated word
    mips: ralink: enable zboot support
    MIPS: ingenic: Remove CPU_SUPPORTS_HUGEPAGES
    MIPS: cpu-probe: remove MIPS_CPU_BP_GHIST option bit
    MIPS: cpu-probe: introduce exclusive R3k CPU probe
    MIPS: cpu-probe: move fpu probing/handling into its own file
    MIPS: replace add_memory_region with memblock
    MIPS: Loongson64: Clean up numa.c
    MIPS: Loongson64: Select SMP in Kconfig to avoid build error
    mips: octeon: Add Ubiquiti E200 and E220 boards
    MIPS: SGI-IP28: disable use of ll/sc in kernel
    MIPS: tx49xx: move tx4939_add_memory_regions into only user
    MIPS: pgtable: Remove used PAGE_USERIO define
    MIPS: alchemy: Share prom_init implementation
    MIPS: alchemy: Fix build breakage, if TOUCHSCREEN_WM97XX is disabled
    MIPS: process: include exec.h header in process.c
    MIPS: process: Add prototype for function arch_dup_task_struct
    MIPS: idle: Add prototype for function check_wait
    ...

    Linus Torvalds
     

16 Oct, 2020

1 commit

  • Pull dma-mapping updates from Christoph Hellwig:

    - rework the non-coherent DMA allocator

    - move private definitions out of

    - lower CMA_ALIGNMENT (Paul Cercueil)

    - remove the omap1 dma address translation in favor of the common code

    - make dma-direct aware of multiple dma offset ranges (Jim Quinlan)

    - support per-node DMA CMA areas (Barry Song)

    - increase the default seg boundary limit (Nicolin Chen)

    - misc fixes (Robin Murphy, Thomas Tai, Xu Wang)

    - various cleanups

    * tag 'dma-mapping-5.10' of git://git.infradead.org/users/hch/dma-mapping: (63 commits)
    ARM/ixp4xx: add a missing include of dma-map-ops.h
    dma-direct: simplify the DMA_ATTR_NO_KERNEL_MAPPING handling
    dma-direct: factor out a dma_direct_alloc_from_pool helper
    dma-direct check for highmem pages in dma_direct_alloc_pages
    dma-mapping: merge into
    dma-mapping: move large parts of to kernel/dma
    dma-mapping: move dma-debug.h to kernel/dma/
    dma-mapping: remove
    dma-mapping: merge into
    dma-contiguous: remove dma_contiguous_set_default
    dma-contiguous: remove dev_set_cma_area
    dma-contiguous: remove dma_declare_contiguous
    dma-mapping: split
    cma: decrease CMA_ALIGNMENT lower limit to 2
    firewire-ohci: use dma_alloc_pages
    dma-iommu: implement ->alloc_noncoherent
    dma-mapping: add new {alloc,free}_noncoherent dma_map_ops methods
    dma-mapping: add a new dma_alloc_pages API
    dma-mapping: remove dma_cache_sync
    53c700: convert to dma_alloc_noncoherent
    ...

    Linus Torvalds
     

13 Oct, 2020

2 commits

  • Pull compat quotactl cleanups from Al Viro:
    "More Christoph's compat cleanups: quotactl(2)"

    * 'work.quota-compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    quota: simplify the quotactl compat handling
    compat: add a compat_need_64bit_alignment_fixup() helper
    compat: lift compat_s64 and compat_u64 to

    Linus Torvalds
     
  • Pull copy_and_csum cleanups from Al Viro:
    "Saner calling conventions for csum_and_copy_..._user() and friends"

    [ Removing 800+ lines of code and cleaning stuff up is good - Linus ]

    * 'work.csum_and_copy' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    ppc: propagate the calling conventions change down to csum_partial_copy_generic()
    amd64: switch csum_partial_copy_generic() to new calling conventions
    sparc64: propagate the calling convention changes down to __csum_partial_copy_...()
    xtensa: propagate the calling conventions change down into csum_partial_copy_generic()
    mips: propagate the calling convention change down into __csum_partial_copy_..._user()
    mips: __csum_partial_copy_kernel() has no users left
    mips: csum_and_copy_{to,from}_user() are never called under KERNEL_DS
    sparc32: propagate the calling conventions change down to __csum_partial_copy_sparc_generic()
    i386: propagate the calling conventions change down to csum_partial_copy_generic()
    sh: propage the calling conventions change down to csum_partial_copy_generic()
    m68k: get rid of zeroing destination on error in csum_and_copy_from_user()
    arm: propagate the calling convention changes down to csum_partial_copy_from_user()
    alpha: propagate the calling convention changes down to csum_partial_copy.c helpers
    saner calling conventions for csum_and_copy_..._user()
    csum_and_copy_..._user(): pass 0xffffffff instead of 0 as initial sum
    csum_partial_copy_nocheck(): drop the last argument
    unify generic instances of csum_partial_copy_nocheck()
    icmp_push_reply(): reorder adding the checksum up
    skb_copy_and_csum_bits(): don't bother with the last argument

    Linus Torvalds
     

12 Oct, 2020

4 commits

  • MIPS_CPU_BP_GHIST is only set two times and more or less immediately
    used in cpu-probe.c itself. Remove this option to make room in options
    word.

    Signed-off-by: Thomas Bogendoerfer

    Thomas Bogendoerfer
     
  • add_memory_region was the old interface for registering memory and
    was already changed to used memblock internaly. Replace it by
    directly calling memblock functions.

    Signed-off-by: Thomas Bogendoerfer

    Thomas Bogendoerfer
     
  • (1) Replace nid_to_addroffset() with nid_to_addrbase() and then remove the
    related useless code.

    (2) Since end_pfn = start_pfn + node_psize, use "node_psize" instead of
    "end_pfn - start_pfn" to avoid the redundant calculation.

    (3) After commit 6fbde6b492df ("MIPS: Loongson64: Move files to the
    top-level directory"), CONFIG_ZONE_DMA32 is always set for Loongson64
    due to MACH_LOONGSON64 selects ZONE_DMA32, so no need to use ifdef any
    more, just remove it.

    Signed-off-by: Tiezhu Yang
    Reviewed-by: Jiaxun Yang
    Signed-off-by: Thomas Bogendoerfer

    Tiezhu Yang
     
  • These boards are used in
    - Ubiquiti EdgeRouter (E200),
    - Ubiquiti EdgeRouter Pro (E200) and
    - Ubiquiti Security Gateway Pro 4 (E220).

    Signed-off-by: Mikhail Gusarov
    Signed-off-by: Thomas Bogendoerfer

    Mikhail Gusarov
     

08 Oct, 2020

2 commits


06 Oct, 2020

1 commit


01 Oct, 2020

1 commit


28 Sep, 2020

1 commit

  • In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu'
    structure. For historical reasons, many kvm-related function parameters
    retain the 'kvm_run' and 'kvm_vcpu' parameters at the same time. This
    patch does a unified cleanup of these remaining redundant parameters.

    Signed-off-by: Tianjia Zhang
    Reviewed-by: Huacai Chen
    Tested-by: Jiaxun Yang
    Message-Id:
    Signed-off-by: Paolo Bonzini

    Tianjia Zhang
     

27 Sep, 2020

2 commits


26 Sep, 2020

1 commit

  • Pull MIPS fixes from Thomas Bogendoerfer:

    - fixed FP register access on Loongsoon-3

    - added missing 1074 cpu handling

    - fixed Loongson2ef build error

    * tag 'mips_fixes_5.9_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
    MIPS: BCM47XX: Remove the needless check with the 1074K
    MIPS: Add the missing 'CPU_1074K' into __get_cpu_type()
    MIPS: Loongson2ef: Disable Loongson MMI instructions
    MIPS: Loongson-3: Fix fp register access if MSA enabled

    Linus Torvalds
     

25 Sep, 2020

1 commit


23 Sep, 2020

1 commit

  • Commit 442e14a2c55e ("MIPS: Add 1074K CPU support explicitly.") split
    1074K from the 74K as an unique CPU type, while it missed to add the
    'CPU_1074K' in __get_cpu_type(). So let's add it back.

    Fixes: 442e14a2c55e ("MIPS: Add 1074K CPU support explicitly.")
    Signed-off-by: Wei Li
    Signed-off-by: Thomas Bogendoerfer

    Wei Li
     

22 Sep, 2020

6 commits


18 Sep, 2020

8 commits


11 Sep, 2020

3 commits


08 Sep, 2020

1 commit