Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp679236imn; Fri, 29 Jul 2022 21:27:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR7uSA2wqosG1lRrMlRSTragCRAV0dVTsqv2ThmEKmoS46/lgD9B9csd95H6EEMSDGovsemU X-Received: by 2002:a17:90a:7ac4:b0:1ef:a606:4974 with SMTP id b4-20020a17090a7ac400b001efa6064974mr8315030pjl.51.1659155251888; Fri, 29 Jul 2022 21:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659155251; cv=none; d=google.com; s=arc-20160816; b=q3FsnZowXl9wlqvTscBxTHznPxzRObrULMq/aUShEkvFXYgYI5OjI4Pt5pbmpwaQSY Ctfvc/wm0VPApGnZk4zjp5MulR7WDR3519/nS5r5fhMv7FDeCMzl4MXZEtk3VpqdjzN3 BG84iiWOx9WmSur/GOYXPeg6XbghkjDleauTIAFoJ8cR59TWCKM23DG5Q7LKHSMHIWHX f5+xWxTL6OLdV46oKoiAfOqtXZ+39Wz1MLV8VQaGQ3ooYvQrozxIT4Oz7nf+xbDeByuS wFN3svKHSRVrRexgUp5Ybqg6vZe2aHehOiKJsDsjI5Y3occMmNWQFJuFvi8INQLIid5f nM0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=fFgeLGDEXPjOLoUZJYNTF+ABbc7/QLMmmIBC+Ua0eXw=; b=eryeIxYLEanEixo3fo7GBk7+rN2fRkbpqS4rRj9cgI3jElaz/o73n++9ZHbz5iNhyI xIeEgZtpNPiVXRvte+NSQY5SbncQ9YDNnj1Sfyyup1EaI3K0osjf03N81e1yqc9uQ3Zw zVOukrZ16WrysyIK3dV4Br16pcU6CLO1W5xHfFhfulhQL3A6UPOnh5qY0NZLyv+25Qe9 wtX0R0l4YyQHlhYYuis/yA2/7xH1qAZk9sroSsxUqFnnY7AI0EurOsVHIzZXvWI9Wb5s p9Ua5sM1CvwlU98tq/mjWwdHLM4bKFmA6rtmhyS/ak7ufsv3idCBqk2AjHiE1FtOv+Wb RxGg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x18-20020a170902ec9200b0016d6e9cb213si6554643plg.564.2022.07.29.21.27.17; Fri, 29 Jul 2022 21:27:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233479AbiG3EQH (ORCPT + 99 others); Sat, 30 Jul 2022 00:16:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbiG3EQG (ORCPT ); Sat, 30 Jul 2022 00:16:06 -0400 Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494C7255BD; Fri, 29 Jul 2022 21:16:03 -0700 (PDT) Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-31f443e276fso67866417b3.1; Fri, 29 Jul 2022 21:16:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fFgeLGDEXPjOLoUZJYNTF+ABbc7/QLMmmIBC+Ua0eXw=; b=mRVQ1C2qSFk38q8RHRGoly5s1xIrOa9l7Ae/vdguNp5Yme5JTZ2fnftV8/Rxp7aFP5 sA82Agx5h0BETSUyESNj7E3F7TsEfIcdYCEf0nGEm0/H/RTpWDocEpyoeLyG5yjbHjQb WfLlgiadDQQx/+7ytlBxecyl2JkImTUx7DKUGjH2K9aFOmzSJ5wEw0jYA2DLVkEiquYD cYcx/ngwPEjUw8N847RjlOTSeFvVhNMpKZQOPUTGfGSF2H3wmmMBZUXljZgqJ9QqcT53 DVfMkLFDZfrPqXzZhAakPZPK4lU62p4nyS/6zgVTU1BY4GMRTK044V5/LxyRiMeYd1d8 i7xw== X-Gm-Message-State: ACgBeo1OiycMSEH7ksAP6sME3iXNpiCH9gpOY1/m2iehGmfqa01m57p9 Gr7WqpjG1bqkWIAI5qTalYIPFcFFwvd2i66K4y4= X-Received: by 2002:a0d:e682:0:b0:322:b5e1:5ed4 with SMTP id p124-20020a0de682000000b00322b5e15ed4mr5561178ywe.220.1659154562409; Fri, 29 Jul 2022 21:16:02 -0700 (PDT) MIME-Version: 1.0 References: <20220729084533.54500-1-mailhol.vincent@wanadoo.fr> In-Reply-To: From: Vincent MAILHOL Date: Sat, 30 Jul 2022 13:15:51 +0900 Message-ID: Subject: Re: [PATCH] KVM: x86: do not shadow apic global definition To: Sean Christopherson Cc: kvm@vger.kernel.org, Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Sat. 30 Jul. 2022 at 02:48, Sean Christopherson wrote: > On Fri, Jul 29, 2022, Vincent Mailhol wrote: > > arch/x86/include/asm/apic.h declares a global variable named `apic'. > > > > Many function arguments from arch/x86/kvm/lapic.h also uses the same > > name and thus shadow the global declaration. For each case of > > shadowing, rename the function argument from `apic' to `lapic'. > > > > This patch silences below -Wshadow warnings: > > This is just the tip of the iceberg, nearly every KVM x86 .c file has at least one > "apic" variable. arch/x86/kvm/lapic.c alone has nearly 100. If this were the very > last step before a kernel-wide (or even KVM-wide) enabling of -Wshadow then maybe > it would be worth doing, but as it stands IMO it's unnecesary churn. I would say the opposite: in terms of *volume*, warnings from apic.c would be the tip of the iceberg and apic.h is the submerged part. When the warning occurs in a header from the include directory, it will spam some random files which include such header. This is annoying when trying to triage W=2 warnings because you get totally unrelated warning (and W=2 has some useful flags such as -Wmaybe-uninitialized so there are some insensitive to check it). My intent is only to silence the headers. I do not really care about the -Wshadow on *.c files because it is local. > What I would really love is to not have the global (and exported!) "apic", but > properly solving that, i.e. not just a rename, would require a significant rework. I double agree. I would also like to rename the global "apic" but I do not think this is easily feasible. Yours sincerely, Vincent Mailhol