aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/Makefile
diff options
context:
space:
mode:
authorGravatar Isaku Yamahata <isaku.yamahata@intel.com> 2021-03-18 13:26:57 -0700
committerGravatar Borislav Petkov <bp@suse.de> 2021-03-23 11:59:45 +0100
commit8249d17d3194eac064a8ca5bc5ca0abc86feecde (patch)
treed13e20babf47b3d10bd481c58cef24518aedaf1c /arch/x86/Makefile
parentLinux 5.12-rc4 (diff)
downloadlinux-8249d17d3194eac064a8ca5bc5ca0abc86feecde.tar.gz
linux-8249d17d3194eac064a8ca5bc5ca0abc86feecde.tar.bz2
linux-8249d17d3194eac064a8ca5bc5ca0abc86feecde.zip
x86/mem_encrypt: Correct physical address calculation in __set_clr_pte_enc()
The pfn variable contains the page frame number as returned by the pXX_pfn() functions, shifted to the right by PAGE_SHIFT to remove the page bits. After page protection computations are done to it, it gets shifted back to the physical address using page_level_shift(). That is wrong, of course, because that function determines the shift length based on the level of the page in the page table but in all the cases, it was shifted by PAGE_SHIFT before. Therefore, shift it back using PAGE_SHIFT to get the correct physical address. [ bp: Rewrite commit message. ] Fixes: dfaaec9033b8 ("x86: Add support for changing memory encryption attribute in early boot") Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Cc: <stable@vger.kernel.org> Link: https://lkml.kernel.org/r/81abbae1657053eccc535c16151f63cd049dcb97.1616098294.git.isaku.yamahata@intel.com
Diffstat (limited to 'arch/x86/Makefile')
0 files changed, 0 insertions, 0 deletions