Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31422273rwd; Thu, 6 Jul 2023 22:10:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlHXx/0bs+yHSU1pPnEMK547OzNrBzuhj4DahbDWt95B0Q3k4xs7ze2iwpWYHkF0J2ptuQSX X-Received: by 2002:a05:6808:220c:b0:39c:4553:964b with SMTP id bd12-20020a056808220c00b0039c4553964bmr3961154oib.50.1688706653078; Thu, 06 Jul 2023 22:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688706653; cv=none; d=google.com; s=arc-20160816; b=nJFwhTzQAmY1jqYwJkqaLNxmRBFOe/n0w6LGAVOCI75aMOXqOtUdS5VWrL5obafjL+ 1sj+0oA8F+CkKjp+epgmAlGORgjHDEFkLX4ODk+2K9RpHhIjtz57C4jHmgvrEKy7GA4I zV8j8C1jUuqJlQO3YR+sGRcUpVbegcDhWZGLIDwevWWjHebz8U8iw39UIqKwGYUuSWTX 8OnIkq50FjFPSr7J2/FXc8gGkzQRaFggvGhdif6o2282q7S9K95xpfhqYKL8lfA+AYUp SZKSj2dKq+QF9ACdc9crUD9n0Dawa+OVORKmbLBrqDqjd3Jxedp3x/N+ovO/2X2UiDIt njSg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WH5e5yrUwYhfZlLQss/cQIH00cXYe+Ubohm+t4WsCng=; fh=b+kl+SFQaQ9uRG4gMcaDDu9gzcjpJhYhgwJpHbTi5LM=; b=yOLzUdKkA3oOjaV+FAjq1RFzWM2Z7Z84dggaK/UtxXwCBQH86DF3+/VPKjgIMiR0ZU jC5u6vG7PQy+YThB4hr9vmPpRKom8I57cqWMgeky2WFJq/kVPRi90sCd1Nc93sVmUB9f kVCgRwuUabMQmW5EnLtw8f5T3qKvegE3/GIxbUW31Of5UHSGSAbt5ubmokd8dOeF6TCc UwgO3u820jIfSfuot+6K2pglW5QE+X37qEXmoGXeYSsPE5ycuNxU6q1kVs4D7fwMSKjN 8mUY3G3LfhxQgF0A5X+cRT3lYiuGFbjymzDieQYUxQli8LVburLCvjsfvbjIB5lvNv/n ebgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cv2HNKzn; 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 q69-20020a17090a17cb00b00262deac42d1si1276782pja.90.2023.07.06.22.10.40; Thu, 06 Jul 2023 22:10:53 -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=cv2HNKzn; 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 S231367AbjGGEZG (ORCPT + 99 others); Fri, 7 Jul 2023 00:25:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbjGGEY4 (ORCPT ); Fri, 7 Jul 2023 00:24:56 -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 517B3E65 for ; Thu, 6 Jul 2023 21:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688703848; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WH5e5yrUwYhfZlLQss/cQIH00cXYe+Ubohm+t4WsCng=; b=cv2HNKznLezqClMohBtSdII+vU6S+On4kr9LIvrDGuA08zowuUu8WCoakETcdpISPoLwd8 k+gKCerkc6UfiBWXv+PaoeY9eW9l1n6q+ntXldehkhKcXurOQm7QwqHY3vrNxsbFRQyOKv oroST3i/Yj+pvte12o2kSGfM0P8gaeY= 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-262-9SxUlnh6OMaN0meM_RXW8g-1; Fri, 07 Jul 2023 00:24:06 -0400 X-MC-Unique: 9SxUlnh6OMaN0meM_RXW8g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F2B580123E; Fri, 7 Jul 2023 04:24:06 +0000 (UTC) Received: from localhost (ovpn-12-39.pek2.redhat.com [10.72.12.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 98DE7492C13; Fri, 7 Jul 2023 04:24:03 +0000 (UTC) Date: Fri, 7 Jul 2023 12:23:59 +0800 From: Baoquan He To: Tao Liu , jroedel@suse.de, thomas.lendacky@amd.com Cc: 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=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 07/07/23 at 11:38am, Tao Liu wrote: > Hi Borislav, > > Thanks for the patch review! > > On Thu, Jul 6, 2023 at 1:34 AM Borislav Petkov wrote: > > > > On Thu, Jun 01, 2023 at 03:20:44PM +0800, Tao Liu wrote: > > > A kexec kernel bootup hang is observed on Intel Atom cpu due to unmapped > > > > s/cpu/CPU/g > > > > > EFI config table. > > > > > > Currently EFI system table is identity-mapped for the kexec kernel, but EFI > > > config table is not mapped explicitly: > > > > Why does the EFI config table *need* to be mapped explicitly? > > > > > commit 6bbeb276b71f ("x86/kexec: Add the EFI system tables and ACPI > > > tables to the ident map") > > > > > > Later in the following 2 commits, EFI config table will be accessed when > > > enabling sev at kernel startup. > > > > What does SEV have to do with an Intel problem? > > For the 2 questions above. The call stack is follows: > > head_64.S:.Lon_kernel_cs(which is before extract_kernel) -> sev_enable > -> snp_init -> find_cc_blob -> find_cc_blob_efi. No matter what cpu, > with CONFIG_AMD_MEM_ENCRYPT enabled, all will enter sev_enable() and > go through these functions. I assume it is harmless for Intel cpu, 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. Thanks Baoquan