Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp235241pxb; Tue, 7 Sep 2021 23:19:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzk1kQ92MZUOcWDy8hNb1MaO7VpLzHDcdq2mzujpTs1TboRondDT12/3L172pxQZoaGq23 X-Received: by 2002:a17:906:3146:: with SMTP id e6mr2346480eje.296.1631081950904; Tue, 07 Sep 2021 23:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631081950; cv=none; d=google.com; s=arc-20160816; b=XRSENc8t+89bNlMwMZIK8bmL+EtaPHf/qgq76U8RFoegMpHVVvh4SxjfFzllnwve5j DBeWGuxTaWyreUzVDp/pDAd4CmZ0mDUrMNLBlLFRWGCcDanE+G9oE4Z+uC34MV/e8IxM MGmSuNCUPIO9ZbB5L2Cenkut0/Rk8oFXXaL6WS++flzFln/qYv7Cq1lV0DUhE5MDCnCy fwrmIDbUGaWI3v7VnigZB3/iqTE6dme17+9gX84hPlE0AR4R02RFbMkYVkf2jwwvU2GV Xp/3+zU2K1fhVTkAMZ8UixR/Yzu56Ad9v4nTNZ8hywhBs7oooRI4iUiGVDk+EUnWORNE TQLg== 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:subject:from :references:cc:to:sender:dkim-signature; bh=oI034eT0o3xJiZ0XQLCTDDDSm6gdqB6B1NQ4npTSYHk=; b=uWUT1c+G8R/w7l8nIdgshvHAX1g1B7IQqtGb+LvVx/cLjV4PrNvhIfeVBjcHL2kchg 1CieeI9985VjQmWTrTX+ydAbXMSCJ4jZIamKGLCkv+4XBkRps0gKcvTK61UzB6z4NbiZ SSQEkwVmdU461XX6hWtpl05VQN9nFWr5W3L38F1eIyDhr+PJUxesSRQqL+NPJ5pXjrHG xliLTGa2zjYSarVUw+vdwUEGnCmhjA+QISuBgFnywzj0AEmCoJtzdfXWIhHBZ/erWQYT Ju1zgFAVa4l9WQzhQafX6kgsq+VGkSHJ1TG76vpWgmVmRiZEz9Z980+EJ6AVRHKgO1Rh itmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HJhp2Upx; 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 u5si1134724eju.138.2021.09.07.23.18.34; Tue, 07 Sep 2021 23:19:10 -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=@gmail.com header.s=20210112 header.b=HJhp2Upx; 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 S1345306AbhIHFrZ (ORCPT + 99 others); Wed, 8 Sep 2021 01:47:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245528AbhIHFrW (ORCPT ); Wed, 8 Sep 2021 01:47:22 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2928AC061575; Tue, 7 Sep 2021 22:46:13 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id v2so1685859oie.6; Tue, 07 Sep 2021 22:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=oI034eT0o3xJiZ0XQLCTDDDSm6gdqB6B1NQ4npTSYHk=; b=HJhp2UpxJXFc+THZ2MvQqyB9sdi46546xOcIpM+/wZnoWg0u3azReP5bzAGRGEfozr jxZ/XInG5BgfbT1KgJEhtH8VUMbwSK9tsOhVIb5nKMjgd6kBE04wq7WAxfuypM+W9ZOK EabyF8QjvtAJKmYXoCcraYlwHEfWpLR59L4pe6X0ZY68hC7VRvU5wIB8vinwjNbsYJXS 564g6wgYgxDnPuvc8Koc1duY73NKaum7bjhJ17QGwQhs5R0Sso//L3fSDHl7e95Bmf8U NWyRq0DaOTE1ZJlmtUTXClOUDxORGRfrpZFJIaZJJbsUnVrGRBiyLvp1q+e0JY8hP6V9 x/ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:cc:references:from:subject:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oI034eT0o3xJiZ0XQLCTDDDSm6gdqB6B1NQ4npTSYHk=; b=jZAv2uvX/YwyH3fkPQrFWs2j3a/TzHdnmR9q+52lJ8HeH8eXOvrrErZrYTIckuzVA/ fqNcqVfgS7zf5fc4lSgVPMEiTnpAoaJejwJopNB9gcVLhWMhhab9KbFgWKyxb39c9vn1 021pas6yO6JDTXZ/3dXZtFSNsGpLnap7uTECGzjZ2M1q12+T5z7+qf/bXFGqAXa/FJMb A7w6+HY0EKBxqVDQA65qYSnt7sZb+AEl8zR7NE4NtNO8nexWqY5jXq3G47WqoTpyWbFN v9Oc3d/5eJtviDmsQSMIom1iw4c0YA69KK2bfJdbTRNyYy5nW7Ha6t7wyGtkh1W3kHXm 7e5A== X-Gm-Message-State: AOAM5318oe+6tn2oZw+1Z4gIChue/DFpT+6ymdSmOYVSN/7s2FviXa+n hPko4WZJXwqJtYfI68CEr5rXBlHhNtM= X-Received: by 2002:aca:ad07:: with SMTP id w7mr1238229oie.22.1631079972289; Tue, 07 Sep 2021 22:46:12 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c3sm270855oiy.30.2021.09.07.22.46.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 22:46:11 -0700 (PDT) Sender: Guenter Roeck To: Linus Torvalds Cc: "David S. Miller" , Dmitry Torokhov , Christian Koenig , Huang Rui , Linux Kernel Mailing List , linux-sparc References: <20210906142615.GA1917503@roeck-us.net> <20210906234921.GA1394069@roeck-us.net> <20210908042838.GA2585993@roeck-us.net> From: Guenter Roeck Subject: Re: [PATCH] Enable '-Werror' by default for all kernel builds Message-ID: <0428495c-fbf3-77f2-b296-cba4a59e52da@roeck-us.net> Date: Tue, 7 Sep 2021 22:46:10 -0700 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: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/7/21 9:55 PM, Linus Torvalds wrote: > On Tue, Sep 7, 2021 at 9:28 PM Guenter Roeck wrote: >> >> It is seen with gcc 11.x whenever a memXXX or strXXX function parameter >> is a pointer to a fixed address. > > I wonder why I don't see it with gcc 11.2 here on x86-64. > I see the problem only on some architectures. No idea what triggers it, but it is definitely architecture dependent. >> gcc is happy if "(void *) 0xfffc1f2c" >> is passed to a global function which does nothing but return the address, >> such as: >> >> void *sanitize_address(void *address) >> { >> return address; >> } > > We have had reasons to do things like that before for somewhat similar > (well, opposite) reasons - trying to disassociate some pointer from > its originating symbol type. > > Look at RELOC_HIDE(). > > It might be worth it having something similar for "absolute_pointer()". > > Entirely untested "written-in-the-MUA" garbage: > > #define absolute_pointer(val) \ > ({ void *__res; __asm__("":"=r" (__res):"0" ((unsigned > long)(val))); __res; }) > or: #define absolute_pointer(val) RELOC_HIDE(val, 0) or maybe: #define absolute_pointer(val) RELOC_HIDE((void *)val, 0) would do the same (though the first variant needs a pointer as argument). All of those compile. I tested the first and the last option on qemu:parisc and confirmed that both work as expected. I'd be happy to send a formal patch. Which one do you prefer, and where should I put it ? Thanks, Guenter