27 Sep, 2020

5 commits

  • LLVM implemented a recent "libcall optimization" that lowers calls to
    `sprintf(dest, "%s", str)` where the return value is used to
    `stpcpy(dest, str) - dest`.

    This generally avoids the machinery involved in parsing format strings.
    `stpcpy` is just like `strcpy` except it returns the pointer to the new
    tail of `dest`. This optimization was introduced into clang-12.

    Implement this so that we don't observe linkage failures due to missing
    symbol definitions for `stpcpy`.

    Similar to last year's fire drill with: commit 5f074f3e192f
    ("lib/string.c: implement a basic bcmp")

    The kernel is somewhere between a "freestanding" environment (no full
    libc) and "hosted" environment (many symbols from libc exist with the
    same type, function signature, and semantics).

    As Peter Anvin notes, there's not really a great way to inform the
    compiler that you're targeting a freestanding environment but would like
    to opt-in to some libcall optimizations (see pr/47280 below), rather
    than opt-out.

    Arvind notes, -fno-builtin-* behaves slightly differently between GCC
    and Clang, and Clang is missing many __builtin_* definitions, which I
    consider a bug in Clang and am working on fixing.

    Masahiro summarizes the subtle distinction between compilers justly:
    To prevent transformation from foo() into bar(), there are two ways in
    Clang to do that; -fno-builtin-foo, and -fno-builtin-bar. There is
    only one in GCC; -fno-buitin-foo.

    (Any difference in that behavior in Clang is likely a bug from a missing
    __builtin_* definition.)

    Masahiro also notes:
    We want to disable optimization from foo() to bar(),
    but we may still benefit from the optimization from
    foo() into something else. If GCC implements the same transform, we
    would run into a problem because it is not -fno-builtin-bar, but
    -fno-builtin-foo that disables that optimization.

    In this regard, -fno-builtin-foo would be more future-proof than
    -fno-built-bar, but -fno-builtin-foo is still potentially overkill. We
    may want to prevent calls from foo() being optimized into calls to
    bar(), but we still may want other optimization on calls to foo().

    It seems that compilers today don't quite provide the fine grain control
    over which libcall optimizations pseudo-freestanding environments would
    prefer.

    Finally, Kees notes that this interface is unsafe, so we should not
    encourage its use. As such, I've removed the declaration from any
    header, but it still needs to be exported to avoid linkage errors in
    modules.

    Reported-by: Sami Tolvanen
    Suggested-by: Andy Lavr
    Suggested-by: Arvind Sankar
    Suggested-by: Joe Perches
    Suggested-by: Kees Cook
    Suggested-by: Masahiro Yamada
    Suggested-by: Rasmus Villemoes
    Signed-off-by: Nick Desaulniers
    Signed-off-by: Andrew Morton
    Tested-by: Nathan Chancellor
    Cc:
    Link: https://lkml.kernel.org/r/20200914161643.938408-1-ndesaulniers@google.com
    Link: https://bugs.llvm.org/show_bug.cgi?id=47162
    Link: https://bugs.llvm.org/show_bug.cgi?id=47280
    Link: https://github.com/ClangBuiltLinux/linux/issues/1126
    Link: https://man7.org/linux/man-pages/man3/stpcpy.3.html
    Link: https://pubs.opengroup.org/onlinepubs/9699919799/functions/stpcpy.html
    Link: https://reviews.llvm.org/D85963
    Signed-off-by: Linus Torvalds

    Nick Desaulniers
     
  • PageTransHuge returns true for both thp and hugetlb, so thp stats was
    counting both thp and hugetlb migrations. Exclude hugetlb migration by
    setting is_thp variable right.

    Clean up thp handling code too when we are there.

    Fixes: 1a5bae25e3cf ("mm/vmstat: add events for THP migration without split")
    Signed-off-by: Zi Yan
    Signed-off-by: Andrew Morton
    Reviewed-by: Daniel Jordan
    Cc: Anshuman Khandual
    Link: https://lkml.kernel.org/r/20200917210413.1462975-1-zi.yan@sent.com
    Signed-off-by: Linus Torvalds

    Zi Yan
     
  • Currently to make sure that every page table entry is read just once
    gup_fast walks perform READ_ONCE and pass pXd value down to the next
    gup_pXd_range function by value e.g.:

    static int gup_pud_range(p4d_t p4d, unsigned long addr, unsigned long end,
    unsigned int flags, struct page **pages, int *nr)
    ...
    pudp = pud_offset(&p4d, addr);

    This function passes a reference on that local value copy to pXd_offset,
    and might get the very same pointer in return. This happens when the
    level is folded (on most arches), and that pointer should not be
    iterated.

    On s390 due to the fact that each task might have different 5,4 or
    3-level address translation and hence different levels folded the logic
    is more complex and non-iteratable pointer to a local copy leads to
    severe problems.

    Here is an example of what happens with gup_fast on s390, for a task
    with 3-level paging, crossing a 2 GB pud boundary:

    // addr = 0x1007ffff000, end = 0x10080001000
    static int gup_pud_range(p4d_t p4d, unsigned long addr, unsigned long end,
    unsigned int flags, struct page **pages, int *nr)
    {
    unsigned long next;
    pud_t *pudp;

    // pud_offset returns &p4d itself (a pointer to a value on stack)
    pudp = pud_offset(&p4d, addr);
    do {
    // on second iteratation reading "random" stack value
    pud_t pud = READ_ONCE(*pudp);

    // next = 0x10080000000, due to PUD_SIZE/MASK != PGDIR_SIZE/MASK on s390
    next = pud_addr_end(addr, end);
    ...
    } while (pudp++, addr = next, addr != end); // pudp++ iterating over stack

    return 1;
    }

    This happens since s390 moved to common gup code with commit
    d1874a0c2805 ("s390/mm: make the pxd_offset functions more robust") and
    commit 1a42010cdc26 ("s390/mm: convert to the generic
    get_user_pages_fast code").

    s390 tried to mimic static level folding by changing pXd_offset
    primitives to always calculate top level page table offset in pgd_offset
    and just return the value passed when pXd_offset has to act as folded.

    What is crucial for gup_fast and what has been overlooked is that
    PxD_SIZE/MASK and thus pXd_addr_end should also change correspondingly.
    And the latter is not possible with dynamic folding.

    To fix the issue in addition to pXd values pass original pXdp pointers
    down to gup_pXd_range functions. And introduce pXd_offset_lockless
    helpers, which take an additional pXd entry value parameter. This has
    already been discussed in

    https://lkml.kernel.org/r/20190418100218.0a4afd51@mschwideX1

    Fixes: 1a42010cdc26 ("s390/mm: convert to the generic get_user_pages_fast code")
    Signed-off-by: Vasily Gorbik
    Signed-off-by: Andrew Morton
    Reviewed-by: Gerald Schaefer
    Reviewed-by: Alexander Gordeev
    Reviewed-by: Jason Gunthorpe
    Reviewed-by: Mike Rapoport
    Reviewed-by: John Hubbard
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Dave Hansen
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Dave Hansen
    Cc: Andy Lutomirski
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: Arnd Bergmann
    Cc: Andrey Ryabinin
    Cc: Heiko Carstens
    Cc: Christian Borntraeger
    Cc: Claudio Imbrenda
    Cc: [5.2+]
    Link: https://lkml.kernel.org/r/patch.git-943f1e5dcff2.your-ad-here.call-01599856292-ext-8676@work.hours
    Signed-off-by: Linus Torvalds

    Vasily Gorbik
     
  • We forget to add the suffix to the workingset_restore string, so fix it.

    And also update the documentation of cgroup-v2.rst.

    Fixes: 170b04b7ae49 ("mm/workingset: prepare the workingset detection infrastructure for anon LRU")
    Signed-off-by: Muchun Song
    Signed-off-by: Andrew Morton
    Reviewed-by: Shakeel Butt
    Cc: Joonsoo Kim
    Cc: Johannes Weiner
    Cc: Vlastimil Babka
    Cc: Tejun Heo
    Cc: Zefan Li
    Cc: Jonathan Corbet
    Cc: Michal Hocko
    Cc: Vladimir Davydov
    Cc: Roman Gushchin
    Cc: Randy Dunlap
    Link: https://lkml.kernel.org/r/20200916100030.71698-1-songmuchun@bytedance.com
    Signed-off-by: Linus Torvalds

    Muchun Song
     
  • SWP_FS is used to make swap_{read,write}page() go through the
    filesystem, and it's only used for swap files over NFS. So, !SWP_FS
    means non NFS for now, it could be either file backed or device backed.
    Something similar goes with legacy SWP_FILE.

    So in order to achieve the goal of the original patch, SWP_BLKDEV should
    be used instead.

    FS corruption can be observed with SSD device + XFS + fragmented
    swapfile due to CONFIG_THP_SWAP=y.

    I reproduced the issue with the following details:

    Environment:

    QEMU + upstream kernel + buildroot + NVMe (2 GB)

    Kernel config:

    CONFIG_BLK_DEV_NVME=y
    CONFIG_THP_SWAP=y

    Some reproducible steps:

    mkfs.xfs -f /dev/nvme0n1
    mkdir /tmp/mnt
    mount /dev/nvme0n1 /tmp/mnt
    bs="32k"
    sz="1024m" # doesn't matter too much, I also tried 16m
    xfs_io -f -c "pwrite -R -b $bs 0 $sz" -c "fdatasync" /tmp/mnt/sw
    xfs_io -f -c "pwrite -R -b $bs 0 $sz" -c "fdatasync" /tmp/mnt/sw
    xfs_io -f -c "pwrite -R -b $bs 0 $sz" -c "fdatasync" /tmp/mnt/sw
    xfs_io -f -c "pwrite -F -S 0 -b $bs 0 $sz" -c "fdatasync" /tmp/mnt/sw
    xfs_io -f -c "pwrite -R -b $bs 0 $sz" -c "fsync" /tmp/mnt/sw

    mkswap /tmp/mnt/sw
    swapon /tmp/mnt/sw

    stress --vm 2 --vm-bytes 600M # doesn't matter too much as well

    Symptoms:
    - FS corruption (e.g. checksum failure)
    - memory corruption at: 0xd2808010
    - segfault

    Fixes: f0eea189e8e9 ("mm, THP, swap: Don't allocate huge cluster for file backed swap device")
    Fixes: 38d8b4e6bdc8 ("mm, THP, swap: delay splitting THP during swap out")
    Signed-off-by: Gao Xiang
    Signed-off-by: Andrew Morton
    Reviewed-by: "Huang, Ying"
    Reviewed-by: Yang Shi
    Acked-by: Rafael Aquini
    Cc: Matthew Wilcox
    Cc: Carlos Maiolino
    Cc: Eric Sandeen
    Cc: Dave Chinner
    Cc:
    Link: https://lkml.kernel.org/r/20200820045323.7809-1-hsiangkao@redhat.com
    Signed-off-by: Linus Torvalds

    Gao Xiang
     

26 Sep, 2020

11 commits

  • Pull more kvm fixes from Paolo Bonzini:
    "Five small fixes.

    The nested migration bug will be fixed with a better API in 5.10 or
    5.11, for now this is a fix that works with existing userspace but
    keeps the current ugly API"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM: SVM: Add a dedicated INVD intercept routine
    KVM: x86: Reset MMU context if guest toggles CR4.SMAP or CR4.PKE
    KVM: x86: fix MSR_IA32_TSC read for nested migration
    selftests: kvm: Fix assert failure in single-step test
    KVM: x86: VMX: Make smaller physical guest address space support user-configurable

    Linus Torvalds
     
  • 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
     
  • Pull spi fixes from Mark Brown:
    "A small collection of driver specific fixes, the fsl-espi and bcm-qspi
    changes in particular have been causing breakage for users"

    * tag 'spi-fix-v5.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
    spi: bcm-qspi: Fix probe regression on iProc platforms
    spi: fsl-dspi: fix use-after-free in remove path
    spi: fsl-espi: Only process interrupts for expected events
    spi: bcm2835: Make polling_limit_us static
    spi: spi-fsl-dspi: use XSPI mode instead of DMA for DPAA2 SoCs

    Linus Torvalds
     
  • …git/broonie/regulator

    Pull regulator fix from Mark Brown:
    "A single fix for incorrect specification of some of the register
    fields on axp20x devices which would break voltage setting on affected
    systems"

    * tag 'regulator-fix-v5.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
    regulator: axp20x: fix LDO2/4 description

    Linus Torvalds
     
  • Pull regmap fixes from Mark Brown:
    "Two issues here - one is a fix for use after free issues in the case
    where a regmap overrides its name using something dynamically
    generated, the other is that we weren't handling access checks
    non-incrementing I/O on registers within paged register regions
    correctly resulting in spurious errors.

    Both of these are quite rare but serious if they occur"

    * tag 'regmap-fix-v5.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
    regmap: fix page selection for noinc writes
    regmap: fix page selection for noinc reads
    regmap: debugfs: Add back in erroneously removed initialisation of ret
    regmap: debugfs: Fix handling of name string for debugfs init delays

    Linus Torvalds
     
  • Pull NFS server fix from Chuck Lever:
    "Fix incorrect calculation on platforms that implement
    flush_dcache_page()"

    * tag 'nfsd-5.9-2' of git://git.linux-nfs.org/projects/cel/cel-2.6:
    SUNRPC: Fix svc_flush_dcache()

    Linus Torvalds
     
  • Pull power management fixes from Rafael Wysocki:
    "These fix more fallout of recent RCU-lockdep changes in CPU idle code
    and two devfreq issues.

    Specifics:

    - Export rcu_idle_{enter,exit} to modules to fix build issues
    introduced by recent RCU-lockdep fixes (Borislav Petkov)

    - Add missing return statement to a stub function in the ACPI
    processor driver to fix a build issue introduced by recent
    RCU-lockdep fixes (Rafael Wysocki)

    - Fix recently introduced suspicious RCU usage warnings in the PSCI
    cpuidle driver and drop stale comments regarding RCU_NONIDLE()
    usage from enter_s2idle_proper() (Ulf Hansson)

    - Fix error code path in the tegra30 devfreq driver (Dan Carpenter)

    - Add missing information to devfreq_summary debugfs (Chanwoo Choi)"

    * tag 'pm-5.9-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI: processor: Fix build for ARCH_APICTIMER_STOPS_ON_C3 unset
    PM / devfreq: tegra30: Disable clock on error in probe
    PM / devfreq: Add timer type to devfreq_summary debugfs
    cpuidle: Drop misleading comments about RCU usage
    cpuidle: psci: Fix suspicious RCU usage
    rcu/tree: Export rcu_idle_{enter,exit} to modules

    Linus Torvalds
     
  • The INVD instruction intercept performs emulation. Emulation can't be done
    on an SEV guest because the guest memory is encrypted.

    Provide a dedicated intercept routine for the INVD intercept. And since
    the instruction is emulated as a NOP, just skip it instead.

    Fixes: 1654efcbc431 ("KVM: SVM: Add KVM_SEV_INIT command")
    Signed-off-by: Tom Lendacky
    Message-Id:
    Signed-off-by: Paolo Bonzini

    Tom Lendacky
     
  • Pull rdma fix from Jason Gunthorpe:
    "One fix for a bug that blktests hits when using rxe: tear down the CQ
    pool before waiting for all references to go away"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
    RDMA/core: Fix ordering of CQ pool destruction

    Linus Torvalds
     
  • Pull drm fixes from Dave Airlie:
    "Fairly quiet, a couple of i915 fixes, one dma-buf fix, one vc4 and two
    sun4i changes

    dma-buf:
    - Single null pointer deref fix

    i915:
    - Fix selftest reference to stack data out of scope
    - Fix GVT null pointer dereference

    vc4:
    - fill asoc card owner

    sun4i:
    - program secondary CSC correctly"

    * tag 'drm-fixes-2020-09-25' of git://anongit.freedesktop.org/drm/drm:
    drm/i915/selftests: Push the fake iommu device from the stack to data
    dmabuf: fix NULL pointer dereference in dma_buf_release()
    drm/i915/gvt: Fix port number for BDW on EDID region setup
    drm/sun4i: mixer: Extend regmap max_register
    drm/sun4i: sun8i-csc: Secondary CSC register correction
    drm/vc4/vc4_hdmi: fill ASoC card owner

    Linus Torvalds
     
  • * pm-cpuidle:
    ACPI: processor: Fix build for ARCH_APICTIMER_STOPS_ON_C3 unset
    cpuidle: Drop misleading comments about RCU usage
    cpuidle: psci: Fix suspicious RCU usage
    rcu/tree: Export rcu_idle_{enter,exit} to modules

    Rafael J. Wysocki
     

25 Sep, 2020

9 commits


24 Sep, 2020

9 commits

  • Commit 09854ba94c6a ("mm: do_wp_page() simplification") reorganized all
    the code around the page re-use vs copy, but in the process also moved
    the final unlock_page() around to after the wp_page_reuse() call.

    That normally doesn't matter - but it means that the unlock_page() is
    now done after releasing the page table lock. Again, not a big deal,
    you'd think.

    But it turns out that it's very wrong indeed, because once we've
    released the page table lock, we've basically lost our only reference to
    the page - the page tables - and it could now be free'd at any time. We
    do hold the mmap_sem, so no actual unmap() can happen, but madvise can
    come in and a MADV_DONTNEED will zap the page range - and free the page.

    So now the page may be free'd just as we're unlocking it, which in turn
    will usually trigger a "Bad page state" error in the freeing path. To
    make matters more confusing, by the time the debug code prints out the
    page state, the unlock has typically completed and everything looks fine
    again.

    This all doesn't happen in any normal situations, but it does trigger
    with the dirtyc0w_child LTP test. And it seems to trigger much more
    easily (but not expclusively) on s390 than elsewhere, probably because
    s390 doesn't do the "batch pages up for freeing after the TLB flush"
    that gives the unlock_page() more time to complete and makes the race
    harder to hit.

    Fixes: 09854ba94c6a ("mm: do_wp_page() simplification")
    Link: https://lore.kernel.org/lkml/a46e9bbef2ed4e17778f5615e818526ef848d791.camel@redhat.com/
    Link: https://lore.kernel.org/linux-mm/c41149a8-211e-390b-af1d-d5eee690fecb@linux.alibaba.com/
    Reported-by: Qian Cai
    Reported-by: Alex Shi
    Bisected-and-analyzed-by: Gerald Schaefer
    Tested-by: Gerald Schaefer
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • iProc chips have QSPI controller that does not have the MSPI_REV
    offset. Reading from that offset will cause a bus error. Fix it by
    having MSPI_REV query disabled in the generic compatible string.

    Fixes: 3a01f04d74ef ("spi: bcm-qspi: Handle lack of MSPI_REV offset")
    Link: https://lore.kernel.org/linux-arm-kernel/20200909211857.4144718-1-f.fainelli@gmail.com/T/#u
    Signed-off-by: Ray Jui
    Acked-by: Florian Fainelli
    Link: https://lore.kernel.org/r/20200910152539.45584-3-ray.jui@broadcom.com
    Signed-off-by: Mark Brown

    Ray Jui
     
  • Pull bootconfig fixes from Steven Rostedt:
    "A couple of fixes for bootconfig.

    Masami discovered two bugs which this fixes and he added tests to
    cover these issues.

    - Fix a bug that breaks bootconfig tree nodes

    - Fix a bug that does not truncate whitespace properly

    - Add tests to cover the above two cases"

    * tag 'trace-v5.9-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
    tools/bootconfig: Add testcase for tailing space
    tools/bootconfig: Add testcases for repeated key with brace
    lib/bootconfig: Fix to remove tailing spaces after value
    lib/bootconfig: Fix a bug of breaking existing tree nodes

    Linus Torvalds
     
  • …device-mapper/linux-dm

    Pull device mapper fixes from Mike Snitzer:

    - DM core fix for incorrect double bio splitting. Keep "fixing" this
    because past attempts didn't fully appreciate the liability relative
    to recursive bio splitting. This fix limits DM's bio splitting to a
    single method and does _not_ use blk_queue_split() for normal IO.

    - DM crypt Documentation updates for features added during 5.9 merge.

    * tag 'for-5.9/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
    dm crypt: document encrypted keyring key option
    dm crypt: document new no_workqueue flags
    dm: fix comment in dm_process_bio()
    dm: fix bio splitting and its bio completion order for regular IO

    Linus Torvalds
     
  • Pull btrfs fixes from David Sterba:
    "syzkaller started to hit us with reports, here's a fix for one type
    (stack overflow when printing checksums on read error).

    The other patch is a fix for sysfs object, we have a test for that and
    it leads to a crash."

    * tag 'for-5.9-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
    btrfs: fix put of uninitialized kobject after seed device delete
    btrfs: fix overflow when copying corrupt csums for a message

    Linus Torvalds
     
  • This completes the split of the non-present and present pte cases by
    moving the check for the source pte being present into the single
    caller, which also means that we clearly separate out the very different
    return value case for a non-present pte.

    The present pte case currently always succeeds.

    This is a pure code re-organization with no semantic change: the intent
    is to make it much easier to add a new return case to the present pte
    case for when we do early COW at page table copy time.

    This was split out from the previous commit simply to make it easy to
    visually see that there were no semantic changes from this code
    re-organization.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • This is a purely mechanical split of the copy_one_pte() function. It's
    not immediately obvious when looking at the diff because of the
    indentation change, but the way to see what is going on in this commit
    is to use the "-w" flag to not show pure whitespace changes, and you see
    how the first part of copy_one_pte() is simply lifted out into a
    separate function.

    And since the non-present case is marked unlikely, don't make the new
    function be inlined. Not that gcc really seems to care, since it looks
    like it will inline it anyway due to the whole "single callsite for
    static function" logic. In fact, code generation with the function
    split is almost identical to before. But not marking it inline is the
    right thing to do.

    This is pure prep-work and cleanup for subsequent changes.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • spi_unregister_controller() not only unregisters the controller, but
    also frees the controller. This will free the driver data with it, so
    we must not access it later dspi_remove().

    Solve this by allocating the driver data separately from the SPI
    controller.

    Signed-off-by: Sascha Hauer
    Link: https://lore.kernel.org/r/20200923131026.20707-1-s.hauer@pengutronix.de
    Signed-off-by: Mark Brown

    Sascha Hauer
     
  • Currently we wrongly set the mask of value of LDO2/4 both to the mask of
    LDO2, and the LDO4 voltage configuration is left untouched. This leads
    to conflict when LDO2/4 are both in use.

    Fix this issue by setting different vsel_mask to both regulators.

    Fixes: db4a555f7c4c ("regulator: axp20x: use defines for masks")
    Signed-off-by: Icenowy Zheng
    Link: https://lore.kernel.org/r/20200923005142.147135-1-icenowy@aosc.io
    Signed-off-by: Mark Brown

    Icenowy Zheng
     

23 Sep, 2020

6 commits

  • This is a follow-up patch to fix an issue left in commit:
    98b0bf02738004829d7e26d6cb47b2e469aaba86
    selftests: kvm: Use a shorter encoding to clear RAX

    With the change in the commit, we also need to modify "xor" instruction
    length from 3 to 2 in array ss_size accordingly to pass below check:

    for (i = 0; i < (sizeof(ss_size) / sizeof(ss_size[0])); i++) {
    target_rip += ss_size[i];
    CLEAR_DEBUG();
    debug.control = KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_SINGLESTEP;
    debug.arch.debugreg[7] = 0x00000400;
    APPLY_DEBUG();
    vcpu_run(vm, VCPU_ID);
    TEST_ASSERT(run->exit_reason == KVM_EXIT_DEBUG &&
    run->debug.arch.exception == DB_VECTOR &&
    run->debug.arch.pc == target_rip &&
    run->debug.arch.dr6 == target_dr6,
    "SINGLE_STEP[%d]: exit %d exception %d rip 0x%llx "
    "(should be 0x%llx) dr6 0x%llx (should be 0x%llx)",
    i, run->exit_reason, run->debug.arch.exception,
    run->debug.arch.pc, target_rip, run->debug.arch.dr6,
    target_dr6);
    }

    Reported-by: kernel test robot
    Signed-off-by: Yang Weijiang
    Message-Id:
    Signed-off-by: Paolo Bonzini

    Yang Weijiang
     
  • This patch exposes allow_smaller_maxphyaddr to the user as a module parameter.
    Since smaller physical address spaces are only supported on VMX, the
    parameter is only exposed in the kvm_intel module.

    For now disable support by default, and let the user decide if they want
    to enable it.

    Modifications to VMX page fault and EPT violation handling will depend
    on whether that parameter is enabled.

    Signed-off-by: Mohammed Gamal
    Message-Id:
    Signed-off-by: Paolo Bonzini

    Mohammed Gamal
     
  • As there is no known soc powered by mips 1074K in bcm47xx series,
    the check with 1074K is needless. So just remove it.

    Link: https://wireless.wiki.kernel.org/en/users/Drivers/b43/soc
    Fixes: 442e14a2c55e ("MIPS: Add 1074K CPU support explicitly.")
    Signed-off-by: Wei Li
    Acked-by: Rafał Miłecki
    Signed-off-by: Thomas Bogendoerfer

    Wei Li
     
  • 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
     
  • It was missed when I was forking Loongson2ef from Loongson64 but
    should be applied to Loongson2ef as march=loongson2f
    will also enable Loongson MMI in GCC-9+.

    Signed-off-by: Jiaxun Yang
    Fixes: 71e2f4dd5a65 ("MIPS: Fork loongson2ef from loongson64")
    Reported-by: Thomas Bogendoerfer
    Cc: stable@vger.kernel.org # v5.8+
    Signed-off-by: Thomas Bogendoerfer

    Jiaxun Yang
     
  • Fix the lapic_timer_needs_broadcast() stub for
    ARCH_APICTIMER_STOPS_ON_C3 unset to actually return
    a value.

    Fixes: aa6b43d57f99 ("ACPI: processor: Use CPUIDLE_FLAG_TIMER_STOP")
    Reported-by: Guenter Roeck
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki