Re: [PATCH 10/13] x86/virt/tdx: Add SEAMCALL wrappers to remove a TD private page

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

 



On 1/6/25 22:43, Yan Zhao wrote:
> +u64 tdh_phymem_page_wbinvd_hkid(struct page *page, u16 hkid)
> +{
> +       struct tdx_module_args args = {};
> +
> +       args.rcx = page_to_phys(page) | ((hpa_t)hkid << boot_cpu_data.x86_phys_bits);

I've seen this idiom enough times. You need a helper:

u64 mk_keyed_paddr(struct page *page, u64 keyid)
{
	u64 ret;

	ret = page_to_phys(page);
	/* KeyID bits are just above the physical address bits: */
	ret |= keyid << boot_cpu_data.x86_phys_bits;
	
	return ret;
}

Although I'm also debating a bit what the typing on 'keyid' should be.
Right now it's quite tied to the physical address width, but that's not
fundamental to TDX. It could absolutely change in the future.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux