Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp973105rwe; Wed, 24 Aug 2022 12:20:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR5RBTuIoyzR9fwGWUHsXbFbhKl7rJBNndnXVi92l/KeTugAH3MYh7jO85MNFkawOAgZlnyP X-Received: by 2002:a17:907:760b:b0:73d:b5bc:feb6 with SMTP id jx11-20020a170907760b00b0073db5bcfeb6mr248224ejc.407.1661368806922; Wed, 24 Aug 2022 12:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661368806; cv=none; d=google.com; s=arc-20160816; b=ldhZ86dcunVcN9jvOm3gMi1Rr5LF0Si+0N4/yec5jCuhqIpZjYWnRqyqiUL4AJmRQ/ cWE38H3jsbBRMm0eBrRmOqld458ZVL1W1jJV6HuOEZdJD8XES+xs7xR1B8K9Z4W2LG4P 8z0HfCv3LF3Bv7NbOuPGa1BubntJqYymZ6y3zbLZJnRtuwocdHtXT9r3/uSnWIt45NzE HZktaYlwhm7uja2Ne5dEm+iUs36qMRjazrVkfVGGX1JcfhKWtblcqGq21yvWmHUIG6/Z ydzoRW+m4MvlJ1mFEDpSM9luSkl0etXQr1iA4evvCOyNllpP5LVyZ/lgS+rKLOmK2uZq P7qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=qZqi12WbU4wAdseBvcb2ZXyeOqwxbb7QP7RfUNZ8Gic=; b=xIcDK/ErJzK1+/H6stfzpJsggquGT+J04Pt3v5NydfOC86pxAuUGCFSjD/YRDxKZxq VglpiODpi636wXV6B3MRqg4ElC6INaMUDn5lvKLP/hSnQ4zm7dT5+hqO9jLSPE+5h7eR QCEsqWRiakT+SjeUJVhjQEpQ2tV9nvoZLljRdyYsCMzHcWN0cTZbpcYaoBdYQYGLo1aY SG+hraRLPdx0ZZFX10V5NIXhhwLXDINW3T+qvutq2HshZuDbOmm1ogp/xyfmNcA+cwWn oujjf7cT5PcaJa8IubBFrtIAcXZhy+u85xXZ4uhXmgbd8e6dYaIt9imBvmr2Mb0j7YFV Ue5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iTr7zUzd; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v18-20020a1709061dd200b0072f0a99a62bsi2109318ejh.143.2022.08.24.12.19.41; Wed, 24 Aug 2022 12:20:06 -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=@intel.com header.s=Intel header.b=iTr7zUzd; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238860AbiHXSxy (ORCPT + 99 others); Wed, 24 Aug 2022 14:53:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235430AbiHXSxw (ORCPT ); Wed, 24 Aug 2022 14:53:52 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7871C7B78F; Wed, 24 Aug 2022 11:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661367231; x=1692903231; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=yaInQXGMxPy/U9mnFtXLRZ4xzYSYO86IjKv3UMnKCgk=; b=iTr7zUzd7RnuOHHnx+V29btfuN82eTWw1XRNU+XdgMZcPIbroGbLSbuD w+34VbS8Bc8oDYVP8TO/MeD4X1OGf0c7taTOY1wghGZTBOoxovP+dfXiH EHIVCEodECpvwxMtcSVuByACZiJBwyAqB2mq7NSII1og5e+NYJWAk0RvB H4LOLBeM5XwsVV4PFN/N0RQee/8Q8gYEZbu8pf38SbnxZHXtMOaxfj2yu bpgNbZle6O0pxlLgobkQl1RA3DA2zvaiQTv9kP3nQDqz/9CFdNkcra0/f Jkwywb1RJwSI/eYd0P+A6ULDg+RPTa6GjSCdqMGUV59JZjUKtAkzpu73u g==; X-IronPort-AV: E=McAfee;i="6500,9779,10449"; a="273803143" X-IronPort-AV: E=Sophos;i="5.93,261,1654585200"; d="scan'208";a="273803143" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2022 11:53:51 -0700 X-IronPort-AV: E=Sophos;i="5.93,261,1654585200"; d="scan'208";a="938024615" Received: from skeshri-mobl.ger.corp.intel.com (HELO [10.212.154.182]) ([10.212.154.182]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2022 11:53:50 -0700 Message-ID: Date: Wed, 24 Aug 2022 11:53:49 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] x86/sev: Don't use cc_platform_has() for early SEV-SNP calls Content-Language: en-US To: Borislav Petkov Cc: Tom Lendacky , linux-kernel@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , Asish Kalra , Michael Roth , Joerg Roedel , "Kirill A. Shutemov" , stable@vger.kernel.org, Sean Christopherson References: <0c9b9a6c33ff4b8ce17a87a6c09db44d3b52bad3.1661291751.git.thomas.lendacky@amd.com> <10bc452f-3564-e41b-836d-e135a8f4260d@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 8/24/22 11:48, Borislav Petkov wrote: > On Wed, Aug 24, 2022 at 11:43:10AM -0700, Dave Hansen wrote: >> So, we don't have *ANY* control over where the compiler uses jump >> tables. The kernel just happened to add some code that uses them, fell >> over, and this adds a hack to get booting again. >> >> Isn't this a bigger problem? > I had the same question already. Was thinking of maybe disabling > the compiler from producing jump tables in the ident-mapped code. > Tom's argument is that that might prevent the compiler from doing > optimizations but I haven't talked to compiler folks whether those > optimizations are even worth the effort. > > Regardless, the potential problem is limited: > > "# (jump-tables are implicitly disabled by RETPOLINE)" Ahh, I missed the connection with retpoline. The ubiquity of RETPOLINE=y probably means we'll see more of these issues because people won't find them unless they're building and running weirdo configurations. > i.e., only RETPOLINE=n builds for now which should be a minority? > > I guess when this explodes somewhere else again, we will have to > generalize a fix. Yep. It also reminds me to add RETPOLINE=n build to my tests.