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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C832ACF9C6B for ; Tue, 24 Sep 2024 14:28:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 478D96B0089; Tue, 24 Sep 2024 10:28:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 401A36B0095; Tue, 24 Sep 2024 10:28:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27BBE6B009E; Tue, 24 Sep 2024 10:28:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 040EA6B0089 for ; Tue, 24 Sep 2024 10:28:19 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A0509C1851 for ; Tue, 24 Sep 2024 14:28:19 +0000 (UTC) X-FDA: 82599861918.14.19E3045 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf15.hostedemail.com (Postfix) with ESMTP id 45D35A0012 for ; Tue, 24 Sep 2024 14:28:17 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727187939; h=from:from:sender: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uil0+sL+SnQqSdMHGOlUAN3dCtfKAMYeOf6sWKLe4pE=; b=ofQSseT1UKhOXH1wLD9B/jZglB7a+SX3HMP6ZtPNrxvbUnPNHtgYD9nxtQP9Etw0Oio603 lzOhXlziOIlEYS3bM6zHv0RuLeGfC0s0Jf0ndo6dxTBjTGEhOmKtwuU/4Y4zcf5u7jtzd/ ArK6tDPUQYxLqRNIEnqbGymTLvNFXYQ= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727187939; a=rsa-sha256; cv=none; b=ga9FMyK40i0nvMqhhid6hYUvykAAS3CFHXfjno7dMgy2tD8JDDoSlpbfUDRVP+Lp3cFV2R qMcXJrD6dVs84UR/rcHXEOs0Ju+oohmCPauRAZmySw4qidsdwCGUbpdgRKvWzwA8VG4YbQ aJB1jk5f3sHeT39l8BwHeS001wASq+M= Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4XChzg06DTz9sSZ; Tue, 24 Sep 2024 16:28:15 +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 ki0JqHY4FxX6; Tue, 24 Sep 2024 16:28:14 +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 4XChzf6GBFz9sSK; Tue, 24 Sep 2024 16:28:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BC2948B76E; Tue, 24 Sep 2024 16:28:14 +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 T3IA0DH180bA; Tue, 24 Sep 2024 16:28:14 +0200 (CEST) Received: from [192.168.232.31] (unknown [192.168.232.31]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DE98B8B763; Tue, 24 Sep 2024 16:28:13 +0200 (CEST) Message-ID: Date: Tue, 24 Sep 2024 16:28:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 4/8] vdso: Introduce vdso/page.h To: Vincenzo Frascino , Arnd Bergmann , linux-kernel@vger.kernel.org, Linux-Arch , linux-mm@kvack.org Cc: Andy Lutomirski , Thomas Gleixner , "Jason A . Donenfeld" , Michael Ellerman , Nicholas Piggin , Naveen N Rao , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Theodore Ts'o , Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers References: <20240923141943.133551-1-vincenzo.frascino@arm.com> <20240923141943.133551-5-vincenzo.frascino@arm.com> <645e5f3f-debf-4f68-ad75-4fb749b07a5b@arm.com> Content-Language: fr-FR From: Christophe Leroy In-Reply-To: <645e5f3f-debf-4f68-ad75-4fb749b07a5b@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 45D35A0012 X-Stat-Signature: m151g7yj5b6b38mqo47feysureqw7oy9 X-Rspam-User: X-HE-Tag: 1727188097-269027 X-HE-Meta: U2FsdGVkX194kaavNgU8RwY/XEXPHXnVARnlUrVF5NPbD8stR/kwY9t9ULhQ+ICK28Kd52se5p4WQvpBtOEfEOLDh/DFvR40y1drWl59LjxDpOvI2qCLRHNWrytQMK2fu3Qn+ZiCK8MQnP2hDR7ysv3xGSjYIPMYOI8KaLm9POjduuDfqxbcICiUp41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SCIpr6Lu+GjWhXEG5yW/Cgj8I 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: List-Subscribe: List-Unsubscribe: Le 24/09/2024 à 16:10, Vincenzo Frascino a écrit : > > > On 23/09/2024 17:54, Arnd Bergmann wrote: >> On Mon, Sep 23, 2024, at 14:19, Vincenzo Frascino wrote: >>> The VDSO implementation includes headers from outside of the >>> vdso/ namespace. >>> >>> Introduce vdso/page.h to make sure that the generic library >>> uses only the allowed namespace. >>> >>> Cc: Andy Lutomirski >>> Cc: Thomas Gleixner >>> Cc: Jason A. Donenfeld >>> Signed-off-by: Vincenzo Frascino >> >> Thanks for the new version. This looks all good, just some >> very minor ideas for how to possibly improve the new version: >> > > Thanks Arnd. > >>> +/* PAGE_SHIFT determines the page size */ >>> +#define PAGE_SHIFT CONFIG_PAGE_SHIFT >>> + >>> +#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) >>> + >>> +#if defined(CONFIG_PHYS_ADDR_T_64BIT) && !defined(CONFIG_X86_64) >>> +#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) >>> +#else >>> +#define PAGE_MASK (~(PAGE_SIZE-1)) >>> +#endif >> >> I would open-code the CONFIG_PAGE_SHIFT in PAGE_SIZE >> and PAGE_MASK, just to avoid the extra indirection in the >> preprocessor. This mainly has the benefit of slightly >> shorter compiler warnings when all the macros get >> traced back but can also slightly improve compile speed >> in case this is used in deeply nested macros. >> > > I will fix it in the next iteration. > >> Without a comment, the special case for CONFIG_X86_64 >> not very clear, and probably not needed. If you are >> worried about introducing an architecture specific >> regression, I would suggest instead explaining the >> possible issue in the patch description but using the >> more generic and simpler #ifdef check. >> > > If I do not add the #ifdef, it does not build. But you are right, I should have > put a comment in the commit message. > > Regression below: > > drivers/gpu/drm/i915/gt/intel_gt_print.h:29:36: error: format ‘%lx’ expects > argument of type ‘long unsigned int’, but argument 6 has type ‘u32’ {aka > ‘unsigned int’} [-Werror=format=] > 29 | drm_dbg(&(_gt)->i915->drm, "GT%u: " _fmt, (_gt)->info.id, > ##__VA_ARGS__) > | ^~~~~~~~ > include/drm/drm_print.h:424:39: note: in definition of macro ‘drm_dev_dbg’ > 424 | __drm_dev_dbg(NULL, dev, cat, fmt, ##__VA_ARGS__) > | ^~~ > include/drm/drm_print.h:524:33: note: in expansion of macro ‘drm_dbg_driver’ > 524 | #define drm_dbg(drm, fmt, ...) drm_dbg_driver(drm, fmt, ##__VA_ARGS__) > | ^~~~~~~~~~~~~~ > linux/drivers/gpu/drm/i915/gt/intel_gt_print.h:29:9: note: in expansion of macro > ‘drm_dbg’ > 29 | drm_dbg(&(_gt)->i915->drm, "GT%u: " _fmt, (_gt)->info.id, > ##__VA_ARGS__) > | ^~~~~~~ > drivers/gpu/drm/i915/gt/intel_gt.c:310:25: note: in expansion of macro ‘gt_dbg’ > 310 | gt_dbg(gt, "Unexpected fault\n" > | ^~~~~~ > > I am open to alternative suggestions. > 'fault' is an 'u32' and 'mask' should be agnostic so the format should be %x not %lx I think: diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c index a6c69a706fd7..352ef5e1c615 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt.c +++ b/drivers/gpu/drm/i915/gt/intel_gt.c @@ -308,7 +308,7 @@ static void gen6_check_faults(struct intel_gt *gt) fault = GEN6_RING_FAULT_REG_READ(engine); if (fault & RING_FAULT_VALID) { gt_dbg(gt, "Unexpected fault\n" - "\tAddr: 0x%08lx\n" + "\tAddr: 0x%08x\n" "\tAddress space: %s\n" "\tSource ID: %d\n" "\tType: %d\n", Christophe