Re: [tip: x86/urgent] x86/tdx: Prepare for using "INFO" call for a second purpose

From: Dave Hansen
Date: Sun Nov 06 2022 - 12:02:34 EST


On 11/6/22 04:45, Borislav Petkov wrote:
> On Tue, Nov 01, 2022 at 11:25:36PM -0000, tip-bot2 for Dave Hansen wrote:
>> @@ -121,7 +121,7 @@ static u64 get_cc_mask(void)
>> * The highest bit of a guest physical address is the "sharing" bit.
>> * Set it for shared pages and clear it for private pages.
>> */
>> - return BIT_ULL(gpa_width - 1);
>> + *cc_mask = BIT_ULL(gpa_width - 1);
>> }
> I'm looking at the next patch too and I still don't see what the point
> is of making it a void?
>
> IOW, what's wrong with doing this?

It's fine for now, except that the naming on this:

- tdx_parse_tdinfo(&cc_mask);
+ cc_mask = tdx_parse_tdinfo();

is a bit funky since tdx_parse_tdinfo() is doing a couple of things and
will need to return a second item shortly.

But, zero objections if you want to make it that way for now.