lkml.org 
[lkml]   [2016]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC PATCH v2 19/20] x86: Access the setup data through debugfs un-encrypted
    From
    Date
    On 09/12/2016 11:59 AM, Borislav Petkov wrote:
    > On Mon, Aug 22, 2016 at 05:38:59PM -0500, Tom Lendacky wrote:
    >> Since the setup data is in memory in the clear, it must be accessed as
    >> un-encrypted. Always use ioremap (similar to sysfs setup data support)
    >> to map the data.
    >>
    >> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
    >> ---
    >> arch/x86/kernel/kdebugfs.c | 30 +++++++++++-------------------
    >> 1 file changed, 11 insertions(+), 19 deletions(-)
    >>
    >> diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c
    >> index bdb83e4..a58a82e 100644
    >> --- a/arch/x86/kernel/kdebugfs.c
    >> +++ b/arch/x86/kernel/kdebugfs.c
    >> @@ -48,17 +48,13 @@ static ssize_t setup_data_read(struct file *file, char __user *user_buf,
    >>
    >> pa = node->paddr + sizeof(struct setup_data) + pos;
    >> pg = pfn_to_page((pa + count - 1) >> PAGE_SHIFT);
    >> - if (PageHighMem(pg)) {
    >
    > Why is it ok to get rid of the PageHighMem() check?

    Since the change is to perform the ioremap call no matter what the check
    for PageHighMem() wasn't needed anymore.

    >
    > Btw, we did talk earlier in the thread about making __va() clear the SME
    > mask and then you won't really need to change stuff here. Or?

    This is still required because just using the __va() would still cause
    the mapping created to have the encryption bit set. The ioremap call
    will result in the mapping not having the encryption bit set.

    Thanks,
    Tom

    >

    \
     
     \ /
      Last update: 2016-09-17 09:59    [W:4.188 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site