lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250827082932.GBaK7B7CdT1gd68C8T@fat_crate.local>
Date: Wed, 27 Aug 2025 10:29:32 +0200
From: Borislav Petkov <bp@...en8.de>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>,
	Tony Luck <tony.luck@...el.com>, pbonzini@...hat.com,
	seanjc@...gle.com, vannapurve@...gle.com,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
	H Peter Anvin <hpa@...or.com>, linux-edac@...r.kernel.org,
	linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
	rick.p.edgecombe@...el.com, kai.huang@...el.com,
	reinette.chatre@...el.com, xiaoyao.li@...el.com,
	tony.lindgren@...ux.intel.com, binbin.wu@...ux.intel.com,
	ira.weiny@...el.com, isaku.yamahata@...el.com,
	Fan Du <fan.du@...el.com>, Yazen Ghannam <yazen.ghannam@....com>,
	yan.y.zhao@...el.com, chao.gao@...el.com
Subject: Re: [PATCH RESEND V2 1/2] x86/mce: Fix missing address mask in
 recovery for errors in TDX/SEAM non-root mode

On Wed, Aug 27, 2025 at 11:22:07AM +0300, Adrian Hunter wrote:
> +#ifdef CONFIG_X86_MCE_INTEL
> +static __always_inline void tdx_extract_err_addr(struct mce *m)
> +{
> +	if (boot_cpu_has(X86_FEATURE_TDX_HOST_PLATFORM))
> +		m->addr &= GENMASK_ULL(boot_cpu_data.x86_phys_bits - 1, 0);

Right, you can stick that thing straight into mce_read_aux() since it is
simple enough and drop the ifdeffery and use cpu_feature_enabled():

mce_read_aux:

	...

	/* Remove TDX KeyID from the address */
	if (cpu_feature_enabled(X86_FEATURE_TDX_HOST_PLATFORM))
		m->addr &= GENMASK_ULL(boot_cpu_data.x86_phys_bits - 1, 0);

Something like that...

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