[PATCH v15 22/28] x86: Secure Launch kernel early boot stub
ross.philipson at oracle.com
ross.philipson at oracle.com
Wed Dec 17 10:47:19 PST 2025
On 12/16/25 2:32 PM, Dave Hansen wrote:
> On 12/15/25 15:33, Ross Philipson wrote:
>> +static u64 sl_txt_read(u32 reg)
>> +{
>> + return readq((void *)(u64)(TXT_PRIV_CONFIG_REGS_BASE + reg));
>> +}
>> +
>> +static void sl_txt_write(u32 reg, u64 val)
>> +{
>> + writeq(val, (void *)(u64)(TXT_PRIV_CONFIG_REGS_BASE + reg));
>> +}
>
> Man, that's a lot of casting. If TXT_PRIV_CONFIG_REGS_BASE were just a
> pointer to being with, it could be:
>
> writeq(val, TXT_PRIV_CONFIG_REGS_BASE + reg);
>
> Right?
Indeed, we can simplify this per your suggestion.
>
> This _looks_ like it was just written and then had casts added to it
> until it compiled.
Thank you for you feedback so far.
Ross
More information about the kexec
mailing list