From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 3A352B661 for ; Tue, 7 Oct 2025 18:23:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759861387; cv=none; b=ZlCvpkd+5Q21LBFGGFKJP1WXtCUwYXK7qOL+d5Ie94KKoMGjJavM6rdmmQsDh97qlOZiFkqy+wcsLAglKMOB2hPCibWyyiuW3xaeA38Z6Weu89yS07oUn5sVhgplQg4zpaAMEIuzUvLQakji/hXjem1XGLYrSYNFlTHQMAT3WUA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759861387; c=relaxed/simple; bh=lxcxiGcnSQhOw8q03P3pElZ1Cb5DunYGWxewnXa2vaM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OcX7djRQtFE4M3WahgeLRjE6aHnfjjAgAzLiRDJ539hDzYPbChvq485PUD6Qze0sOFCP4FlmtVdOWBOaRV1kL/Y/pznEQgA/ft8HKWU82f8SNXA1o/E9fkvb9mtYl7HOlN+rZntaeI1pXGXorAuwFl/SXd6pJPRazo7n/1VwnHo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MBpN8GEl; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass 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="MBpN8GEl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1759861385; x=1791397385; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=lxcxiGcnSQhOw8q03P3pElZ1Cb5DunYGWxewnXa2vaM=; b=MBpN8GElGQAzxI3Zjx0EIgaRdpFbcFMU+q1w1gFX/fj30YgyFPffzdif /YvQ29VMzQiEu9esifzw9P8BuK7PJRdaT5K8TNV6hmvfty/uTmn/hR+kP xIjE78j2hESlgDLZi2HpBTcliISADUP6hWtSvUDcf5Su63bClk9ljHxrf AKO+GozEUz+AwOYLesSZigYtFY4ZrGn2xl0DgITVIpdSfUPi2iCKjdAMH LRmu2yRBC0R2K+F8IcZsF1QrvI7JIx/eVOxsBKHbKOCnw4MnDuIHRa0sj TKgTcz6eT+h9Eqh/q32JY9BBv7aH9y6nWvbWFs6A15VZccfYBy83SbaXz A==; X-CSE-ConnectionGUID: OShHspBwS7u4my7+l/sJnQ== X-CSE-MsgGUID: qvLi9QPsSeCw7FHHI1XZtw== X-IronPort-AV: E=McAfee;i="6800,10657,11575"; a="84672028" X-IronPort-AV: E=Sophos;i="6.18,321,1751266800"; d="scan'208";a="84672028" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2025 11:23:04 -0700 X-CSE-ConnectionGUID: QfymVmV3RqyMzqeo7g+8Rg== X-CSE-MsgGUID: V5GmDUPsTaKpxLpp9bKntg== X-ExtLoop1: 1 Received: from jdoman-mobl3.amr.corp.intel.com (HELO desk) ([10.124.220.94]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2025 11:23:03 -0700 Date: Tue, 7 Oct 2025 11:22:57 -0700 From: Pawan Gupta To: Borislav Petkov Cc: "Kaplan, David" , Thomas Gleixner , Peter Zijlstra , Josh Poimboeuf , Ingo Molnar , Dave Hansen , "x86@kernel.org" , "H . Peter Anvin" , Klaus Kusche , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] x86/bugs: Qualify RETBLEED_INTEL_MSG Message-ID: <20251007182257.ywrqrrhgrtrviila@desk> References: <20251003171936.155391-1-david.kaplan@amd.com> <20251006131126.GBaOO__iUbQHNR6QhW@fat_crate.local> <20251006140442.GDaOPMemqB7SRJSHWL@fat_crate.local> 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: <20251006140442.GDaOPMemqB7SRJSHWL@fat_crate.local> On Mon, Oct 06, 2025 at 04:04:42PM +0200, Borislav Petkov wrote: > On Mon, Oct 06, 2025 at 01:58:55PM +0000, Kaplan, David wrote: > > Sounds rather yucky. > > I'll give it a try at some point and see how ugly it becomes... > > > What about just not calling cpu_select_mitigations() if > > CONFIG_CPU_MITIGATIONS=n? Then you won't get any print messages either I'd > > think. > > I want to not compile in that code at all if CPU_MITIGATIONS=off, actually. Even when CPU mitigations are disabled there is still some handling required for mitigations like GDS that requires a write to MSR to ensure correct behavior. So not all of bugs.c can be compiled out easily. IMO, rather than targeting the mitigation enabling code it might make more sense to compile out the actual mitigations scattered accross the kernel. This may also improve performance by reducing the code footprint, and can also help getting a cleaner disassembly.