Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp43321rdb; Tue, 19 Dec 2023 08:55:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8gmtdrE2b2aNAMabnk09I/JPmfyIn7uVEwIibnSUaN0tBl3nRT4ltR8j0qfarlrfcq0cN X-Received: by 2002:a05:6830:168c:b0:6d9:f1e9:20c1 with SMTP id k12-20020a056830168c00b006d9f1e920c1mr16622179otr.21.1703004949279; Tue, 19 Dec 2023 08:55:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703004949; cv=none; d=google.com; s=arc-20160816; b=EzL9Na9EcD/7C+VyOpsNibzfc1rSFeaftzhqXsMeBd7yaA7BYlZ63VPmA7xLxXLrkH IFYvKlVknpaJf1uXueNrqvkN2boZKGtflSkT8Apy3WeDcalmkOz1y8pBfQgXq+g9IPO3 9lEE7RwSdCQ3WLiRLKjwrFsblndPN5n1oZ+pBex0n6VvcJVylUuF3i2vshIEyNnBs99Y a4ayKZxNUBX5dh9IQ4LTr5aepWxkgpmMuYEZI0WwMeySg6uTUgXPOP8SsjhKiGII2UUT xgXBuws12NJ6BDm/N1MGF0lmnas5Pyhi9E5EMJEWrbztvVum7QMNj6pektSVuDbi9did MFkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Pr1gwYwEAqV3CPDFt5tJeZc4Ej3mhik7sPY5D9i4L+4=; fh=ebdhtEkVQbsX9DZRC4DPbhnq8lsXNwrz+iIY+C8KnRc=; b=rIoAYLCIBv5yLkCGa9IgY/oRTuOk5ZI3Vf02BWhhPaGIeXfJbcb/tj6Xn5ldGKVIpA AW0IB8DJ/+8skf9yNu5Thu5gsTBBU3i2/I3m6Ef7yLvmqmxixfhlMpoefYBHXKZ5wfOr ZQ3x5q+O/yUHYCAEInvgleezBmMe4vSfoob7XuRpZWPO60b0r5qK2njU67puG7npczWA bpf1Gkem6ch46LcGZ7Y3bWWfolxYyhitj0ek2/XFk1zbeYJNdv5EAMjK5H4Kbtk8Oedt YSnRgfmrxtpzHOWMyoMS1AdzoqxIaDM5zltzMn4rxrKd+twu0iW70yYIHSZENM+5miBt c5fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qmJ1UAFB; spf=pass (google.com: domain of linux-kernel+bounces-5608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bz13-20020a05622a1e8d00b004254f1ddb34si28683441qtb.52.2023.12.19.08.55.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 08:55:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qmJ1UAFB; spf=pass (google.com: domain of linux-kernel+bounces-5608-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5608-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id ECE191C247B2 for ; Tue, 19 Dec 2023 16:55:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4341320B2A; Tue, 19 Dec 2023 16:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qmJ1UAFB" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2BE320DD7 for ; Tue, 19 Dec 2023 16:55:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-33668163949so2681054f8f.2 for ; Tue, 19 Dec 2023 08:55:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703004933; x=1703609733; darn=vger.kernel.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=Pr1gwYwEAqV3CPDFt5tJeZc4Ej3mhik7sPY5D9i4L+4=; b=qmJ1UAFBfZ4ahVGkaLyRsoMDVYtCQes7HeM62U+vzeFk3ZVVdgg1vfXb/WgqTdHYLG RxZs5YIA2yusvw7zBQ4gmjr6CmTttUnjf8rxsY+ZycnbY7FWl+b19Uv/Gv7W00djvUTt zzuihPgrjItSSdUGH7QVI+R5TdKp5KrojWRie0IIilVM8islbrnFg59q6lu982cXdzqN 3ZdLGf4GedeEmDHSBcNeveM72dmgK3lu2Wdg78d1wDk3CsIhpjbYLcLPVQ0UHQm+4Ntw a3mQ/vR+iOh0MO6Byw87tI/ETdRaI9EQjY54KSD/fUooASgvnk4H8gEtKqAmi7jmc89D pAvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703004933; x=1703609733; 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=Pr1gwYwEAqV3CPDFt5tJeZc4Ej3mhik7sPY5D9i4L+4=; b=J48Jug8QxWLwRV+XX00lgM68fZk9dwPnsEW3R+lXdCyQZ6f4PcEwrGMIFNZd7T3xQG fa8QddP+E3FmATyk/BboPlq3/2Z0+HUi/IuNFguZJ9hCLCkFyR9Qmy8aiS3ezBJP12it Cdg/CS4aAOrAz9LCoFdjOn4wFP9+PTcgnRO9CRzdQvhiSxoWSbVTc4TtRbjXFtwLXtDc eZFdT+jZUHwqF3cXmchgt7ftpz6KLW4jVCRY+ksoi15X6eINssV4c+86Uq5C9nduw8N8 vGRKUZJJa1Si3VPkz9QEZx1HRFdLxyAeiDO842bFto4F5oTH43xxFMX6GX3HPom8f7SH +zxA== X-Gm-Message-State: AOJu0Yyjf5R4jy8Rdl1Gql0RWJF1p+BzWktt3OIVe6EBTKllFoNNH1Vh iAh3ZUpVlyXM3OfpDtBUauusfCEPGBt210wG7gh39Q== X-Received: by 2002:adf:e4c3:0:b0:336:60da:7530 with SMTP id v3-20020adfe4c3000000b0033660da7530mr1849799wrm.158.1703004932880; Tue, 19 Dec 2023 08:55:32 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231215171020.687342-21-bigeasy@linutronix.de> <202312161212.D5tju5i6-lkp@intel.com> <20231219000116.GA3956476@dev-arch.thelio-3990X> In-Reply-To: <20231219000116.GA3956476@dev-arch.thelio-3990X> From: Nick Desaulniers Date: Tue, 19 Dec 2023 08:55:21 -0800 Message-ID: Subject: Re: [PATCH net-next 20/24] net: intel: Use nested-BH locking for XDP redirect. To: Nathan Chancellor , Sebastian Andrzej Siewior Cc: kernel test robot , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Boqun Feng , Daniel Borkmann , Eric Dumazet , Frederic Weisbecker , Ingo Molnar , Jakub Kicinski , Paolo Abeni , Peter Zijlstra , Thomas Gleixner , Waiman Long , Will Deacon , Alexei Starovoitov , Jesper Dangaard Brouer , Jesse Brandeburg , John Fastabend , Tony Nguyen , bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Dec 18, 2023 at 4:01=E2=80=AFPM Nathan Chancellor wrote: > > On Sat, Dec 16, 2023 at 12:53:43PM +0800, kernel test robot wrote: > > Hi Sebastian, > > > > kernel test robot noticed the following build errors: > > > > [auto build test ERROR on net-next/main] > > > > url: https://github.com/intel-lab-lkp/linux/commits/Sebastian-Andrze= j-Siewior/locking-local_lock-Introduce-guard-definition-for-local_lock/2023= 1216-011911 > > base: net-next/main > > patch link: https://lore.kernel.org/r/20231215171020.687342-21-bigea= sy%40linutronix.de > > patch subject: [PATCH net-next 20/24] net: intel: Use nested-BH locking= for XDP redirect. > > config: arm-defconfig (https://download.01.org/0day-ci/archive/20231216= /202312161212.D5tju5i6-lkp@intel.com/config) > > compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.gi= t f28c006a5895fc0e329fe15fead81e37457cb1d1) > > reproduce (this is a W=3D1 build): (https://download.01.org/0day-ci/arc= hive/20231216/202312161212.D5tju5i6-lkp@intel.com/reproduce) > > > > If you fix the issue in a separate patch/commit (i.e. not just a new ve= rsion of > > the same patch/commit), kindly add following tags > > | Reported-by: kernel test robot > > | Closes: https://lore.kernel.org/oe-kbuild-all/202312161212.D5tju5i6-l= kp@intel.com/ > > > > All errors (new ones prefixed by >>): > > > > >> drivers/net/ethernet/intel/igb/igb_main.c:8620:3: error: cannot jump= from this goto statement to its label > > goto xdp_out; > > ^ ^ The problematic goto should be replaced with an early return. (and perhaps a comment that you can't jump over __cleanup variable initialization). Otherwise the compiler cannot put the cleanup in the destination basic block; it would have to split the edges and have all the happy paths go to a synthesized basic block that runs the cleanup, then jumps to the original destination. > > drivers/net/ethernet/intel/igb/igb_main.c:8624:2: note: jump bypasse= s initialization of variable with __attribute__((cleanup)) > > guard(local_lock_nested_bh)(&bpf_run_lock.redirect_lock); > > ^ > > include/linux/cleanup.h:142:15: note: expanded from macro 'guard' > > CLASS(_name, __UNIQUE_ID(guard)) > > ^ > > include/linux/compiler.h:180:29: note: expanded from macro '__UNIQUE= _ID' > > #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), _= _COUNTER__) > > ^ > > include/linux/compiler_types.h:84:22: note: expanded from macro '__P= ASTE' > > #define __PASTE(a,b) ___PASTE(a,b) > > ^ > > include/linux/compiler_types.h:83:23: note: expanded from macro '___= PASTE' > > #define ___PASTE(a,b) a##b > > ^ > > :52:1: note: expanded from here > > __UNIQUE_ID_guard753 > > ^ > > 1 error generated. > > I initially thought that this may have been > https://github.com/ClangBuiltLinux/linux/issues/1886 but asm goto is not > involved here. > > This error occurs because jumping over the initialization of a variable > declared with __attribute__((__cleanup__(...))) does not prevent the > clean up function from running as one may expect it to, but could > instead result in the clean up function getting run on uninitialized > memory. A contrived example (see the bottom of the "Output" tabs for the > execution output): > > https://godbolt.org/z/9bvGboxvc > > While there is a warning from GCC in that example, I don't see one in > the kernel's case. I see there is an open GCC issue around this problem: > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91951 > > While it is possible that there may not actually be a problem with how > the kernel uses __attribute__((__cleanup__(...))) and gotos, I think > clang's behavior is reasonable given the potential footguns that this > construct has. > > Cheers, > Nathan > --=20 Thanks, ~Nick Desaulniers