Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp233411lqg; Thu, 11 Apr 2024 00:35:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUk/iaaGwGPESK/AYLtNQe7lJRjn8MPFDcUqPJqaX9M72znFRuO8MzShJvDeO2UQMKBLRypZxzG0w47Hxym2k8tXuvgUilSUdpkwZVFgQ== X-Google-Smtp-Source: AGHT+IHmic55g9f3VIQsjQbQZbBjOZFRt5l3gP07Dx4cgF8NsdTscWUdY9SlYW+8JKPerhOuTYDa X-Received: by 2002:a05:6359:498c:b0:17f:72d6:ce2a with SMTP id mv12-20020a056359498c00b0017f72d6ce2amr6922849rwb.1.1712820917495; Thu, 11 Apr 2024 00:35:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712820917; cv=pass; d=google.com; s=arc-20160816; b=CFRqI6a6Wxj3AyvyjLk54o4LQpEshI/mxxmmqklUiwDK9Qyu44LEqyeyYGkdOO9X5t CIZP72hPFUM7uDqcpCLcjm2aLoJwzJDTxSKvvTGP+P2qhidm9LSas7H8qcQxg5kLJf1S JfGSMX9JKi2IWAsJgueivdO0kS5/r0q3f2rnVDAXLbbI8r31R80kb9lDdb9/KTXBJ0L/ mFO2zEI4k4fUiNTu/wQZOf5Td7qe36LMNbdXHuh8KWus9otZUTQMH8/7Tfv/9nm9WrEL Jl3fyLvykKPo+vg5jc+iNLjQ52X3nVup3/mtLcxDTYeTkqzaG5cXeKCzk1VzEuIIxQ5R LZKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=6uppAUCOOge1mOQ2ZlH0/0bUz4CTL7m2KKQSHyY4RBc=; fh=0VBzFs3ZcnmcJcGd+OfJlTTCUWf6nrR+XRGGlaGEb+w=; b=nPNyz0iu1SG7TVUXLDYrXDE1Tw0Eo+MHwRa9R4maalob32hpypn3lbteazZsVD2R5i Flq9WhV0DDjcVEeSSVjNCdvxeUAfCy6zwywCBxhNiWe6nXDvnzq8Xa0eH9sqkihBQsiW Odt11VdjCuEAwXHPwWJihWNKT/zKb/I6J9QR0qv/hWQAMNoCIfthlo00MaMuByO5jH3D dmXiJkHPxlppfmooizyPlECr5BTDazcqUU85BRzNnEUXUMlYAX95J4ddpQjuK/R+Iarj VwAyMn9+EvfKj/JjaFWRKmu4uWxK6d4AYmQOYs/WxJyDp4ieR9UxqeON/jkBJomJh2eH SZSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TlD1DoIZ; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-139948-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a193-20020a6390ca000000b005dc4b84b38asi784373pge.72.2024.04.11.00.35.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 00:35:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139948-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TlD1DoIZ; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-139948-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 89FDEB22D43 for ; Thu, 11 Apr 2024 07:16:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 30E5C13DDB8; Thu, 11 Apr 2024 07:16:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TlD1DoIZ" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CA9A63D; Thu, 11 Apr 2024 07:16:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712819796; cv=none; b=p5fy1AZMqF0nQ6/+xcXE6MFFq011/z6zJwerHlRrF8Nrerteee6MzET7U2a/iQ06E2mmTq2hpfhDb6Pkus4pzX1+9FAJr/KCeXwoL+SfQdyiZhra/XxIQ556eY8CCbl45OYkwT5cuaUmzfs/qkv4wbtUED/IJzcDkGoPUSotZ40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712819796; c=relaxed/simple; bh=1xYOPTuqtpTLVmhwlopOxLtF8xWMfDY79SUp6Zprkhs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BAkieN0JQh7jbKmMXuQ+d3YqdgjHDO0Duk7+cPYHGPkMlotTd4L3wgpk1ouG9uA8HN0/XD7qRZsWx9RoBf5UJaxIoK6uEwc3sAkUZNCWQutunH04l24IBqt84qjibXkMcJYRU8yibwzv0AQWzr2o9LZ2iXERrUaDFCEUUtMGr5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=TlD1DoIZ; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712819794; x=1744355794; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=1xYOPTuqtpTLVmhwlopOxLtF8xWMfDY79SUp6Zprkhs=; b=TlD1DoIZP0MfejzZBcf3zO9DYoxfNeYoP7E/tsDYBjAzzlPuN9zCVlP+ zOV906eMNqZgi6yAfaJr/QUGwTQyNrBzl5JWB7f4awO1df22BmkQ4wwCb GZBdnbHN3MXLGGHz3t07bCPitQskjk5xme5yBiLQiH+GKKw0/q3CRefOD vsCdytE8rQLuv2oM0YZ/XEUAzKQgG4MQHOI91Nr/YpcGVSKC5AYrntsz0 4ic7XxsMZEV9Tfwsl/S6cGpTKKVbAQZK2xg2RtDgqm0ZvbVLSFV63hmQf RjPJ4Vhje9fjuywKDvjdWxuHklflpv0C0FsqCnjUc+5nvRbt6Vzk6jPGv g==; X-CSE-ConnectionGUID: jIC+0rbRTS63WX8hHkmkoQ== X-CSE-MsgGUID: /BqFLQzTRHSfmAj4DyZB+Q== X-IronPort-AV: E=McAfee;i="6600,9927,11039"; a="33614631" X-IronPort-AV: E=Sophos;i="6.07,192,1708416000"; d="scan'208";a="33614631" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 00:16:33 -0700 X-CSE-ConnectionGUID: 9K0+1AyfRha/RGU+uETIcQ== X-CSE-MsgGUID: gRrxQhn1TSy0zaj59tdxaA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,192,1708416000"; d="scan'208";a="20894302" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.251.215.66]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2024 00:16:20 -0700 Message-ID: Date: Thu, 11 Apr 2024 10:16:16 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] bug: Fix no-return-statement warning with !CONFIG_BUG To: Arnd Bergmann Cc: Naresh Kamboju , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Vincenzo Frascino , John Stultz , Stephen Boyd , Peter Zijlstra , Randy Dunlap , Bjorn Helgaas , Anna-Maria Gleixner , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Thomas Gleixner References: <20240410153212.127477-1-adrian.hunter@intel.com> <87be83da-6102-483d-b1dc-a77eecc9f780@app.fastmail.com> Content-Language: en-US From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <87be83da-6102-483d-b1dc-a77eecc9f780@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 11/04/24 10:04, Arnd Bergmann wrote: > On Wed, Apr 10, 2024, at 17:32, Adrian Hunter wrote: >> BUG() does not return, and arch implementations of BUG() use unreachable() >> or other non-returning code. However with !CONFIG_BUG, the default >> implementation is often used instead, and that does not do that. x86 always >> uses its own implementation, but powerpc with !CONFIG_BUG gives a build >> error: >> >> kernel/time/timekeeping.c: In function ‘timekeeping_debug_get_ns’: >> kernel/time/timekeeping.c:286:1: error: no return statement in function >> returning non-void [-Werror=return-type] >> >> Add unreachable() to default !CONFIG_BUG BUG() implementation. > > I'm a bit worried about this patch, since we have had problems > with unreachable() inside of BUG() in the past, and as far as I > can remember, the current version was the only one that > actually did the right thing on all compilers. > > One problem with an unreachable() annotation here is that if > a compiler misanalyses the endless loop, it can decide to > throw out the entire code path leading up to it and just > run into undefined behavior instead of printing a BUG() > message. > > Do you know which compiler version show the warning above? Original report has a list https://lore.kernel.org/all/CA+G9fYvjdZCW=7ZGxS6A_3bysjQ56YF7S-+PNLQ_8a4DKh1Bhg@mail.gmail.com/