Re: [RFC v2 27/32] x86/tdx: Exclude Shared bit from __PHYSICAL_MASK

From: Andi Kleen
Date: Thu May 20 2021 - 16:31:27 EST



On 5/20/2021 1:16 PM, Sean Christopherson wrote:
On Thu, May 20, 2021, Kuppuswamy, Sathyanarayanan wrote:
So what is your proposal? "tdx_guest_" / "tdx_host_" ?
1. Abstract things where appropriate, e.g. I'm guessing there is a clever way
to deal with the shared vs. private inversion and avoid tdg_shared_mask
altogether.

2. Steal what SEV-ES did for the #VC handlers and use ve_ as the prefix for
handlers.

3. Use tdx_ everywhere else and handle the conflicts on a case-by-case basis
with a healthy dose of common sense. E.g. there should be no need to worry
about "static __cpuidle void tdg_safe_halt(void)" colliding because neither
the guest nor KVM should be exposing tdx_safe_halt() outside of its
compilation unit.


Sorry Sean, but your suggestion is against all good code hygiene practices. Normally we try to pick unique prefixes for every module, and trying to coordinate with lots of other code that is maintained by other people is just a long term recipe for annoying merging problems.  Same with coordinating with SEV-ES for ve_.

Is it really that hard to adjust your grep patterns?

I'm not against changing tdg_, but if it's changed it should be something unique, and also not too long. Today tdg_ fits that criteria nicely.


-Andi