diff options
author | Borislav Petkov <bp@suse.de> | 2022-05-02 17:33:40 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2022-05-02 17:34:29 +0200 |
commit | ab65f49253ff706723ecbf87af74e9383b5e4582 (patch) | |
tree | 37ed5373d429b3e89037c91087440683f51659bd /arch/x86/kernel | |
parent | c2106a231c2ba36ff9af50cdf2867b9a5f8150a6 (diff) | |
download | linux-ab65f49253ff706723ecbf87af74e9383b5e4582.tar.bz2 |
x86/sev: Fix address space sparse warning
Fix:
arch/x86/kernel/sev.c:605:16: warning: incorrect type in assignment (different address spaces)
arch/x86/kernel/sev.c:605:16: expected struct snp_secrets_page_layout *layout
arch/x86/kernel/sev.c:605:16: got void [noderef] __iomem *[assigned] mem
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/202205022233.XgNDR7WR-lkp@intel.com
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/sev.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c index 166375084b1f..c05f0124c410 100644 --- a/arch/x86/kernel/sev.c +++ b/arch/x86/kernel/sev.c @@ -589,20 +589,23 @@ static u64 __init get_secrets_page(void) static u64 __init get_snp_jump_table_addr(void) { struct snp_secrets_page_layout *layout; + void __iomem *mem; u64 pa, addr; pa = get_secrets_page(); if (!pa) return 0; - layout = (__force void *)ioremap_encrypted(pa, PAGE_SIZE); - if (!layout) { + mem = ioremap_encrypted(pa, PAGE_SIZE); + if (!mem) { pr_err("Unable to locate AP jump table address: failed to map the SNP secrets page.\n"); return 0; } + layout = (__force struct snp_secrets_page_layout *)mem; + addr = layout->os_area.ap_jump_table_pa; - iounmap(layout); + iounmap(mem); return addr; } |