Re: [PATCH 2/2] x86/snp: Convert shared memory back to private on kexec

2024-02-22 Thread Tom Lendacky
On 2/22/24 04:50, Kirill A. Shutemov wrote: On Wed, Feb 21, 2024 at 02:35:13PM -0600, Tom Lendacky wrote: @@ -906,6 +917,206 @@ void snp_accept_memory(phys_addr_t start, phys_addr_t end) set_pages_state(vaddr, npages, SNP_PAGE_STATE_PRIVATE); } +static inline bool pte_decrypted(pte_t

Re: [PATCH 2/2] x86/snp: Convert shared memory back to private on kexec

2024-02-22 Thread Kirill A. Shutemov
On Wed, Feb 21, 2024 at 02:35:13PM -0600, Tom Lendacky wrote: > > @@ -906,6 +917,206 @@ void snp_accept_memory(phys_addr_t start, phys_addr_t > > end) > > set_pages_state(vaddr, npages, SNP_PAGE_STATE_PRIVATE); > > } > > +static inline bool pte_decrypted(pte_t pte) > > +{ > > + return

Re: [PATCH 2/2] x86/snp: Convert shared memory back to private on kexec

2024-02-21 Thread Tom Lendacky
On 2/19/24 19:18, Ashish Kalra wrote: From: Ashish Kalra SNP guests allocate shared buffers to perform I/O. It is done by allocating pages normally from the buddy allocator and converting them to shared with set_memory_decrypted(). The second kernel has no idea what memory is converted this

[PATCH 2/2] x86/snp: Convert shared memory back to private on kexec

2024-02-19 Thread Ashish Kalra
From: Ashish Kalra SNP guests allocate shared buffers to perform I/O. It is done by allocating pages normally from the buddy allocator and converting them to shared with set_memory_decrypted(). The second kernel has no idea what memory is converted this way. It only sees E820_TYPE_RAM.