Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31609201rwd; Fri, 7 Jul 2023 01:41:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlHVEdgJAb5XE3pBBJ7Q0IbhrREDoH1JggWmFxfmforgDFjaLCNO4/J1USS7BPHAKuJdtcGD X-Received: by 2002:a37:f601:0:b0:767:a4b7:e5c2 with SMTP id y1-20020a37f601000000b00767a4b7e5c2mr3543592qkj.65.1688719263401; Fri, 07 Jul 2023 01:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688719263; cv=none; d=google.com; s=arc-20160816; b=l0eaIe9HL83jMthp9FIiyEBoWV/WAmNn6OBYzXFWlX0qAPQ0mCTEhhyGjbetQ/vDEp RxBfirY84us42BcKxZ3NOjC3DuMBvVK0XXAbceHwXKTVgUViZw0JopS5+GXu3DYqSeoh X8acqroqap6JLdnI28manJoqfXG8jVh7LibGEEQdulQeq4jPQjuBU8qVd2DtANe5zxdq RI/MW9bBpc2Gg2K4dtDodQAM9nF/EOFUTR8nFkIGPcImBuYyMj43/t0UqY9WGPWAWsS4 fylt4xiZV/xY4+OPfuSA4jluoB/LsrudVi6DYjYB5q2iK8DlNEFrRO/HldLp/UoM6+Zi taNg== 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:dkim-signature; bh=rTaTx/R0QAu6GJW6rE7C/1qQWY5Fc41FkF1jDqmTGVY=; fh=iVElSaiA1pSCyEp1PXvoHQxjroOaIsQHSbhAQqw4ZeM=; b=Yn2K+vXqaErYWiRHs0pt0rsj3WVSoiFun4JTuyc88DM+iHQiKShl6NNNaw+QnaZ8h/ /nSrdqwS55PrYbRhiQXWcG1RATEKsw/4wMoyyGwxc8VkZjcjiT2V5OecHNdlznCDhrMP 3Ht3UnvN6PTcTm9Rzrc2DbLtMFIH6v3qzcwnXkwzuZGfbYKDrLtCGvZn8gg+4RQIgs0L WsWTTD+gSI0fgUg7cfY0BcyJ2rAophLuUfE3QwzSDTR3xS0cI7mJ/9FDCiLf2lvKJMoW UIdtgQBv51BpWDGCDoDaTYL/3kiuAT03g7lj1ls1ruAPEAvUFkUFkMpyvGEseA4QVwDj cB7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=aKFSdPYV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y63-20020a626442000000b0068219eb279bsi3140460pfb.245.2023.07.07.01.40.51; Fri, 07 Jul 2023 01:41:03 -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=@suse.de header.s=susede2_rsa header.b=aKFSdPYV; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232735AbjGGIXJ (ORCPT + 99 others); Fri, 7 Jul 2023 04:23:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233069AbjGGIXB (ORCPT ); Fri, 7 Jul 2023 04:23:01 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D0B6DD; Fri, 7 Jul 2023 01:23:00 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A4702227B0; Fri, 7 Jul 2023 08:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688718178; h=from:from:reply-to: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=rTaTx/R0QAu6GJW6rE7C/1qQWY5Fc41FkF1jDqmTGVY=; b=aKFSdPYVU/8rW9N80UySni4O07Kx0AnMzhdVdu6NZat0CXnyicNGBh0pQ35tkiT+R3C/Gb GbKfjoEWjEfJAkHI/g1B/gl9Sz7Q2fbWtc2MK5JoHa4mBGzbIEw9cOtBUxmHDC3O+bFB50 /SfLFPdBwGH/E4cuoBk9/yAih7SGX/g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688718178; h=from:from:reply-to: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=rTaTx/R0QAu6GJW6rE7C/1qQWY5Fc41FkF1jDqmTGVY=; b=W3ApvboxU9JouxaEEKxMBuOkgOmRPL0CSDAdvIGYPnLG/UJpYFfjtQKjX2tQUrHrD9D4Ke d8zwq+IS+W5MfMDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4FA23139E0; Fri, 7 Jul 2023 08:22:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id s/dbEmLLp2SiOgAAMHmgww (envelope-from ); Fri, 07 Jul 2023 08:22:58 +0000 Date: Fri, 7 Jul 2023 10:22:56 +0200 From: Joerg Roedel To: Baoquan He 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,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 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? Regards, -- J?rg R?del jroedel@suse.de SUSE Software Solutions Germany GmbH Frankenstra?e 146 90461 N?rnberg Germany (HRB 36809, AG N?rnberg) Gesch?ftsf?hrer: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman