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 758EFC0218A for ; Sat, 1 Feb 2025 20:07:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDED96B0085; Sat, 1 Feb 2025 15:07:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D8EE96B0088; Sat, 1 Feb 2025 15:07:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C569C6B0089; Sat, 1 Feb 2025 15:07:08 -0500 (EST) 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 A3ABD6B0085 for ; Sat, 1 Feb 2025 15:07:08 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6442AA1A4F for ; Sat, 1 Feb 2025 20:07:07 +0000 (UTC) X-FDA: 83072459694.11.3E54FFB Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by imf09.hostedemail.com (Postfix) with ESMTP id 7BAA6140007 for ; Sat, 1 Feb 2025 20:07:05 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=ysll3TbV; spf=pass (imf09.hostedemail.com: domain of surenb@google.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738440425; 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=6n+dd3xMQn5Y+r0NTIc5RKRpV9R1LhdDYsaSaI6Y4a0=; b=0SjQbpCwN1W7oELUlg+OnKjWOFK43/GbSSFkgxDMPfHN7xiL9uNRGECnU1YkRAS6pM/UfD HsDDY8R0/szVgFA7jlTDOmhSXPQFVQ4+aqqk6jPZ6hKj3KB3wiO3/jbstS0KLvUJ5UPujX m/n2ktz1YfeuLRpZEmGreG09xbY7Wzg= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=ysll3TbV; spf=pass (imf09.hostedemail.com: domain of surenb@google.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738440425; a=rsa-sha256; cv=none; b=H1Hz//WSVJ54Tg6YVB0qFm44waE/LeMN9VrKBmHiVHU2PC9gGqHOedv27WRpGB8bY0s793 tG9XqtYOxZyTiG22ULTjnL6mJFXKoaXYfFLd8zeiO7rbGuKRN9UgBE6gByKUe8QidvHvY1 Zy0nu+0P/3Sp+xaBFCTOjx7HzzaQDFQ= Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4679b5c66d0so159551cf.1 for ; Sat, 01 Feb 2025 12:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1738440425; x=1739045225; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6n+dd3xMQn5Y+r0NTIc5RKRpV9R1LhdDYsaSaI6Y4a0=; b=ysll3TbVGhqZph2Y969hm+0vYAAnv9R0pP86Gvc/uhxX4A1+5VWg8C6SH3xSnEXiDg EglrGQ0hulb5BrqwWMhmCrMYqm0pQaIdFmJyX+ltw4He7ohpo2NHslm9mhbQ7TNC1QRY kNrfcMO6SdMwyw0X/Bza2fqaqG015+WgGeW+uf1OTCaLCTERIfkUdQDflmLi6chhv4ye j+Bsv+L8B/3ghADbFzibSI/gsoUGaYJXE2TH83KlkTD/h8DqZ/505k3o/aTJAnKuPNBi iS4kP/wH6Ja2vHno/HNmhpiM/NkC1oJcrwae6oXvovedCFNR6dNVJCHUj7BgeeLEkhu3 avfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738440425; x=1739045225; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6n+dd3xMQn5Y+r0NTIc5RKRpV9R1LhdDYsaSaI6Y4a0=; b=ZGABBuFz3u2DJFnf+Bx2aGZHBlTJkR+ZKVMOd4FE8fZo3reuWqPkb74MoXpnqginoO AewvY/kLOy4JBcB1rgmV2Tkp+sOQmdb1PBShmHkAqo8agt+NaiZDcVu1BOtCdjGT/Tby hYFJQlNWkzTRWZ+m0DlfagLC6T+J18BBVcFuixfMOTyaNYB8hnVJHhi80oW1l0w65IYW kb2fOF2h1NbeHJhg2ZbZ96a8VLgk110RGDly/58bmahCv3GAcRrJTERAVaARy43wPDy0 ClGzdOcOa2/Iou/p8m5QjANaMCyH7k+A+Gp72jrSSAP1f5zYvWXiKxWtYMcCd5P86v4t 9rnA== X-Forwarded-Encrypted: i=1; AJvYcCU0nvXZZBvJDpEHtlNNbXY558B88DxgkaZFd23bGnN9/+AIjbSUeE/LcAhyrKL3tI7zbnNtZetqIw==@kvack.org X-Gm-Message-State: AOJu0Yylyd+/QElRzoToDkUbTmGdPUMKpDv3m1PNSW//RffZaOnPYoSL teLPDt8F1ILtfrwzby2VqpHEcsBoQfFHVOtuz4xtTEuao9j0sbAaDKccT0k7FDP4G1tU5vYSr5e N1tzPgJXJk1sFJqTteHllwiejpEo3x69rfG1Q X-Gm-Gg: ASbGncsQDuYAZWssiy9YSSuMbv+KO5zg/69HcM1rfPRKO45QvXQJH/cusZGPvC7+McI HjFr5eln4V7DKgxwSR5o+dQZIGA8yHSyzc9Uhxh7VtQRls+g67iZqQP+HXfd1i430/Sv2QeswOL rG6W1v0Dy4q1Q6IIpEKA7AAAeSVcA= X-Google-Smtp-Source: AGHT+IFGScRsZu/BSeeBdha40frViqOW3XvGsw73ciQbR25FNCf8NQtTdfM2PHZm54fHj/maOIj4GMqzJl2X2uWUDN8= X-Received: by 2002:a05:622a:6204:b0:467:86b4:4e92 with SMTP id d75a77b69052e-46ffa8e17b4mr1859991cf.29.1738440424326; Sat, 01 Feb 2025 12:07:04 -0800 (PST) MIME-Version: 1.0 References: <202501310832.kiAeOt2z-lkp@intel.com> In-Reply-To: From: Suren Baghdasaryan Date: Sat, 1 Feb 2025 12:06:53 -0800 X-Gm-Features: AWEUYZlprt5O7-6D2FTFY-_Zt2KqcyXzKkEksVKOi2hLmo6QpH2b5Im5TKCukqw Message-ID: 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 To: kernel test robot , Nathan Chancellor , Nick Desaulniers , Andrew Morton Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, Linux Memory Management List , Kent Overstreet , Kees Cook , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 7BAA6140007 X-Stat-Signature: gomf88de4jqcf7qyed1bkkffethhf37k X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1738440425-128463 X-HE-Meta: U2FsdGVkX198EZkZYl34pewHIyR7Tx5uXFDn6zVui4Ta30lf1CtxbPGLizDqW9wNzQnyArQYgowapyk3GVQnyu0RSWh5uTxP7WbiI0JfrcMQrUU4+nTA09SXmsQAkHBpCcXsYsEWOM44y+fg2KkSNx+8D6+1fLv5EPFK9XgvxE3o6AcFSapy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gQ3X4GTYOw8Yvy6XgEjbouNeuGNbd1uay8DkTfwZne2BmhiNMDL6ixAzVe9zYCupZfDm27gAKcZHF69sxUQ/P3VDLNcvUiGCHqpk0lYvVOFDCerSRzOydUM1F2ynYAbt6FzXRRjzePfhydKsabPPC6zoL/s2V6904uQj5CSeS1vzU9x1pLV1Ci3TN85luOJNZVI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000013, 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 Sat, Feb 1, 2025 at 11:21=E2=80=AFAM Suren Baghdasaryan wrote: > > On Fri, Jan 31, 2025 at 2:51=E2=80=AFPM Suren Baghdasaryan wrote: > > > > On Fri, Jan 31, 2025 at 8:55=E2=80=AFAM Suren Baghdasaryan wrote: > > > > > > On Thu, Jan 30, 2025 at 4:06=E2=80=AFPM kernel test robot wrote: > > > > > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/li= nux.git master > > > > head: b4b0881156fb8209bf5ef6cb63211bb0ad6e1a6b > > > > commit: 07438779313caafe52ac1a1a6958d735a5938988 alloc_tag: avoid c= urrent->alloc_tag manipulations when profiling is disabled > > > > date: 5 days ago > > > > config: hexagon-randconfig-r133-20250131 (https://download.01.org/0= day-ci/archive/20250131/202501310832.kiAeOt2z-lkp@intel.com/config) > > > > compiler: clang version 14.0.6 (https://github.com/llvm/llvm-projec= t f28c006a5895fc0e329fe15fead81e37457cb1d1) > > > > reproduce: (https://download.01.org/0day-ci/archive/20250131/202501= 310832.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 =3D alloc_tag_save(_tag); \ > > _res =3D _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. > > CC'ing Nathan Chancellor, Nick Desaulniers and llvm@lists.linux.dev > > Looks like this error happens only with clang version 14 (more > specifically CONFIG_CLANG_VERSION=3D140006). I tested with clang-13, > clang-15 and clang-17 and all of them build this code fine. Same thing > for other archs (clang-14 fails, others don't). I tried hexagon, x86 > and arm64. > > To fix the build I can add: > > #if defined(CONFIG_CC_IS_CLANG) && CONFIG_CLANG_VERSION >=3D 140000 && > CONFIG_CLANG_VERSION < 150000 > // do this the old way > #else > // do this the new way > #endif > > but I'm not sure if that's the right fix. > > Andrew, while compiler folks investigate this issue, I'll post the > above fix in case we need to deal with this build error urgently. Workaround is posted at: https://lore.kernel.org/all/20250201200503.2532357-1-surenb@google.com/ > Thanks, > Suren. > > > > > > > > > > > > > > If you fix the issue in a separate patch/commit (i.e. not just a ne= w version of > > > > the same patch/commit), kindly add following tags > > > > | Reported-by: kernel test robot > > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202501310832.kiAeOt= 2z-lkp@intel.com/ > > > > > > > > All errors (new ones prefixed by >>): > > > > > > > > >> 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 =3D=3D (size_t)-1 > > > > strtomem_pad(key->u.kbd.release_str, release, '\0'); > > > > ^ > > > > include/linux/string.h:417:2: note: expanded from macro 'strtome= m_pad' > > > > BUILD_BUG_ON(!__builtin_constant_p(_dest_len) || = \ > > > > ^ > > > > include/linux/build_bug.h:50:2: note: expanded from macro 'BUILD= _BUG_ON' > > > > BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #con= dition) > > > > ^ > > > > include/linux/build_bug.h:39:37: note: expanded from macro 'BUIL= D_BUG_ON_MSG' > > > > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), = msg) > > > > ^ > > > > note: (skipping 1 expansions in backtrace; use -fmacro-backtrace= -limit=3D0 to see all) > > > > include/linux/compiler_types.h:530:2: note: expanded from macro = '_compiletime_assert' > > > > __compiletime_assert(condition, msg, prefix, suffix) > > > > ^ > > > > include/linux/compiler_types.h:523:4: note: expanded from macro = '__compiletime_assert' > > > > prefix ## suffix(); = \ > > > > ^ > > > > :127:1: note: expanded from here > > > > __compiletime_assert_309 > > > > ^ > > > > 1 error generated. > > > > > > > > > > > > vim +/error +1454 drivers/auxdisplay/panel.c > > > > > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1426 > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1427 /* tries to bind a key to the signal name . The = key will send the > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1428 * strings , , for these resp= ective events. > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1429 * Returns the pointer to the new key if ok, NULL if t= he key could not be bound. > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1430 */ > > > > 36d2041a3d57b9 drivers/staging/panel/panel.c Peter Huewe = 2013-02-15 1431 static struct logical_input *panel_bind_key(const char= *name, const char *press, > > > > 36d2041a3d57b9 drivers/staging/panel/panel.c Peter Huewe = 2013-02-15 1432 const char= *repeat, > > > > 36d2041a3d57b9 drivers/staging/panel/panel.c Peter Huewe = 2013-02-15 1433 const char= *release) > > > > 698b1515f03914 drivers/staging/panel/panel.c Willy Tarreau = 2008-11-22 1434 { > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1435 struct logical_input *key; > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1436 > > > > fdf4a4948ca8a1 drivers/staging/panel/panel.c Dominique van den Broe= ck 2014-05-21 1437 key =3D kzalloc(sizeof(*key), GFP_KERNEL); > > > > eb073a9bf2b6ed drivers/staging/panel/panel.c Toshiaki Yamane = 2012-07-12 1438 if (!key) > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1439 return NULL; > > > > eb073a9bf2b6ed drivers/staging/panel/panel.c Toshiaki Yamane = 2012-07-12 1440 > > > > 698b1515f03914 drivers/staging/panel/panel.c Willy Tarreau = 2008-11-22 1441 if (!input_name2mask(name, &key->mask, &key->v= alue, &scan_mask_i, > > > > cb46f472cbb08c drivers/staging/panel/panel.c Kulikov Vasiliy = 2010-07-12 1442 &scan_mask_o)) { > > > > cb46f472cbb08c drivers/staging/panel/panel.c Kulikov Vasiliy = 2010-07-12 1443 kfree(key); > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1444 return NULL; > > > > cb46f472cbb08c drivers/staging/panel/panel.c Kulikov Vasiliy = 2010-07-12 1445 } > > > > 698b1515f03914 drivers/staging/panel/panel.c Willy Tarreau = 2008-11-22 1446 > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1447 key->type =3D INPUT_TYPE_KBD; > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1448 key->state =3D INPUT_ST_LOW; > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1449 key->rise_time =3D 1; > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1450 key->fall_time =3D 1; > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1451 > > > > a952abcdaa2211 drivers/auxdisplay/panel.c Justin Stitt = 2023-09-11 1452 strtomem_pad(key->u.kbd.press_str, press, '\0'= ); > > > > a952abcdaa2211 drivers/auxdisplay/panel.c Justin Stitt = 2023-09-11 1453 strtomem_pad(key->u.kbd.repeat_str, repeat, '\= 0'); > > > > a952abcdaa2211 drivers/auxdisplay/panel.c Justin Stitt = 2023-09-11 @1454 strtomem_pad(key->u.kbd.release_str, release, = '\0'); > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1455 list_add(&key->list, &logical_inputs); > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1456 return key; > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1457 } > > > > 7005b58458e4be drivers/staging/panel/panel.c Willy Tarreau = 2008-11-13 1458 > > > > > > > > :::::: The code at line 1454 was first introduced by commit > > > > :::::: a952abcdaa22116d940ca9cb9253caad1622ae93 auxdisplay: panel: = Replace deprecated strncpy() with strtomem_pad() > > > > > > > > :::::: TO: Justin Stitt > > > > :::::: CC: Kees Cook > > > > > > > > -- > > > > 0-DAY CI Kernel Test Service > > > > https://github.com/intel/lkp-tests/wiki