Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3292856pxb; Fri, 4 Feb 2022 05:44:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJTx+jXmW0QJq1XuVOYkPCBKq/rWFA7NRCJoQXueyiruc0BPoTlQ13S/oj0Iv2tj69yByI X-Received: by 2002:a17:90b:1e50:: with SMTP id pi16mr3221267pjb.102.1643982260841; Fri, 04 Feb 2022 05:44:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643982260; cv=none; d=google.com; s=arc-20160816; b=MJOdHWZJzb5/zSiPQkYaaxHUGxZVjx/55afV5lSUda92MwaRi8KD8j9JOk3OnNwJUu 4aswTVLcXNFjMewBPL0t5tIgiD1V5EOWt7fjE7yUNEBGrwtjCT1nlkviPkvUpMgfuNGJ 9feS9Bk1pDtLoZvIu8DHseF2hUq7Yx8uGt3hCaAq/iw+7LIjXQvsBFtUQ6pydHaQvfKJ cxFmwTmJ0O/3nvV12wvCZl3Iao8ql87r7lQgWPHeQFXMagEETlX+eAyF2hQEa7ydw+KH WLBaPVXFSDMlaXg1319T8inPqazgjYX8YMr8DgTI3CzbZrK+Z7AK/FmL3VzhIMSDyFi5 UQXA== 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=su0chIW0cbLPhkXWhBMbksAxZ8gJeI5gzh3NlG+Xo84=; b=E6qTeL7Vmzct+hM8e4jIRm3ZE0fQJFsktysPNTCwSkuNfo6+yeOJyhJ4VxYVC9+4X5 W+7827Jcf2h3ScQzHPaIKsun5RSb5KPo0aWphRyMTiyegvKtvs2G9OyJpjuVBvvHhNQi +nyI+KXvKn4f78tQS4hM8aTbXSOBVGF6GO5eBRTJ4j5gViwQhhDHeYGF0PkWXjxlEazg wnhI48ZhxTtQ/vZIsSv1GYOgLM4iszyrM0rWme8mNk78v2nf+kftJSJWoK0SawVApuFT U3rN2Eh2C9Iqy547B7QHcda8+SI5mw64E250oYW5nyMRaR/xlEo9ZQ/JUCx2U0/AxJb/ XdqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=IR0S7zOk; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9si1770369plq.78.2022.02.04.05.44.07; Fri, 04 Feb 2022 05:44:20 -0800 (PST) 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=@alien8.de header.s=dkim header.b=IR0S7zOk; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351744AbiBCPNo (ORCPT + 99 others); Thu, 3 Feb 2022 10:13:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351724AbiBCPNl (ORCPT ); Thu, 3 Feb 2022 10:13:41 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DA67C061714; Thu, 3 Feb 2022 07:13:41 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (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 06EFB1EC058A; Thu, 3 Feb 2022 16:13:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1643901215; 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=su0chIW0cbLPhkXWhBMbksAxZ8gJeI5gzh3NlG+Xo84=; b=IR0S7zOkfUWi6s+H1hW6QRZqmnqKiQr+TTTkruM9jmVAPrd6LPVMOz/kLFqsEMBL6OHUdb 0RirvheWyH6ntw7tYuI3euDtmJu0KSSIcQ2UrY+HQkOAfjVqNXUkgvupXLWO5B8tEQ0tDr MFvLcIG8N1QcnGZL9J29hBqtFkThfxs= Date: Thu, 3 Feb 2022 16:13:29 +0100 From: Borislav Petkov To: Brijesh Singh Cc: 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, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Michael Roth , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , "Dr . David Alan Gilbert" , brijesh.ksingh@gmail.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH v9 26/43] x86/compressed/acpi: Move EFI config table lookup to helper Message-ID: References: <20220128171804.569796-1-brijesh.singh@amd.com> <20220128171804.569796-27-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220128171804.569796-27-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 28, 2022 at 11:17:47AM -0600, Brijesh Singh wrote: > +int efi_get_conf_table(struct boot_params *boot_params, unsigned long *cfg_tbl_pa, > + unsigned int *cfg_tbl_len) > +{ > + unsigned long sys_tbl_pa = 0; > + enum efi_type et; > + int ret; > + > + if (!cfg_tbl_pa || !cfg_tbl_len) > + return -EINVAL; > + > + sys_tbl_pa = efi_get_system_table(boot_params); > + if (!sys_tbl_pa) > + return -EINVAL; > + > + /* Handle EFI bitness properly */ > + et = efi_get_type(boot_params); > + if (et == EFI_TYPE_64) { > + efi_system_table_64_t *stbl = > + (efi_system_table_64_t *)sys_tbl_pa; > + > + *cfg_tbl_pa = stbl->tables; > + *cfg_tbl_len = stbl->nr_tables; > + } else if (et == EFI_TYPE_32) { > + efi_system_table_32_t *stbl = > + (efi_system_table_32_t *)sys_tbl_pa; You don't have to break those assignment lines - the 80 cols rule is not a hard one. Readability is more important. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette