Commit graph

3635 commits

Author SHA1 Message Date
Markus Elfring
3fe40a6e2d firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()
[ Upstream commit 1315848f1f ]

The kfree() function was called in one case by
the get_filename() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.

Thus return directly after a call of the function “kzalloc” failed
at the beginning.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:09:59 +02:00
Ard Biesheuvel
70a2425a13 x86/efistub: Remap kernel text read-only before dropping NX attribute
commit 9c55461040 upstream.

Currently, the EFI stub invokes the EFI memory attributes protocol to
strip any NX restrictions from the entire loaded kernel, resulting in
all code and data being mapped read-write-execute.

The point of the EFI memory attributes protocol is to remove the need
for all memory allocations to be mapped with both write and execute
permissions by default, and make it the OS loader's responsibility to
transition data mappings to code mappings where appropriate.

Even though the UEFI specification does not appear to leave room for
denying memory attribute changes based on security policy, let's be
cautious and avoid relying on the ability to create read-write-execute
mappings. This is trivially achievable, given that the amount of kernel
code executing via the firmware's 1:1 mapping is rather small and
limited to the .head.text region. So let's drop the NX restrictions only
on that subregion, but not before remapping it as read-only first.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-10 16:38:23 +02:00
Ard Biesheuvel
2ff01ae567 x86/boot: Move mem_encrypt= parsing to the decompressor
commit cd0d9d92c8 upstream.

The early SME/SEV code parses the command line very early, in order to
decide whether or not memory encryption should be enabled, which needs
to occur even before the initial page tables are created.

This is problematic for a number of reasons:
- this early code runs from the 1:1 mapping provided by the decompressor
  or firmware, which uses a different translation than the one assumed by
  the linker, and so the code needs to be built in a special way;
- parsing external input while the entire kernel image is still mapped
  writable is a bad idea in general, and really does not belong in
  security minded code;
- the current code ignores the built-in command line entirely (although
  this appears to be the case for the entire decompressor)

Given that the decompressor/EFI stub is an intrinsic part of the x86
bootable kernel image, move the command line parsing there and out of
the core kernel. This removes the need to build lib/cmdline.o in a
special way, or to use RIP-relative LEA instructions in inline asm
blocks.

This involves a new xloadflag in the setup header to indicate
that mem_encrypt=on appeared on the kernel command line.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240227151907.387873-17-ardb+git@google.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-10 16:38:23 +02:00
Ard Biesheuvel
7596a378a1 efi/libstub: Add generic support for parsing mem_encrypt=
commit 7205f06e84 upstream.

Parse the mem_encrypt= command line parameter from the EFI stub if
CONFIG_ARCH_HAS_MEM_ENCRYPT=y, so that it can be passed to the early
boot code by the arch code in the stub.

This avoids the need for the core kernel to do any string parsing very
early in the boot.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240227151907.387873-16-ardb+git@google.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-10 16:38:23 +02:00
Ard Biesheuvel
b03bf0dc87 x86/efistub: Reinstate soft limit for initrd loading
commit decd347c2a upstream.

Commit

  8117961d98 ("x86/efi: Disregard setup header of loaded image")

dropped the memcopy of the image's setup header into the boot_params
struct provided to the core kernel, on the basis that EFI boot does not
need it and should rely only on a single protocol to interface with the
boot chain. It is also a prerequisite for being able to increase the
section alignment to 4k, which is needed to enable memory protections
when running in the boot services.

So only the setup_header fields that matter to the core kernel are
populated explicitly, and everything else is ignored. One thing was
overlooked, though: the initrd_addr_max field in the setup_header is not
used by the core kernel, but it is used by the EFI stub itself when it
loads the initrd, where its default value of INT_MAX is used as the soft
limit for memory allocation.

This means that, in the old situation, the initrd was virtually always
loaded in the lower 2G of memory, but now, due to initrd_addr_max being
0x0, the initrd may end up anywhere in memory. This should not be an
issue principle, as most systems can deal with this fine. However, it
does appear to tickle some problems in older UEFI implementations, where
the memory ends up being corrupted, resulting in errors when unpacking
the initramfs.

So set the initrd_addr_max field to INT_MAX like it was before.

Fixes: 8117961d98 ("x86/efi: Disregard setup header of loaded image")
Reported-by: Radek Podgorny <radek@podgorny.cz>
Closes: https://lore.kernel.org/all/a99a831a-8ad5-4cb0-bff9-be637311f771@podgorny.cz
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-03 15:32:37 +02:00
Ard Biesheuvel
cea10ef17f efi/libstub: Cast away type warning in use of max()
commit 61d130f261 upstream.

Avoid a type mismatch warning in max() by switching to max_t() and
providing the type explicitly.

Fixes: 3cb4a48275 ("efi/libstub: fix efi_random_alloc() ...")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-03 15:32:37 +02:00
Oleksandr Tymoshenko
090d2b4515 efi: fix panic in kdump kernel
[ Upstream commit 62b71cd73d ]

Check if get_next_variable() is actually valid pointer before
calling it. In kdump kernel this method is set to NULL that causes
panic during the kexec-ed kernel boot.

Tested with QEMU and OVMF firmware.

Fixes: bad267f9e1 ("efi: verify that variable services are supported")
Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:32:35 +02:00
KONDO KAZUMA(近藤 和真)
1cc2320c52 efi/libstub: fix efi_random_alloc() to allocate memory at alloc_min or higher address
[ Upstream commit 3cb4a48275 ]

Following warning is sometimes observed while booting my servers:
  [    3.594838] DMA: preallocated 4096 KiB GFP_KERNEL pool for atomic allocations
  [    3.602918] swapper/0: page allocation failure: order:10, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0-1
  ...
  [    3.851862] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocation

If 'nokaslr' boot option is set, the warning always happens.

On x86, ZONE_DMA is small zone at the first 16MB of physical address
space. When this problem happens, most of that space seems to be used by
decompressed kernel. Thereby, there is not enough space at DMA_ZONE to
meet the request of DMA pool allocation.

