From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 07C2A34BA50 for ; Fri, 12 Jun 2026 20:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781296410; cv=none; b=n2UMtpZ13uGXTb3xx3u14l0engmsBClM/aUTdvXZRlLY3cqpRgbmO8lFLtySZNd2oHt8+QqrlNxxHwKeabtayN5iHIZ0c8IR0DOLmKDdBq0PCJGh9bndPcmSmQUeNS6/oE4HCNk05mQWpE44tEjwMiMOg5lkHk7qLrIyz3M+ngM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781296410; c=relaxed/simple; bh=ZziSC1n6N4F1brdtCP75PwL3mwkBGaV/H9I0p/XM020=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EKkYVl1pUpAoU3EiExJOB3kSQUsf//qz6yTg8kRPIah/cRljz8PPEhLJNqvOtsshUz5I9wIjWSeEU8vHNyZCa7AzpTKXkDMDaV8GkjeLuLpD9Yowu0uJdGVTdT1XuwRfsr3t4D7+U/0WD8jLqv5YR0N/Ui6PYjzQ/oK9DlK1vwY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JE2MZ7l2; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JE2MZ7l2" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5aa88b4f792so1876087e87.1 for ; Fri, 12 Jun 2026 13:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781296407; x=1781901207; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XTcVz9luL8bir/ZzptwlcjQQqCfAppeo2d04/ZWzcNg=; b=JE2MZ7l2u7dcbm2GUtkaJvrYXKr26cTCpGIQOaLIjtQ00QVB30e4g0bE5CZC+JZIdG Hiig0JxO9KbK+6nhZ7cjjW7bxnyt3suo89Hp0AlJhyabanuAAt0j7/erXTFlliFGpw0x zGbDT0ll6yOpw2TQY/3meMPiEfvm2Hl3dxrTGiq1TrVXNk2XhTPohvXXXz37/WjPjsn+ CnqJ7apD6kUtKVdqdTbZ7DGyHp9+eeXIa80qiSFOg1hFTy8C9gEy4HzPG9jChZI9F/z9 YuJCBIQ9PCaIGchITgeehinnX3dnRGiXwd65iy2qORggNCib7vhXsnhulRiU5IIq315+ c4iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781296407; x=1781901207; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XTcVz9luL8bir/ZzptwlcjQQqCfAppeo2d04/ZWzcNg=; b=WlZPuAKxxpvVfZz+2+8PfctX5MNML27OXsxTeSPnpDZYDEuAgpq233LL0WcxKH/jJo HCDUopqIvnwFkYeTja7mTtyoB/CoJOXZbkKH6rDKNdG9UivHUGNe7NHXgq6m1YOnQXhK /NSPyjKgwj/gMlaZ/6jHtBOM3p1/Ua2VXcdaHLltRoWnE7KFzHVszhXzXSpjeRuNIUog Fw+u0O9klg/wravuT+GAzDerR9Ai9HiUeSzooMWPLAVLwQRdRDUdGmjUNJHAyDPz+e55 KhHT+2CMys9RSS2NZoKwBLZeLCvnatbP8bbMLSROSiIaRg0ta/WmWiwf7MJDi0XNBtEE YvjQ== X-Forwarded-Encrypted: i=1; AFNElJ89QJHuCj9KZD1VePyHmsAuvpDgS9/sTcFIb1OBTvGOjKDSy5akkVuNUHHHoTCE3t6jPftoVuoEpIiZZjY=@vger.kernel.org X-Gm-Message-State: AOJu0YxD6oq7G88rn5V8hKy0OA2ATwJo64oNkmTTdv36Mfxltlpsff8f lanGs0tWPZWYM10T8NbLSfMbUFk4XkYqZTyX+2okGOLMkignyLwUeauY X-Gm-Gg: Acq92OFINIuWot84yyua0nyHMjeyMsIuITYaoq5oh/B1tFG1Zj/eP1H/W/XY4JmwBmg Sw1jjVBYfn6zqgvYK6tGMxHl4Mvwlw3PpJIMUFwlpfLN3C9e5eXXvq+VXzcDJC2Q16Y/sJEMaF2 Frm1LqEDpAXBqErxMdaNemCDbu0BYGiS1WXF0tpcq+woGJabJ6Q5DruVjndVv6sYCuf/ed5CqUV y4L0XmyHx3letwD4lHBayU+jfvBMpyAeKHAel8XsCg43m59ZS37a6AcXJWpxWXx0K2q7Ni32OZn 5YH9JnlNyLcfIyxcyFCHohrIifZo4ftYXBPjFJBaV5JTcgAkGmRU5L+lyKTn3ZXWpXVC+vViYsz OqGoUfmdtO58NvOgAZ3FHqV2Xm7JoMXUVJFYqtuwWwJv3R462LTtIbhmPEvMeOzRZ2m1rjr+X9t 93PMoI5yggQDunyW5pJ7U0bZi2KSsY0DHp6vaNvQY0gT/z3hJPjV8YHJI0ND+Eqddf95iwoCiMs aY+xbTMcfFgtelYxe6MuMGG18GADT21 X-Received: by 2002:ac2:568d:0:b0:5a3:ff48:f7d6 with SMTP id 2adb3069b0e04-5ad2e1302cfmr949739e87.13.1781296407105; Fri, 12 Jun 2026 13:33:27 -0700 (PDT) Received: from buildhost.darklands.se (h-37-123-143-144.NA.cust.bahnhof.se. [37.123.143.144]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5ad2e161e70sm788949e87.5.2026.06.12.13.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2026 13:33:26 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: glaubitz@physik.fu-berlin.de, mcree@orcon.net.nz, ink@unseen.parts, macro@orcam.me.uk, Magnus Lindholm Subject: [PATCH v3 3/8] alpha: make irqflags helpers operate on IPL state Date: Fri, 12 Jun 2026 22:26:51 +0200 Message-ID: <20260612203006.2265557-4-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260612203006.2265557-1-linmag7@gmail.com> References: <20260612203006.2265557-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Alpha interrupt masking is controlled by the PAL IPL value, not by the full processor status word. Make arch_local_save_flags() return the current IPL directly, and make arch_local_irq_restore() and arch_irqs_disabled_flags() treat their argument as IPL state. Mask the low IPL bits in the restore and test helpers so callers which still pass a saved PS value continue to behave as expected. This prepares the irqflags helpers for lockdep IRQ-state tracking, where the saved flags value is used to determine whether hard IRQs are enabled or disabled. Reviewed-by: Matt Turner Tested-by: Matt Turner Signed-off-by: Magnus Lindholm --- arch/alpha/include/asm/irqflags.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/alpha/include/asm/irqflags.h b/arch/alpha/include/asm/irqflags.h index 9f25d4e0d37e..f207544f52de 100644 --- a/arch/alpha/include/asm/irqflags.h +++ b/arch/alpha/include/asm/irqflags.h @@ -26,7 +26,7 @@ extern int __min_ipl; static inline unsigned long arch_local_save_flags(void) { - return rdps(); + return getipl(); } static inline void arch_local_irq_disable(void) @@ -51,13 +51,13 @@ static inline void arch_local_irq_enable(void) static inline void arch_local_irq_restore(unsigned long flags) { barrier(); - setipl(flags); + setipl(flags & 7); barrier(); } static inline bool arch_irqs_disabled_flags(unsigned long flags) { - return flags == IPL_MAX; + return (flags & 7) == IPL_MAX; } static inline bool arch_irqs_disabled(void) -- 2.53.0