01 Feb, 2020

1 commit

  • %pa takes into consideration the special types such as resource_size_t.
    Use this specifier %instead of explicit casting.

    Link: http://lkml.kernel.org/r/20191209165413.56263-1-andriy.shevchenko@linux.intel.com
    Signed-off-by: Andy Shevchenko
    Reviewed-by: David Hildenbrand
    Reviewed-by: Andrew Morton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     

11 Dec, 2017

1 commit

  • earlyprintk=efi,keep does not work any more with a warning
    in mm/early_ioremap.c: WARN_ON(system_state != SYSTEM_BOOTING):
    Boot just hangs because of the earlyprintk within the earlyprintk
    implementation code itself.

    This is caused by a new introduced middle state in:

    69a78ff226fe ("init: Introduce SYSTEM_SCHEDULING state")

    early_ioremap() is fine in both SYSTEM_BOOTING and SYSTEM_SCHEDULING
    states, original condition should be updated accordingly.

    Signed-off-by: Dave Young
    Acked-by: Thomas Gleixner
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: bp@suse.de
    Cc: linux-efi@vger.kernel.org
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/20171209041610.GA3249@dhcp-128-65.nay.redhat.com
    Signed-off-by: Ingo Molnar

    Dave Young
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

18 Jul, 2017

2 commits

  • Boot data (such as EFI related data) is not encrypted when the system is
    booted because UEFI/BIOS does not run with SME active. In order to access
    this data properly it needs to be mapped decrypted.

    Update early_memremap() to provide an arch specific routine to modify the
    pagetable protection attributes before they are applied to the new
    mapping. This is used to remove the encryption mask for boot related data.

    Update memremap() to provide an arch specific routine to determine if RAM
    remapping is allowed. RAM remapping will cause an encrypted mapping to be
    generated. By preventing RAM remapping, ioremap_cache() will be used
    instead, which will provide a decrypted mapping of the boot related data.

    Signed-off-by: Tom Lendacky
    Reviewed-by: Thomas Gleixner
    Reviewed-by: Matt Fleming
    Reviewed-by: Borislav Petkov
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Brijesh Singh
    Cc: Dave Young
    Cc: Dmitry Vyukov
    Cc: Jonathan Corbet
    Cc: Konrad Rzeszutek Wilk
    Cc: Larry Woodman
    Cc: Linus Torvalds
    Cc: Michael S. Tsirkin
    Cc: Paolo Bonzini
    Cc: Peter Zijlstra
    Cc: Radim Krčmář
    Cc: Rik van Riel
    Cc: Toshimitsu Kani
    Cc: kasan-dev@googlegroups.com
    Cc: kvm@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-doc@vger.kernel.org
    Cc: linux-efi@vger.kernel.org
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/81fb6b4117a5df6b9f2eda342f81bbef4b23d2e5.1500319216.git.thomas.lendacky@amd.com
    Signed-off-by: Ingo Molnar

    Tom Lendacky
     
  • Add early_memremap() support to be able to specify encrypted and
    decrypted mappings with and without write-protection. The use of
    write-protection is necessary when encrypting data "in place". The
    write-protect attribute is considered cacheable for loads, but not
    stores. This implies that the hardware will never give the core a
    dirty line with this memtype.

    Signed-off-by: Tom Lendacky
    Reviewed-by: Thomas Gleixner
    Reviewed-by: Borislav Petkov
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Brijesh Singh
    Cc: Dave Young
    Cc: Dmitry Vyukov
    Cc: Jonathan Corbet
    Cc: Konrad Rzeszutek Wilk
    Cc: Larry Woodman
    Cc: Linus Torvalds
    Cc: Matt Fleming
    Cc: Michael S. Tsirkin
    Cc: Paolo Bonzini
    Cc: Peter Zijlstra
    Cc: Radim Krčmář
    Cc: Rik van Riel
    Cc: Toshimitsu Kani
    Cc: kasan-dev@googlegroups.com
    Cc: kvm@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-doc@vger.kernel.org
    Cc: linux-efi@vger.kernel.org
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/479b5832c30fae3efa7932e48f81794e86397229.1500319216.git.thomas.lendacky@amd.com
    Signed-off-by: Ingo Molnar

    Tom Lendacky
     

