Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp732377pxb; Wed, 15 Sep 2021 11:50:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1IVoWVo2IujqGyiib5/I2WKb/kCUUM5bWHM78pB+iGXC6MHhVE6nOa3RkuaukVLAS+J48 X-Received: by 2002:a92:da85:: with SMTP id u5mr1162144iln.213.1631731802808; Wed, 15 Sep 2021 11:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631731802; cv=none; d=google.com; s=arc-20160816; b=iih12YTDKkFxM1r0vPZPBTmXHbBJ50ZDFosrYerKtvmyhtgv75FFPyxz6U3JK9uTgu lJnNZNdsmIacG2LvnYHaRdlDlyjj7DNZyLOKNGYgNoKeHokf0ZljLUzuF1xaqkOwX/o9 vTpCylZ2y4u4104vScEBRZjicEbpwN1YKLhPmGma6ErVkD35wgkFlVA2duQrA14z4eLc wsho8WjP+AINlhtkYSAikPGap726NbDswquMjpgKhADkq6uiZQ2X6I6P+yQ6a0FihnWh 9bVggJ0E9hZFoPO7sGlABbmrb5IIgbBMXWfLI38uGhhgTEIbokcAianONCLGOVUCknoW MFpg== 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=lm6vQs2/Rhr3v+Gkqez9mosqAUPoKD4IW0wHjidPrGY=; b=hyEUWMGw15nu0uc1wp4S/UgCtqIEoM5ToLCysATcA9kkcg8X13iKipKAfYjPs0gUUy AdgoB3Gvb10DItILY6pzYv/yg/Keyy6SLNK7kEOqhn0mspi5+uk2jjyKR/uQDjR7/gDS rgamJyZ97kVbeml8zFWZjGUu3pQE5DuvjnKD1Fq+VUKDpr3iAA5RVEJ4ka/yBQ+NYAl+ qHenBhcr0RSuO7Hrf5pcFZsLbkh+1hLdeZZO7jzWFftCf3LpjD/fP4UnyBEd0VwdkUve mRnk8ngsGDdK9Yojiey36q3z2M1uRVnW9KYf8/4AL6zEDM0UHVUs/uOw37RG1pmJ8Llm D2Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=XN5RscNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r19si653611ilh.119.2021.09.15.11.49.50; Wed, 15 Sep 2021 11:50:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=XN5RscNf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231501AbhIOStJ (ORCPT + 99 others); Wed, 15 Sep 2021 14:49:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231384AbhIOStI (ORCPT ); Wed, 15 Sep 2021 14:49:08 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6F9DC061574; Wed, 15 Sep 2021 11:47:48 -0700 (PDT) Received: from zn.tnic (p200300ec2f0d0700f7a2811245428a79.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:700:f7a2:8112:4542:8a79]) (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 2DD591EC0257; Wed, 15 Sep 2021 20:47:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1631731663; 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=lm6vQs2/Rhr3v+Gkqez9mosqAUPoKD4IW0wHjidPrGY=; b=XN5RscNfsftBTFcuRzGdY1iuAMSDX6NKtwpYReOnfaZk/QSrf/8VqAHOkAjfLPxC1UO6qn 9BHTplTlRlxpF7vtQWQch60eAekg1676yowhlJTxL/nJGxhj8z9rv3ulfK5vkpFuCcwh8v CPa1Q28irpOcNBFG98fwkSAbgq7mLSg= Date: Wed, 15 Sep 2021 20:47:37 +0200 From: Borislav Petkov To: Christophe Leroy Cc: Michael Ellerman , Sathyanarayanan Kuppuswamy , linux-efi@vger.kernel.org, Brijesh Singh , kvm@vger.kernel.org, dri-devel@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, Paul Mackerras , linux-s390@vger.kernel.org, Andi Kleen , Joerg Roedel , x86@kernel.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , linux-graphics-maintainer@vmware.com, Tom Lendacky , Tianyu Lan , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v3 4/8] powerpc/pseries/svm: Add a powerpc version of cc_platform_has() Message-ID: References: <9d4fc3f8ea7b325aaa1879beab1286876f45d450.1631141919.git.thomas.lendacky@amd.com> <87lf3yk7g4.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 15, 2021 at 07:18:34PM +0200, Christophe Leroy wrote: > Could you please provide more explicit explanation why inlining such an > helper is considered as bad practice and messy ? Tom already told you to look at the previous threads. Let's read them together. This one, for example: https://lore.kernel.org/lkml/YSScWvpXeVXw%2Fed5@infradead.org/ | > To take it out of line, I'm leaning towards the latter, creating a new | > file that is built based on the ARCH_HAS_PROTECTED_GUEST setting. | | Yes. In general everytime architectures have to provide the prototype | and not just the implementation of something we end up with a giant mess | sooner or later. In a few cases that is still warranted due to | performance concerns, but i don't think that is the case here. So I think what Christoph means here is that you want to have the generic prototype defined in a header and arches get to implement it exactly to the letter so that there's no mess. As to what mess exactly, I'd let him explain that. > Because as demonstrated in my previous response some days ago, taking that > outline ends up with an unneccessary ugly generated code and we don't > benefit front GCC's capability to fold in and opt out unreachable code. And this is real fast path where a couple of instructions matter or what? set_memory_encrypted/_decrypted doesn't look like one to me. > I can't see your point here. Inlining the function wouldn't add any > ifdeffery as far as I can see. If the function is touching defines etc, they all need to be visible. If that function needs to call other functions - which is the case on x86, perhaps not so much on power - then you need to either ifdef around them or provide stubs with ifdeffery in the headers. And you need to make them global functions instead of keeping them static to the same compilation unit, etc, etc. With a separate compilation unit, you don't need any of that and it is all kept in that single file. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette