1. 25 1月, 2020 1 次提交
  2. 20 1月, 2020 4 次提交
    • A
      x86/boot/compressed: Relax sed symbol type regex for LLVM ld.lld · bc310baf
      Ard Biesheuvel 提交于
      The final build stage of the x86 kernel captures some symbol
      addresses from the decompressor binary and copies them into zoffset.h.
      It uses sed with a regular expression that matches the address, symbol
      type and symbol name, and mangles the captured addresses and the names
      of symbols of interest into #define directives that are added to
      zoffset.h
      
      The symbol type is indicated by a single letter, which we match
      strictly: only letters in the set 'ABCDGRSTVW' are matched, even
      though the actual symbol type is relevant and therefore ignored.
      
      Commit bc7c9d62 ("efi/libstub/x86: Force 'hidden' visibility for
      extern declarations") made a change to the way external symbol
      references are classified, resulting in 'startup_32' now being
      emitted as a hidden symbol. This prevents the use of GOT entries to
      refer to this symbol via its absolute address, which recent toolchains
      (including Clang based ones) already avoid by default, making this
      change a no-op in the majority of cases.
      
      However, as it turns out, the LLVM linker classifies such hidden
      symbols as symbols with static linkage in fully linked ELF binaries,
      causing tools such as NM to output a lowercase 't' rather than an upper
      case 'T' for the type of such symbols. Since our sed expression only
      matches upper case letters for the symbol type, the line describing
      startup_32 is disregarded, resulting in a build error like the following
      
        arch/x86/boot/header.S:568:18: error: symbol 'ZO_startup_32' can not be
                                              undefined in a subtraction expression
        init_size: .long (0x00000000008fd000 - ZO_startup_32 +
                          (((0x0000000001f6361c + ((0x0000000001f6361c >> 8) + 65536)
                           - 0x00000000008c32e5) + 4095) & ~4095)) # kernel initialization size
      
      Given that we are only interested in the value of the symbol, let's match
      any character in the set 'a-zA-Z' instead.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Tested-by: NNathan Chancellor <natechancellor@gmail.com>
      bc310baf
    • A
      efi/libstub/x86: Fix unused-variable warning · bd1d7093
      Arnd Bergmann 提交于
      The only users of these got removed, so they also need to be
      removed to avoid warnings:
      
        arch/x86/boot/compressed/eboot.c: In function 'setup_efi_pci':
        arch/x86/boot/compressed/eboot.c:117:16: error: unused variable 'nr_pci' [-Werror=unused-variable]
          unsigned long nr_pci;
                        ^~~~~~
        arch/x86/boot/compressed/eboot.c: In function 'setup_uga':
        arch/x86/boot/compressed/eboot.c:244:16: error: unused variable 'nr_ugas' [-Werror=unused-variable]
          unsigned long nr_ugas;
                        ^~~~~~~
      
      Fixes: 2732ea0d ("efi/libstub: Use a helper to iterate over a EFI handle array")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/20200113172245.27925-4-ardb@kernel.org
      bd1d7093
    • A
      efi/libstub/x86: Use mandatory 16-byte stack alignment in mixed mode · ac3c76cc
      Ard Biesheuvel 提交于
      Reduce the stack frame of the EFI stub's mixed mode thunk routine by
      8 bytes, by moving the GDT and return addresses to EBP and EBX, which
      we need to preserve anyway, since their top halves will be cleared by
      the call into 32-bit firmware code. Doing so results in the UEFI code
      being entered with a 16 byte aligned stack, as mandated by the UEFI
      spec, fixing the last occurrence in the 64-bit kernel where we violate
      this requirement.
      
      Also, move the saved GDT from a global variable to an unused part of the
      stack frame, and touch up some other parts of the code.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/20200113172245.27925-3-ardb@kernel.org
      ac3c76cc
    • A
      efi/libstub/x86: Use const attribute for efi_is_64bit() · 796eb8d2
      Ard Biesheuvel 提交于
      Reshuffle the x86 stub code a bit so that we can tag the efi_is_64bit()
      function with the 'const' attribute, which permits the compiler to
      optimize away any redundant calls. Since we have two different entry
      points for 32 and 64 bit firmware in the startup code, this also
      simplifies the C code since we'll enter it with the efi_is64 variable
      already set.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/20200113172245.27925-2-ardb@kernel.org
      796eb8d2
  3. 11 1月, 2020 4 次提交
    • A
      efi/x86: Allow translating 64-bit arguments for mixed mode calls · ea7d87f9
      Arvind Sankar 提交于
      Introduce the ability to define macros to perform argument translation
      for the calls that need it, and define them for the boot services that
      we currently use.
      
      When calling 32-bit firmware methods in mixed mode, all output
      parameters that are 32-bit according to the firmware, but 64-bit in the
      kernel (ie OUT UINTN * or OUT VOID **) must be initialized in the
      kernel, or the upper 32 bits may contain garbage. Define macros that
      zero out the upper 32 bits of the output before invoking the firmware
      method.
      
      When a 32-bit EFI call takes 64-bit arguments, the mixed-mode call must
      push the two 32-bit halves as separate arguments onto the stack. This
      can be achieved by splitting the argument into its two halves when
      calling the assembler thunk. Define a macro to do this for the
      free_pages boot service.
      Signed-off-by: NArvind Sankar <nivedita@alum.mit.edu>
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Matthew Garrett <mjg59@google.com>
      Cc: linux-efi@vger.kernel.org
      Link: https://lkml.kernel.org/r/20200103113953.9571-17-ardb@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      ea7d87f9
    • A
      efi/x86: Check number of arguments to variadic functions · 14b864f4
      Arvind Sankar 提交于
      On x86 we need to thunk through assembler stubs to call the EFI services
      for mixed mode, and for runtime services in 64-bit mode. The assembler
      stubs have limits on how many arguments it handles. Introduce a few
      macros to check that we do not try to pass too many arguments to the
      stubs.
      Signed-off-by: NArvind Sankar <nivedita@alum.mit.edu>
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Matthew Garrett <mjg59@google.com>
      Cc: linux-efi@vger.kernel.org
      Link: https://lkml.kernel.org/r/20200103113953.9571-16-ardb@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      14b864f4
    • A
      efi/libstub/x86: Force 'hidden' visibility for extern declarations · bc7c9d62
      Ard Biesheuvel 提交于
      Commit c3710de5 ("efi/libstub/x86: Drop __efi_early() export and
      efi_config struct") introduced a reference from C code in eboot.c to
      the startup_32 symbol defined in the .S startup code. This results in
      a GOT based reference to startup_32, and since GOT entries carry
      absolute addresses, they need to be fixed up before they can be used.
      
      On modern toolchains (binutils 2.26 or later), this reference is
      relaxed into a R_386_GOTOFF relocation (or the analogous X86_64 one)
      which never uses the absolute address in the entry, and so we get
      away with not fixing up the GOT table before calling the EFI entry
      point. However, GCC 4.6 combined with a binutils of the era (2.24)
      will produce a true GOT indirected reference, resulting in a wrong
      value to be returned for the address of startup_32() if the boot
      code is not running at the address it was linked at.
      
      Fortunately, we can easily override this behavior, and force GCC to
      emit the GOTOFF relocations explicitly, by setting the visibility
      pragma 'hidden'.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Arvind Sankar <nivedita@alum.mit.edu>
      Cc: Matthew Garrett <mjg59@google.com>
      Cc: linux-efi@vger.kernel.org
      Link: https://lkml.kernel.org/r/20200103113953.9571-3-ardb@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      bc7c9d62
    • A
      efi/libstub: Fix boot argument handling in mixed mode entry code · 12dc9e15
      Ard Biesheuvel 提交于
      The mixed mode refactor actually broke mixed mode by failing to
      pass the bootparam structure to startup_32(). This went unnoticed
      because it apparently has a high tolerance for being passed random
      junk, and still boots fine in some cases. So let's fix this by
      populating %esi as required when entering via efi32_stub_entry,
      and while at it, preserve the arguments themselves instead of their
      address in memory (via the stack pointer) since that memory could
      be clobbered before we get to it.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arvind Sankar <nivedita@alum.mit.edu>
      Cc: Matthew Garrett <mjg59@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: https://lkml.kernel.org/r/20200103113953.9571-2-ardb@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      12dc9e15
  4. 25 12月, 2019 18 次提交
  5. 14 12月, 2019 1 次提交
  6. 12 11月, 2019 3 次提交
    • D
      x86/boot: Introduce setup_indirect · b3c72fc9
      Daniel Kiper 提交于
      The setup_data is a bit awkward to use for extremely large data objects,
      both because the setup_data header has to be adjacent to the data object
      and because it has a 32-bit length field. However, it is important that
      intermediate stages of the boot process have a way to identify which
      chunks of memory are occupied by kernel data. Thus introduce an uniform
      way to specify such indirect data as setup_indirect struct and
      SETUP_INDIRECT type.
      
      And finally bump setup_header version in arch/x86/boot/header.S.
      Suggested-by: NH. Peter Anvin (Intel) <hpa@zytor.com>
      Signed-off-by: NDaniel Kiper <daniel.kiper@oracle.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NRoss Philipson <ross.philipson@oracle.com>
      Reviewed-by: NH. Peter Anvin (Intel) <hpa@zytor.com>
      Acked-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: ard.biesheuvel@linaro.org
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: dave.hansen@linux.intel.com
      Cc: eric.snowberg@oracle.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: kanth.ghatraju@oracle.com
      Cc: linux-doc@vger.kernel.org
      Cc: linux-efi <linux-efi@vger.kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: rdunlap@infradead.org
      Cc: ross.philipson@oracle.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Cc: xen-devel@lists.xenproject.org
      Link: https://lkml.kernel.org/r/20191112134640.16035-4-daniel.kiper@oracle.com
      b3c72fc9
    • D
      x86/boot: Introduce kernel_info.setup_type_max · 00cd1c15
      Daniel Kiper 提交于
      This field contains maximal allowed type for setup_data.
      
      Do not bump setup_header version in arch/x86/boot/header.S because it
      will be followed by additional changes coming into the Linux/x86 boot
      protocol.
      Suggested-by: NH. Peter Anvin (Intel) <hpa@zytor.com>
      Signed-off-by: NDaniel Kiper <daniel.kiper@oracle.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: NRoss Philipson <ross.philipson@oracle.com>
      Reviewed-by: NH. Peter Anvin (Intel) <hpa@zytor.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: ard.biesheuvel@linaro.org
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: dave.hansen@linux.intel.com
      Cc: eric.snowberg@oracle.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: kanth.ghatraju@oracle.com
      Cc: linux-doc@vger.kernel.org
      Cc: linux-efi <linux-efi@vger.kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: rdunlap@infradead.org
      Cc: ross.philipson@oracle.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Cc: xen-devel@lists.xenproject.org
      Link: https://lkml.kernel.org/r/20191112134640.16035-3-daniel.kiper@oracle.com
      00cd1c15
    • D
      x86/boot: Introduce kernel_info · 2c33c27f
      Daniel Kiper 提交于
      The relationships between the headers are analogous to the various data
      sections:
      
        setup_header = .data
        boot_params/setup_data = .bss
      
      What is missing from the above list? That's right:
      
        kernel_info = .rodata
      
      We have been (ab)using .data for things that could go into .rodata or .bss for
      a long time, for lack of alternatives and -- especially early on -- inertia.
      Also, the BIOS stub is responsible for creating boot_params, so it isn't
      available to a BIOS-based loader (setup_data is, though).
      
      setup_header is permanently limited to 144 bytes due to the reach of the
      2-byte jump field, which doubles as a length field for the structure, combined
      with the size of the "hole" in struct boot_params that a protected-mode loader
      or the BIOS stub has to copy it into. It is currently 119 bytes long, which
      leaves us with 25 very precious bytes. This isn't something that can be fixed
      without revising the boot protocol entirely, breaking backwards compatibility.
      
      boot_params proper is limited to 4096 bytes, but can be arbitrarily extended
      by adding setup_data entries. It cannot be used to communicate properties of
      the kernel image, because it is .bss and has no image-provided content.
      
      kernel_info solves this by providing an extensible place for information about
      the kernel image. It is readonly, because the kernel cannot rely on a
      bootloader copying its contents anywhere, but that is OK; if it becomes
      necessary it can still contain data items that an enabled bootloader would be
      expected to copy into a setup_data chunk.
      
      Do not bump setup_header version in arch/x86/boot/header.S because it
      will be followed by additional changes coming into the Linux/x86 boot
      protocol.
      Suggested-by: NH. Peter Anvin (Intel) <hpa@zytor.com>
      Signed-off-by: NDaniel Kiper <daniel.kiper@oracle.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: NRoss Philipson <ross.philipson@oracle.com>
      Reviewed-by: NH. Peter Anvin (Intel) <hpa@zytor.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: ard.biesheuvel@linaro.org
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: dave.hansen@linux.intel.com
      Cc: eric.snowberg@oracle.com
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: kanth.ghatraju@oracle.com
      Cc: linux-doc@vger.kernel.org
      Cc: linux-efi <linux-efi@vger.kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: rdunlap@infradead.org
      Cc: ross.philipson@oracle.com
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Cc: xen-devel@lists.xenproject.org
      Link: https://lkml.kernel.org/r/20191112134640.16035-2-daniel.kiper@oracle.com
      2c33c27f
  7. 07 11月, 2019 3 次提交
    • D
      x86/efi: Add efi_fake_mem support for EFI_MEMORY_SP · 199c8471
      Dan Williams 提交于
      Given that EFI_MEMORY_SP is platform BIOS policy decision for marking
      memory ranges as "reserved for a specific purpose" there will inevitably
      be scenarios where the BIOS omits the attribute in situations where it
      is desired. Unlike other attributes if the OS wants to reserve this
      memory from the kernel the reservation needs to happen early in init. So
      early, in fact, that it needs to happen before e820__memblock_setup()
      which is a pre-requisite for efi_fake_memmap() that wants to allocate
      memory for the updated table.
      
      Introduce an x86 specific efi_fake_memmap_early() that can search for
      attempts to set EFI_MEMORY_SP via efi_fake_mem and update the e820 table
      accordingly.
      
      The KASLR code that scans the command line looking for user-directed
      memory reservations also needs to be updated to consider
      "efi_fake_mem=nn@ss:0x40000" requests.
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: NDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      199c8471
    • D
      x86/efi: EFI soft reservation to E820 enumeration · 262b45ae
      Dan Williams 提交于
      UEFI 2.8 defines an EFI_MEMORY_SP attribute bit to augment the
      interpretation of the EFI Memory Types as "reserved for a specific
      purpose".
      
      The proposed Linux behavior for specific purpose memory is that it is
      reserved for direct-access (device-dax) by default and not available for
      any kernel usage, not even as an OOM fallback.  Later, through udev
      scripts or another init mechanism, these device-dax claimed ranges can
      be reconfigured and hot-added to the available System-RAM with a unique
      node identifier. This device-dax management scheme implements "soft" in
      the "soft reserved" designation by allowing some or all of the
      reservation to be recovered as typical memory. This policy can be
      disabled at compile-time with CONFIG_EFI_SOFT_RESERVE=n, or runtime with
      efi=nosoftreserve.
      
      This patch introduces 2 new concepts at once given the entanglement
      between early boot enumeration relative to memory that can optionally be
      reserved from the kernel page allocator by default. The new concepts
      are:
      
      - E820_TYPE_SOFT_RESERVED: Upon detecting the EFI_MEMORY_SP
        attribute on EFI_CONVENTIONAL memory, update the E820 map with this
        new type. Only perform this classification if the
        CONFIG_EFI_SOFT_RESERVE=y policy is enabled, otherwise treat it as
        typical ram.
      
      - IORES_DESC_SOFT_RESERVED: Add a new I/O resource descriptor for
        a device driver to search iomem resources for application specific
        memory. Teach the iomem code to identify such ranges as "Soft Reserved".
      
      Note that the comment for do_add_efi_memmap() needed refreshing since it
      seemed to imply that the efi map might overflow the e820 table, but that
      is not an issue as of commit 7b6e4ba3 "x86/boot/e820: Clean up the
      E820_X_MAX definition" that removed the 128 entry limit for
      e820__range_add().
      
      A follow-on change integrates parsing of the ACPI HMAT to identify the
      node and sub-range boundaries of EFI_MEMORY_SP designated memory. For
      now, just identify and reserve memory of this type.
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reported-by: Nkbuild test robot <lkp@intel.com>
      Reviewed-by: NDave Hansen <dave.hansen@linux.intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      262b45ae
    • D
      x86: efi/random: Invoke EFI_RNG_PROTOCOL to seed the UEFI RNG table · 0d959814
      Dominik Brodowski 提交于
      Invoke the EFI_RNG_PROTOCOL protocol in the context of the x86 EFI stub,
      same as is done on arm/arm64 since commit 568bc4e8 ("efi/arm*/libstub:
      Invoke EFI_RNG_PROTOCOL to seed the UEFI RNG table"). Within the stub,
      a Linux-specific RNG seed UEFI config table will be seeded. The EFI routines
      in the core kernel will pick that up later, yet still early during boot,
      to seed the kernel entropy pool. If CONFIG_RANDOM_TRUST_BOOTLOADER, entropy
      is credited for this seed.
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      0d959814
  8. 31 10月, 2019 1 次提交
    • K
      x86, efi: Never relocate kernel below lowest acceptable address · 220dd769
      Kairui Song 提交于
      Currently, kernel fails to boot on some HyperV VMs when using EFI.
      And it's a potential issue on all x86 platforms.
      
      It's caused by broken kernel relocation on EFI systems, when below three
      conditions are met:
      
      1. Kernel image is not loaded to the default address (LOAD_PHYSICAL_ADDR)
         by the loader.
      2. There isn't enough room to contain the kernel, starting from the
         default load address (eg. something else occupied part the region).
      3. In the memmap provided by EFI firmware, there is a memory region
         starts below LOAD_PHYSICAL_ADDR, and suitable for containing the
         kernel.
      
      EFI stub will perform a kernel relocation when condition 1 is met. But
      due to condition 2, EFI stub can't relocate kernel to the preferred
      address, so it fallback to ask EFI firmware to alloc lowest usable memory
      region, got the low region mentioned in condition 3, and relocated
      kernel there.
      
      It's incorrect to relocate the kernel below LOAD_PHYSICAL_ADDR. This
      is the lowest acceptable kernel relocation address.
      
      The first thing goes wrong is in arch/x86/boot/compressed/head_64.S.
      Kernel decompression will force use LOAD_PHYSICAL_ADDR as the output
      address if kernel is located below it. Then the relocation before
      decompression, which move kernel to the end of the decompression buffer,
      will overwrite other memory region, as there is no enough memory there.
      
      To fix it, just don't let EFI stub relocate the kernel to any address
      lower than lowest acceptable address.
      
      [ ardb: introduce efi_low_alloc_above() to reduce the scope of the change ]
      Signed-off-by: NKairui Song <kasong@redhat.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Link: https://lkml.kernel.org/r/20191029173755.27149-6-ardb@kernel.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      220dd769
  9. 18 10月, 2019 5 次提交
    • Z
      x86/boot/acpi: Move get_cmdline_acpi_rsdp() under #ifdef guard · 228d1200
      Zhenzhong Duan 提交于
      When building with "EXTRA_CFLAGS=-Wall" gcc warns:
      
      arch/x86/boot/compressed/acpi.c:29:30: warning: get_cmdline_acpi_rsdp defined but not used [-Wunused-function]
      
      get_cmdline_acpi_rsdp() is only used when CONFIG_RANDOMIZE_BASE and
      CONFIG_MEMORY_HOTREMOVE are both enabled, so any build where one of these
      config options is disabled has this issue.
      
      Move the function under the same ifdef guard as the call site.
      
      [ tglx: Add context to the changelog so it becomes useful ]
      
      Fixes: 41fa1ee9 ("acpi: Ignore acpi_rsdp kernel param when the kernel has been locked down")
      Signed-off-by: NZhenzhong Duan <zhenzhong.duan@oracle.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/1569719633-32164-1-git-send-email-zhenzhong.duan@oracle.com
      
      228d1200
    • J
      x86/asm/32: Change all ENTRY+ENDPROC to SYM_FUNC_* · 6d685e53
      Jiri Slaby 提交于
      These are all functions which are invoked from elsewhere, so annotate
      them as global using the new SYM_FUNC_START and their ENDPROC's by
      SYM_FUNC_END.
      
      Now, ENTRY/ENDPROC can be forced to be undefined on X86, so do so.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Allison Randal <allison@lohutok.net>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Andy Shevchenko <andy@infradead.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Bill Metzenthen <billm@melbpc.org.au>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-crypto@vger.kernel.org
      Cc: linux-efi <linux-efi@vger.kernel.org>
      Cc: linux-efi@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: platform-driver-x86@vger.kernel.org
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20191011115108.12392-28-jslaby@suse.cz
      6d685e53
    • J
      x86/asm: Change all ENTRY+ENDPROC to SYM_FUNC_* · 6dcc5627
      Jiri Slaby 提交于
      These are all functions which are invoked from elsewhere, so annotate
      them as global using the new SYM_FUNC_START and their ENDPROC's by
      SYM_FUNC_END.
      
      Make sure ENTRY/ENDPROC is not defined on X86_64, given these were the
      last users.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [hibernate]
      Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> [xen bits]
      Acked-by: Herbert Xu <herbert@gondor.apana.org.au> [crypto]
      Cc: Allison Randal <allison@lohutok.net>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Andy Shevchenko <andy@infradead.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Armijn Hemel <armijn@tjaldur.nl>
      Cc: Cao jin <caoj.fnst@cn.fujitsu.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Enrico Weigelt <info@metux.net>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jim Mattson <jmattson@google.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: kvm ML <kvm@vger.kernel.org>
      Cc: Len Brown <len.brown@intel.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-crypto@vger.kernel.org
      Cc: linux-efi <linux-efi@vger.kernel.org>
      Cc: linux-efi@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: platform-driver-x86@vger.kernel.org
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
      Cc: Wanpeng Li <wanpengli@tencent.com>
      Cc: Wei Huang <wei@redhat.com>
      Cc: x86-ml <x86@kernel.org>
      Cc: xen-devel@lists.xenproject.org
      Cc: Xiaoyao Li <xiaoyao.li@linux.intel.com>
      Link: https://lkml.kernel.org/r/20191011115108.12392-25-jslaby@suse.cz
      6dcc5627
    • J
      x86/asm/64: Add ENDs to some functions and relabel with SYM_CODE_* · 4aec216b
      Jiri Slaby 提交于
      All these are functions which are invoked from elsewhere but they are
      not typical C functions. So annotate them using the new SYM_CODE_START.
      All these were not balanced with any END, so mark their ends by
      SYM_CODE_END appropriately too.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> [xen bits]
      Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [power mgmt]
      Cc: Andy Shevchenko <andy@infradead.org>
      Cc: Cao jin <caoj.fnst@cn.fujitsu.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Pingfan Liu <kernelfans@gmail.com>
      Cc: platform-driver-x86@vger.kernel.org
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Wei Huang <wei@redhat.com>
      Cc: x86-ml <x86@kernel.org>
      Cc: xen-devel@lists.xenproject.org
      Cc: Xiaoyao Li <xiaoyao.li@linux.intel.com>
      Link: https://lkml.kernel.org/r/20191011115108.12392-23-jslaby@suse.cz
      4aec216b
    • J
      x86/asm: Make some functions local · ef1e0315
      Jiri Slaby 提交于
      There are a couple of assembly functions which are invoked only locally
      in the file they are defined. In C, they are marked "static". In
      assembly, annotate them using SYM_{FUNC,CODE}_START_LOCAL (and switch
      their ENDPROC to SYM_{FUNC,CODE}_END too). Whether FUNC or CODE is used,
      depends on whether ENDPROC or END was used for a particular function
      before.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Andy Shevchenko <andy@infradead.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-efi <linux-efi@vger.kernel.org>
      Cc: linux-efi@vger.kernel.org
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: platform-driver-x86@vger.kernel.org
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Cc: xen-devel@lists.xenproject.org
      Link: https://lkml.kernel.org/r/20191011115108.12392-21-jslaby@suse.cz
      ef1e0315