06 Nov, 2015

1 commit


12 Sep, 2015

1 commit

  • Commit 6b0f68e32ea8 ("mm: add utility for early copy from unmapped ram")
    introduces a function copy_from_early_mem() into mm/early_ioremap.c
    which itself calls early_memremap()/early_memunmap(). However, since
    early_memunmap() has not been declared yet at this point in the .c file,
    nor by any explicitly included header files, we are depending on a
    transitive include of asm/early_ioremap.h to declare it, which is
    fragile.

    So instead, include this header explicitly.

    Signed-off-by: Ard Biesheuvel
    Acked-by: Mark Salter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ard Biesheuvel
     

09 Sep, 2015

2 commits

  • Merge second patch-bomb from Andrew Morton:
    "Almost all of the rest of MM. There was an unusually large amount of
    MM material this time"

    * emailed patches from Andrew Morton : (141 commits)
    zpool: remove no-op module init/exit
    mm: zbud: constify the zbud_ops
    mm: zpool: constify the zpool_ops
    mm: swap: zswap: maybe_preload & refactoring
    zram: unify error reporting
    zsmalloc: remove null check from destroy_handle_cache()
    zsmalloc: do not take class lock in zs_shrinker_count()
    zsmalloc: use class->pages_per_zspage
    zsmalloc: consider ZS_ALMOST_FULL as migrate source
    zsmalloc: partial page ordering within a fullness_list
    zsmalloc: use shrinker to trigger auto-compaction
    zsmalloc: account the number of compacted pages
    zsmalloc/zram: introduce zs_pool_stats api
    zsmalloc: cosmetic compaction code adjustments
    zsmalloc: introduce zs_can_compact() function
    zsmalloc: always keep per-class stats
    zsmalloc: drop unused variable `nr_to_migrate'
    mm/memblock.c: fix comment in __next_mem_range()
    mm/page_alloc.c: fix type information of memoryless node
    memory-hotplug: fix comments in zone_spanned_pages_in_node() and zone_spanned_pages_in_node()
    ...

    Linus Torvalds
     
  • When booting an arm64 kernel w/initrd using UEFI/grub, use of mem= will
    likely cut off part or all of the initrd. This leaves it outside the
    kernel linear map which leads to failure when unpacking. The x86 code
    has a similar need to relocate an initrd outside of mapped memory in
    some cases.

    The current x86 code uses early_memremap() to copy the original initrd
    from unmapped to mapped RAM. This patchset creates a generic
    copy_from_early_mem() utility based on that x86 code and has arm64 and
    x86 share it in their respective initrd relocation code.

    This patch (of 3):

    In some early boot circumstances, it may be necessary to copy from RAM
    outside the kernel linear mapping to mapped RAM. The need to relocate
    an initrd is one example in the x86 code. This patch creates a helper
    function based on current x86 code.

    Signed-off-by: Mark Salter
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Arnd Bergmann
    Cc: Ard Biesheuvel
    Cc: Mark Rutland
    Cc: Russell King
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Yinghai Lu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Salter
     

20 Aug, 2015

1 commit

  • During early boot as Xen pv domain the kernel needs to map some page
    tables supplied by the hypervisor read only. This is needed to be
    able to relocate some data structures conflicting with the physical
    memory map especially on systems with huge RAM (above 512GB).

    Provide the function early_memremap_ro() to provide this read only
    mapping.

    Signed-off-by: Juergen Gross
    Acked-by: Konrad Rzeszutek Wilk
    Acked-by: Vlastimil Babka
    Signed-off-by: David Vrabel

    Juergen Gross
     

08 Apr, 2014

1 commit

  • This patch creates a generic implementation of early_ioremap() support
    based on the existing x86 implementation. early_ioremp() is useful for
    early boot code which needs to temporarily map I/O or memory regions
    before normal mapping functions such as ioremap() are available.

    Some architectures have optional MMU. In the no-MMU case, the remap
    functions simply return the passed in physical address and the unmap
    functions do nothing.

    Signed-off-by: Mark Salter
    Acked-by: Catalin Marinas
    Acked-by: H. Peter Anvin
    Cc: Borislav Petkov
    Cc: Dave Young
    Cc: Will Deacon
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Salter