From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f201.google.com (mail-qk1-f201.google.com [209.85.222.201]) (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 8DAC62FF161 for ; Fri, 19 Dec 2025 11:20:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766143213; cv=none; b=nUWvJsPElAdk6LrSv+mnMD3qZoK8tVo2ha0oVDnlQfUDxwr5fXGOerxJ3tmJa+/OMV45nBDs3exCseaJZYbGzZQoYIlb4vOK7YxkvPSUrrdjJn4jUrE9sW57TDqXjMmU3o8njADrDFFRlTInKYv1oKGxYNZqPxU6aCuW92V33Lc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766143213; c=relaxed/simple; bh=K+0QH/EoO14PG32l/6tjd3/h9OOha4eUsO0l27iOfuE=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=kE7aTntuJkonea9cPLL0jxfxWFwSC2vwaVbJgXj9fjraEuScYAK6q9izDzRegpblhk0ttmvuDDOmpg6sHCviIdDruZraIp4ufox+5tYPKSGiyWgSwwQ/HcceoMNL+soxf5boidn4CLOXU039fa/swyRR/xju9M89jaT80v6LJLE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=E/OTAMbO; arc=none smtp.client-ip=209.85.222.201 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=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="E/OTAMbO" Received: by mail-qk1-f201.google.com with SMTP id af79cd13be357-8b245c49d0cso358240285a.3 for ; Fri, 19 Dec 2025 03:20:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1766143209; x=1766748009; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=en69sHXP7M+vMlUlDseZTZ5w8A4RV5mDqmpYVNvfhf8=; b=E/OTAMbOaUph4o/tWefw8bMyr5WalWMDLXXZolUyqxqLPaUCm8qhZnksZwsnr01OI9 o0TsryWXJD8ozjl48oBQ44tNaFajvAqmytFdB6kQiSiCzvdxtnVhW6QMbls60xSar2oD BdbCYK2e2LATRtl8a+lHsNMQ/9WbwBI/eCzHUX75WcIfe+LRJsNzSFt534r2oyBCNt5a H7gq038KLdIVrt2lHgWNlZ8ugKKFnUBSbLWUM0wMJAa5zk2y0Kd/UNgF2pQ/zzmG0iUr NarpxPU0qsTGBw8pd1K+CZRCuyS1YGuw6Qsu7C2313iKRhJTS/KAp6xyL9kI2g3jWnvz mDcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766143209; x=1766748009; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=en69sHXP7M+vMlUlDseZTZ5w8A4RV5mDqmpYVNvfhf8=; b=C56dcxtCWcDq0qcDO2YaOXyCdCbfGdKiHgW+ZwZTQnHbp0/ecyxkqiz5fEPiE74ouu nAN177ClaOoVKgqLYhqjoP4sZemfPNS2uYovsaJdsY/eI5PMG7o/juaFB6lv+jisXCiw csGoKCNPU4gXwKejcXVPFEpJtR8e70mR/lvy3ZGobnm85vkHG/7ZSQcWo3ZUYpBQ/f+S LK1Ia/Tibjvx28j7jSLbZRz7Bd7ZprCQyuUx6EmeKjS2ucJGlNe36ogwEc2vI7KwHT3h Wf2e8mNx1F0PqUDun3yU5usQMeSzUXYsrKGrowJF0x6+ZGPGS4lXr2+l154J5t4wD6Ry 3qVA== X-Gm-Message-State: AOJu0YzQQeS0ZY3pKnk2kAKl6R2mZ5CjnqWDAhIYm3pg+Qrj9k5rnPUh rwQXabAg+VxP2FwXvuP0b83uPUligsrbcMKaRJB7iA0/wlRF5bYzUqsWvMiaCCRNGr9Cmd+R3Re 6vJHL9SBC/0CQiQ== X-Google-Smtp-Source: AGHT+IFutVugj9UBfTcDw17Ei2jYIfPp36WFd1sJ9R4gjxiiddO7QI9uQO9XqCRo22skfGDtbSjomv6S9w1NeA== X-Received: from qvbkr11.prod.google.com ([2002:a05:6214:2b8b:b0:888:db8:f98f]) (user=edumazet job=prod-delivery.src-stubby-dispatcher) by 2002:a05:620a:298a:b0:893:b99:711a with SMTP id af79cd13be357-8c08f6668a9mr395644285a.19.1766143209444; Fri, 19 Dec 2025 03:20:09 -0800 (PST) Date: Fri, 19 Dec 2025 11:20:05 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.52.0.322.g1dd061c0dc-goog Message-ID: <20251219112007.2827302-1-edumazet@google.com> Subject: [PATCH 0/2] x86: speedup local_irq_save() for clang From: Eric Dumazet To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Uros Bizjak , Linus Torvalds , x86@kernel.org, "H . Peter Anvin" Cc: linux-kernel , Eric Dumazet , Eric Dumazet Content-Type: text/plain; charset="UTF-8" clang generates poor code for local_irq_save() callers, because of asm "=rm" output constraint being mishandled. Frst patch adds ASM_OUTPUT_RM macro, extending ASM_INPUT_RM that Linus added in linux-6.10. Suggested by Uros Bizjak. Second patch uses it in local_irq_save(), to not penalize gcc while forcing clang to generate better code especially when CONFIG_STACKPROTECTOR_STRONG=y. smap_save() could also use it, but is not in any fast path. Eric Dumazet (2): clang: work around asm output constraint problems x86/irqflags: Use ASM_OUTPUT_RM in native_save_fl() arch/x86/include/asm/irqflags.h | 2 +- include/linux/compiler-clang.h | 7 +++++++ include/linux/compiler_types.h | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) -- 2.52.0.322.g1dd061c0dc-goog