lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c64b90c9-ee7f-4ca3-b199-24b4927d5608@linux.intel.com>
Date: Fri, 15 Aug 2025 13:38:33 +0800
From: Binbin Wu <binbin.wu@...ux.intel.com>
To: Sagi Shahar <sagis@...gle.com>
Cc: linux-kselftest@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
 Shuah Khan <shuah@...nel.org>, Sean Christopherson <seanjc@...gle.com>,
 Ackerley Tng <ackerleytng@...gle.com>, Ryan Afranji <afranji@...gle.com>,
 Andrew Jones <ajones@...tanamicro.com>,
 Isaku Yamahata <isaku.yamahata@...el.com>,
 Erdem Aktas <erdemaktas@...gle.com>,
 Rick Edgecombe <rick.p.edgecombe@...el.com>,
 Roger Wang <runanwang@...gle.com>, Oliver Upton <oliver.upton@...ux.dev>,
 "Pratik R. Sampat" <pratikrajesh.sampat@....com>,
 Reinette Chatre <reinette.chatre@...el.com>, Ira Weiny
 <ira.weiny@...el.com>, linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [PATCH v8 26/30] KVM: selftests: TDX: Add support for
 TDG.MEM.PAGE.ACCEPT



On 8/8/2025 4:16 AM, Sagi Shahar wrote:
> From: Ackerley Tng <ackerleytng@...gle.com>
>
> Add support for TDG.MEM.PAGE.ACCEPT that the guest uses to accept
> a pending private page, previously added by TDH.MEM.PAGE.AUG or after
> conversion using the KVM_SET_MEMORY_ATTRIBUTES ioctl().

KVM_SET_MEMORY_ATTRIBUTES does the invalidation and attribute change, but it
doesn't add pending private pages.

Actually, pending pages are still added by TDH.MEM.PAGE.AUG during fault path.

>
> Signed-off-by: Ackerley Tng <ackerleytng@...gle.com>
> Signed-off-by: Sagi Shahar <sagis@...gle.com>
> ---
>   tools/testing/selftests/kvm/include/x86/tdx/tdx.h | 2 ++
>   tools/testing/selftests/kvm/lib/x86/tdx/tdx.c     | 7 +++++++
>   2 files changed, 9 insertions(+)
>
> diff --git a/tools/testing/selftests/kvm/include/x86/tdx/tdx.h b/tools/testing/selftests/kvm/include/x86/tdx/tdx.h
> index 88f3571df16f..53637159fa12 100644
> --- a/tools/testing/selftests/kvm/include/x86/tdx/tdx.h
> +++ b/tools/testing/selftests/kvm/include/x86/tdx/tdx.h
> @@ -7,6 +7,7 @@
>   #include "kvm_util.h"
>   
>   #define TDG_VP_INFO 1
> +#define TDG_MEM_PAGE_ACCEPT 6
>   
>   #define TDG_VP_VMCALL_GET_TD_VM_CALL_INFO 0x10000
>   #define TDG_VP_VMCALL_MAP_GPA 0x10001
> @@ -40,5 +41,6 @@ uint64_t tdg_vp_info(uint64_t *rcx, uint64_t *rdx,
>   		     uint64_t *r8, uint64_t *r9,
>   		     uint64_t *r10, uint64_t *r11);
>   uint64_t tdg_vp_vmcall_map_gpa(uint64_t address, uint64_t size, uint64_t *data_out);
> +uint64_t tdg_mem_page_accept(uint64_t gpa, uint8_t level);
>   
>   #endif // SELFTEST_TDX_TDX_H
> diff --git a/tools/testing/selftests/kvm/lib/x86/tdx/tdx.c b/tools/testing/selftests/kvm/lib/x86/tdx/tdx.c
> index bae84c34c19e..a51ab7511936 100644
> --- a/tools/testing/selftests/kvm/lib/x86/tdx/tdx.c
> +++ b/tools/testing/selftests/kvm/lib/x86/tdx/tdx.c
> @@ -3,6 +3,7 @@
>   #include <linux/kvm_para.h>
>   #include <string.h>
>   
> +#include "processor.h"
>   #include "tdx/tdcall.h"
>   #include "tdx/tdx.h"
>   #include "tdx/tdx_util.h"
> @@ -215,3 +216,9 @@ uint64_t tdg_vp_vmcall_map_gpa(uint64_t address, uint64_t size, uint64_t *data_o
>   		*data_out = args.r11;
>   	return ret;
>   }
> +
> +uint64_t tdg_mem_page_accept(uint64_t gpa, uint8_t level)
> +{
> +	return __tdx_module_call(TDG_MEM_PAGE_ACCEPT, (gpa & PAGE_MASK) | level,
> +				 0, 0, 0, NULL);
> +}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