From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61C88EB64D9 for ; Fri, 7 Jul 2023 04:25:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbjGGEZI (ORCPT ); Fri, 7 Jul 2023 00:25:08 -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 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