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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACFB7C43216 for ; Thu, 19 Aug 2021 17:09:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 18D94610CE for ; Thu, 19 Aug 2021 17:09:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 18D94610CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 765BA6B006C; Thu, 19 Aug 2021 13:09:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7166A6B0071; Thu, 19 Aug 2021 13:09:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DDE48D0001; Thu, 19 Aug 2021 13:09:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id 40AF46B006C for ; Thu, 19 Aug 2021 13:09:10 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DB637274BC for ; Thu, 19 Aug 2021 17:09:09 +0000 (UTC) X-FDA: 78492465618.23.896E771 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf14.hostedemail.com (Postfix) with ESMTP id 4B51C600198B for ; Thu, 19 Aug 2021 17:09:08 +0000 (UTC) Received: from zn.tnic (p200300ec2f0f6a00894cffc8901d9ad3.dip0.t-ipconnect.de [IPv6:2003:ec:2f0f:6a00:894c:ffc8:901d:9ad3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id F092D1EC04F3; Thu, 19 Aug 2021 19:09:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1629392943; 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:in-reply-to:in-reply-to: references:references; bh=5h/pBCa48TpXaDC5k6IrIdMKol2hS7fNRvaR9js1Y0w=; b=Y+o2JyP4Tg1O4OSMYH/GIP8+RzcS0qjXj/JucPGugTCf3iMvd2TXwRWBSklMZvSnsBBjzn fr3Y7u61lMY10cqPUfxz1UkhK57dEAyb8NrVtZid6qA8GMlZphUUqzbVVrsR6nRZEgXn0p Zwnk5rkTl3zqeU7wg2G67ypkiAml6Zw= Date: Thu, 19 Aug 2021 19:09:42 +0200 From: Borislav Petkov To: Michael Roth Cc: Brijesh Singh , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Vlastimil Babka , tony.luck@intel.com, brijesh.ksingh@gmail.com Subject: Re: [PATCH Part1 RFC v4 24/36] x86/compressed/acpi: move EFI config table access to common code Message-ID: References: <20210707181506.30489-1-brijesh.singh@amd.com> <20210707181506.30489-25-brijesh.singh@amd.com> <20210819145831.42uszc4lcsffebzu@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210819145831.42uszc4lcsffebzu@amd.com> X-Rspamd-Queue-Id: 4B51C600198B Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=Y+o2JyP4; dmarc=pass (policy=none) header.from=alien8.de; spf=pass (imf14.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de X-Rspamd-Server: rspam04 X-Stat-Signature: y7dw6ppwog8t6qytcbbp1bk8gio8wxwx X-HE-Tag: 1629392948-272662 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Aug 19, 2021 at 09:58:31AM -0500, Michael Roth wrote: > Not sure what you mean here. All the interfaces introduced here are used > by acpi.c. There is another helper added later (efi_bp_find_vendor_table()) > in "enable SEV-SNP-validated CPUID in #VC handler", since it's not used > here by acpi.c. Maybe I got confused by the amount of changes in a single patch. I'll try harder with your v5. :) > There is the aforementioned efi_bp_find_vendor_table() that does the > simple iteration, but I wasn't sure how to build the "find one of these, > but this one is preferred" logic into it in a reasonable way. Instead of efi_foreach_conf_entry() you simply do a bog-down simple loop and each time you stop at a table, you examine it and overwrite pointers, if you've found something better. With "overwrite pointers" I mean you cache the pointers to those conf tables you iterate over and dig out so that you don't have to do it a second time. That is, *if* you need them a second time. I believe you call at least efi_bp_get_conf_table() twice... you get the idea. > I could just call it once for each of these GUIDs though. I was > hesitant to do so since it's less efficient than existing code, but if > it's worth it for the simplification then I'm all for it. Yeah, this is executed once during boot so I don't think you can make it more efficient than a single iteration over the config table blobs. I hope that makes more sense. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette