Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1137634rdb; Fri, 9 Feb 2024 11:21:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5qrRCl0cKxiARcJAkahj2HDyhc/pmncGTS4T4pSfiuX3FOQwCz6MR7nvPlfyE3qfdA6sp X-Received: by 2002:ac8:5b8c:0:b0:42c:5f73:9a99 with SMTP id a12-20020ac85b8c000000b0042c5f739a99mr182058qta.31.1707506461362; Fri, 09 Feb 2024 11:21:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707506461; cv=pass; d=google.com; s=arc-20160816; b=u4U1CU7/y8iu5thNMqrL6/DUFwrMGYYecc7ZDAMlCrNpPHZ/dY5O9fAu1zR0FSoDtw wdx3fwk8/uFcEFTMVVdHMoeu1kg0FdrGMZ1XVgUlI3nmCasjKKZ7Xv5KzHzOWIlSzBT7 /eMAnCYe1G54rhDkX1Nyt3Ms7kq4kL5bqaoQU+889eK6obxbJm5WqzI3N4IjCQent9t6 K2iTQM2Tbuc3FCpjVR48uV6l98GqfPEKbLJfWA1v9q9M3/9pRwlRnI/aIaCa4sV9mAaI 4Nk9YlSOBHAHdoLke3/FqRltPylwIf3/QLyz6QrFzqcM9EVzYRXOcIjs66rf+6whIlDz sPbg== ARC-Message-Signature: i=2; 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=sKc43LnuruE4C4gTj1SBUB4Fdvh7DqI2CHhYP6wkvVw=; fh=jJoHKRGA1TUuxfmmzXh3fdW3ZFxgVd6At0wbecihpaY=; b=z14mpcAstZlLGuHVAQJtbXwvd+cK1KPO12ljXeCx9ewDOViFszMpVHwVy6bpDbX1VI tybAYLkb+C4QmVWFJ3XRfqzOOqjYjCEb5nzfOc8x4gLQvOtlxG2GtZtn8fhxJMd8admZ iXLBCY9wzzLOm7yl0MAshsjqfq5E4EwsXT6oO3rcjPw2qlDRpGXE7QCRJgWUpQxSfq4N 7i0BQ2rwlMOBBq3eFyDsEzpbuRQ/KLo25fXJvEQDj5k/2UqOdib7pOihhJSllG3C1EyH WKYz7SSHQYYMzMwWcEv6dLcIu+8JtKIqzy31t2tzPiMj3+ZH+FQnQA617CrzpAGYXHmC HezA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=0Wl3N3mv; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-59865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59865-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCUgA6NwjnxktqdrLN+2RNghxUeesxswLModi1KEnEWURCeMSPHDqECgSnxzqboWktz1In0RD03YkmlCwcfs/TurtsQkyn/lIqHc7N6qTQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bp33-20020a05622a1ba100b0042c4500fa5asi2646168qtb.358.2024.02.09.11.21.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:21:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59865-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=0Wl3N3mv; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-59865-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59865-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 20DAC1C2354B for ; Fri, 9 Feb 2024 19:21:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E8CA83CAF; Fri, 9 Feb 2024 19:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="0Wl3N3mv" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 A8A422E3F7 for ; Fri, 9 Feb 2024 19:20:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707506450; cv=none; b=TTL8w/GbRwEYZFZleFsRcJnaIFdBhQbid2uhEPDQ0YIuCW2gmG61XF/S5H1iMxLI5k+iXUNTkcJxriHo+9qwl4CvFueKThnCMFOF6fPYvlRFrsUSy+o3kpwl18Jy8+fMSoI/ARy6O8qkLHUOa6JY/m1pGlwTFkbQOlQy8m2UVnY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707506450; c=relaxed/simple; bh=RMUeTIdrpjvqLvRywC3xhAkIf7wdZECwCEXb1rHQiBA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=R/O3WX/qqELL3nvF+yxgcvOra2KkRu0y1qmyAY9fEyyTBmMaavQ0pLjKmgwHkV9UluV6Q/VzomZlBXjd9iEWGSAeg4+W4sJtsq3yG6tyEfmMATEhs5O2kprO96dYTmt46vwurXDyhuO25kgmrJBWwa5+IhD14mFzwO66ma9ds0g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=0Wl3N3mv; arc=none smtp.client-ip=209.85.128.48 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-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40fe59b22dbso10370655e9.3 for ; Fri, 09 Feb 2024 11:20:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707506447; x=1708111247; 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=sKc43LnuruE4C4gTj1SBUB4Fdvh7DqI2CHhYP6wkvVw=; b=0Wl3N3mvxvWZAyGwWlWHkOB2+o92YmmRKaRDhW/LaUnWcupROsZiDwUvgb3wku/DTD YOwS8dFLmCquwltT0T9OFWCz2ydOn+E/n5jQbWIsTYcW2myVpPwcjtKKvPrFIYpdUr2g DNpSlq1mHeiiyAOSSOQUwnzm//0v9SP5ojLYRskpnoEwlg6HBDEPwT4klHWvtChy4pL7 8kSvHYRhBv3zxCt46ev0y29gb955/fa9VdAghRFk9dtCpckFpgdPgKDmH6UWFr6ZkeW7 6eoaHzq/Yn2oYaOEfAh3zgC7XpMOurpuoVBGwJ/3A4DaXm2pUHSWIaRZNNOy/7Vv8osc DJnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707506447; x=1708111247; 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=sKc43LnuruE4C4gTj1SBUB4Fdvh7DqI2CHhYP6wkvVw=; b=ua7u9QgTgf6OX4EwZAqQTYTQRI5nFuRjOy+UUL4NPzr8X/dqwMpvZHwKMlCIL1IGVt cfZFeT2nJvzNBkIJlwfD65X9ZO7uMYwz5UALWlf2ETgF7172rtNHYEnemb9J8fsHlyN7 eIg1OHT5pEoRHvTH/RQHb4Vk0DNuqoXTUUF+HJ2ITC97g/xatWHduHmzB1JPkoSMY5BW GMsrYGu8FcWvqLB2bWVte7jGUrCqD5+MQA4rmlJQfBlrIkw40tW6Ny6Rh/9yhNa7kcEj MaqVPLecHoP8ECNIFMu9izvoMbOfNyrXV6STN/bda7n4fmAd4dYFO3Xn8v9cACg3PgGW nsqw== X-Gm-Message-State: AOJu0YwOrH7DD7N5k7D8yh9oqV4J9WlxWGfhTB4bvoSVx+pCca7BSxfF iSUngXa+K/rk7s+V06+xz1I2uT+5nKlXCPKDRzk1lR5JHUxJ3kBuewPdPOofLKOvuGPoZQrFgIB APsjek7euu8PbKSsbfl/qv8K4MH/CDD33qoDh X-Received: by 2002:a05:6000:1250:b0:33b:1577:a2d1 with SMTP id j16-20020a056000125000b0033b1577a2d1mr1835327wrx.1.1707506446818; Fri, 09 Feb 2024 11:20:46 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240208220604.140859-1-seanjc@google.com> In-Reply-To: From: Nick Desaulniers Date: Fri, 9 Feb 2024 11:20:35 -0800 Message-ID: Subject: Re: [PATCH] Kconfig: Explicitly disable asm goto w/ outputs on gcc-11 (and earlier) To: Linus Torvalds Cc: Sean Christopherson , "Andrew Pinski (QUIC)" , "linux-kernel@vger.kernel.org" , Masahiro Yamada , Peter Zijlstra , "kvm@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 9, 2024 at 11:01=E2=80=AFAM Linus Torvalds wrote: > > On Fri, 9 Feb 2024 at 10:55, Nick Desaulniers w= rote: > > > > And also pessimizes all asm gotos (for gcc) including ones that don't > > contain output as described in 43c249ea0b1e. The version checks would > > at least not pessimize those. > > Yeah, no, we should limit that workaround only to the asm goto with > outputs case. > > We should also probably get rid of the existing "asm_volatile_goto()" > macro name entirely. That name was always pretty horrific, in that it > didn't even mark the asm as volatile even in the case where it did > anything. +1. 43c249ea0b1e could have done so, but I'm guessing "tree wide changes in Linux are not fun" was perhaps the reason it wasn't done so then. I also think folks are too aggressive putting volatile on asm statements that might not need them; it's definitely less cognitive burden to just always put `volatile` on inline asm but I suspect that's leaving some performance on the floor in certain cases. (I had a patch to clang to warn when the volatile was unnecessary in cases where it was explicit, but that was shot down in code review as being harassing to users). > > So the name of that macro made little sense, and the new workaround > should be only for asm goto with outputs. So I'd suggest jmaking a new > macro with that name: > > #define asm_goto_output(x...) > > and on gcc use that old workaround, and on clang just make it be a > plain "asm goto". > > Hmm? Thinking through the tradeoffs, the Kconfig approach would pessimize GCC versions with the "lack of implicit volatile" bug to not use asm goto w/ outputs at all. Having a new macro would just make the `volatile` qualifier explicit, which is a no-op on gcc versions that don't contain the bug (while allowing them to use asm goto with outputs, which is probably better for codegen). So I agree a new macro seems better than disabling things for kconfig. (Assuming the only issue is the need to make `volatile` explicit for a few GCC versions; it's not clear to me from Sean's latest response if there's more than one bug here). I'm not signing up to shave either yak though. --=20 Thanks, ~Nick Desaulniers