mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
* refs/heads/tmp-2bb70f4: ANDROID: virtio: virtio_input: Set the amount of multitouch slots in virtio input ANDROID: dummy_cpufreq: Implement get() rtlwifi: Fix potential overflow on P2P code ANDROID: cpufreq: create dummy cpufreq driver ANDROID: Allow DRM_IOCTL_MODE_*_DUMB for render clients. ANDROID: sdcardfs: evict dentries on fscrypt key removal ANDROID: fscrypt: add key removal notifier chain ANDROID: Move from clang r353983c to r365631c ANDROID: move up spin_unlock_bh() ahead of remove_proc_entry() BACKPORT: arm64: tags: Preserve tags for addresses translated via TTBR1 UPSTREAM: arm64: memory: Implement __tag_set() as common function UPSTREAM: arm64/mm: fix variable 'tag' set but not used UPSTREAM: arm64: avoid clang warning about self-assignment ANDROID: refactor build.config files to remove duplication UPSTREAM: mm: vmalloc: show number of vmalloc pages in /proc/meminfo BACKPORT: PM/sleep: Expose suspend stats in sysfs UPSTREAM: power: supply: Init device wakeup after device_add() UPSTREAM: PM / wakeup: Unexport wakeup_source_sysfs_{add,remove}() UPSTREAM: PM / wakeup: Register wakeup class kobj after device is added BACKPORT: PM / wakeup: Fix sysfs registration error path BACKPORT: PM / wakeup: Show wakeup sources stats in sysfs UPSTREAM: PM / wakeup: Print warn if device gets enabled as wakeup source during sleep UPSTREAM: PM / wakeup: Use wakeup_source_register() in wakelock.c UPSTREAM: PM / wakeup: Only update last time for active wakeup sources UPSTREAM: PM / core: Add support to skip power management in device/driver model cuttlefish-4.14: Enable CONFIG_DM_SNAPSHOT ANDROID: cuttlefish_defconfig: Enable BPF_JIT and BPF_JIT_ALWAYS_ON UPSTREAM: netfilter: xt_IDLETIMER: fix sysfs callback function type UPSTREAM: mm: untag user pointers in mmap/munmap/mremap/brk UPSTREAM: vfio/type1: untag user pointers in vaddr_get_pfn UPSTREAM: media/v4l2-core: untag user pointers in videobuf_dma_contig_user_get UPSTREAM: drm/radeon: untag user pointers in radeon_gem_userptr_ioctl BACKPORT: drm/amdgpu: untag user pointers UPSTREAM: userfaultfd: untag user pointers UPSTREAM: fs/namespace: untag user pointers in copy_mount_options UPSTREAM: mm: untag user pointers in get_vaddr_frames UPSTREAM: mm: untag user pointers in mm/gup.c BACKPORT: mm: untag user pointers passed to memory syscalls BACKPORT: lib: untag user pointers in strn*_user UPSTREAM: arm64: Fix reference to docs for ARM64_TAGGED_ADDR_ABI UPSTREAM: selftests, arm64: add kernel headers path for tags_test BACKPORT: arm64: Relax Documentation/arm64/tagged-pointers.rst UPSTREAM: arm64: Define Documentation/arm64/tagged-address-abi.rst UPSTREAM: arm64: Change the tagged_addr sysctl control semantics to only prevent the opt-in UPSTREAM: arm64: Tighten the PR_{SET, GET}_TAGGED_ADDR_CTRL prctl() unused arguments UPSTREAM: selftests, arm64: fix uninitialized symbol in tags_test.c UPSTREAM: arm64: mm: Really fix sparse warning in untagged_addr() UPSTREAM: selftests, arm64: add a selftest for passing tagged pointers to kernel BACKPORT: arm64: Introduce prctl() options to control the tagged user addresses ABI UPSTREAM: thread_info: Add update_thread_flag() helpers UPSTREAM: arm64: untag user pointers in access_ok and __uaccess_mask_ptr UPSTREAM: uaccess: add noop untagged_addr definition BACKPORT: block: annotate refault stalls from IO submission ext4: add verity flag check for dax ANDROID: usb: gadget: Fix dependency for f_accessory ANDROID: sched: fair: balance for single core cluster UPSTREAM: mm/kasan: fix false positive invalid-free reports with CONFIG_KASAN_SW_TAGS=y f2fs: add a condition to detect overflow in f2fs_ioc_gc_range() f2fs: fix to add missing F2FS_IO_ALIGNED() condition f2fs: fix to fallback to buffered IO in IO aligned mode f2fs: fix to handle error path correctly in f2fs_map_blocks f2fs: fix extent corrupotion during directIO in LFS mode f2fs: check all the data segments against all node ones f2fs: Add a small clarification to CONFIG_FS_F2FS_FS_SECURITY f2fs: fix inode rwsem regression f2fs: fix to avoid accessing uninitialized field of inode page in is_alive() f2fs: avoid infinite GC loop due to stale atomic files f2fs: Fix indefinite loop in f2fs_gc() f2fs: convert inline_data in prior to i_size_write f2fs: fix error path of f2fs_convert_inline_page() f2fs: add missing documents of reserve_root/resuid/resgid f2fs: fix flushing node pages when checkpoint is disabled f2fs: enhance f2fs_is_checkpoint_ready()'s readability f2fs: clean up __bio_alloc()'s parameter f2fs: fix wrong error injection path in inc_valid_block_count() f2fs: fix to writeout dirty inode during node flush f2fs: optimize case-insensitive lookups f2fs: introduce f2fs_match_name() for cleanup f2fs: Fix indefinite loop in f2fs_gc() f2fs: allocate memory in batch in build_sit_info() f2fs: fix to avoid data corruption by forbidding SSR overwrite f2fs: Fix build error while CONFIG_NLS=m Revert "f2fs: avoid out-of-range memory access" f2fs: cleanup the code in build_sit_entries. f2fs: fix wrong available node count calculation f2fs: remove duplicate code in f2fs_file_write_iter f2fs: fix to migrate blocks correctly during defragment f2fs: use wrapped f2fs_cp_error() f2fs: fix to use more generic EOPNOTSUPP f2fs: use wrapped IS_SWAPFILE() f2fs: Support case-insensitive file name lookups f2fs: include charset encoding information in the superblock fs: Reserve flag for casefolding f2fs: fix to avoid call kvfree under spinlock fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status() f2fs: disallow direct IO in atomic write f2fs: fix to handle quota_{on,off} correctly f2fs: fix to detect cp error in f2fs_setxattr() f2fs: fix to spread f2fs_is_checkpoint_ready() f2fs: support fiemap() for directory inode f2fs: fix to avoid discard command leak f2fs: fix to avoid tagging SBI_QUOTA_NEED_REPAIR incorrectly f2fs: fix to drop meta/node pages during umount f2fs: disallow switching io_bits option during remount f2fs: fix panic of IO alignment feature f2fs: introduce {page,io}_is_mergeable() for readability f2fs: fix livelock in swapfile writes f2fs: add fs-verity support ext4: update on-disk format documentation for fs-verity ext4: add fs-verity read support ext4: add basic fs-verity support fs-verity: support builtin file signatures fs-verity: add SHA-512 support fs-verity: implement FS_IOC_MEASURE_VERITY ioctl fs-verity: implement FS_IOC_ENABLE_VERITY ioctl fs-verity: add data verification hooks for ->readpages() fs-verity: add the hook for file ->setattr() fs-verity: add the hook for file ->open() fs-verity: add inode and superblock fields fs-verity: add Kconfig and the helper functions for hashing fs: uapi: define verity bit for FS_IOC_GETFLAGS fs-verity: add UAPI header fs-verity: add MAINTAINERS file entry fs-verity: add a documentation file ext4: fix kernel oops caused by spurious casefold flag ext4: fix coverity warning on error path of filename setup ext4: optimize case-insensitive lookups ext4: fix dcache lookup of !casefolded directories unicode: update to Unicode 12.1.0 final unicode: add missing check for an error return from utf8lookup() ext4: export /sys/fs/ext4/feature/casefold if Unicode support is present unicode: refactor the rule for regenerating utf8data.h ext4: Support case-insensitive file name lookups ext4: include charset encoding information in the superblock unicode: update unicode database unicode version 12.1.0 unicode: introduce test module for normalized utf8 implementation unicode: implement higher level API for string handling unicode: reduce the size of utf8data[] unicode: introduce code for UTF-8 normalization unicode: introduce UTF-8 character database ext4 crypto: fix to check feature status before get policy fscrypt: document the new ioctls and policy version ubifs: wire up new fscrypt ioctls f2fs: wire up new fscrypt ioctls ext4: wire up new fscrypt ioctls fscrypt: require that key be added when setting a v2 encryption policy fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS ioctl fscrypt: allow unprivileged users to add/remove keys for v2 policies fscrypt: v2 encryption policy support fscrypt: add an HKDF-SHA512 implementation fscrypt: add FS_IOC_GET_ENCRYPTION_KEY_STATUS ioctl fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY ioctl fscrypt: add FS_IOC_ADD_ENCRYPTION_KEY ioctl fscrypt: rename keyinfo.c to keysetup.c fscrypt: move v1 policy key setup to keysetup_v1.c fscrypt: refactor key setup code in preparation for v2 policies fscrypt: rename fscrypt_master_key to fscrypt_direct_key fscrypt: add ->ci_inode to fscrypt_info fscrypt: use FSCRYPT_* definitions, not FS_* fscrypt: use FSCRYPT_ prefix for uapi constants fs, fscrypt: move uapi definitions to new header <linux/fscrypt.h> fscrypt: use ENOPKG when crypto API support missing fscrypt: improve warnings for missing crypto API support fscrypt: improve warning messages for unsupported encryption contexts fscrypt: make fscrypt_msg() take inode instead of super_block fscrypt: clean up base64 encoding/decoding fscrypt: remove loadable module related code ANDROID: arm64: bpf: implement arch_bpf_jit_check_func ANDROID: bpf: validate bpf_func when BPF_JIT is enabled with CFI UPSTREAM: kcm: use BPF_PROG_RUN UPSTREAM: psi: get poll_work to run when calling poll syscall next time UPSTREAM: sched/psi: Do not require setsched permission from the trigger creator UPSTREAM: sched/psi: Reduce psimon FIFO priority BACKPORT: arm64: Add support for relocating the kernel with RELR relocations ANDROID: Log which device failed to suspend in dpm_suspend_start() ANDROID: Revert "ANDROID: sched: Disallow WALT with CFS bandwidth control" ANDROID: sched: WALT: Add support for CFS_BANDWIDTH ANDROID: sched: WALT: Refactor cumulative runnable average fixup ANDROID: sched: Disallow WALT with CFS bandwidth control fscrypt: document testing with xfstests fscrypt: remove selection of CONFIG_CRYPTO_SHA256 fscrypt: remove unnecessary includes of ratelimit.h fscrypt: don't set policy for a dead directory fscrypt: decrypt only the needed blocks in __fscrypt_decrypt_bio() fscrypt: support decrypting multiple filesystem blocks per page fscrypt: introduce fscrypt_decrypt_block_inplace() fscrypt: handle blocksize < PAGE_SIZE in fscrypt_zeroout_range() fscrypt: support encrypting multiple filesystem blocks per page fscrypt: introduce fscrypt_encrypt_block_inplace() fscrypt: clean up some BUG_ON()s in block encryption/decryption fscrypt: rename fscrypt_do_page_crypto() to fscrypt_crypt_block() fscrypt: remove the "write" part of struct fscrypt_ctx fscrypt: simplify bounce page handling ANDROID: fiq_debugger: remove UPSTREAM: lib/test_meminit.c: use GFP_ATOMIC in RCU critical section UPSTREAM: mm: slub: Fix slab walking for init_on_free UPSTREAM: lib/test_meminit.c: minor test fixes UPSTREAM: lib/test_meminit.c: fix -Wmaybe-uninitialized false positive UPSTREAM: lib: introduce test_meminit module UPSTREAM: mm: init: report memory auto-initialization features at boot time BACKPORT: mm: security: introduce init_on_alloc=1 and init_on_free=1 boot options UPSTREAM: arm64: move jump_label_init() before parse_early_param() ANDROID: Add a tracepoint for mapping inode to full path BACKPORT: arch: add pidfd and io_uring syscalls everywhere UPSTREAM: dma-buf: add show_fdinfo handler UPSTREAM: dma-buf: add DMA_BUF_SET_NAME ioctls BACKPORT: dma-buf: give each buffer a full-fledged inode ANDROID: fix kernelci build-break UPSTREAM: drm/virtio: Fix cache entry creation race. UPSTREAM: drm/virtio: Wake up all waiters when capset response comes in. UPSTREAM: drm/virtio: Ensure cached capset entries are valid before copying. UPSTREAM: drm/virtio: use u64_to_user_ptr macro UPSTREAM: drm/virtio: remove irrelevant DRM_UNLOCKED flag UPSTREAM: drm/virtio: Remove redundant return type UPSTREAM: drm/virtio: allocate fences with GFP_KERNEL UPSTREAM: drm/virtio: add trace events for commands UPSTREAM: drm/virtio: trace drm_fence_emit BACKPORT: drm/virtio: set seqno for dma-fence BACKPORT: drm/virtio: move drm_connector_update_edid_property() call UPSTREAM: drm/virtio: add missing drm_atomic_helper_shutdown() call. BACKPORT: drm/virtio: rework resource creation workflow. UPSTREAM: drm/virtio: params struct for virtio_gpu_cmd_create_resource_3d() BACKPORT: drm/virtio: params struct for virtio_gpu_cmd_create_resource() BACKPORT: drm/virtio: use struct to pass params to virtio_gpu_object_create() UPSTREAM: drm/virtio: add virtio-gpu-features debugfs file. UPSTREAM: drm/virtio: remove set but not used variable 'vgdev' BACKPORT: drm/virtio: implement prime export UPSTREAM: drm/virtio: remove prime pin/unpin callbacks. UPSTREAM: drm/virtio: implement prime mmap UPSTREAM: drm/virtio: drop virtio_gpu_fence_cleanup() UPSTREAM: drm/virtio: fix pageflip flush UPSTREAM: drm/virtio: log error responses UPSTREAM: drm/virtio: Add missing virtqueue reset UPSTREAM: drm/virtio: Remove incorrect kfree() UPSTREAM: drm/virtio: virtio_gpu_cmd_resource_create_3d: drop unused fence arg UPSTREAM: drm/virtio: fence: pass plain pointer BACKPORT: drm/virtio: add edid support UPSTREAM: virtio-gpu: add VIRTIO_GPU_F_EDID feature BACKPORT: drm/virtio: fix memory leak of vfpriv on error return path UPSTREAM: drm/virtio: bump driver version after explicit synchronization addition UPSTREAM: drm/virtio: add in/out fence support for explicit synchronization UPSTREAM: drm/virtio: add uapi for in and out explicit fences UPSTREAM: drm/virtio: add virtio_gpu_alloc_fence() UPSTREAM: drm/virtio: Handle error from virtio_gpu_resource_id_get UPSTREAM: gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc UPSTREAM: drm/virtio: fix resource id handling UPSTREAM: drm/virtio: drop resource_id argument. UPSTREAM: drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpu_resource_create_ioctl() UPSTREAM: drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpu_mode_dumb_create() UPSTREAM: drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpufb_create() BACKPORT: drm/virtio: track created object state UPSTREAM: drm/virtio: document drm_dev_set_unique workaround UPSTREAM: virtio: Support prime objects vmap/vunmap UPSTREAM: virtio: Rework virtio_gpu_object_kmap() UPSTREAM: virtio: Add virtio_gpu_object_kunmap() UPSTREAM: drm/virtio: pass virtio_gpu_object to virtio_gpu_cmd_transfer_to_host_{2d, 3d} UPSTREAM: drm/virtio: add dma sync for dma mapped virtio gpu framebuffer pages UPSTREAM: drm/virtio: Remove set but not used variable 'bo' UPSTREAM: drm/virtio: add iommu support. UPSTREAM: drm/virtio: add virtio_gpu_object_detach() function UPSTREAM: drm/virtio: track virtual output state UPSTREAM: drm/virtio: fix bounds check in virtio_gpu_cmd_get_capset() UPSTREAM: gpu: drm: virtio: code cleanup UPSTREAM: drm/virtio: Place GEM BOs in drm_framebuffer UPSTREAM: drm/virtio: fix mode_valid's return type UPSTREAM: drm/virtio: Add spaces around operators UPSTREAM: drm/virtio: Remove multiple blank lines UPSTREAM: drm/virtio: Replace 'unsigned' for 'unsigned int' UPSTREAM: drm/virtio: Remove return from void function UPSTREAM: drm/virtio: Add */ in block comments to separate line UPSTREAM: drm/virtio: Add blank line after variable declarations UPSTREAM: drm/virtio: Add tabs at the start of a line UPSTREAM: drm/virtio: Don't return invalid caps on timeout UPSTREAM: virtgpu: remove redundant task_comm copying UPSTREAM: drm/virtio: add create_handle support. UPSTREAM: drm: virtio: replace reference/unreference with get/put UPSTREAM: drm/virtio: Replace instances of reference/unreference with get/put UPSTREAM: drm: byteorder: add DRM_FORMAT_HOST_* UPSTREAM: drm: add drm_connector_attach_edid_property() BACKPORT: drm/prime: Add drm_gem_prime_mmap() f2fs: fix build error on android tracepoints ANDROID: cuttlefish_defconfig: Enable CAN/VCAN UPSTREAM: pidfd: fix a poll race when setting exit_state BACKPORT: arch: wire-up pidfd_open() BACKPORT: pid: add pidfd_open() UPSTREAM: pidfd: add polling support UPSTREAM: signal: improve comments UPSTREAM: fork: do not release lock that wasn't taken BACKPORT: signal: support CLONE_PIDFD with pidfd_send_signal BACKPORT: clone: add CLONE_PIDFD UPSTREAM: Make anon_inodes unconditional UPSTREAM: signal: use fdget() since we don't allow O_PATH UPSTREAM: signal: don't silently convert SI_USER signals to non-current pidfd BACKPORT: signal: add pidfd_send_signal() syscall UPSTREAM: net-ipv6-ndisc: add support for RFC7710 RA Captive Portal Identifier ANDROID: fix up 9p filesystem due to CFI non-upstream patches f2fs: use EINVAL for superblock with invalid magic f2fs: fix to read source block before invalidating it f2fs: remove redundant check from f2fs_setflags_common() f2fs: use generic checking function for FS_IOC_FSSETXATTR f2fs: use generic checking and prep function for FS_IOC_SETFLAGS ubifs, fscrypt: cache decrypted symlink target in ->i_link vfs: use READ_ONCE() to access ->i_link fs, fscrypt: clear DCACHE_ENCRYPTED_NAME when unaliasing directory ANDROID: (arm64) cuttlefish_defconfig: enable CONFIG_CPU_FREQ_TIMES ANDROID: xfrm: remove in_compat_syscall() checks ANDROID: enable CONFIG_RTC_DRV_TEST on cuttlefish UPSTREAM: binder: Set end of SG buffer area properly. ANDROID: x86_64_cuttlefish_defconfig: enable CONFIG_CPU_FREQ_TIMES ANDROID: f2fs: add android fsync tracepoint ANDROID: f2fs: fix wrong android tracepoint fscrypt: cache decrypted symlink target in ->i_link fscrypt: fix race where ->lookup() marks plaintext dentry as ciphertext fscrypt: only set dentry_operations on ciphertext dentries fscrypt: fix race allowing rename() and link() of ciphertext dentries fscrypt: clean up and improve dentry revalidation fscrypt: use READ_ONCE() to access ->i_crypt_info fscrypt: remove WARN_ON_ONCE() when decryption fails fscrypt: drop inode argument from fscrypt_get_ctx() f2fs: improve print log in f2fs_sanity_check_ckpt() f2fs: avoid out-of-range memory access f2fs: fix to avoid long latency during umount f2fs: allow all the users to pin a file f2fs: support swap file w/ DIO f2fs: allocate blocks for pinned file f2fs: fix is_idle() check for discard type f2fs: add a rw_sem to cover quota flag changes f2fs: set SBI_NEED_FSCK for xattr corruption case f2fs: use generic EFSBADCRC/EFSCORRUPTED f2fs: Use DIV_ROUND_UP() instead of open-coding f2fs: print kernel message if filesystem is inconsistent f2fs: introduce f2fs_<level> macros to wrap f2fs_printk() f2fs: avoid get_valid_blocks() for cleanup f2fs: ioctl for removing a range from F2FS f2fs: only set project inherit bit for directory f2fs: separate f2fs i_flags from fs_flags and ext4 i_flags UPSTREAM: kasan: initialize tag to 0xff in __kasan_kmalloc UPSTREAM: x86/boot: Provide KASAN compatible aliases for string routines UPSTREAM: mm/kasan: Remove the ULONG_MAX stack trace hackery UPSTREAM: x86/uaccess, kasan: Fix KASAN vs SMAP UPSTREAM: x86/uaccess: Introduce user_access_{save,restore}() UPSTREAM: kasan: fix variable 'tag' set but not used warning UPSTREAM: Revert "x86_64: Increase stack size for KASAN_EXTRA" UPSTREAM: kasan: fix coccinelle warnings in kasan_p*_table UPSTREAM: kasan: fix kasan_check_read/write definitions BACKPORT: kasan: remove use after scope bugs detection. BACKPORT: kasan: turn off asan-stack for clang-8 and earlier UPSTREAM: slub: fix a crash with SLUB_DEBUG + KASAN_SW_TAGS UPSTREAM: kasan, slab: remove redundant kasan_slab_alloc hooks UPSTREAM: kasan, slab: make freelist stored without tags UPSTREAM: kasan, slab: fix conflicts with CONFIG_HARDENED_USERCOPY UPSTREAM: kasan: prevent tracing of tags.c UPSTREAM: kasan: fix random seed generation for tag-based mode UPSTREAM: slub: fix SLAB_CONSISTENCY_CHECKS + KASAN_SW_TAGS UPSTREAM: kasan, slub: fix more conflicts with CONFIG_SLAB_FREELIST_HARDENED UPSTREAM: kasan, slub: fix conflicts with CONFIG_SLAB_FREELIST_HARDENED UPSTREAM: kasan, slub: move kasan_poison_slab hook before page_address UPSTREAM: kasan, kmemleak: pass tagged pointers to kmemleak UPSTREAM: kasan: fix assigning tags twice UPSTREAM: kasan: mark file common so ftrace doesn't trace it UPSTREAM: kasan, arm64: remove redundant ARCH_SLAB_MINALIGN define UPSTREAM: kasan: fix krealloc handling for tag-based mode UPSTREAM: kasan: make tag based mode work with CONFIG_HARDENED_USERCOPY UPSTREAM: kasan, arm64: use ARCH_SLAB_MINALIGN instead of manual aligning BACKPORT: mm/memblock.c: skip kmemleak for kasan_init() UPSTREAM: kasan: add SPDX-License-Identifier mark to source files BACKPORT: kasan: update documentation UPSTREAM: kasan, arm64: select HAVE_ARCH_KASAN_SW_TAGS UPSTREAM: kasan: add __must_check annotations to kasan hooks BACKPORT: kasan, mm, arm64: tag non slab memory allocated via pagealloc UPSTREAM: kasan, arm64: add brk handler for inline instrumentation UPSTREAM: kasan: add hooks implementation for tag-based mode UPSTREAM: mm: move obj_to_index to include/linux/slab_def.h UPSTREAM: kasan: add bug reporting routines for tag-based mode UPSTREAM: kasan: split out generic_report.c from report.c UPSTREAM: kasan, mm: perform untagged pointers comparison in krealloc BACKPORT: kasan, arm64: enable top byte ignore for the kernel BACKPORT: kasan, arm64: fix up fault handling logic UPSTREAM: kasan: preassign tags to objects with ctors or SLAB_TYPESAFE_BY_RCU UPSTREAM: kasan, arm64: untag address in _virt_addr_is_linear UPSTREAM: kasan: add tag related helper functions BACKPORT: arm64: move untagged_addr macro from uaccess.h to memory.h BACKPORT: kasan: initialize shadow to 0xff for tag-based mode BACKPORT: kasan: rename kasan_zero_page to kasan_early_shadow_page BACKPORT: kasan, arm64: adjust shadow size for tag-based mode BACKPORT: kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS UPSTREAM: kasan: rename source files to reflect the new naming scheme BACKPORT: kasan: move common generic and tag-based code to common.c UPSTREAM: kasan, slub: handle pointer tags in early_kmem_cache_node_alloc UPSTREAM: kasan, mm: change hooks signatures UPSTREAM: arm64: add EXPORT_SYMBOL_NOKASAN() BACKPORT: compiler: remove __no_sanitize_address_or_inline again UPSTREAM: mm/kasan/quarantine.c: make quarantine_lock a raw_spinlock_t UPSTREAM: lib/test_kasan.c: add tests for several string/memory API functions UPSTREAM: arm64: lib: use C string functions with KASAN enabled UPSTREAM: compiler: introduce __no_sanitize_address_or_inline UPSTREAM: arm64: Fix typo in a comment in arch/arm64/mm/kasan_init.c BACKPORT: kernel/memremap, kasan: make ZONE_DEVICE with work with KASAN BACKPORT: mm/mempool.c: remove unused argument in kasan_unpoison_element() and remove_element() UPSTREAM: kasan: only select SLUB_DEBUG with SYSFS=y UPSTREAM: kasan: depend on CONFIG_SLUB_DEBUG UPSTREAM: KASAN: prohibit KASAN+STRUCTLEAK combination UPSTREAM: arm64: kasan: avoid pfn_to_nid() before page array is initialized UPSTREAM: kasan: fix invalid-free test crashing the kernel UPSTREAM: kasan, slub: fix handling of kasan_slab_free hook UPSTREAM: slab, slub: skip unnecessary kasan_cache_shutdown() BACKPORT: kasan: make kasan_cache_create() work with 32-bit slab cache sizes UPSTREAM: locking/atomics: Instrument cmpxchg_double*() UPSTREAM: locking/atomics: Instrument xchg() UPSTREAM: locking/atomics: Simplify cmpxchg() instrumentation UPSTREAM: locking/atomics/x86: Reduce arch_cmpxchg64*() instrumentation UPSTREAM: locking/atomic, asm-generic, x86: Add comments for atomic instrumentation UPSTREAM: locking/atomic, asm-generic: Add KASAN instrumentation to atomic operations UPSTREAM: locking/atomic/x86: Switch atomic.h to use atomic-instrumented.h UPSTREAM: locking/atomic, asm-generic: Add asm-generic/atomic-instrumented.h BACKPORT: kasan, arm64: clean up KASAN_SHADOW_SCALE_SHIFT usage UPSTREAM: kasan: clean up KASAN_SHADOW_SCALE_SHIFT usage UPSTREAM: kasan: fix prototype author email address UPSTREAM: kasan: detect invalid frees UPSTREAM: kasan: unify code between kasan_slab_free() and kasan_poison_kfree() UPSTREAM: kasan: detect invalid frees for large mempool objects UPSTREAM: kasan: don't use __builtin_return_address(1) UPSTREAM: kasan: detect invalid frees for large objects UPSTREAM: kasan: add functions for unpoisoning stack variables UPSTREAM: kasan: add tests for alloca poisoning UPSTREAM: kasan: support alloca() poisoning UPSTREAM: kasan/Makefile: support LLVM style asan parameters BACKPORT: kasan: add compiler support for clang BACKPORT: fs: dcache: Revert "manually unpoison dname after allocation to shut up kasan's reports" UPSTREAM: fs/dcache: Use read_word_at_a_time() in dentry_string_cmp() UPSTREAM: lib/strscpy: Shut up KASAN false-positives in strscpy() UPSTREAM: compiler.h: Add read_word_at_a_time() function. UPSTREAM: compiler.h, kasan: Avoid duplicating __read_once_size_nocheck() UPSTREAM: arm64/mm/kasan: don't use vmemmap_populate() to initialize shadow UPSTREAM: Documentation/features/KASAN: mark KASAN as supported only on 64-bit on x86 f2fs: Add option to limit required GC for checkpoint=disable f2fs: Fix accounting for unusable blocks f2fs: Fix root reserved on remount f2fs: Lower threshold for disable_cp_again f2fs: fix sparse warning f2fs: fix f2fs_show_options to show nodiscard mount option f2fs: add error prints for debugging mount failure f2fs: fix to do sanity check on segment bitmap of LFS curseg f2fs: add missing sysfs entries in documentation f2fs: fix to avoid deadloop if data_flush is on f2fs: always assume that the device is idle under gc_urgent f2fs: add bio cache for IPU f2fs: allow ssr block allocation during checkpoint=disable period f2fs: fix to check layout on last valid checkpoint park Conflicts: arch/arm64/configs/cuttlefish_defconfig arch/arm64/include/asm/memory.h arch/arm64/include/asm/thread_info.h arch/x86/configs/x86_64_cuttlefish_defconfig build.config.common drivers/dma-buf/dma-buf.c fs/crypto/Makefile fs/crypto/bio.c fs/crypto/fscrypt_private.h fs/crypto/keyinfo.c fs/ext4/page-io.c fs/f2fs/data.c fs/f2fs/f2fs.h fs/f2fs/inode.c fs/f2fs/segment.c fs/userfaultfd.c include/linux/dma-buf.h include/linux/fscrypt.h include/linux/kasan.h include/linux/platform_data/ds2482.h include/uapi/linux/fs.h kernel/sched/deadline.c kernel/sched/fair.c kernel/sched/rt.c kernel/sched/sched.h kernel/sched/stop_task.c kernel/sched/walt.c kernel/sched/walt.h lib/test_kasan.c mm/kasan/common.c mm/kasan/kasan.h mm/kasan/report.c mm/slub.c mm/vmalloc.c scripts/Makefile.kasan Changed below files to fix build errors: drivers/char/diag/diagchar_core.c drivers/power/supply/qcom/battery.c drivers/power/supply/qcom/smb1390-charger-psy.c drivers/power/supply/qcom/smb1390-charger.c drivers/power/supply/qcom/step-chg-jeita.c fs/crypto/fscrypt_ice.c fs/crypto/fscrypt_private.h fs/f2fs/inode.c include/uapi/linux/fscrypt.h net/qrtr/qrtr.c gen_headers_arm.bp gen_headers_arm64.bp Extra added fixes in fs/f2fs/data.c for FBE: * Fix FBE regression with 9937c21ce1 ("f2fs: add bio cache for IPU"). The above commit is not setting the DUN for bio, due to which the bio's could get corrupted when FBE is enabled. * The f2fs_merge_page_bio() incorrectly uses the bio after it is submitted for IO when fscrypt_mergeable_bio() returns false. Fix it by making the submitted bio NULL so that a new bio gets allocated for the next/new page. Ignored the below scheduler patches as they are already present: ANDROID: sched: WALT: Add support for CFS_BANDWIDTH ANDROID: sched: WALT: Refactor cumulative runnable average fixup picked below patches from 4.14.159 and 4.14.172 versions to fix issues 0e39aa9d5 "UPSTREAM: arm64: Validate tagged addresses in access_ok() called from kernel threads" 352902650 "fscrypt: support passing a keyring key to FS_IOC_ADD_ENCRYPTION_KEY" Change-Id: I205b796ee125fa6e9d27fa30f881e4e8fe8bea29 Signed-off-by: Srinivasarao P <spathi@codeaurora.org> Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
435 lines
14 KiB
C
435 lines
14 KiB
C
#ifndef _LINUX_MEMBLOCK_H
|
|
#define _LINUX_MEMBLOCK_H
|
|
#ifdef __KERNEL__
|
|
|
|
#ifdef CONFIG_HAVE_MEMBLOCK
|
|
/*
|
|
* Logical memory blocks.
|
|
*
|
|
* Copyright (C) 2001 Peter Bergner, IBM Corp.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the License, or (at your option) any later version.
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/mm.h>
|
|
|
|
#define INIT_MEMBLOCK_REGIONS 128
|
|
#define INIT_PHYSMEM_REGIONS 4
|
|
|
|
/* Definition of memblock flags. */
|
|
enum {
|
|
MEMBLOCK_NONE = 0x0, /* No special request */
|
|
MEMBLOCK_HOTPLUG = 0x1, /* hotpluggable region */
|
|
MEMBLOCK_MIRROR = 0x2, /* mirrored region */
|
|
MEMBLOCK_NOMAP = 0x4, /* don't add to kernel direct mapping */
|
|
};
|
|
|
|
struct memblock_region {
|
|
phys_addr_t base;
|
|
phys_addr_t size;
|
|
unsigned long flags;
|
|
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
|
|
int nid;
|
|
#endif
|
|
};
|
|
|
|
struct memblock_type {
|
|
unsigned long cnt; /* number of regions */
|
|
unsigned long max; /* size of the allocated array */
|
|
phys_addr_t total_size; /* size of all regions */
|
|
struct memblock_region *regions;
|
|
char *name;
|
|
};
|
|
|
|
struct memblock {
|
|
bool bottom_up; /* is bottom up direction? */
|
|
phys_addr_t current_limit;
|
|
struct memblock_type memory;
|
|
struct memblock_type reserved;
|
|
#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
|
|
struct memblock_type physmem;
|
|
#endif
|
|
};
|
|
|
|
extern struct memblock memblock;
|
|
extern int memblock_debug;
|
|
|
|
#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
|
|
#define __init_memblock __meminit
|
|
#define __initdata_memblock __meminitdata
|
|
void memblock_discard(void);
|
|
#else
|
|
#define __init_memblock
|
|
#define __initdata_memblock
|
|
#endif
|
|
|
|
#define memblock_dbg(fmt, ...) \
|
|
if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
|
phys_addr_t memblock_find_in_range_node(phys_addr_t size, phys_addr_t align,
|
|
phys_addr_t start, phys_addr_t end,
|
|
int nid, ulong flags);
|
|
phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end,
|
|
phys_addr_t size, phys_addr_t align);
|
|
void memblock_allow_resize(void);
|
|
int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid);
|
|
int memblock_add(phys_addr_t base, phys_addr_t size);
|
|
int memblock_remove(phys_addr_t base, phys_addr_t size);
|
|
int memblock_free(phys_addr_t base, phys_addr_t size);
|
|
int memblock_reserve(phys_addr_t base, phys_addr_t size);
|
|
void memblock_trim_memory(phys_addr_t align);
|
|
bool memblock_overlaps_region(struct memblock_type *type,
|
|
phys_addr_t base, phys_addr_t size);
|
|
int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size);
|
|
int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size);
|
|
int memblock_mark_mirror(phys_addr_t base, phys_addr_t size);
|
|
int memblock_mark_nomap(phys_addr_t base, phys_addr_t size);
|
|
int memblock_clear_nomap(phys_addr_t base, phys_addr_t size);
|
|
#ifdef CONFIG_MEMORY_HOTPLUG
|
|
int memblock_dump_aligned_blocks_addr(char *buf);
|
|
int memblock_dump_aligned_blocks_num(char *buf);
|
|
#endif
|
|
ulong choose_memblock_flags(void);
|
|
|
|
/* Low level functions */
|
|
int memblock_add_range(struct memblock_type *type,
|
|
phys_addr_t base, phys_addr_t size,
|
|
int nid, unsigned long flags);
|
|
|
|
void __next_mem_range(u64 *idx, int nid, ulong flags,
|
|
struct memblock_type *type_a,
|
|
struct memblock_type *type_b, phys_addr_t *out_start,
|
|
phys_addr_t *out_end, int *out_nid);
|
|
|
|
void __next_mem_range_rev(u64 *idx, int nid, ulong flags,
|
|
struct memblock_type *type_a,
|
|
struct memblock_type *type_b, phys_addr_t *out_start,
|
|
phys_addr_t *out_end, int *out_nid);
|
|
|
|
void __next_reserved_mem_region(u64 *idx, phys_addr_t *out_start,
|
|
phys_addr_t *out_end);
|
|
|
|
void __memblock_free_early(phys_addr_t base, phys_addr_t size);
|
|
void __memblock_free_late(phys_addr_t base, phys_addr_t size);
|
|
void create_pgtable_mapping(phys_addr_t start, phys_addr_t end);
|
|
/**
|
|
* for_each_mem_range - iterate through memblock areas from type_a and not
|
|
* included in type_b. Or just type_a if type_b is NULL.
|
|
* @i: u64 used as loop variable
|
|
* @type_a: ptr to memblock_type to iterate
|
|
* @type_b: ptr to memblock_type which excludes from the iteration
|
|
* @nid: node selector, %NUMA_NO_NODE for all nodes
|
|
* @flags: pick from blocks based on memory attributes
|
|
* @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
|
|
* @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
|
|
* @p_nid: ptr to int for nid of the range, can be %NULL
|
|
*/
|
|
#define for_each_mem_range(i, type_a, type_b, nid, flags, \
|
|
p_start, p_end, p_nid) \
|
|
for (i = 0, __next_mem_range(&i, nid, flags, type_a, type_b, \
|
|
p_start, p_end, p_nid); \
|
|
i != (u64)ULLONG_MAX; \
|
|
__next_mem_range(&i, nid, flags, type_a, type_b, \
|
|
p_start, p_end, p_nid))
|
|
|
|
/**
|
|
* for_each_mem_range_rev - reverse iterate through memblock areas from
|
|
* type_a and not included in type_b. Or just type_a if type_b is NULL.
|
|
* @i: u64 used as loop variable
|
|
* @type_a: ptr to memblock_type to iterate
|
|
* @type_b: ptr to memblock_type which excludes from the iteration
|
|
* @nid: node selector, %NUMA_NO_NODE for all nodes
|
|
* @flags: pick from blocks based on memory attributes
|
|
* @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
|
|
* @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
|
|
* @p_nid: ptr to int for nid of the range, can be %NULL
|
|
*/
|
|
#define for_each_mem_range_rev(i, type_a, type_b, nid, flags, \
|
|
p_start, p_end, p_nid) \
|
|
for (i = (u64)ULLONG_MAX, \
|
|
__next_mem_range_rev(&i, nid, flags, type_a, type_b,\
|
|
p_start, p_end, p_nid); \
|
|
i != (u64)ULLONG_MAX; \
|
|
__next_mem_range_rev(&i, nid, flags, type_a, type_b, \
|
|
p_start, p_end, p_nid))
|
|
|
|
/**
|
|
* for_each_reserved_mem_region - iterate over all reserved memblock areas
|
|
* @i: u64 used as loop variable
|
|
* @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
|
|
* @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
|
|
*
|
|
* Walks over reserved areas of memblock. Available as soon as memblock
|
|
* is initialized.
|
|
*/
|
|
#define for_each_reserved_mem_region(i, p_start, p_end) \
|
|
for (i = 0UL, __next_reserved_mem_region(&i, p_start, p_end); \
|
|
i != (u64)ULLONG_MAX; \
|
|
__next_reserved_mem_region(&i, p_start, p_end))
|
|
|
|
static inline bool memblock_is_hotpluggable(struct memblock_region *m)
|
|
{
|
|
return m->flags & MEMBLOCK_HOTPLUG;
|
|
}
|
|
|
|
static inline bool memblock_is_mirror(struct memblock_region *m)
|
|
{
|
|
return m->flags & MEMBLOCK_MIRROR;
|
|
}
|
|
|
|
static inline bool memblock_is_nomap(struct memblock_region *m)
|
|
{
|
|
return m->flags & MEMBLOCK_NOMAP;
|
|
}
|
|
|
|
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
|
|
int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
|
|
unsigned long *end_pfn);
|
|
void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
|
|
unsigned long *out_end_pfn, int *out_nid);
|
|
|
|
/**
|
|
* for_each_mem_pfn_range - early memory pfn range iterator
|
|
* @i: an integer used as loop variable
|
|
* @nid: node selector, %MAX_NUMNODES for all nodes
|
|
* @p_start: ptr to ulong for start pfn of the range, can be %NULL
|
|
* @p_end: ptr to ulong for end pfn of the range, can be %NULL
|
|
* @p_nid: ptr to int for nid of the range, can be %NULL
|
|
*
|
|
* Walks over configured memory ranges.
|
|
*/
|
|
#define for_each_mem_pfn_range(i, nid, p_start, p_end, p_nid) \
|
|
for (i = -1, __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid); \
|
|
i >= 0; __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid))
|
|
#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
|
|
|
|
/**
|
|
* for_each_free_mem_range - iterate through free memblock areas
|
|
* @i: u64 used as loop variable
|
|
* @nid: node selector, %NUMA_NO_NODE for all nodes
|
|
* @flags: pick from blocks based on memory attributes
|
|
* @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
|
|
* @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
|
|
* @p_nid: ptr to int for nid of the range, can be %NULL
|
|
*
|
|
* Walks over free (memory && !reserved) areas of memblock. Available as
|
|
* soon as memblock is initialized.
|
|
*/
|
|
#define for_each_free_mem_range(i, nid, flags, p_start, p_end, p_nid) \
|
|
for_each_mem_range(i, &memblock.memory, &memblock.reserved, \
|
|
nid, flags, p_start, p_end, p_nid)
|
|
|
|
/**
|
|
* for_each_free_mem_range_reverse - rev-iterate through free memblock areas
|
|
* @i: u64 used as loop variable
|
|
* @nid: node selector, %NUMA_NO_NODE for all nodes
|
|
* @flags: pick from blocks based on memory attributes
|
|
* @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
|
|
* @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
|
|
* @p_nid: ptr to int for nid of the range, can be %NULL
|
|
*
|
|
* Walks over free (memory && !reserved) areas of memblock in reverse
|
|
* order. Available as soon as memblock is initialized.
|
|
*/
|
|
#define for_each_free_mem_range_reverse(i, nid, flags, p_start, p_end, \
|
|
p_nid) \
|
|
for_each_mem_range_rev(i, &memblock.memory, &memblock.reserved, \
|
|
nid, flags, p_start, p_end, p_nid)
|
|
|
|
static inline void memblock_set_region_flags(struct memblock_region *r,
|
|
unsigned long flags)
|
|
{
|
|
r->flags |= flags;
|
|
}
|
|
|
|
static inline void memblock_clear_region_flags(struct memblock_region *r,
|
|
unsigned long flags)
|
|
{
|
|
r->flags &= ~flags;
|
|
}
|
|
|
|
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
|
|
int memblock_set_node(phys_addr_t base, phys_addr_t size,
|
|
struct memblock_type *type, int nid);
|
|
|
|
static inline void memblock_set_region_node(struct memblock_region *r, int nid)
|
|
{
|
|
r->nid = nid;
|
|
}
|
|
|
|
static inline int memblock_get_region_node(const struct memblock_region *r)
|
|
{
|
|
return r->nid;
|
|
}
|
|
#else
|
|
static inline void memblock_set_region_node(struct memblock_region *r, int nid)
|
|
{
|
|
}
|
|
|
|
static inline int memblock_get_region_node(const struct memblock_region *r)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
|
|
|
|
phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid);
|
|
phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid);
|
|
|
|
phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align);
|
|
|
|
/*
|
|
* Set the allocation direction to bottom-up or top-down.
|
|
*/
|
|
static inline void __init memblock_set_bottom_up(bool enable)
|
|
{
|
|
memblock.bottom_up = enable;
|
|
}
|
|
|
|
/*
|
|
* Check if the allocation direction is bottom-up or not.
|
|
* if this is true, that said, memblock will allocate memory
|
|
* in bottom-up direction.
|
|
*/
|
|
static inline bool memblock_bottom_up(void)
|
|
{
|
|
return memblock.bottom_up;
|
|
}
|
|
|
|
/* Flags for memblock_alloc_base() amd __memblock_alloc_base() */
|
|
#define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0)
|
|
#define MEMBLOCK_ALLOC_ACCESSIBLE 0
|
|
#define MEMBLOCK_ALLOC_KASAN 1
|
|
|
|
phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align,
|
|
phys_addr_t start, phys_addr_t end,
|
|
ulong flags);
|
|
phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align,
|
|
phys_addr_t max_addr);
|
|
phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align,
|
|
phys_addr_t max_addr);
|
|
phys_addr_t memblock_phys_mem_size(void);
|
|
phys_addr_t memblock_reserved_size(void);
|
|
phys_addr_t memblock_mem_size(unsigned long limit_pfn);
|
|
phys_addr_t memblock_start_of_DRAM(void);
|
|
phys_addr_t memblock_end_of_DRAM(void);
|
|
phys_addr_t memblock_max_addr(phys_addr_t limit);
|
|
void memblock_enforce_memory_limit(phys_addr_t memory_limit);
|
|
void memblock_cap_memory_range(phys_addr_t base, phys_addr_t size);
|
|
void memblock_mem_limit_remove_map(phys_addr_t limit);
|
|
bool memblock_is_memory(phys_addr_t addr);
|
|
int memblock_is_map_memory(phys_addr_t addr);
|
|
int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
|
|
bool memblock_is_reserved(phys_addr_t addr);
|
|
bool memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
|
|
bool memblock_overlaps_memory(phys_addr_t base, phys_addr_t size);
|
|
|
|
extern void __memblock_dump_all(void);
|
|
|
|
static inline void memblock_dump_all(void)
|
|
{
|
|
if (memblock_debug)
|
|
__memblock_dump_all();
|
|
}
|
|
|
|
/**
|
|
* memblock_set_current_limit - Set the current allocation limit to allow
|
|
* limiting allocations to what is currently
|
|
* accessible during boot
|
|
* @limit: New limit value (physical address)
|
|
*/
|
|
void memblock_set_current_limit(phys_addr_t limit);
|
|
|
|
|
|
phys_addr_t memblock_get_current_limit(void);
|
|
|
|
/*
|
|
* pfn conversion functions
|
|
*
|
|
* While the memory MEMBLOCKs should always be page aligned, the reserved
|
|
* MEMBLOCKs may not be. This accessor attempt to provide a very clear
|
|
* idea of what they return for such non aligned MEMBLOCKs.
|
|
*/
|
|
|
|
/**
|
|
* memblock_region_memory_base_pfn - Return the lowest pfn intersecting with the memory region
|
|
* @reg: memblock_region structure
|
|
*/
|
|
static inline unsigned long memblock_region_memory_base_pfn(const struct memblock_region *reg)
|
|
{
|
|
return PFN_UP(reg->base);
|
|
}
|
|
|
|
/**
|
|
* memblock_region_memory_end_pfn - Return the end_pfn this region
|
|
* @reg: memblock_region structure
|
|
*/
|
|
static inline unsigned long memblock_region_memory_end_pfn(const struct memblock_region *reg)
|
|
{
|
|
return PFN_DOWN(reg->base + reg->size);
|
|
}
|
|
|
|
/**
|
|
* memblock_region_reserved_base_pfn - Return the lowest pfn intersecting with the reserved region
|
|
* @reg: memblock_region structure
|
|
*/
|
|
static inline unsigned long memblock_region_reserved_base_pfn(const struct memblock_region *reg)
|
|
{
|
|
return PFN_DOWN(reg->base);
|
|
}
|
|
|
|
/**
|
|
* memblock_region_reserved_end_pfn - Return the end_pfn this region
|
|
* @reg: memblock_region structure
|
|
*/
|
|
static inline unsigned long memblock_region_reserved_end_pfn(const struct memblock_region *reg)
|
|
{
|
|
return PFN_UP(reg->base + reg->size);
|
|
}
|
|
|
|
#define for_each_memblock(memblock_type, region) \
|
|
for (region = memblock.memblock_type.regions; \
|
|
region < (memblock.memblock_type.regions + memblock.memblock_type.cnt); \
|
|
region++)
|
|
|
|
#define for_each_memblock_type(memblock_type, rgn) \
|
|
for (idx = 0, rgn = &memblock_type->regions[0]; \
|
|
idx < memblock_type->cnt; \
|
|
idx++, rgn = &memblock_type->regions[idx])
|
|
#define for_each_memblock_rev(memblock_type, region) \
|
|
for (region = memblock.memblock_type.regions + \
|
|
memblock.memblock_type.cnt - 1; \
|
|
region >= memblock.memblock_type.regions; \
|
|
region--)
|
|
|
|
#ifdef CONFIG_MEMTEST
|
|
extern void early_memtest(phys_addr_t start, phys_addr_t end);
|
|
#else
|
|
static inline void early_memtest(phys_addr_t start, phys_addr_t end)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
extern unsigned long memblock_reserved_memory_within(phys_addr_t start_addr,
|
|
phys_addr_t end_addr);
|
|
#else
|
|
static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline unsigned long memblock_reserved_memory_within(phys_addr_t start_addr,
|
|
phys_addr_t end_addr)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
#endif /* CONFIG_HAVE_MEMBLOCK */
|
|
|
|
#endif /* __KERNEL__ */
|
|
|
|
#endif /* _LINUX_MEMBLOCK_H */
|