Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp669945pxb; Wed, 15 Sep 2021 10:21:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7gRDmEUL2Si7ljEM50sxxzlJMlGvTZIYWgicbZpmc8Y9/1+Ux6rb+dXA8yhIIdqoZBKwe X-Received: by 2002:a17:906:68cb:: with SMTP id y11mr1208361ejr.70.1631726461312; Wed, 15 Sep 2021 10:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631726461; cv=none; d=google.com; s=arc-20160816; b=ekFLqobcds8bJ1FNymfcAoq1BlDlm3GMF/e18W1xQNaPPQQV+wMxJ3G7KlcTJN50Aw iEJ40fsDgrv1ZYVgGqrAFC1/GdbXBznaqY2seDnaYsSCz+rRZ+ec4IISMVY/hnvz+JHD Fx6POEscb9YmEmDRl43mP1xaeuZUBwOsVZJASalukjxolXCNGcgPeiyXIVzssPE/+Id8 eHn3sv2wcUo9/4HunTBS4FJb0RKeVGoloIleAA5ubP1Ef/33IKi3fE4rgiBlPRgHMJXt dX0CDdM75ERcr90K7Xs7NcmQ1uFCIWwHueFb1YbzdDuwHodlDBbosaN0AfzzaR1Zzwhw 1jKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=hteNL4NQ5ug54JbXRkEF5N0gOthjwTRZUQ3xaNxGy6Y=; b=ts1sNxE2mM5eHf6LEOO2AN5y3fcSx5aNAqC3x7lETPLgr4ZKwl2HX26aQjKC069v1M HHOeMxfoVZcFpcqK2bA6FoAbsQ5SvC/3BnAqG0pwIMbEaszI7zlgUGjjjg8UJOvEVraD fEDDqjO4af+h4fmnVK0FMtyLLHQcITgzdN6eOYKGma5jEIVRRBR7LA8gBQLt6d/kPxKj BrI1iVlupGZH3L2JhRaxa/JOoKll2g5VMu8liRvS52BjOdrjr100CXH6bsnrz248et3J wPzZlLmkrXXIJALVWC/SX8hTUmSmhGhVTawrUIID1kDEY7X1In+zRIJGDPJmXN3q8Hkc mNQA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si558929ejk.531.2021.09.15.10.20.36; Wed, 15 Sep 2021 10:21:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230264AbhIORT7 (ORCPT + 99 others); Wed, 15 Sep 2021 13:19:59 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:49777 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbhIORT6 (ORCPT ); Wed, 15 Sep 2021 13:19:58 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4H8n4F0x0Hz9sV4; Wed, 15 Sep 2021 19:18:37 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PKzNyxImFUbI; Wed, 15 Sep 2021 19:18:37 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4H8n4D73HWz9sV3; Wed, 15 Sep 2021 19:18:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D8C808B77C; Wed, 15 Sep 2021 19:18:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id QXqNkIx7zBCr; Wed, 15 Sep 2021 19:18:36 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.204.250]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 11BA38B763; Wed, 15 Sep 2021 19:18:34 +0200 (CEST) Subject: Re: [PATCH v3 4/8] powerpc/pseries/svm: Add a powerpc version of cc_platform_has() To: Borislav Petkov , Michael Ellerman Cc: 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 References: <9d4fc3f8ea7b325aaa1879beab1286876f45d450.1631141919.git.thomas.lendacky@amd.com> <87lf3yk7g4.fsf@mpe.ellerman.id.au> From: Christophe Leroy Message-ID: Date: Wed, 15 Sep 2021 19:18:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr-FR Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 15/09/2021 à 12:08, Borislav Petkov a écrit : > On Wed, Sep 15, 2021 at 10:28:59AM +1000, Michael Ellerman wrote: >> I don't love it, a new C file and an out-of-line call to then call back >> to a static inline that for most configuration will return false ... but >> whatever :) > > Yeah, hch thinks it'll cause a big mess otherwise: > > https://lore.kernel.org/lkml/YSScWvpXeVXw%2Fed5@infradead.org/ Could you please provide more explicit explanation why inlining such an helper is considered as bad practice and messy ? 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. As pointed by Michael in most cases the function will just return false so behind the performance concern, there is also the code size and code coverage topic that is to be taken into account. And even when the function doesn't return false, the only thing it does folds into a single powerpc instruction so there is really no point in making a dedicated out-of-line fonction for that and suffer the cost and the size of a function call and to justify the addition of a dedicated C file. > > I guess less ifdeffery is nice too. I can't see your point here. Inlining the function wouldn't add any ifdeffery as far as I can see. So, would you mind reconsidering your approach and allow architectures to provide inline implementation by just not enforcing a generic prototype ? Or otherwise provide more details and exemple of why the cons are more important versus the pros ? Thanks Christophe