Re: [PATCH v15 22/28] x86: Secure Launch kernel early boot stub

Dave Hansen
2025-12-16T22:32:32Z

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?

This _looks_ like it was just written and then had casts added to it
until it compiled.