Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31614111rwd; Fri, 7 Jul 2023 01:46:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlGuaz2PL7R9+7rFrnq8rH1yC0psCVYD1Wzv4Y49JXW1m4aXylfjw01U3/BGKfM1aqWt3p96 X-Received: by 2002:a05:6358:24aa:b0:134:d422:138d with SMTP id m42-20020a05635824aa00b00134d422138dmr5465870rwc.21.1688719599499; Fri, 07 Jul 2023 01:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688719599; cv=none; d=google.com; s=arc-20160816; b=jexf2Zj7BvFRw95UgONmpmnCiOCVUqo5qXdT1blNITH8vhshQSJ7giV0LYO7fdHE2v 6qGlZn/P0fOuoSJ92zqeocG65jXE+IG9vwZxhyCZ3ymB7d80rkX3NUJ68eUkH7Jy3JsA 4YZZbUjXh13u46fwkEcib/+mnekS382OqYsPZyfgdQRyATijMlOmUbc22mDobk2oK6Or AT4v0eBLxm4qZSF3V1quKAG7yrSnezvtWdM4kS/EhiNIlJ6Jp/K2DODYOhbd9P2PeEb4 kz8wcH3yfhF48BpQ1OzwoMdislsroS7okOOsDklZeZUGjv58qzGEv1IyHMryfM9YZ4aW wdGA== 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=hBR9f0r6qj9T/laRL93krURZPm3hZ8Dm5t8S9yrOV30=; fh=0mxjUhXqurwuIJgEyDweLU1Uvs7CDU0hAa5vA1GglPo=; b=1IVGi7LSiahK3V771RmWK4QbvC1TXbrfm7S+qG37iwltnnDBc5ZRVM4yuReuTUyjAa zCBZolwhqaIPco7u47IYSRiOdufu3kody4ZYbeLEE7nyu3OrumkjISNWOzaWWOQ8rb/F Lhf6hUVyZz0eNT+kUge+XwhDLy7szmHiH5JFE8jl0TMENM2CrkmWCXuco6gYWFJWjQVw kytXWD+5BJ8/jDuHmWHBQ4fMlsi3DQ4rDCQ8y9Tx74S5zzja/NJ8YNtwZyUYadj41Hyn TtBYFALI0vTFahIDi4EaG6Hi0ugFGL0fvxht+GrBnmcxmr8UOLii0timoPzo/q0sdG9v GvHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=F5hTGzHy; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d20-20020a056a0024d400b00679a6ce03f6si3484178pfv.59.2023.07.07.01.46.27; Fri, 07 Jul 2023 01:46:39 -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=@redhat.com header.s=mimecast20190719 header.b=F5hTGzHy; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229555AbjGGImJ (ORCPT + 99 others); Fri, 7 Jul 2023 04:42:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbjGGImI (ORCPT ); Fri, 7 Jul 2023 04:42:08 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FE071997 for ; Fri, 7 Jul 2023 01:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688719282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hBR9f0r6qj9T/laRL93krURZPm3hZ8Dm5t8S9yrOV30=; b=F5hTGzHyObxTPFMzjWMGdIicSbG2zeLiZufCjbOe8i+SIk3iSlEvZ961wCnhEXyOU3nFe6 082oJcI4rGjMFxvbjc+sdSAgVixCZfFwZmNKTwaq1CSEnioNQSxZfpaOoX0dJDze6RNVgm +XWNZMoF0J0JEfxGjCR8MfwkK1TAIb8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-104-mseXw9BVPAa9SLtaA0G1vQ-1; Fri, 07 Jul 2023 04:41:17 -0400 X-MC-Unique: mseXw9BVPAa9SLtaA0G1vQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B2C5680027F; Fri, 7 Jul 2023 08:41:16 +0000 (UTC) Received: from localhost (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4DE1200B402; Fri, 7 Jul 2023 08:41:15 +0000 (UTC) Date: Fri, 7 Jul 2023 16:41:12 +0800 From: Baoquan He To: Joerg Roedel Cc: Tao Liu , thomas.lendacky@amd.com, Borislav Petkov , tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, linux-kernel@vger.kernel.org, dyoung@redhat.com, kexec@lists.infradead.org, linux-efi@vger.kernel.org, michael.roth@amd.com Subject: Re: [PATCH v2] x86/kexec: Add EFI config table identity mapping for kexec kernel Message-ID: References: <20230601072043.24439-1-ltao@redhat.com> <20230705173359.GDZKWphyFbNE8id6Jm@fat_crate.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 07/07/23 at 10:22am, Joerg Roedel wrote: > On Fri, Jul 07, 2023 at 12:23:59PM +0800, Baoquan He wrote: > > I am wondering why we don't detect the cpu type and return early inside > > sev_enable() if it's Intel cpu. > > > > We can't rely on CONFIG_AMD_MEM_ENCRYPT to decide if the code need be > > executed or not because we usually enable them all in distros. > > Looking at the code in head_64.S, by the time sev_enable() runs the SEV > bit should already be set in sev_status. Maybe use that to detect > whether SEV is enabled and bail out early? Makes sense to me. Thanks.