From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EEACD1E231C for ; Wed, 1 Jan 2025 22:30:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735770613; cv=none; b=Edx7DeZKW7+v5N+2qTtk9E7nAPC2p+5T9GBoUaR62O5jXzU0WzgDqdnKYxK7496JTb7qhvf1tVRGtrCfsTRXwTdTKHzGGy1Kazj1Hn5YAdBi/zSl2d598wqfH1i79rHGVhVwF9sZWRs9O0NiwMKohakjM+hqSCjQXJ7vX/BjjYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735770613; c=relaxed/simple; bh=evO1rCUSq/x2TA1PGby7GMi1T6tRgtDsNcA2kLtprwg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sHmMVUwR771rEQjk7O+8hzX9oCf7uegeeQ2mwC4PJNPcEd18w/L8+PPHpidfRfE26QP5H7fJKqOLki40oce0GymVUyqODgeLbrQ39k+qeqctXhgDHErwPjdy3/hXRdlRzLjIjd2k+6sc3zVdJOSnhEC1aL4Ml9hKtv10JXiAkRQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oVQc/2p4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oVQc/2p4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D5D1C4CECE; Wed, 1 Jan 2025 22:30:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735770612; bh=evO1rCUSq/x2TA1PGby7GMi1T6tRgtDsNcA2kLtprwg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oVQc/2p47xKDt9J5W3dA6deVlCFZw2CrlDf8hxMvGVMv+hAnTAcWnGpW9tKMXhXJc sdOFlXMLUNnla5tNQ9uSpjyCsTvZHArvDBbOnHVDxFtE29Lz0asmsvIneSpGFLeVEt q5++Kn8gah/w5s43NpkVt+Sl82ximdju5Tje8jUKhmTpttNdV78KAhwb+UepB6G1eb P/aFqOFpCtiWhnC6VzrCVxGU6c60BFjCOPMoli3SOpP+bo9mg2am/dQKVwG6hQApb0 EhQfudpVzQqhLhFyiVFZ9nkHwJX6pwwAdDAFUzNR0f7ubyMfHCV7nfyconEdiupIq6 icgAA9WXJPZpw== Date: Wed, 1 Jan 2025 15:30:08 -0700 From: Nathan Chancellor To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Borislav Petkov Subject: Re: [PATCH] x86/sev: Disable UBSAN on SEV code that may execute very early Message-ID: <20250101223008.GA2803252@ax162> References: <20250101115119.114584-2-ardb@kernel.org> 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: <20250101115119.114584-2-ardb@kernel.org> On Wed, Jan 01, 2025 at 12:51:20PM +0100, Ard Biesheuvel wrote: > Clang 14 and older may emit UBSAN instrumentation into code that is > inlined into functions marked with __no_sanitize_undefined. This may > result in faults when the code is executed very early, which may be the > case for functions annotated as __head. Now that this requirement is > strictly enforced, the build will fail in this case with the following > message > > Absolute reference to symbol '.data' not permitted in .head.text > > Work around this by disabling UBSAN instrumentation on all SEV core > code. > > Cc: Borislav Petkov > Cc: Nathan Chancellor > Signed-off-by: Ard Biesheuvel Seems reasonable to me. Reviewed-by: Nathan Chancellor > --- > arch/x86/coco/sev/Makefile | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/coco/sev/Makefile b/arch/x86/coco/sev/Makefile > index 4e375e7305ac..08de37559307 100644 > --- a/arch/x86/coco/sev/Makefile > +++ b/arch/x86/coco/sev/Makefile > @@ -13,3 +13,6 @@ KCOV_INSTRUMENT_core.o := n > # With some compiler versions the generated code results in boot hangs, caused > # by several compilation units. To be safe, disable all instrumentation. > KCSAN_SANITIZE := n > + > +# Clang 14 and older may fail to respect __no_sanitize_undefined when inlining > +UBSAN_SANITIZE := n > -- > 2.45.2 >