]> git.baikalelectronics.ru Git - kernel.git/commit
x86/compressed/64: Add identity mappings for setup_data entries
authorMichael Roth <michael.roth@amd.com>
Wed, 6 Jul 2022 02:53:15 +0000 (21:53 -0500)
committerBorislav Petkov <bp@suse.de>
Wed, 6 Jul 2022 09:23:39 +0000 (11:23 +0200)
commit6dbd7dbc23402b72ce6b07181e3414f07cbadabd
treeec9328cb876bbe1ae169bc06fa4babe952946be6
parenta0ad1a4b6ec9f89dd7023f22b5672cbf4c2d6887
x86/compressed/64: Add identity mappings for setup_data entries

The decompressed kernel initially relies on the identity map set up by
the boot/compressed kernel for accessing things like boot_params. With
the recent introduction of SEV-SNP support, the decompressed kernel
also needs to access the setup_data entries pointed to by
boot_params->hdr.setup_data.

This can lead to a crash in the kexec kernel during early boot due to
these entries not currently being included in the initial identity map,
see thread at Link below.

Include mappings for the setup_data entries in the initial identity map.

  [ bp: Massage commit message and use a helper var for better readability. ]

Fixes: 2a4b04480103 ("x86/sev: Add SEV-SNP feature detection/setup")
Reported-by: Jun'ichi Nomura <junichi.nomura@nec.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/TYCPR01MB694815CD815E98945F63C99183B49@TYCPR01MB6948.jpnprd01.prod.outlook.com
arch/x86/boot/compressed/ident_map_64.c