[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c9a1b86-efef-fa56-4451-ac3348b678bf@intel.com>
Date: Fri, 4 Nov 2022 07:38:17 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Coiby Xu <coxu@...hat.com>, kexec@...ts.infradead.org
Cc: Milan Broz <gmazyland@...il.com>,
Thomas Staudt <tstaudt@...ibm.com>,
Kairui Song <ryncsn@...il.com>, dm-devel@...hat.com,
Jan Pazdziora <jpazdziora@...hat.com>,
Pingfan Liu <kernelfans@...il.com>,
Baoquan He <bhe@...hat.com>, Dave Young <dyoung@...hat.com>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [RFC v2 4/5] x86/crash: make the page that stores the LUKS volume
key inaccessible
On 11/4/22 04:29, Coiby Xu wrote:
> + if (kexec_crash_image->luks_volume_key_addr) {
> + start = kexec_crash_image->luks_volume_key_addr;
> + end = start + kexec_crash_image->luks_volume_key_sz - 1;
> + page = pfn_to_page(start >> PAGE_SHIFT);
> + nr_pages = (end >> PAGE_SHIFT) - (start >> PAGE_SHIFT) + 1;
> + set_memory_np((unsigned long)page_address(page), nr_pages);
> + }
Why does this go pfn -> page -> vaddr? What good does having the page
do? Can you just do phys_to_virt() on the start address? Maybe:
start_paddr = kexec_crash_image->luks_volume_key_addr;
end_paddr = start_paddr + kexec_crash_image->luks_volume_key_sz - 1;
nr_pages = (PAGE_ALIGN(end_paddr) - PAGE_ALIGN_DOWN(start_paddr))/
PAGE_SIZE;
set_memory_np((unsigned long)phys_to_virt(start_paddr), nr_pages);
Also, if you resend this, please just cc the x86 folks on the series.
The other patches and cover letter have desperately needed context
around this.
Powered by blists - more mailing lists