From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5E73221DA3 for ; Thu, 9 Jan 2025 16:40:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736440844; cv=none; b=LCPP5BchZ/nmsSjHMrffUGqyHOmU6Fed3TghgbQatCLatTVTBE8714KbdVvbqY0kQZClEiqjpGN6fem1qAErTuCXYcdLKe03ApRd+e6ZxSXevM9IHg9droMl3R55jAElSZEtxsqFuHW7qgP9JhcZs44og3C6r6iqHcnDizhYGDY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736440844; c=relaxed/simple; bh=ox3F4gdiKRFedpKyGjlCXPXdXVUirHRU+U7iMFxTN/Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RRr71bN4luABosZh7lEYBBbswcxOSbr3s9CjkOg7aG+yZwWBKiX2d1dIhDrjd7Mutox45p9SV4h5G8Wb0gC172Ef9MTUDXHvDyOia+WJfudiXoQ1raCaSF63RCq37MfAuF/CK2UmemifTYXWBSz5dGhVP+FkniY9vAJxNfLNHMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iE8aYk5Q; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iE8aYk5Q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736440842; x=1767976842; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ox3F4gdiKRFedpKyGjlCXPXdXVUirHRU+U7iMFxTN/Y=; b=iE8aYk5QxJ5nBOl0akCyC/alsKDCNfUJaF7UbiCi08p7GoPSwzodi6W4 dNMcLqx1yWOUpX6ZulpZX2qhwcFtfCxGg+WObOAd2/bZ48GsBlHk/oHEl AcC7ZmqEU7KDrwbdkoY1J8obShRnZrQJLWRKBhLZyQD/wQOkIY6PGyV26 2ovmseLEx2n/Pwvmbg+kmgiC/KXqNB1TeskVIL4pYgB2bB6v91Vkob7ax U7DgVQyaOhW75ZzJV/hpsDbt1kmZ+0kSsBaN1sg47j7f8/V/GZbTSNp+r sv9op06A0MxTu6cDil99JQ8dd3g5RfMGRNXAQAOjTCN5Ob4SJYk9GGNrS w==; X-CSE-ConnectionGUID: JxrtTUstTDCyaPM7QiZXjQ== X-CSE-MsgGUID: PZ8L0ynZSSC9+62pg4Nd1g== X-IronPort-AV: E=McAfee;i="6700,10204,11310"; a="36405108" X-IronPort-AV: E=Sophos;i="6.12,301,1728975600"; d="scan'208";a="36405108" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2025 08:40:41 -0800 X-CSE-ConnectionGUID: KPQN6si5QhWxYzB6IwonGA== X-CSE-MsgGUID: 7t438dr9RbSnoU2QR/zQGA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,301,1728975600"; d="scan'208";a="134291507" Received: from kaknauer-mobl.amr.corp.intel.com (HELO desk) ([10.125.145.68]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2025 08:40:41 -0800 Date: Thu, 9 Jan 2025 08:40:33 -0800 From: Pawan Gupta To: "Kaplan, David" Cc: Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Josh Poimboeuf , Ingo Molnar , Dave Hansen , "x86@kernel.org" , "H . Peter Anvin" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 12/35] x86/bugs: Restructure retbleed mitigation Message-ID: <20250109164033.bv3lnitv4jat43r3@desk> References: <20250108202515.385902-1-david.kaplan@amd.com> <20250108202515.385902-13-david.kaplan@amd.com> <20250109052237.pq4irr2iycitl5il@desk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Jan 09, 2025 at 03:26:58PM +0000, Kaplan, David wrote: > The intent was never to allow AUTO to persist, it should always be turned > into a real mitigation. However it looks like I did miss a case there, > where if the mitigation is AUTO when retbleed_select_mitigation() is > called, the bug should be mitigated but the vendor isn't AMD/Hygon, it > wasn't being transformed. > > I'll figure out how to fix this to match the existing functionality, > thanks for pointing this out. Also, adding a guard to ensure AUTO never persists would be good. diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 5bc2782f4ce1..ad63b5678250 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -1383,6 +1383,9 @@ static void __init retbleed_update_mitigation(void) } } out: + if (retbleed_mitigation == RETBLEED_MITIGATION_AUTO) + retbleed_mitigation = RETBLEED_MITIGATION_NONE; + pr_info("%s\n", retbleed_strings[retbleed_mitigation]); }