No description
Find a file
Arnd Bergmann 5b4bf87e96 arm64: pgtable: make __pte_to_phys/__phys_to_pte_val inline functions
[ Upstream commit c7c386fbc2 ]

gcc warns about undefined behavior the vmalloc code when building
with CONFIG_ARM64_PA_BITS_52, when the 'idx++' in the argument to
__phys_to_pte_val() is evaluated twice:

mm/vmalloc.c: In function 'vmap_pfn_apply':
mm/vmalloc.c:2800:58: error: operation on 'data->idx' may be undefined [-Werror=sequence-point]
 2800 |         *pte = pte_mkspecial(pfn_pte(data->pfns[data->idx++], data->prot));
      |                                                 ~~~~~~~~~^~
arch/arm64/include/asm/pgtable-types.h:25:37: note: in definition of macro '__pte'
   25 | #define __pte(x)        ((pte_t) { (x) } )
      |                                     ^
arch/arm64/include/asm/pgtable.h:80:15: note: in expansion of macro '__phys_to_pte_val'
   80 |         __pte(__phys_to_pte_val((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot))
      |               ^~~~~~~~~~~~~~~~~
mm/vmalloc.c:2800:30: note: in expansion of macro 'pfn_pte'
 2800 |         *pte = pte_mkspecial(pfn_pte(data->pfns[data->idx++], data->prot));
      |                              ^~~~~~~

I have no idea why this never showed up earlier, but the safest
workaround appears to be changing those macros into inline functions
so the arguments get evaluated only once.

Cc: Matthew Wilcox <willy@infradead.org>
Fixes: 75387b9263 ("arm64: handle 52-bit physical addresses in page table entries")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20211105075414.2553155-1-arnd@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-26 11:36:16 +01:00
arch arm64: pgtable: make __pte_to_phys/__phys_to_pte_val inline functions 2021-11-26 11:36:16 +01:00
block Revert "block, bfq: honor already-setup queue merges" 2021-10-06 15:31:23 +02:00
certs certs: Trigger creation of RSA module signing key if it's not an RSA key 2021-09-22 11:47:51 +02:00
crypto crypto: pcrypt - Delay write to padata->info 2021-11-26 11:36:11 +01:00
Documentation xen/balloon: add late_initcall_sync() for initial ballooning done 2021-11-26 11:36:02 +01:00
drivers nfc: pn533: Fix double free when pn533_fill_fragment_skbs() fails 2021-11-26 11:36:16 +01:00
firmware
fs fs: orangefs: fix error return code of orangefs_revalidate_lookup() 2021-11-26 11:36:14 +01:00
include llc: fix out-of-bound array index in llc_sk_dev_hash() 2021-11-26 11:36:16 +01:00
init pid: take a reference when initializing cad_pid 2021-06-10 13:24:06 +02:00
ipc
kernel PM: hibernate: fix sparse warnings 2021-11-26 11:36:10 +01:00
lib lib/xz: Validate the value before assigning it to an enum variable 2021-11-26 11:36:06 +01:00
LICENSES
mm mm/zsmalloc.c: close race window between zs_pool_dec_isolated() and zs_unregister_migration() 2021-11-26 11:36:16 +01:00
net netfilter: nfnetlink_queue: fix OOB when mac header was cleared 2021-11-26 11:36:15 +01:00
samples samples/kretprobes: Fix return value if register_kretprobe() failed 2021-11-26 11:36:11 +01:00
scripts leaking_addresses: Always print a trailing newline 2021-11-26 11:36:06 +01:00
security apparmor: fix error check 2021-11-26 11:36:14 +01:00
sound ASoC: cs42l42: Defer probe if request_threaded_irq() returns EPROBE_DEFER 2021-11-26 11:36:13 +01:00
tools selftests/bpf: Fix fclose/pclose mismatch in test_progs 2021-11-26 11:36:11 +01:00
usr
virt KVM: remember position in kvm->vcpus array 2021-09-26 13:39:46 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 4.19.217 2021-11-12 14:40:52 +01:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.