The commit 2f77465b05 ("x86/efistub: Avoid placing the kernel below
LOAD_PHYSICAL_ADDR") tried to fix this problem by introducing lower
bound of allocation.

But the fix is not complete.

efi_random_alloc() allocates pages by following steps.
1. Count total available slots ('total_slots')
2. Select a slot ('target_slot') to allocate randomly
3. Calculate a starting address ('target') to be included target_slot
4. Allocate pages, which starting address is 'target'

In step 1, 'alloc_min' is used to offset the starting address of memory
chunk. But in step 3 'alloc_min' is not considered at all.  As the
result, 'target' can be miscalculated and become lower than 'alloc_min'.

When KASLR is disabled, 'target_slot' is always 0 and the problem
happens everytime if the EFI memory map of the system meets the
condition.

Fix this problem by calculating 'target' considering 'alloc_min'.

Cc: linux-efi@vger.kernel.org
Cc: Tom Englund <tomenglund26@gmail.com>
Cc: linux-kernel@vger.kernel.org
Fixes: 2f77465b05 ("x86/efistub: Avoid placing the kernel below LOAD_PHYSICAL_ADDR")
Signed-off-by: Kazuma Kondo <kazuma-kondo@nec.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:32:34 +02:00
Ard Biesheuvel
245a7547fc x86/efistub: Don't clear BSS twice in mixed mode
[ Upstream commit df7ecce842 ]

Clearing BSS should only be done once, at the very beginning.
efi_pe_entry() is the entrypoint from the firmware, which may not clear
BSS and so it is done explicitly. However, efi_pe_entry() is also used
as an entrypoint by the mixed mode startup code, in which case BSS will
already have been cleared, and doing it again at this point will corrupt
global variables holding the firmware's GDT/IDT and segment selectors.

So make the memset() conditional on whether the EFI stub is running in
native mode.

Fixes: b3810c5a2c ("x86/efistub: Clear decompressor BSS in native EFI entrypoint")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:17:39 -04:00
Ard Biesheuvel
7d78b47982 x86/efistub: Clear decompressor BSS in native EFI entrypoint
[ Upstream commit b3810c5a2c ]

The EFI stub on x86 no longer invokes the decompressor as a subsequent
boot stage, but calls into the decompression code directly while running
in the context of the EFI boot services.

This means that when using the native EFI entrypoint (as opposed to the
EFI handover protocol, which clears BSS explicitly), the firmware PE
image loader is being relied upon to ensure that BSS is zeroed before
the EFI stub is entered from the firmware.

As Radek's report proves, this is a bad idea. Not all loaders do this
correctly, which means some global variables that should be statically
initialized to 0x0 may have junk in them.

So clear BSS explicitly when entering via efi_pe_entry(). Note that
zeroing BSS from C code is not generally safe, but in this case, the
following assignment and dereference of a global pointer variable
ensures that the memset() cannot be deferred or reordered.

Cc: <stable@kernel.org> # v6.1+
Reported-by: Radek Podgorny <radek@podgorny.cz>
Closes: https://lore.kernel.org/all/a99a831a-8ad5-4cb0-bff9-be637311f771@podgorny.cz
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:17:39 -04:00
Andre Przywara
ead445dd3d firmware: arm_scmi: Fix double free in SMC transport cleanup path
[ Upstream commit f1d71576d2 ]

When the generic SCMI code tears down a channel, it calls the chan_free
callback function, defined by each transport. Since multiple protocols
might share the same transport_info member, chan_free() might want to
clean up the same member multiple times within the given SCMI transport
implementation. In this case, it is SMC transport. This will lead to a NULL
pointer dereference at the second time:

    | scmi_protocol scmi_dev.1: Enabled polling mode TX channel - prot_id:16
    | arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
    | arm-scmi firmware:scmi: unable to communicate with SCMI
    | Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
    | Mem abort info:
    |   ESR = 0x0000000096000004
    |   EC = 0x25: DABT (current EL), IL = 32 bits
    |   SET = 0, FnV = 0
    |   EA = 0, S1PTW = 0
    |   FSC = 0x04: level 0 translation fault
    | Data abort info:
    |   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
    |   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
    |   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
    | user pgtable: 4k pages, 48-bit VAs, pgdp=0000000881ef8000
    | [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
    | Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
    | Modules linked in:
    | CPU: 4 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc2-00124-g455ef3d016c9-dirty #793
    | Hardware name: FVP Base RevC (DT)
    | pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
    | pc : smc_chan_free+0x3c/0x6c
    | lr : smc_chan_free+0x3c/0x6c
    | Call trace:
    |  smc_chan_free+0x3c/0x6c
    |  idr_for_each+0x68/0xf8
    |  scmi_cleanup_channels.isra.0+0x2c/0x58
    |  scmi_probe+0x434/0x734
    |  platform_probe+0x68/0xd8
    |  really_probe+0x110/0x27c
    |  __driver_probe_device+0x78/0x12c
    |  driver_probe_device+0x3c/0x118
    |  __driver_attach+0x74/0x128
    |  bus_for_each_dev+0x78/0xe0
    |  driver_attach+0x24/0x30
    |  bus_add_driver+0xe4/0x1e8
    |  driver_register+0x60/0x128
    |  __platform_driver_register+0x28/0x34
    |  scmi_driver_init+0x84/0xc0
    |  do_one_initcall+0x78/0x33c
    |  kernel_init_freeable+0x2b8/0x51c
    |  kernel_init+0x24/0x130
    |  ret_from_fork+0x10/0x20
    | Code: f0004701 910a0021 aa1403e5 97b91c70 (b9400280)
    | ---[ end trace 0000000000000000 ]---

Simply check for the struct pointer being NULL before trying to access
its members, to avoid this situation.

This was found when a transport doesn't really work (for instance no SMC
service), the probe routines then tries to clean up, and triggers a crash.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Fixes: 1dc6558062 ("firmware: arm_scmi: Add smc/hvc transport")
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240126122325.2039669-1-andre.przywara@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:16:46 -04:00
Arnd Bergmann
1c7cfb6158 RISC-V firmware drivers for v6.9
A single minor fix for an oversized allocation due to sizeof() misuse by
 yours truly that came in since I sent my last fixes PR.
 
 Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZed5RAAKCRB4tDGHoIJi
 0qRIAQCeMKuoQNOHXQtC3u5FKGcpsZPctEnbhg2pWK6ZOwdqjwEAsEJLqApFw4cG
 oB9cR3O3mtN49aOBM3w700Hafykv9Ak=
 =oU9U
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXoEEAACgkQYKtH/8kJ
 Uic1PRAAr/Fc1qOB6gp05NPqXDuHvFGU/qYCMINss8n33mXuyfG3HnR8YBoybEnH
 mm0cpVn1VqsJbixiM1d07/luRfBZXiMCQw55UNwbU7PVyBHc9at9QnruYX4uFRsZ
 V6AgTkni1QDDMYANFgvs9dJv+r4Ul1gusqSj/z71an/A6d2fmsVXlFkH7ZXsGhGR
 PJR5NDLjuqJIR2kGKC23QvrQWY+Kuf90+6FExVOc/3ZnUS5Eg0QrbBf1vd8JYz+o
 wNR/IeHO9anvoe1tSNJDpHDdCKl+88SiJGjUcMI/H4ncdkGslBuErzBB2cwRHWWC
 JHD4ZbAB5qFNHaZqUTAuHkAyMdZEPxibDdtW084thD8X7vFJe27JuRXfMJTHWRKt
 jemhC9mcZ/lEM1neShSZe7jdQLzzjEEdNSDe4dcMihstGu3yHDXuhzzf6AxXh5bU
 GvihHMQ4ENnNSUgSDC6FcW+HOaakBL728JE6ySAIP/7mSICF9MVasyT+NO0DLTEC
 67rmGoealy2c//dmtcslYDQzeFbaNtL4FpLVkc1uFotQ5FFHsXzbwkETAZOWZwbL
 0nT5OnpdixwB2389RbAwXVrpstrgjYxRwKehNGa8LgIxKcsYVtROLRiwTs474g6a
 PsYTW7GfCJg+SsT1A4cZ7sV8lP3cn5WwewZ+0lRjSTmdWgIQ294=
 =OVem
 -----END PGP SIGNATURE-----

Merge tag 'riscv-firmware-for-v6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into arm/fixes

RISC-V firmware drivers for v6.9

A single minor fix for an oversized allocation due to sizeof() misuse by
yours truly that came in since I sent my last fixes PR.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>

* tag 'riscv-firmware-for-v6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux:
  firmware: microchip: Fix over-requested allocation size

Link: https://lore.kernel.org/r/20240305-vicinity-dumpling-8943ef26f004@spud
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-03-06 07:42:08 +01:00
Dawei Li
af1e0a7d39 firmware: microchip: Fix over-requested allocation size
cocci warnings: (new ones prefixed by >>)
>> drivers/firmware/microchip/mpfs-auto-update.c:387:72-78:
   ERROR: application of sizeof to pointer
   drivers/firmware/microchip/mpfs-auto-update.c:170:72-78:
   ERROR: application of sizeof to pointer

response_msg is a pointer to u32, so the size of element it points to is
supposed to be a multiple of sizeof(u32), rather than sizeof(u32 *).

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202403040516.CYxoWTXw-lkp@intel.com/
Signed-off-by: Dawei Li <dawei.li@shingroup.cn>
Fixes: ec5b0f1193 ("firmware: microchip: add PolarFire SoC Auto Update support")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2024-03-04 19:18:16 +00:00
Linus Torvalds
2bbb54ba1b EFI fixes for v6.8 #2
- Fix phys_addr_t size confusion in 32-bit capsule loader
 - Reduce maximum EFI variable name size to 512 to work around buggy
   firmware
 - Drop some redundant code from efivarfs while at it
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQQm/3uucuRGn1Dmh0wbglWLn0tXAUCZdr/HgAKCRAwbglWLn0t
 XGqrAP96SmiLbkEBzBAkjpIvQIwoiPUAQmfBXs4PuZ6MH/aq3wEA0VOxxH8CpVAu
 dpjd2HIjO59zMr4G7BvR/ezit3Gp2A0=
 =Bd3Z
 -----END PGP SIGNATURE-----

Merge tag 'efi-fixes-for-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fixes from Ard Biesheuvel:
 "Only the EFI variable name size change is significant, and will be
  backported once it lands. The others are cleanup.

   - Fix phys_addr_t size confusion in 32-bit capsule loader

   - Reduce maximum EFI variable name size to 512 to work around buggy
     firmware

   - Drop some redundant code from efivarfs while at it"

* tag 'efi-fixes-for-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efivarfs: Drop 'duplicates' bool parameter on efivar_init()
  efivarfs: Drop redundant cleanup on fill_super() failure
  efivarfs: Request at most 512 bytes for variable names
  efi/capsule-loader: fix incorrect allocation size
2024-03-01 11:40:29 -08:00
Arnd Bergmann
4d934f94ad Microchip firmware driver fixes for v6.8-rc6
A single fix for me incorrectly using sizeof().
 
 Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZdYmOQAKCRB4tDGHoIJi
 0hTQAQDCFXu/AYZJHRpoF3GyafM3JnJ/FlXVsm/ShzvnTF9LXAEAyN1XqaxZ0vuW
 7RMcf8KxsM2Y5/5X+7SZ9MtLQMorjQI=
 =BN1C
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmXYlVgACgkQYKtH/8kJ
 Uic1KA/+JdxTN4rfsp/4TWQZmVr/1+JT5Soue14gTyjZY1pdzbpgvIdwLl/EZVQJ
 Yg1Mq6OGsIu2qnTgm0Cl9GayEhzan3KfvEHlqO0YAceX4pbnEt6C56djxPO5gEDq
 GcLGAaBjFEe/spG8D9dxABtsT9wy8BDhu+H1aeQwsROD5t8/ujDMKDyR8eXLKVbt
 ZODHMZrnl79c1BfZNmegXMnTicoM9q5GIVaa0h3D7JpGanmJvRZcudgAkYLDPool
 C3OXPOq/dZqeFa5+LyLex7DtEvdAGHRNzJTUUoV8ZYN9+o+uGReXUB3w7ZheAMaK
 rI3H1NZyz3fz9uiN8yLKFB7c2V6ddaBm0DQ2K0NdOqE6g8Jex4u9JqZ5O7lvxt+s
 K81xQ+J84c6gwb0eIQ7cny4teXNAQz6oPqQ9M+k9y0AYnsnjBGby/RAbRESl36ng
 RHwNMFy0zJQelg/xqM1kzVhyB1wyNvtSkDE2Xt+wleHe2VxAr90gQ0dN8U2F6YEc
 E3fzgUnrCySvcDz+qtGCvMF0KaKXdQcvHxKQDPioHrGAwlHtv4rA3F8w+5m3wiBn
 bDWThBb+gEIv6ZG//yXFtZFwtoIyc7Ntv7qrjAOupJfGxBjEglY3WEZvODcG0Xn7
 YWbHGvC/lYxNfcDJZ0ioo3nKQFgVYY92M+7qt0Ls6EpU99GEDf4=
 =FJ4K
 -----END PGP SIGNATURE-----

Merge tag 'riscv-firmware-fixes-for-v6.8-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into arm/fixes

Microchip firmware driver fixes for v6.8-rc6

A single fix for me incorrectly using sizeof().

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>

* tag 'riscv-firmware-fixes-for-v6.8-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux:
  firmware: microchip: fix wrong sizeof argument

Link: https://lore.kernel.org/r/20240221-recognize-dust-4bb575f4e67b@spud
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-02-23 13:53:44 +01:00
Arnd Bergmann
fccfa646ef efi/capsule-loader: fix incorrect allocation size
gcc-14 notices that the allocation with sizeof(void) on 32-bit architectures
is not enough for a 64-bit phys_addr_t:

drivers/firmware/efi/capsule-loader.c: In function 'efi_capsule_open':
drivers/firmware/efi/capsule-loader.c:295:24: error: allocation of insufficient size '4' for type 'phys_addr_t' {aka 'long long unsigned int'} with size '8' [-Werror=alloc-size]
  295 |         cap_info->phys = kzalloc(sizeof(void *), GFP_KERNEL);
      |                        ^

Use the correct type instead here.

Fixes: f24c4d4780 ("efi/capsule-loader: Reinstate virtual capsule mapping")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-02-13 16:30:07 +01:00
Linus Torvalds
e6f39a90de EFI fixes for v6.8 #1
- Tighten ELF relocation checks on the RISC-V EFI stub
 - Give up if the new EFI memory attributes protocol fails spuriously on
   x86
 - Take care not to place the kernel in the lowest 16 MB of DRAM on x86
 - Omit special purpose EFI memory from memblock
 - Some fixes for the CXL CPER reporting code
 - Make the PE/COFF layout of mixed-mode capable images comply with a
   strict interpretation of the spec
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQQm/3uucuRGn1Dmh0wbglWLn0tXAUCZcDtKAAKCRAwbglWLn0t
 XMDfAP9ttq8Ir4+hp8A0DGE79x6eSgBIkl5ztGmMQGybzEkzdAEAgxfDUieQW4TT
 GmbyGGUouvSYxfZf4gVTQn8b/bd57AI=
 =Af8A
 -----END PGP SIGNATURE-----

Merge tag 'efi-fixes-for-v6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fixes from Ard Biesheuvel:
 "The only notable change here is the patch that changes the way we deal
  with spurious errors from the EFI memory attribute protocol. This will
  be backported to v6.6, and is intended to ensure that we will not
  paint ourselves into a corner when we tighten this further in order to
  comply with MS requirements on signed EFI code.

  Note that this protocol does not currently exist in x86 production
  systems in the field, only in Microsoft's fork of OVMF, but it will be
  mandatory for Windows logo certification for x86 PCs in the future.

   - Tighten ELF relocation checks on the RISC-V EFI stub

   - Give up if the new EFI memory attributes protocol fails spuriously
     on x86

   - Take care not to place the kernel in the lowest 16 MB of DRAM on
     x86

   - Omit special purpose EFI memory from memblock

   - Some fixes for the CXL CPER reporting code

   - Make the PE/COFF layout of mixed-mode capable images comply with a
     strict interpretation of the spec"

* tag 'efi-fixes-for-v6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  x86/efistub: Use 1:1 file:memory mapping for PE/COFF .compat section
  cxl/trace: Remove unnecessary memcpy's
  cxl/cper: Fix errant CPER prints for CXL events
  efi: Don't add memblocks for soft-reserved memory
  efi: runtime: Fix potential overflow of soft-reserved region size
  efi/libstub: Add one kernel-doc comment
  x86/efistub: Avoid placing the kernel below LOAD_PHYSICAL_ADDR
  x86/efistub: Give up if memory attribute protocol returns an error
  riscv/efistub: Tighten ELF relocation check
  riscv/efistub: Ensure GP-relative addressing is not used
2024-02-09 10:40:50 -08:00
Ira Weiny
54ce1927eb cxl/cper: Fix errant CPER prints for CXL events
Jonathan reports that CXL CPER events dump an extra generic error
message.

	{1}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 1
	{1}[Hardware Error]: event severity: recoverable
	{1}[Hardware Error]:  Error 0, type: recoverable
	{1}[Hardware Error]:   section type: unknown, fbcd0a77-c260-417f-85a9-088b1621eba6
	{1}[Hardware Error]:   section length: 0x90
	{1}[Hardware Error]:   00000000: 00000090 00000007 00000000 0d938086 ................
	{1}[Hardware Error]:   00000010: 00100000 00000000 00040000 00000000 ................
	...

CXL events were rerouted though the CXL subsystem for additional
processing.  However, when that work was done it was missed that
cper_estatus_print_section() continued with a generic error message
which is confusing.

Teach CPER print code to ignore printing details of some section types.
Assign the CXL event GUIDs to this set to prevent confusing unknown
prints.

Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-02-03 18:31:17 +01:00
Andrew Bresticker
0bcff59ef7 efi: Don't add memblocks for soft-reserved memory
Adding memblocks for soft-reserved regions prevents them from later being
hotplugged in by dax_kmem.

Signed-off-by: Andrew Bresticker <abrestic@rivosinc.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-02-02 19:31:24 +01:00
Andrew Bresticker
de1034b38a efi: runtime: Fix potential overflow of soft-reserved region size
md_size will have been narrowed if we have >= 4GB worth of pages in a
soft-reserved region.

Signed-off-by: Andrew Bresticker <abrestic@rivosinc.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-02-02 19:31:24 +01:00
Yang Li
aa0e784dea efi/libstub: Add one kernel-doc comment
Add the description of @memory_type to silence the warning:
drivers/firmware/efi/libstub/alignedmem.c:27: warning: Function parameter or struct member 'memory_type' not described in 'efi_allocate_pages_aligned'

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
[ardb: tweak comment]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-01-30 21:44:21 +01:00
Ard Biesheuvel
2f77465b05 x86/efistub: Avoid placing the kernel below LOAD_PHYSICAL_ADDR
The EFI stub's kernel placement logic randomizes the physical placement
of the kernel by taking all available memory into account, and picking a
region at random, based on a random seed.

When KASLR is disabled, this seed is set to 0x0, and this results in the
lowest available region of memory to be selected for loading the kernel,
even if this is below LOAD_PHYSICAL_ADDR. Some of this memory is
typically reserved for the GFP_DMA region, to accommodate masters that
can only access the first 16 MiB of system memory.

Even if such devices are rare these days, we may still end up with a
warning in the kernel log, as reported by Tom:

 swapper/0: page allocation failure: order:10, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0

Fix this by tweaking the random allocation logic to accept a low bound
on the placement, and set it to LOAD_PHYSICAL_ADDR.

Fixes: a1b87d54f4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot")
Reported-by: Tom Englund <tomenglund26@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218404
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-01-30 21:44:21 +01:00
Samasth Norway Ananda
0abcac4fe3 firmware: microchip: fix wrong sizeof argument
response_msg is a pointer to an unsigned int (u32). So passing just
response_msg to sizeof would not print the size of the variable. To get
the size of response_msg we need to pass it as a pointer variable.

Fixes: ec5b0f1193 ("firmware: microchip: add PolarFire SoC Auto Update support")
Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
2024-01-29 18:52:11 +00:00
Linus Torvalds
168174d781 drm fixes for 6.8-rc2
fb:
 - fix simpledrm/i915 regression by reverting change
 
 scheduler:
 - fix regression affecting amdgpu users due to sched draining
 
 nouveau:
 - revert 6.7 deadlock fix as it has side effects
 
 dp:
 - fix documentation warning
 
 ttm:
 - fix dummy page read on some platforms
 
 bridge:
 - anx7625 suspend fix
 - sii902x: fix probing and audio registration
 - parade-ps8640: fix suspend of bridge, aux fixes
 - samsung-dsim: avoid using FORCE_STOP_STATE
 
 panel:
 - simple add missing bus flags
 - fix samsung-s6d7aa0 flags
 
 amdgpu:
 - AC/DC power supply tracking fix
 - Don't show invalid vram vendor data
 - SMU 13.0.x fixes
 - GART fix for umr on systems without VRAM
 - GFX 10/11 UNORD_DISPATCH fixes
 - IPS display fixes (required for S0ix on some platforms)
 - Misc fixes
 
 i915:
 - DSI sequence revert to fix GitLab #10071 and DP test-pattern fix
 - Drop -Wstringop-overflow (broken on GCC11)
 
 ivpu:
 - fix recovery/reset support
 - improve submit ioctl stability
 - fix dev open/close races on unbind
 - PLL disable reset fix
 - deprecate context priority param
 - improve debug buffer logging
 - disable buffer sharing across VPU contexts
 - free buffer sgt on unbind
 - fix missing lock around shmem vmap
 - add better boot diagnostics
 - add more debug prints around mapping
 - dump MMU events in case of timeout
 
 v3d:
 - NULL ptr dereference fix
 
 exynos:
 - fix stack usage
 - fix incorrect type
 - fix dt typo
 - fix gsc runtime resume
 
 xe:
 - Make an ops struct static
 - Fix an implicit 0 to NULL conversion
 - A couple of 32-bit fixes
 - A migration coherency fix for Lunar Lake.
 - An error path vm id leak fix
 - Remove PVC references in kunit tests
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEEKbZHaGwW9KfbeusDHTzWXnEhr4FAmWz/lsACgkQDHTzWXnE
 hr4m2Q/8DB5XlLPXQCW7xGwS6H546xItKZv32VxnqChl2qG7CIzLpqO1ZTQm8OtW
 QSE5Xc1kBG2qZeWV5vvtRn3wtwejgzIMBg1KUkDUXllAHGhifZfzti4J8muWXLIx
 ioL4pWefwnq/bhL4F0IzN7j1qSxxR0UyL/0WORvCjIIVBVG/QJpHbpM5gX/00qQE
 APPLJrrU+2dnAEHlKzFwCkp9bR1b2Tf6yRRh7p1gbLjkYS8rfy36BWFYdP6JC/a3
 EU1tPclLVJomt9rfPjhB33lD8DpBVGxi2cDjquMmrgLNPIuaOdD3Lk/awe7TKfiF
 g/ECLojJCIr50268cZ5X6Q1RvZZrbcorcG6EX2JzkP4sKI6fsc6XVPhtfXj59ysR
 jIRUp5eMKZPLF/FS2g68jFFos2HcNqopezNmo1pM/kT1FMT4k0N93PlW+Zr+Uhxx
 BEA2OsdCEXCwJLaLCXiRQkgpsvqyeRy7jK28J7CaY22bJFaRtGyzeSEcSrNb+nGI
 y+1Qqgy/7cSP4+yC7uOtytm/e20zzLt3lOsDPK3atHKa1X/HuWtm1gX2U4sGl9+A
 DChn2p5Xdl10SOt+f346kNGuJict59TGDsXD6ETsbmFG49VRZEzGhoSLZ7UYl90G
 NUBPS8dc6ctQnsLnOZ1iyp3NZxOGm+jLEPXb76Wt2sJPw4KBP1A=
 =eZEy
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-2024-01-27' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Lots going on for rc2, ivpu has a bunch of stabilisation and debugging
  work, then amdgpu and xe are the main fixes. i915, exynos have a few,
  then some misc panel and bridge fixes.

  Worth mentioning are three regressions. One of the nouveau fixes in
  6.7 for a serious deadlock had side effects, so I guess we will bring
  back the deadlock until I can figure out what should be done properly.
  There was a scheduler regression vs amdgpu which was reported in a few
  places and is now fixed. There was an i915 vs simpledrm problem
  resulting in black screens, that is reverted also.

  I'll be working on a proper nouveau fix, it kinda looks like one of
  those cases where someone tried to use an atomic where they should
  have probably used a lock, but I'll see.

  fb:
   - fix simpledrm/i915 regression by reverting change

  scheduler:
   - fix regression affecting amdgpu users due to sched draining

  nouveau:
   - revert 6.7 deadlock fix as it has side effects

  dp:
   - fix documentation warning

  ttm:
   - fix dummy page read on some platforms

  bridge:
   - anx7625 suspend fix
   - sii902x: fix probing and audio registration
   - parade-ps8640: fix suspend of bridge, aux fixes
   - samsung-dsim: avoid using FORCE_STOP_STATE

  panel:
   - simple add missing bus flags
   - fix samsung-s6d7aa0 flags

  amdgpu:
   - AC/DC power supply tracking fix
   - Don't show invalid vram vendor data
   - SMU 13.0.x fixes
   - GART fix for umr on systems without VRAM
   - GFX 10/11 UNORD_DISPATCH fixes
   - IPS display fixes (required for S0ix on some platforms)
   - Misc fixes

  i915:
   - DSI sequence revert to fix GitLab #10071 and DP test-pattern fix
   - Drop -Wstringop-overflow (broken on GCC11)

  ivpu:
   - fix recovery/reset support
   - improve submit ioctl stability
   - fix dev open/close races on unbind
   - PLL disable reset fix
   - deprecate context priority param
   - improve debug buffer logging
   - disable buffer sharing across VPU contexts
   - free buffer sgt on unbind
   - fix missing lock around shmem vmap
   - add better boot diagnostics
   - add more debug prints around mapping
   - dump MMU events in case of timeout

  v3d:
   - NULL ptr dereference fix

  exynos:
   - fix stack usage
   - fix incorrect type
   - fix dt typo
   - fix gsc runtime resume

  xe:
   - Make an ops struct static
   - Fix an implicit 0 to NULL conversion
   - A couple of 32-bit fixes
   - A migration coherency fix for Lunar Lake.
   - An error path vm id leak fix
   - Remove PVC references in kunit tests"

* tag 'drm-fixes-2024-01-27' of git://anongit.freedesktop.org/drm/drm: (66 commits)
  Revert "nouveau: push event block/allowing out of the fence context"
  drm: bridge: samsung-dsim: Don't use FORCE_STOP_STATE
  drm/sched: Drain all entities in DRM sched run job worker
  drm/amd/display: "Enable IPS by default"
  drm/amd: Add a DC debug mask for IPS
  drm/amd/display: Disable ips before dc interrupt setting
  drm/amd/display: Replay + IPS + ABM in Full Screen VPB
  drm/amd/display: Add IPS checks before dcn register access
  drm/amd/display: Add Replay IPS register for DMUB command table
  drm/amd/display: Allow IPS2 during Replay
  drm/amdgpu/gfx11: set UNORD_DISPATCH in compute MQDs
  drm/amdgpu/gfx10: set UNORD_DISPATCH in compute MQDs
  drm/amd/amdgpu: Assign GART pages to AMD device mapping
  drm/amd/pm: Fetch current power limit from FW
  drm/amdgpu: Fix null pointer dereference
  drm/amdgpu: Show vram vendor only if available
  drm/amd/pm: update the power cap setting
  drm/amdgpu: Avoid fetching vram vendor information
  drm/amdgpu/pm: Fix the power source flag error
  drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_dpcd()' functions
  ...
2024-01-26 13:52:18 -08:00
Ard Biesheuvel
a7a6a01f88 x86/efistub: Give up if memory attribute protocol returns an error
The recently introduced EFI memory attributes protocol should be used
if it exists to ensure that the memory allocation created for the kernel
permits execution. This is needed for compatibility with tightened
requirements related to Windows logo certification for x86 PCs.

Currently, we simply strip the execute protect (XP) attribute from the
entire range, but this might be rejected under some firmware security
policies, and so in a subsequent patch, this will be changed to only
strip XP from the executable region that runs early, and make it
read-only (RO) as well.

In order to catch any issues early, ensure that the memory attribute
protocol works as intended, and give up if it produces spurious errors.

Note that the DXE services based fallback was always based on best
effort, so don't propagate any errors returned by that API.

Fixes: a1b87d54f4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-01-26 16:58:19 +01:00
Arnd Bergmann
8ad2c84e2e Arm FF-A fixes for v6.8
Quite a few fixes addressing issues around missing RW lock initialisation
 in ffa_setup_partitions(), missing check for xa_load() return value,
 use of xa_insert instead of xa_store to flag case of duplicate insertion.
 It also simplifies ffa_partitions_cleanup() with xa_for_each() and xa_erase()
 instead of xa_extract() and kfree(). Finally it includes fixes around
 handling of partitions setup failures during initialisation.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAmWuj+IACgkQAEG6vDF+
 4pgufA/9H73+TI0bKWhH9TqXONeJQEISJ3EKHJSsN1yuKsToYDetmadidXegLmGC
 nyJULeuTF9codmId5TQ8Zh29Bir38Nh4bFnfvVONPe78KYm6Xjt3HDei903fRIPK
 wch8ReenHdGzyhuAzcgL9CHUzgvJuM5KtaOgiAAOlNILzMk8nk1qbpoesTzvJOaD
 0sLT/KiN2aTICk6YnSBAHnPFZ2GWGJ7PHqKvzgNMPLloOEQn0xGmKgegH+pWjkWm
 qnLI/Gw/m0Y1yqBF1ffDRhC4qH2lMH2cSBR4UJTFQ4e01Hlr+kNgDqBbYJtsOhPJ
 Fj36RA/mc0uSDrMxgwi2SOVnPOumIGVzH6TjoxBthrSLza6AtI+qocF9SUXxfNFv
 VT/CR3CCZhIpBkSWA6XpFLXivNs5wyPau8HPYyU8w7JAeAihYj294eJpLcYeTYi5
 z6xyPbJFZQ1nTYmctMRaBgvOeJFUzpwlTeWkbjBAhsW5KrOKrdWqHv8/w7JSJEyS
 LGBEKWVKg0etx8tjKuR1nn2RsHegHWXqRiU0ahbhh5ukvOt6grfs/9tK8Nxh4N40
 /xdoEgx1TeIbRfjkcnhcjLdHO92kjZnEvmdPVmZjk6o1MiYl1VqaMks4unJTMXh6
 vYtDpK3LTZ7wq8y45IzXu1CZY+YfS+3J038eVp3KJjL2n5oX4Ig=
 =K7Rw
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmWymK8ACgkQYKtH/8kJ
 UieGsQ/+LqAXbaAL9RA8Mb54HeS1g6JGYj+vEPOjPXb0ie1ow/92Hia87sqvQhBx
 hu1Vf45wypkAvuPnRrUBNiL7SlC8ae6VGaKtswiDNt8vuvwBu4NoV4GDJgBa7Ney
 mNl1wOeaPVl3DQ/zCZaDGkAcq+dNquhFNYb9t7EtOLhTZVf+yNHPYEbcH2Mx/f3h
 guaJJODlKCQjqU22lCQiFTi5iWpie3S8Kgq4PEhfREHIq8Ttbll0ZNC1TUxdD854
 Ye6JUE/xUb3rrUvgUMjA15xPzEd4kcJ/GMcMC7sISbUqJOlLCfv6HfEUM3lABbAA
 NNzbBXJAT9U8xu+qOiGLA8ddxqbkt9QrhftwZGBW93g+KgsTUBVv8AFzsrqba94Y
 o4sufePZd/siR66p2m/EvwT4RJFCZ+CKeu4Y+jSv4ki/5W6GgbB+jHgevLX+rSmW
 DeuRaFl6Up89VwmDpY5FdEJ/GQ0d4mzSJx7Yw0N/OITpYs6fZHhHyWKVMPCg7cSt
 NQn0r6YVh8x+ScwY6/m+ofFiuW+GWjNo+wSkAPW3fl3omChAI1KWwXuB7TfWP1io
 /lTl5Azjnd//2oMzdqqcca3m0p6ZHHOFWr9FfEXxpyUyh7aI3sPxM1yxvs3C77vq
 ID12SlHZRved2MuuO5vwVTH+b2w1ab57AA7lswviHqGY8eJO3QI=
 =IR2+
 -----END PGP SIGNATURE-----

Merge tag 'ffa-fixes-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes

Arm FF-A fixes for v6.8

Quite a few fixes addressing issues around missing RW lock initialisation
in ffa_setup_partitions(), missing check for xa_load() return value,
use of xa_insert instead of xa_store to flag case of duplicate insertion.
It also simplifies ffa_partitions_cleanup() with xa_for_each() and xa_erase()
instead of xa_extract() and kfree(). Finally it includes fixes around
handling of partitions setup failures during initialisation.

* tag 'ffa-fixes-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  firmware: arm_ffa: Handle partitions setup failures
  firmware: arm_ffa: Use xa_insert() and check for result
  firmware: arm_ffa: Simplify ffa_partitions_cleanup()
  firmware: arm_ffa: Check xa_load() return value
  firmware: arm_ffa: Add missing rwlock_init() for the driver partition
  firmware: arm_ffa: Add missing rwlock_init() in ffa_setup_partitions()

Link: https://lore.kernel.org/r/20240122161652.3551159-1-sudeep.holla@arm.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-01-25 18:21:50 +01:00
Thomas Zimmermann
d1b163aa07 Revert "drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync"
This reverts commit 60aebc9559.

Commit 60aebc9559 ("drivers/firmware: Move sysfb_init() from
device_initcall to subsys_initcall_sync") messes up initialization order
of the graphics drivers and leads to blank displays on some systems. So
revert the commit.

To make the display drivers fully independent from initialization
order requires to track framebuffer memory by device and independently
from the loaded drivers. The kernel currently lacks the infrastructure
to do so.

Reported-by: Jaak Ristioja <jaak@ristioja.ee>
Closes: https://lore.kernel.org/dri-devel/ZUnNi3q3yB3zZfTl@P70.localdomain/T/#t
Reported-by: Huacai Chen <chenhuacai@loongson.cn>
Closes: https://lore.kernel.org/dri-devel/20231108024613.2898921-1-chenhuacai@loongson.cn/
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10133
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Thorsten Leemhuis <regressions@leemhuis.info>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: stable@vger.kernel.org # v6.5+
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240123120937.27736-1-tzimmermann@suse.de
2024-01-24 17:03:44 +01:00
Ard Biesheuvel
d2baf8cc82 riscv/efistub: Tighten ELF relocation check
The EFI stub makefile contains logic to ensure that the objects that
make up the stub do not contain relocations that require runtime fixups
(typically to account for the runtime load address of the executable)

On RISC-V, we also avoid GP based relocations, as they require that GP
is assigned the correct base in the startup code, which is not
implemented in the EFI stub.

So add these relocation types to the grep expression that is used to
carry out this check.

Link: https://lkml.kernel.org/r/42c63cb9-87d0-49db-9af8-95771b186684%40siemens.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-01-23 14:31:33 +01:00
Jan Kiszka
afb2a4fb84 riscv/efistub: Ensure GP-relative addressing is not used
The cflags for the RISC-V efistub were missing -mno-relax, thus were
under the risk that the compiler could use GP-relative addressing. That
happened for _edata with binutils-2.41 and kernel 6.1, causing the
relocation to fail due to an invalid kernel_size in handle_kernel_image.
It was not yet observed with newer versions, but that may just be luck.

Cc: <stable@vger.kernel.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-01-23 14:31:32 +01:00
Cristian Marussi
0c565d16b8 firmware: arm_ffa: Handle partitions setup failures
Make ffa_setup_partitions() fail, cleanup and return an error when the Host
partition setup fails: in such a case ffa_init() itself will fail.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240108-ffa_fixes_6-8-v1-6-75bf7035bc50@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:07:12 +00:00
Cristian Marussi
ace760d9c0 firmware: arm_ffa: Use xa_insert() and check for result
While adding new partitions descriptors to the XArray the outcome of the
stores should be checked and, in particular, it has also to be ensured
that an existing entry with the same index was not already present, since
partitions IDs are expected to be unique.

Use xa_insert() instead of xa_store() since it returns -EBUSY when the
index is already in use and log an error when that happens.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240108-ffa_fixes_6-8-v1-5-75bf7035bc50@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:07:12 +00:00
Cristian Marussi
ad9d9a107a firmware: arm_ffa: Simplify ffa_partitions_cleanup()
On cleanup iterate the XArrays with xa_for_each() and remove the existent
entries with xa_erase(), finally destroy the XArray itself.

Remove partition_count field from drv_info since no more used anywhwere.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240108-ffa_fixes_6-8-v1-4-75bf7035bc50@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:07:12 +00:00
Cristian Marussi
c00d9738fd firmware: arm_ffa: Check xa_load() return value
Add a check to verify the result of xa_load() during the partition
lookups done while registering/unregistering the scheduler receiver
interrupt callbacks and while executing the main scheduler receiver
interrupt callback handler.

Fixes: 0184450b8b ("firmware: arm_ffa: Add schedule receiver callback mechanism")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240108-ffa_fixes_6-8-v1-3-75bf7035bc50@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:07:12 +00:00
Cristian Marussi
5ff30ade16 firmware: arm_ffa: Add missing rwlock_init() for the driver partition
Add the missing rwlock initialization for the FF-A partition associated
the driver in ffa_setup_partitions(). It will the primary scheduler
partition in the host or the VM partition in the virtualised environment.
IOW, it corresponds to the partition with VM ID == drv_info->vm_id.

Fixes: 1b6bf41b7a ("firmware: arm_ffa: Add notification handling mechanism")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240108-ffa_fixes_6-8-v1-2-75bf7035bc50@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:07:12 +00:00
Cristian Marussi
59b2e242b1 firmware: arm_ffa: Add missing rwlock_init() in ffa_setup_partitions()
Add the missing rwlock initialization for the individual FF-A partition
information in ffa_setup_partitions().

Fixes: 0184450b8b ("firmware: arm_ffa: Add schedule receiver callback mechanism")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240108-ffa_fixes_6-8-v1-1-75bf7035bc50@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:07:11 +00:00
Cristian Marussi
6bd1b3fede firmware: arm_scmi: Fix the clock protocol supported version
Rollback currently supported SCMI clock protocol version to v2.0 since
some of the mandatory v3.0 features are indeed still not supported yet.

Fixes: b5efc28a75 ("firmware: arm_scmi: Add protocol versioning checks")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240109181716.2338636-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:01:17 +00:00
Cristian Marussi
27600c96e2 firmware: arm_scmi: Fix the clock protocol version for v3.2
The clock protocol version as per the SCMI v3.2 specification is 0x30000.
Enable the v3.0 clock protocol features only when clock protocol version
equals 0x30000.

The previous beta version of the spec had this value set to 0x20001 and
th same value trickled down from the initial development. The version
update were missed in the driver.

Fixes: e49e314a2c ("firmware: arm_scmi: Add clock v3.2 CONFIG_SET support")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240109150106.2066739-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:01:17 +00:00
Cristian Marussi
b5dc0ffd36 firmware: arm_scmi: Use xa_insert() when saving raw queues
Use xa_insert() when saving per-channel raw queues to better check for
duplicates.

Fixes: 7860701d1e ("firmware: arm_scmi: Add per-channel raw injection support")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240108185050.1628687-2-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:01:17 +00:00
Cristian Marussi
e8ef4bbe39 firmware: arm_scmi: Use xa_insert() to store opps
When storing opps by level or index use xa_insert() instead of xa_store()
and add error-checking to spot bad duplicates indexes possibly wrongly
provided by the platform firmware.

Fixes: 31c7c1397a ("firmware: arm_scmi: Add v3.2 perf level indexing mode support")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240108185050.1628687-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:01:17 +00:00
Tanzir Hasan
0726fcc8d4 firmware: arm_scmi: Replace asm-generic/bug.h with linux/bug.h
linux/bug.h includes asm-generic/bug.h already and hence replacing
asm-generic/bug.h with linux/bug.h will not regress any build.
Also, it is always better to avoid header file inclusion from asm-generic
if possible.

Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Tanzir Hasan <tanzirh@google.com>
Link: https://lore.kernel.org/r/20231226-shmem-v1-1-ea15ce81d8ba@google.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:01:16 +00:00
Cristian Marussi
437a310b22 firmware: arm_scmi: Check mailbox/SMT channel for consistency
On reception of a completion interrupt the shared memory area is accessed
to retrieve the message header at first and then, if the message sequence
number identifies a transaction which is still pending, the related
payload is fetched too.

When an SCMI command times out the channel ownership remains with the
platform until eventually a late reply is received and, as a consequence,
any further transmission attempt remains pending, waiting for the channel
to be relinquished by the platform.

Once that late reply is received the channel ownership is given back
to the agent and any pending request is then allowed to proceed and
overwrite the SMT area of the just delivered late reply; then the wait
for the reply to the new request starts.

It has been observed that the spurious IRQ related to the late reply can
be wrongly associated with the freshly enqueued request: when that happens
the SCMI stack in-flight lookup procedure is fooled by the fact that the
message header now present in the SMT area is related to the new pending
transaction, even though the real reply has still to arrive.

This race-condition on the A2P channel can be detected by looking at the
channel status bits: a genuine reply from the platform will have set the
channel free bit before triggering the completion IRQ.

Add a consistency check to validate such condition in the A2P ISR.

Reported-by: Xinglong Yang <xinglong.yang@cixtech.com>
Closes: https://lore.kernel.org/all/PUZPR06MB54981E6FA00D82BFDBB864FBF08DA@PUZPR06MB5498.apcprd06.prod.outlook.com/
Fixes: 5c8a47a5a9 ("firmware: arm_scmi: Make scmi core independent of the transport type")
Cc: stable@vger.kernel.org # 5.15+
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Xinglong Yang <xinglong.yang@cixtech.com>
Link: https://lore.kernel.org/r/20231220172112.763539-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-01-22 10:01:16 +00:00
Helge Deller
2bebc3cd48 Revert "firmware/sysfb: Clear screen_info state after consuming it"
This reverts commit df67699c9c.

Jens Axboe reported a regression that his machine is failing to show a
console, or in fact anything, on current -git. There's no output and no
console after:

Loading Linux 6.7.0+ ...
Loading initial ramdisk ...

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Jens Axboe <axboe@kernel.dk>
2024-01-19 22:22:26 +01:00
Linus Torvalds
296455ade1 Char/Misc and other Driver changes for 6.8-rc1
Here is the big set of char/misc and other driver subsystem changes for
 6.8-rc1.  Lots of stuff in here, but first off, you will get a merge
 conflict in drivers/android/binder_alloc.c when merging this tree due to
 changing coming in through the -mm tree.
 
 The resolution of the merge issue can be found here:
 	https://lore.kernel.org/r/20231207134213.25631ae9@canb.auug.org.au
 or in a simpler patch form in that thread:
 	https://lore.kernel.org/r/ZXHzooF07LfQQYiE@google.com
 
 If there are issues with the merge of this file, please let me know.
 
 Other than lots of binder driver changes (as you can see by the merge
 conflicts) included in here are:
  - lots of iio driver updates and additions
  - spmi driver updates
  - eeprom driver updates
  - firmware driver updates
  - ocxl driver updates
  - mhi driver updates
  - w1 driver updates
  - nvmem driver updates
  - coresight driver updates
  - platform driver remove callback api changes
  - tags.sh script updates
  - bus_type constant marking cleanups
  - lots of other small driver updates
 
 All of these have been in linux-next for a while with no reported issues
 (other than the binder merge conflict.)
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZaeMMQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynWNgCfQ/Yz7QO6EMLDwHO5LRsb3YMhjL4AoNVdanjP
 YoI7f1I4GBcC0GKNfK6s
 =+Kyv
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc and other driver updates from Greg KH:
 "Here is the big set of char/misc and other driver subsystem changes
  for 6.8-rc1.

  Other than lots of binder driver changes (as you can see by the merge
  conflicts) included in here are:

   - lots of iio driver updates and additions

   - spmi driver updates

   - eeprom driver updates

   - firmware driver updates

   - ocxl driver updates

   - mhi driver updates

   - w1 driver updates

   - nvmem driver updates

   - coresight driver updates

   - platform driver remove callback api changes

   - tags.sh script updates

   - bus_type constant marking cleanups

   - lots of other small driver updates

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'char-misc-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (341 commits)
  android: removed duplicate linux/errno
  uio: Fix use-after-free in uio_open
  drivers: soc: xilinx: add check for platform
  firmware: xilinx: Export function to use in other module
  scripts/tags.sh: remove find_sources
  scripts/tags.sh: use -n to test archinclude
  scripts/tags.sh: add local annotation
  scripts/tags.sh: use more portable -path instead of -wholename
  scripts/tags.sh: Update comment (addition of gtags)
  firmware: zynqmp: Convert to platform remove callback returning void
  firmware: turris-mox-rwtm: Convert to platform remove callback returning void
  firmware: stratix10-svc: Convert to platform remove callback returning void
  firmware: stratix10-rsu: Convert to platform remove callback returning void
  firmware: raspberrypi: Convert to platform remove callback returning void
  firmware: qemu_fw_cfg: Convert to platform remove callback returning void
  firmware: mtk-adsp-ipc: Convert to platform remove callback returning void
  firmware: imx-dsp: Convert to platform remove callback returning void
  firmware: coreboot_table: Convert to platform remove callback returning void
  firmware: arm_scpi: Convert to platform remove callback returning void
  firmware: arm_scmi: Convert to platform remove callback returning void
  ...
2024-01-17 16:47:17 -08:00
Linus Torvalds
d97a78423c fbdev fixes and cleanups for 6.8-rc1:
- Remove intelfb fbdev driver (Thomas Zimmermann)
 - Remove amba-clcd fbdev driver (Linus Walleij)
 - Remove vmlfb Carillo Ranch fbdev driver (Matthew Wilcox)
 - fb_deferred_io flushing fixes (Nam Cao)
 - imxfb code fixes and cleanups (Dario Binacchi)
 - stifb primary screen detection cleanups (Thomas Zimmermann)
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCZaEregAKCRD3ErUQojoP
 X0c9AP0ZdpE1zWFdjYg7ucKhNGrMfXWS8auvkC0qdd9Q0psnmQD/Z22JIl/fpgrk
 0T74KAEd7MwMXGIUm5VKMe/AZJtaBgs=
 =/sky
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-for-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev updates from Helge Deller:
 "Three fbdev drivers (~8500 lines of code) removed. The Carillo Ranch
  fbdev driver is for an Intel product which was never shipped, and for
  the intelfb and the amba-clcd drivers the drm drivers can be used
  instead.

  The other code changes are minor: some fb_deferred_io flushing fixes,
  imxfb margin fixes and stifb cleanups.

  Summary:
   - Remove intelfb fbdev driver (Thomas Zimmermann)
   - Remove amba-clcd fbdev driver (Linus Walleij)
   - Remove vmlfb Carillo Ranch fbdev driver (Matthew Wilcox)
   - fb_deferred_io flushing fixes (Nam Cao)
   - imxfb code fixes and cleanups (Dario Binacchi)
   - stifb primary screen detection cleanups (Thomas Zimmermann)"

* tag 'fbdev-for-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (28 commits)
  fbdev/intelfb: Remove driver
  fbdev/hyperv_fb: Do not clear global screen_info
  firmware/sysfb: Clear screen_info state after consuming it
  fbdev/hyperv_fb: Remove firmware framebuffers with aperture helpers
  drm/hyperv: Remove firmware framebuffers with aperture helper
  fbdev/sis: Remove dependency on screen_info
  video/logo: use %u format specifier for unsigned int values
  video/sticore: Remove info field from STI struct
  arch/parisc: Detect primary video device from device instance
  fbdev/stifb: Allocate fb_info instance with framebuffer_alloc()
  video/sticore: Store ROM device in STI struct
  fbdev: flush deferred IO before closing
  fbdev: flush deferred work in fb_deferred_io_fsync()
  fbdev: amba-clcd: Delete the old CLCD driver
  fbdev: Remove support for Carillo Ranch driver
  fbdev: hgafb: fix kernel-doc comments
  fbdev: mmp: Fix typo and wording in code comment
  fbdev: fsl-diu-fb: Fix sparse warning due to virt_to_phys() prototype change
  fbdev: imxfb: add '*/' on a separate line in block comment
  fbdev: imxfb: use __func__ for function name
  ...
2024-01-12 14:38:08 -08:00
Linus Torvalds
0c4b09cb54 Core:
- Move the generic PM domain and its governor to the pmdomain subsystem
  - Drop the unused pm_genpd_opp_to_performance_state()
 
 Providers:
  - Convert some providers to let the ->remove() callback return void
  - amlogic: Add support for G12A ISP power domain
  - arm: Move the SCPI power-domain driver to the pmdomain subsystem
  - arm: Move Kconfig options to the pmdomain subsystem
  - qcom: Update part number to X1E80100 for the rpmhpd
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmWhIk8XHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjCnvBBAAslgbFE31AthRFjRizsIhLD4+
 WXYbuAEWUGOV0VKbcs6JLGqMmgqZ8caPieNWNDPz18M2BpJ3MguS7k5YW6G12QIb
 7nmL/DCYrObO+Q8hMqPaHMRuV6+KjJ+y6UbZrKHKq+ROE+Pk5vfMk1x68nA+J5mO
 rmsDv6eAsBggo4ubDcQ79bJf4t7RdWAcNz6IY8fwZ9HkNbbaC6db6BT0t9f1aTX7
 yeZWxdy317y174xdwPTtQ5dnXQmC3FEBCuG4M0J4gb6nvLtbpoeYqlGrxkNGKxqv
 1IfMl45uu7OuGSq1f3LSpuQluAQs99KG8Y9vTG6kXKC5Xu3sIijciaGTJsCao91e
 af9pjLeX3DWl0RaLUtOB0h78meCHxf79kFUkGUv89FzIWh8iQMWcdwePeXXSNXag
 AklV/gpodCj501Dk1wjs2/3eVI5YUsEcqhLvu9Q3gzDqXy4px8Keut8AollNsfg8
 nZ9P3Kr0eHV2xqtTGYKheebLj5IDWGPC6XS+L60piij52gN6QWnywX/8Kjdms1l6
 2CclTrJ1YZG+I6tLTnrsdy0m9U2w5V2DP/rf+m/lQTRG2d9ZWdKQ+qzakQ7va4Pz
 hokLrm1cC0Wcx/ldwV1wC62WkTnRBmtA4ONMzibAFUCboay8xU7p0OaRmBJcOaPF
 +Nw7Mt3tt4Qn7iE8Fd4=
 =xSMR
 -----END PGP SIGNATURE-----

Merge tag 'pmdomain-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm

Pull pmdomain updates from Ulf Hansson:
 "Core:
   - Move the generic PM domain and its governor to the pmdomain
     subsystem
   - Drop the unused pm_genpd_opp_to_performance_state()

  Providers:
   - Convert some providers to let the ->remove() callback return void
   - amlogic: Add support for G12A ISP power domain
   - arm: Move the SCPI power-domain driver to the pmdomain subsystem
   - arm: Move Kconfig options to the pmdomain subsystem
   - qcom: Update part number to X1E80100 for the rpmhpd"

* tag 'pmdomain-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
  PM: domains: Move genpd and its governor to the pmdomain subsystem
  PM: domains: Drop redundant header for genpd
  PM: domains: Drop the unused pm_genpd_opp_to_performance_state()
  PM: domains: fix domain_governor kernel-doc warnings
  pmdomain: xilinx/zynqmp: Convert to platform remove callback returning void
  pmdomain: qcom-cpr: Convert to platform remove callback returning void
  pmdomain: imx93-pd: Convert to platform remove callback returning void
  pmdomain: imx93-blk-ctrl: Convert to platform remove callback returning void
  pmdomain: imx8mp-blk-ctrl: Convert to platform remove callback returning void
  pmdomain: imx8m-blk-ctrl: Convert to platform remove callback returning void
  pmdomain: imx-gpcv2: Convert to platform remove callback returning void
  pmdomain: imx-gpc: Convert to platform remove callback returning void
  pmdomain: imx-pgc: Convert to platform remove callback returning void
  pmdomain: amlogic: meson-ee-pwrc: add support for G12A ISP power domain
  dt-bindings: power: meson-g12a-power: document ISP power domain
  firmware: arm_scpi: Move power-domain driver to the pmdomain dir
  pmdomain: arm_scmi: Move Kconfig options to the pmdomain subsystem
  pmdomain: qcom: rpmhpd: Update part number to X1E80100
  dt-bindings: power: rpmpd: Update part number to X1E80100
2024-01-12 13:54:25 -08:00
Thomas Zimmermann
df67699c9c firmware/sysfb: Clear screen_info state after consuming it
After consuming the global screen_info_state in sysfb_init(), the
created platform device maintains the firmware framebuffer. Clear
screen_info to avoid conflicting access. Subsequent kexec reboots
now ignore the firmware framebuffer.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Helge Deller <deller@gmx.de>
2024-01-12 12:38:37 +01:00
Linus Torvalds
f6597d1706 SoC: driver updates for 6.8
A new drivers/cache/ subsystem is added to contain drivers for abstracting
 cache flush methods on riscv and potentially others, as this is needed for
 handling non-coherent DMA but several SoCs require nonstandard hardware
 methods for it.
 
 op-tee gains support for asynchronous notification with FF-A, as well
 as support for a system thread for executing in secure world.
 
 The tee, reset, bus, memory and scmi subsystems have a couple of minor
 updates.
 
 Platform specific soc driver changes include:
 
  - Samsung Exynos gains driver support for Google GS101 (Tensor G1)
    across multiple subsystems
 
  - Qualcomm Snapdragon gains support for SM8650 and X1E along with
    added features for some other SoCs
 
  - Mediatek adds support for "Smart Voltage Scaling" on MT8186 and MT8195,
    and driver support for MT8188 along with some code refactoring.
 
  - Microchip Polarfire FPGA support for "Auto Update" of the FPGA bitstream
 
  - Apple M1 mailbox driver is rewritten into a SoC driver
 
  - minor updates on amlogic, mvebu, ti, zynq, imx, renesas and hisilicon
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmWeypsACgkQYKtH/8kJ
 UifCpxAA0CMZRXKZOuTw9we2eS9rCy5nBrJsDiEAi9UPgQYUIrD7BVng+PAMN5UD
 AeEDEjUEmZ+a4hyDDPxwdlhI2qIvIITAZ1qbwcElXvt41MTIyo+1BK+kI6A7oxHd
 oPh9kG0yRjb5tNc6utrHbXpEb6AxfXYcdAOzA2YRonqKohYUJlGqHtAub2Dqd6FD
 nuYXGXSZKWMpd0L1X7nuD8+uBj8DbQgq0HfhiAj3vUgzwkYk/SlTo/DYByJOQeMA
 HE1X/vG7qwrdHC4VNXaiJJ/GQ6ZXAZXdK+F97v+FtfClPVuxAffMlTbb6t/CyiVb
 4HrVzduyNMlIh8OqxLXabXJ0iJ970wkuPlOZy2pZmgkV5oKGSXSGxXWAwMvOmCVO
 RSgetXYHX3gDGQ59Si+LsEQhORdChMMik5nBPdyxj1UK3QsObV40qLpHBae7GWnA
 Qb6+3FrtnbiHfOMxGmhC4lqDfgSfByW1BspxsFyy33wb+TPfYJzOnXYe8aYTZ1iw
 GSuWNa/uHF61Q2v0d3Lt09GhUh9wWradnJ+caxpB0B0MHG2QQqFI8EVwIEn1/spu
 bWpItLT8UUDgNx+F9KRzP3HqwqbDzd9fnojSPescTzudpvpP9MC5X3w05pQ6iA1x
 HFJ+2J/ENvDAHWSAySn7Qx4JKSeLxm1YcquXQW2sVTVwFTkqigw=
 =4bKY
 -----END PGP SIGNATURE-----

Merge tag 'soc-drivers-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC driver updates from Arnd Bergmann:
 "A new drivers/cache/ subsystem is added to contain drivers for
  abstracting cache flush methods on riscv and potentially others, as
  this is needed for handling non-coherent DMA but several SoCs require
  nonstandard hardware methods for it.

  op-tee gains support for asynchronous notification with FF-A, as well
  as support for a system thread for executing in secure world.

  The tee, reset, bus, memory and scmi subsystems have a couple of minor
  updates.

  Platform specific soc driver changes include:

   - Samsung Exynos gains driver support for Google GS101 (Tensor G1)
     across multiple subsystems

   - Qualcomm Snapdragon gains support for SM8650 and X1E along with
     added features for some other SoCs

   - Mediatek adds support for "Smart Voltage Scaling" on MT8186 and
     MT8195, and driver support for MT8188 along with some code
     refactoring.

   - Microchip Polarfire FPGA support for "Auto Update" of the FPGA
     bitstream

   - Apple M1 mailbox driver is rewritten into a SoC driver

   - minor updates on amlogic, mvebu, ti, zynq, imx, renesas and
     hisilicon"

* tag 'soc-drivers-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (189 commits)
  memory: ti-emif-pm: Convert to platform remove callback returning void
  memory: ti-aemif: Convert to platform remove callback returning void
  memory: tegra210-emc: Convert to platform remove callback returning void
  memory: tegra186-emc: Convert to platform remove callback returning void
  memory: stm32-fmc2-ebi: Convert to platform remove callback returning void
  memory: exynos5422-dmc: Convert to platform remove callback returning void
  memory: renesas-rpc-if: Convert to platform remove callback returning void
  memory: omap-gpmc: Convert to platform remove callback returning void
  memory: mtk-smi: Convert to platform remove callback returning void
  memory: jz4780-nemc: Convert to platform remove callback returning void
  memory: fsl_ifc: Convert to platform remove callback returning void
  memory: fsl-corenet-cf: Convert to platform remove callback returning void
  memory: emif: Convert to platform remove callback returning void
  memory: brcmstb_memc: Convert to platform remove callback returning void
  memory: brcmstb_dpfe: Convert to platform remove callback returning void
  soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset
  firmware: qcom: qseecom: fix memory leaks in error paths
  dt-bindings: clock: google,gs101: rename CMU_TOP gate defines
  soc: qcom: llcc: Fix typo in kernel-doc
  dt-bindings: soc: qcom,aoss-qmp: document the X1E80100 Always-On Subsystem side channel
  ...
2024-01-11 11:31:46 -08:00
Linus Torvalds
a7e4c6cf5b EFI updates for v6.8
- Fix a syzbot reported issue in efivarfs where concurrent accesses to
   the file system resulted in list corruption
 
 - Add support for accessing EFI variables via the TEE subsystem (and a
   trusted application in the secure world) instead of via EFI runtime
   firmware running in the OS's execution context
 
 - Avoid linker tricks to discover the image base on LoongArch
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQQm/3uucuRGn1Dmh0wbglWLn0tXAUCZYVaHQAKCRAwbglWLn0t
 XPm/AQDzX9A6TND00eOLYYWw91kybHnzrVd8GRKOv2EIxGz33AEAgW6nXIJlBRax
 MBq6S/sXdyknuCC3sO7H9FexdD4BzQM=
 =MZUx
 -----END PGP SIGNATURE-----

Merge tag 'efi-next-for-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI updates from Ard Biesheuvel:

 - Fix a syzbot reported issue in efivarfs where concurrent accesses to
   the file system resulted in list corruption

 - Add support for accessing EFI variables via the TEE subsystem (and a
   trusted application in the secure world) instead of via EFI runtime
   firmware running in the OS's execution context

 - Avoid linker tricks to discover the image base on LoongArch

* tag 'efi-next-for-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  efi: memmap: fix kernel-doc warnings
  efi/loongarch: Directly position the loaded image file
  efivarfs: automatically update super block flag
  efi: Add tee-based EFI variable driver
  efi: Add EFI_ACCESS_DENIED status code
  efi: expose efivar generic ops register function
  efivarfs: Move efivarfs list into superblock s_fs_info
  efivarfs: Free s_fs_info on unmount
  efivarfs: Move efivar availability check into FS context init
  efivarfs: force RO when remounting if SetVariable is not supported
2024-01-09 17:11:27 -08:00
Linus Torvalds
b9b56eb280 chrome platform firmware changes for 6.8
* Fixes
 
   - Fix an invalid address access.
 
 * Misc
 
   - Use .remove_new() for converting the callback to return void.
 -----BEGIN PGP SIGNATURE-----
 
 iIkEABYIADEWIQS0yQeDP3cjLyifNRUrxTEGBto89AUCZZu2NhMcdHp1bmdiaUBr
 ZXJuZWwub3JnAAoJECvFMQYG2jz0568A/2e7mfbrbOecSIJp+VFNnjg5sUJHKeKR
 qLMrQ2bW3N4bAQC6kb8hBi5bBjDu8qE/ivXn9MbKoXAdZ+gbWdGsSWD6DA==
 =ZOhl
 -----END PGP SIGNATURE-----

Merge tag 'tag-chrome-platform-firmware-for-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux

Pull chrome platform firmware updates from Tzung-Bi Shih:

  - Fix an invalid address access.

  - Use .remove_new() for converting the callback to return void

* tag 'tag-chrome-platform-firmware-for-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  firmware: coreboot: Convert to platform remove callback returning void
  firmware: coreboot: framebuffer: Avoid invalid zero physical address
2024-01-09 17:04:44 -08:00
Linus Torvalds
bd012f3a5b ACPI updates for 6.8-rc1
- Add CSI-2 and DisCo for Imaging support to the ACPI device
    enumeration code (Sakari Ailus, Rafael J. Wysocki).
 
  - Adjust the cpufreq thermal reduction algorithm in the ACPI processor
    driver for Tegra241 (Srikar Srimath Tirumala, Arnd Bergmann).
 
  - Make acpi_proc_quirk_mwait_check() x86-specific (Rafael J. Wysocki).
 
  - Switch over ACPI to using a threaded interrupt handler for the
    SCI (Rafael J. Wysocki).
 
  - Allow ACPI Notify () handlers to run on all CPUs and clean up the
    ACPI interface for deferred events processing (Rafael J. Wysocki).
 
  - Switch over the ACPI EC driver to using a threaded handler for the
    dedicated IRQ on systems without the EC GPE (Rafael J. Wysocki).
 
  - Adjust code using ACPICA spinlocks and the ACPI EC driver spinlock to
    keep local interrupts on (Rafael J. Wysocki).
 
  - Adjust the USB4 _OSC handshake to correctly handle cases in which
    certain types of OS control are denied by the platform (Mika
    Westerberg).
 
  - Correct and clean up the generic function for parsing ACPI data-only
    tables with array structure (Yuntao Wang).
 
  - Modify acpi_dev_uid_match() to support different types of its second
    argument and adjust its users accordingly (Raag Jadav).
 
  - Clean up code related to acpi_evaluate_reference() and ACPI device
    lists (Rafael J. Wysocki).
 
  - Use generic ACPI helpers for evaluating trip point temperature
    objects in the ACPI thermal zone driver (Rafael J. Wysockii, Arnd
    Bergmann).
 
  - Add Thermal fast Sampling Period (_TFP) support to the ACPI thermal
    zone driver (Jeff Brasen).
 
  - Modify the ACPI LPIT table handling code to avoid u32 multiplication
    overflows in state residency computations (Nikita Kiryushin).
 
  - Drop an unused helper function from the ACPI backlight (video) driver
    and add a clarifying comment to it (Hans de Goede).
 
  - Update the ACPI backlight driver to avoid using uninitialized memory
    in some cases (Nikita Kiryushin).
 
  - Add ACPI backlight quirk for the Colorful X15 AT 23 laptop (Yuluo
    Qiu).
 
  - Add support for vendor-defined error types to the ACPI APEI error
    injection code (Avadhut Naik).
 
  - Adjust APEI to properly set MF_ACTION_REQUIRED on synchronous memory
    failure events, so they are handled differently from the asynchronous
    ones (Shuai Xue).
 
  - Fix NULL pointer dereference check in the ACPI extlog driver (Prarit
    Bhargava).
 
  - Adjust the ACPI extlog driver to clear the Extended Error Log status
    when RAS_CEC handled the error (Tony Luck).
 
  - Add IRQ override quirks for some Infinity laptops and for TongFang
    GMxXGxx (David McFarland, Hans de Goede).
 
  - Clean up the ACPI NUMA code and fix it to ensure that fake_pxm is not
    the same as one of the real pxm values (Yuntao Wang).
 
  - Fix the fractional clock divider flags in the ACPI LPSS (Intel SoC)
    driver so as to prevent miscalculation of the values in the clock
    divider (Andy Shevchenko).
 
  - Adjust comments in the ACPI watchdog driver to prevent kernel-doc
    from complaining during documentation builds (Randy Dunlap).
 
  - Make the ACPI button driver send wakeup key events to user space in
    addition to power button events on systems that can be woken up by
    the power button (Ken Xue).
 
  - Adjust pnpacpi_parse_allocated_vendor() to use memcpy() on a full
    structure field (Dmitry Antipov).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmWb8asSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxhsQP/jfRiEP7L9WUl66PdzxSWi1u7bVUZIbs
 z07ujAFdAbvpdM1WgWVq6mSzYewAqIm0A9Koabj7zKuG4VPh0Gjvq26jrK/et65m
 RJhC/qcnZ4h/2bELf9/JE7FIQMDWBGK8gNHBBXVQOZrQYIiBzJ2xyHJ4F0AvLVW6
 GGuX/4mb00jlWGr6uot6qjBgLLxY0EowneLUuH4onEWrThoNWy7zbD34LSsKuljA
 a69UkQPetXbkX4XQYnt4K4BAnwjRQNU2DlUE9lpMtheTS70wilxrC+P0XaETeO7c
 NCm38X2aUv/hSwJ0BekBRdNEvG/WQsfRdOt9jWAkoCL3oDCZdOgfM6Eas7ZDLF2n
 RoxLk2O9UXFwaSSGBVgkRLPCVyWBNI6C8GXnVDN8f9hqIk+jmlsXaXghpzVlGS54
 +ox6fjO81zJjEBxSP5ACCTNZq3BwwHhPhygtIkTO5JQ9SPn+WYCPM0C5Lcvzoj7A
 x7cdOguddhAi4ZWcoRo2cg7qN6vVaDgDgV+ylzh7q5N4cBY4edCJLzcFFuasriN4
 j9/Uj/EgCafrnOhlTJz0iZkAbPZ6T/qa3qBfF948dtFRkztTsddmGA4xof90jfG9
 /FLXL4wSiXK7jbFeUb1OCLOVANWpjHP3pM3gmnggiI3ApcweEGilhhbgVr7FuCG8
 7qj78EUqNVbW
 =Ntzm
 -----END PGP SIGNATURE-----

Merge tag 'acpi-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "From the new features standpoint, the most significant change here is
  the addition of CSI-2 and MIPI DisCo for Imaging support to the ACPI
  device enumeration code that will allow MIPI cameras to be enumerated
  through the platform firmware on systems using ACPI.

  Also significant is the switch-over to threaded interrupt handlers for
  the ACPI SCI and the dedicated EC interrupt (on systems where the
  former is not used) which essentially allows all ACPI code to run with
  local interrupts enabled. That should improve responsiveness
  significantly on systems where multiple GPEs are enabled and the
  handling of one SCI involves many I/O address space accesses which
  previously had to be carried out in one go with disabled interrupts on
  the local CPU.

  Apart from the above, the ACPI thermal zone driver will use the
  Thermal fast Sampling Period (_TFP) object if available, which should
  allow temperature changes to be followed more accurately on some
  systems, the ACPI Notify () handlers can run on all CPUs (not just on
  CPU0), which should generally speed up the processing of events
  signaled through the ACPI SCI, and the ACPI power button driver will
  trigger wakeup key events via the input subsystem (on systems where it
  is a system wakeup device)

  In addition to that, there are the usual bunch of fixes and cleanups.

  Specifics:

   - Add CSI-2 and DisCo for Imaging support to the ACPI device
     enumeration code (Sakari Ailus, Rafael J. Wysocki)

   - Adjust the cpufreq thermal reduction algorithm in the ACPI
     processor driver for Tegra241 (Srikar Srimath Tirumala, Arnd
     Bergmann)

   - Make acpi_proc_quirk_mwait_check() x86-specific (Rafael J. Wysocki)

   - Switch over ACPI to using a threaded interrupt handler for the SCI
     (Rafael J. Wysocki)

   - Allow ACPI Notify () handlers to run on all CPUs and clean up the
     ACPI interface for deferred events processing (Rafael J. Wysocki)

   - Switch over the ACPI EC driver to using a threaded handler for the
     dedicated IRQ on systems without the EC GPE (Rafael J. Wysocki)

   - Adjust code using ACPICA spinlocks and the ACPI EC driver spinlock
     to keep local interrupts on (Rafael J. Wysocki)

   - Adjust the USB4 _OSC handshake to correctly handle cases in which
     certain types of OS control are denied by the platform (Mika
     Westerberg)

   - Correct and clean up the generic function for parsing ACPI
     data-only tables with array structure (Yuntao Wang)

   - Modify acpi_dev_uid_match() to support different types of its
     second argument and adjust its users accordingly (Raag Jadav)

   - Clean up code related to acpi_evaluate_reference() and ACPI device
     lists (Rafael J. Wysocki)

   - Use generic ACPI helpers for evaluating trip point temperature
     objects in the ACPI thermal zone driver (Rafael J. Wysockii, Arnd
     Bergmann)

   - Add Thermal fast Sampling Period (_TFP) support to the ACPI thermal
     zone driver (Jeff Brasen)

   - Modify the ACPI LPIT table handling code to avoid u32
     multiplication overflows in state residency computations (Nikita
     Kiryushin)

   - Drop an unused helper function from the ACPI backlight (video)
     driver and add a clarifying comment to it (Hans de Goede)

   - Update the ACPI backlight driver to avoid using uninitialized
     memory in some cases (Nikita Kiryushin)

   - Add ACPI backlight quirk for the Colorful X15 AT 23 laptop (Yuluo
     Qiu)

   - Add support for vendor-defined error types to the ACPI APEI error
     injection code (Avadhut Naik)

   - Adjust APEI to properly set MF_ACTION_REQUIRED on synchronous
     memory failure events, so they are handled differently from the
     asynchronous ones (Shuai Xue)

   - Fix NULL pointer dereference check in the ACPI extlog driver
     (Prarit Bhargava)

   - Adjust the ACPI extlog driver to clear the Extended Error Log
     status when RAS_CEC handled the error (Tony Luck)

   - Add IRQ override quirks for some Infinity laptops and for TongFang
     GMxXGxx (David McFarland, Hans de Goede)

   - Clean up the ACPI NUMA code and fix it to ensure that fake_pxm is
     not the same as one of the real pxm values (Yuntao Wang)

   - Fix the fractional clock divider flags in the ACPI LPSS (Intel SoC)
     driver so as to prevent miscalculation of the values in the clock
     divider (Andy Shevchenko)

   - Adjust comments in the ACPI watchdog driver to prevent kernel-doc
     from complaining during documentation builds (Randy Dunlap)

   - Make the ACPI button driver send wakeup key events to user space in
     addition to power button events on systems that can be woken up by
     the power button (Ken Xue)

   - Adjust pnpacpi_parse_allocated_vendor() to use memcpy() on a full
     structure field (Dmitry Antipov)"

* tag 'acpi-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (56 commits)
  ACPI: resource: Add Infinity laptops to irq1_edge_low_force_override
  ACPI: button: trigger wakeup key events
  ACPI: resource: Add another DMI match for the TongFang GMxXGxx
  ACPI: EC: Use a spin lock without disabing interrupts
  ACPI: EC: Use a threaded handler for dedicated IRQ
  ACPI: OSL: Use spin locks without disabling interrupts
  ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events
  ACPI: utils: Introduce helper for _DEP list lookup
  ACPI: utils: Fix white space in struct acpi_handle_list definition
  ACPI: utils: Refine acpi_handle_list_equal() slightly
  ACPI: utils: Return bool from acpi_evaluate_reference()
  ACPI: utils: Rearrange in acpi_evaluate_reference()
  ACPI: arm64: export acpi_arch_thermal_cpufreq_pctg()
  ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error
  ACPI: LPSS: Fix the fractional clock divider flags
  ACPI: NUMA: Fix the logic of getting the fake_pxm value
  ACPI: NUMA: Optimize the check for the availability of node values
  ACPI: NUMA: Remove unnecessary check in acpi_parse_gi_affinity()
  ACPI: watchdog: fix kernel-doc warnings
  ACPI: extlog: fix NULL pointer dereference check
  ...
2024-01-09 16:12:44 -08:00