Re: [PATCHv3 09/14] x86/tdx: Account shared memory

2023-11-21 Thread kirill.shute...@linux.intel.com
On Tue, Nov 21, 2023 at 12:42:20PM +0300, kirill.shute...@linux.intel.com wrote: > > That being said, I think perhaps you can separate the /sysfs part as a > > separate > > patch because it's not a mandatory part of this series but a nice to have. > > Then > > the /sysfs part can be reviewed

Re: [PATCHv3 09/14] x86/tdx: Account shared memory

2023-11-21 Thread kirill.shute...@linux.intel.com
On Tue, Nov 21, 2023 at 02:47:29AM +, Huang, Kai wrote: > > > +static atomic_long_t nr_shared; > > + > > +static inline bool pte_decrypted(pte_t pte) > > +{ > > + return cc_mkdec(pte_val(pte)) == pte_val(pte); > > +} > > + > > /* Called from __tdx_hypercall() for unrecoverable failure */ >

Re: [PATCHv3 09/14] x86/tdx: Account shared memory

2023-11-20 Thread Huang, Kai
> +static atomic_long_t nr_shared; > + > +static inline bool pte_decrypted(pte_t pte) > +{ > + return cc_mkdec(pte_val(pte)) == pte_val(pte); > +} > + > /* Called from __tdx_hypercall() for unrecoverable failure */ > noinstr void __noreturn __tdx_hypercall_failed(void) > { > @@ -820,6

[PATCHv3 09/14] x86/tdx: Account shared memory

2023-11-15 Thread Kirill A. Shutemov
The kernel will convert all shared memory back to private during kexec. The direct mapping page tables will provide information on which memory is shared. It is extremely important to convert all shared memory. If a page is missed, it will cause the second kernel to crash when it accesses it.