lkml.org 
[lkml]   [2021]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v7 14/45] x86/compressed: Add helper for validating pages in the decompression stage
    From
    Date


    On 12/7/21 5:48 AM, Borislav Petkov wrote:
    > On Wed, Nov 10, 2021 at 04:07:00PM -0600, Brijesh Singh wrote:
    >> diff --git a/arch/x86/boot/compressed/ident_map_64.c b/arch/x86/boot/compressed/ident_map_64.c
    >> index f7213d0943b8..3cf7a7575f5c 100644
    >> --- a/arch/x86/boot/compressed/ident_map_64.c
    >> +++ b/arch/x86/boot/compressed/ident_map_64.c
    >> @@ -275,15 +275,31 @@ static int set_clr_page_flags(struct x86_mapping_info *info,
    >> * Changing encryption attributes of a page requires to flush it from
    >> * the caches.
    >> */
    >> - if ((set | clr) & _PAGE_ENC)
    >> + if ((set | clr) & _PAGE_ENC) {
    >> clflush_page(address);
    >>
    >> + /*
    >> + * If the encryption attribute is being cleared, then change
    >> + * the page state to shared in the RMP table.
    >> + */
    >> + if (clr)
    >> + snp_set_page_shared(pte_pfn(*ptep) << PAGE_SHIFT);
    >
    > So I'm wondering: __page_state_change() wants a physical address and
    > you're reading it out from the PTE here.
    >
    > Why not do
    >
    > __pa(address & PAGE_MASK);
    >
    > like it is usually done?

    I am okay to use __pa().

    thanks

    \
     
     \ /
      Last update: 2021-12-07 20:22    [W:5.118 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site