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 C6D0DC0218A for ; Sat, 1 Feb 2025 19:27:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E88816B0082; Sat, 1 Feb 2025 14:27:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E39886B0083; Sat, 1 Feb 2025 14:27:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D00BD6B0085; Sat, 1 Feb 2025 14:27:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B16186B0082 for ; Sat, 1 Feb 2025 14:27:22 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 28E19465E6 for ; Sat, 1 Feb 2025 19:27:22 +0000 (UTC) X-FDA: 83072359524.14.A8B9094 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) by imf22.hostedemail.com (Postfix) with ESMTP id 3B7F8C000A for ; Sat, 1 Feb 2025 19:27:20 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=f8ouIYPb; spf=pass (imf22.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738438040; 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:dkim-signature; bh=sSHuoeSCWYWDMrU9YLhoP5a3ZUn6qwlD8/eMeyymnrA=; b=ogl+HDPDTC/SY+/dYsPzcg9+dSBkImsPDBJOPOTCx8Uy/PPz3hLIphnLjNIdXjhcqCYULv HbhVJD6vDbkPpX7BRwlHdOIKOFlA/micwY3i4xFXicW29f0p4MtVlTS1zJ8jxfOsvVUdSF 8bb9sdz07ewYMpXmxIuBCE3pXJfpT7o= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=f8ouIYPb; spf=pass (imf22.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.185 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738438040; a=rsa-sha256; cv=none; b=PTyESt4JDkdUmUYCE0mEuFaqusXPcpjKJJ+Mxt+SxZE/5Eo+Lm6KNXf02nZcJ6omDmdbWS S29OAzyQ1NAjCpfXxq6TZdvR0pa0lvhtWYRJd8T62VBICfDkJfr5HH/88RGQmgPqdLsC/V jhDvTtkqnMETZWCl08MZtLHmJs4lAXw= Date: Sat, 1 Feb 2025 14:27:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1738438033; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sSHuoeSCWYWDMrU9YLhoP5a3ZUn6qwlD8/eMeyymnrA=; b=f8ouIYPbx1ko+gcS5f3MrsvzbpceA3Ve1jIv6bcFGFZB7Ku4cN3F0SqbW8AHkgjYmB5fag v8yOjqUszJ3SZKIpkmpqYMT3slg8OVnJzF9Asn9mhBVw7MpRj27cRtygY813ltMR8fHvFC RDoosUOBG7mJVfuc4tOkne/YttqvO4w= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Suren Baghdasaryan Cc: kernel test robot , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Andrew Morton , Linux Memory Management List , Kees Cook Subject: Re: drivers/auxdisplay/panel.c:1454:2: error: call to __compiletime_assert_309 declared with 'error' attribute: BUILD_BUG_ON failed: !__builtin_constant_p(_dest_len) || _dest_len == (size_t)-1 Message-ID: References: <202501310832.kiAeOt2z-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 3B7F8C000A X-Stat-Signature: 4efwfyuseyoxqfpt9yhbnsfbmgty9ik7 X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1738438040-576749 X-HE-Meta: U2FsdGVkX18Cc9TVeqdUtRlmyfWTMLpZDOfjw9JvusGylUnX+q3fnyXNyJyo4/zoB0WvU9mhb6CJnFLg6rKJaVRzSa9nntX11DR6w5dyhsi57f+yIXSR12uItcpmKmeKFyEsGY5dLJCOMBcDxS8Ux+DB/QypXrkPOFLR8zBgJzn+cPy75knIymXpSsYVk/DbMN3hqBbyXCtAK6pXqWTR8r8yjVxyh7v9QO7/S3PrhHsuZuBoAJHxpM3rmHH7+PwbwKBLp4vOx4ZV5BYmRNJ2Yt8i/nWgMPGnQyc7+QMMRUg3VwNFUFsKGd5Mb32wZ4aEtsezgMBVC6Ff2NLuvwXBB7FGvgZgfljZDJ7eAiZNyxRwIl615+VzH87z5Gq1bjFRVE+DD1oj8P1EySUjlRKygve+jusDeJby5uvUmInZPwZZYzS9daiZJsStREEaxvNVP8MrDnr1bbcoPj285jdKgiFk8YrW1M+7Y/7xnz7HNiULL8J1L9YT7prbXOAKqi5psLjBW4vLyEiTPFn54DQrxJRKJ31r6bFVP2P5Wqw5yCErmDlS6hvVCvYbyd9BNXSRMy35KJD8XA2Gv8LafXvcKaqSKzjqVLzIFe8uEdQ7pGWJZc7nlY6vxBSHoTyJ9xxLjZhTSExj8+W9g7E7OB8iV44WkuwttD3ZdN09fQhCJGJsNW0bvSoWrAqEYZ+sqZYv6oJwHwkhpgD1yJxRA9wUUtA4I6sy9R28smuKEI3xFMlR4QdDdUKV5l4C33IL2rmAe6FZdrB7ieXTDH6JoA2yjS2vWyPU74ICeX8AVDcjyHe8QHT9O5G5mqUQ3RbKJq+1fyo+fk0d6Qn6SwG+14GiMRoJgDky8acT48qlEe6W87kgys+Se4TlykKAoEQ3/d6LNSa7CnAdbR8eP6i96A213G5PtreeoKQxG4GlkP2+7So6pX+UGspR/XjmUazAuib6gwvdny1is97svGDRQrN bPniKnAD 5gSXxZlXOnSaGtD4hpbYR6u3knC6lPbGARFQqcoHBOryCh0Sa2KbaNTnJnlpcRKnAp+ENrln6owQka7+h4nrH4bJd9G1gB+RTleCAzmDejeucdd2KdprzpugtKmJy/XFHVpnlEIk4RpSEvNyKd9FG+uHdlFhDzH6BBSeRs9iKAVSzxCF38kAeUyQPtrS3pY+9NCk91Duj797NTUIekRi3M7BSskssBzQl4sioVwv4646iUqFvpifKIk9C0sqi8UjGdEjpXqzPmXUj+yCF39tf5uuwPl+V7HltnST5qtLC+8fHuog1lHSGFTUJr0OH+4NA3o6vnfRYJ8KmTkiiiPivjR/m4YckOFqVhmdABKuENvF97Bul0MW0HCeivrNNNWcIAbZjbvEfD5RJDE1pocc8mik3XtIagGByinHt9HFlSkliIG1hFpASYBbdvW0FkQ51szKK 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: On Fri, Jan 31, 2025 at 02:51:26PM -0800, Suren Baghdasaryan wrote: > On Fri, Jan 31, 2025 at 8:55 AM Suren Baghdasaryan wrote: > > > > On Thu, Jan 30, 2025 at 4:06 PM kernel test robot wrote: > > > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > > > head: b4b0881156fb8209bf5ef6cb63211bb0ad6e1a6b > > > commit: 07438779313caafe52ac1a1a6958d735a5938988 alloc_tag: avoid current->alloc_tag manipulations when profiling is disabled > > > date: 5 days ago > > > config: hexagon-randconfig-r133-20250131 (https://download.01.org/0day-ci/archive/20250131/202501310832.kiAeOt2z-lkp@intel.com/config) > > > compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) > > > reproduce: (https://download.01.org/0day-ci/archive/20250131/202501310832.kiAeOt2z-lkp@intel.com/reproduce) > > > > Just saw this report (was on vacation). Will try to figure out what's going on. > > I confirmed that my change at > https://lore.kernel.org/all/20241226211639.1357704-1-surenb@google.com > indeed causes this. > Looks like due to the additional mem_alloc_profiling_enabled() check, > the compiler considers allocation size as unknown at compile time > (__builtin_object_size(obj) returns -1) even though both branches of > that condition make the same exact allocation. > I tried changing it to: > > #define alloc_hooks_tag(_tag, _do_alloc) \ > ({ \ > typeof(_do_alloc) _res; \ > struct alloc_tag * __maybe_unused _old; \ > if (mem_alloc_profiling_enabled()) \ > _old = alloc_tag_save(_tag); \ > _res = _do_alloc; \ > if (mem_alloc_profiling_enabled()) \ > alloc_tag_restore(_tag, _old); \ > _res; \ > }) > > and that fixes the problem, however this would require two static key > checks... I wonder if there is a way to tell the compiler that both > branches cause the same result. Let me dig around. strtomem_pad() looks pretty suspect to me. I'm not seeing any reason for it to be using __builtin_object_size(), (and __builtin_object_size() failing looks like perhaps a bizarre compiler bug?). It looks to me like ARRAY_SIZE() would be better here, and also there really should be some actual typechecking on the source and dest arguments - like strcpy(), they should be char *.