Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1142895rwl; Thu, 10 Aug 2023 07:07:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHH74rqFx4MreEChAknnrrgT/k/muMS4sH/QbPW1wPiuFZMqJZP+nc8bg5VyNRNSwDP1jzw X-Received: by 2002:a05:6512:3582:b0:4fb:8987:734e with SMTP id m2-20020a056512358200b004fb8987734emr1753870lfr.68.1691676439735; Thu, 10 Aug 2023 07:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691676439; cv=none; d=google.com; s=arc-20160816; b=HRDGTAMLprL1y7q2wf+peaHgEJbn2Mdl4CS5ZTNOCBu3uH5G4af6Dbb09/P3yqrSro Klw19q7UMhUjiQCHUj9Y7VgpUoIqNaFqte1jcEeUXT5jjRceNM/9vWT28njjgdW7Hmlm WMPu6jKQtCnLM2dxROhxsckeSr0TXAZ4dM8zcM88MGrz/r828L5J6SQfpAktxzs1lFgv au0VSraqTWnAyUAtDeUXjpkRzyk7rPx4DAczpm3Ztr5y1dUaCf5koaRkYF+iFadoPkOD 5rg0sWot1bc5wJc6Acqg2oVppwQRU+5TrjV3Sl+gO/jwCyS0oEow7WIHWvrPm8VkFLZP TDHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oubEI6h+KdSsRo6LtA17+i272A0lxssOL8TRPPhG2K4=; fh=qbL3oTtvI8s5YNAzoA11vdqTq8Zmmw9LvjvyLWw5wyA=; b=XjnDLmVEmaZn/6/6qePeobgILf/MZLDkz2kQOLxPxcWEZwMZAAKc77p2X7Z4yebGbT WnMc+syP74mC26WI1xIE0lv9SqD1vGyYhFP4cnBEzb9D68/noF+BWh6UbC/LtSKBPRCg 8JpOk6W6DAoqfFeAJH7JFKF9k2A/uag8f9LKPQVO0cX+FzItx9oubGaWO2vNSviiC895 mEagnSpEZPwoo5QDyUuYZIRnI63aUB3cDvYCJrO4yNdrmquz3Si+lCKJ1Pf3l5B4/TT8 FlZ6gjPZz1+qrlb1MJeuXL9zwYXOL4DLE5YQJ+yxziTD/3cndTpp5OFepNp0jIuEmp2o 7PiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cGX8ryyy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020aa7dcd1000000b00522b8b66749si1460582edu.492.2023.08.10.07.06.14; Thu, 10 Aug 2023 07:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cGX8ryyy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235289AbjHJN1R (ORCPT + 99 others); Thu, 10 Aug 2023 09:27:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235265AbjHJN1J (ORCPT ); Thu, 10 Aug 2023 09:27:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92794C7 for ; Thu, 10 Aug 2023 06:27:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2C8C965C77 for ; Thu, 10 Aug 2023 13:27:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42BBAC433C8; Thu, 10 Aug 2023 13:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691674028; bh=npt7UXBpc0DNHjnEk6D3ZvNr6yBDAu9PrIPCFznBoGU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cGX8ryyyg4d0O7lOmmgQyO4vX5eS1tm7k30XmViZJqSf3xcwTekcq1pdoDd9PLYN/ E5DIsdu/39PvOpgNiUT4U5xABWHmW3ZlaFJcDvl0TyC6xNUB13wTLkLSyS3d+0wce5 EipP5IxOMQjCY92Q54wR6sMTXswFT6WpXEd0t4Am4HCGbwWYcDRKQKbZWbMGEx6MdE B4KtB47GxTsTfFaqZgOT6IREWXL3sb5NMlcZWAgRLV5EBdcOpT2N/BCgF8xKudNT6i az49MCXCSyWBVIufxpD49Jh5uprxQz3Wwi+sSpfYziocdPbXVpjjlSx4IARdInYFWp 5uyu/yI7XrfGg== Date: Thu, 10 Aug 2023 06:27:06 -0700 From: Nathan Chancellor To: Borislav Petkov Cc: x86@kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: Hang when booting guest kernels compiled with clang after SRSO mitigations Message-ID: <20230810132706.GA3805855@dev-arch.thelio-3990X> References: <20230810013334.GA5354@dev-arch.thelio-3990X> <20230810081038.GAZNSbftb6DOgg/U7e@fat_crate.local> <20230810090835.GBZNSpE6tCw+Ci+9yh@fat_crate.local> <20230810101649.GA1795474@dev-arch.thelio-3990X> <20230810125122.GIZNTdSuFvA3Cjfexq@fat_crate.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230810125122.GIZNTdSuFvA3Cjfexq@fat_crate.local> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 10, 2023 at 02:51:22PM +0200, Borislav Petkov wrote: > On Thu, Aug 10, 2023 at 03:16:49AM -0700, Nathan Chancellor wrote: > > Just to clarify, this is the guest kernel at -rc5 and the host kernel > > with the SRSO mitigations applied? If so, that's the problem. The guest > > kernel does not have to have the SRSO mitigations applied to see this > > problem. Sorry I should have made that more clear! If not though, that's > > interesting because I was running -rc5 on the host without issues. > > Well, how do you even build CPU_SRSO with clang? > > config CPU_SRSO > bool "Mitigate speculative RAS overflow on AMD" > depends on CPU_SUP_AMD && X86_64 && RETHUNK > ^^^^^^^ > > config RETHUNK > bool "Enable return-thunks" > depends on RETPOLINE && CC_HAS_RETURN_THUNK > ^^^^^^^^^^^^^^^^^^^ > > config CC_HAS_RETURN_THUNK > def_bool $(cc-option,-mfunction-return=thunk-extern) > > $ clang -mfunction-return=thunk-extern > clang: error: unknown argument: '-mfunction-return=thunk-extern' > clang: error: no input files > > $ clang --version > Debian clang version 14.0.6 > Target: x86_64-pc-linux-gnu > Thread model: posix > InstalledDir: /usr/bin > > Hmmm. That option was only backported to LLVM 15.x+ because 14.x and older were not supported any more when it was added. $ clang -mfunction-return=thunk-extern -x c -c -o /dev/null /dev/null $ clang --version clang version 15.0.7 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin But my host kernel was compiled using GCC 13.2.0 from kernel.org for the sake of testing to see if the compiler used to build the host kernel had an impact on the problem and it did not. Cheers, Nathan