Re: [PATCH v2 1/1] swiotlb: do not free decrypted pages if dynamic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2023-11-02 at 10:36 +0100, Petr Tesarik wrote:
> +       vaddr = phys_to_virt(paddr);
>         if (set_memory_decrypted((unsigned long)vaddr,
> PFN_UP(bytes)))
>                 goto error;
>         return page;
>  
>  error:
> -       __free_pages(page, order);
> +       /* Intentional leak if pages cannot be encrypted again. */
> +       if (!set_memory_encrypted((unsigned long)vaddr,
> PFN_UP(bytes)))
> +               __free_pages(page, order);
>         return NULL;
>  }

My patch was going to just leak the pages if set_memory_decrypted()
fails, and not try to re-encrypt. It didn't seem worth the extra logic
for the rare case. But this works too.

Reviewed-by: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux