From patchwork Wed Jan 25 16:43:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13115863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 863E9C27C76 for ; Wed, 25 Jan 2023 16:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:From:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dtSpRt8lwkPCAKQa4ySI3Ub+kyKiEyySwMfF+v9Ts6U=; b=Qv8kxiMDj/yAuC j//4Tn1LTd1pdBd0rZi7KBO2ylT91aebR8zCYLuLST0PSUy6Urpuf4N9MVXrDyBMi4soPRkbN9tiN FWFeXoNJtuYnhY8KW4mvKwFaEu/e+4Bs1oH3CBZRDD/0CKTnMbrF7stxBKLjQn61vv4/7Jju15kqN pbryXfUdyM++v5c0t4yfSwUq78L/4r33PQc9UrewItGKSyxAyftsJaPUBBpawmoImj1tB3OciDZyK 9AZJLzTHdOiFVx1wA40PjQ8ZfjhyqzMclL2QdzzDwtdZQ5Gvof6cE8PujC8Q/z5wG3Y3gF+rZLBFl CZxdxzsXZcJjZlWVqEqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKite-0081ej-Bq; Wed, 25 Jan 2023 16:45:16 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKis8-0080rp-0n for linux-arm-kernel@lists.infradead.org; Wed, 25 Jan 2023 16:43:41 +0000 Received: by mail-pl1-x62d.google.com with SMTP id z13so18399048plg.6 for ; Wed, 25 Jan 2023 08:43:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:cc:to:subject:from:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=EeDkdKN25o3yAJllL5p2u+0Q2ytQ67GLc0qJXhBxDxM=; b=SHnmgjJZYXj7WagRfToRtcQ/9sikQnmv4aBPeZOQ6Qe2+p/XBHqQIZeAtjNvTZgvnT EXAcrEpkwoU7qUT7EqvehQSR0I2qkTs5HjeIkeTEWpRZnl7FCR4/ESiBRwbd3uIJWVV/ sP36xp8wXbIbk6GoWIIDr6RVMkTGednVsUJrSQ+4cfiEiyHshS9vkSHY9ncRU80lpcYA Tw0R+iZGZbnjXihRhy779KRYWly1cAXYH/KCt0mK+crrpcJQH5Rg7wjx8pLvQ8qqey8I UVs2PMq1wrl6h9JB0sXDnzcCVcgSavnrnHOJZg+XBScIp1/ZLAOc8bY5i7Sxb2PtkL15 yRBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:from:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=EeDkdKN25o3yAJllL5p2u+0Q2ytQ67GLc0qJXhBxDxM=; b=30HM9XvVRBSDmUuRlGb3452Q91R1cgRfxkwvYLwiKpiIn1VRhvfjLo1JVJnG/2aCwX aWiNKcvNwj44f4Ps0eR51sMU195FQXISEG0oUcK/UuoTkgNaSQ700U4K07Sm9PXLyk1G 1j6iossmS7MLP2rhuoLfimzw3p+yknIF+gSpAGE2kw1LLdbgPoJ/JmXEZDPTihhXl3V4 aLypcICCgOGkPIXG1t2eDbdqjxBT42M8+VRCXyjvsu2Ugsjo3VJnPobRAwMIcWVDguxI b9rf6Fx9GM4OiaM411omihc8CI5guevSa7vp7uAR7y9ePZLYfJ791RtKmaCmzG9twMPi X30A== X-Gm-Message-State: AO0yUKVxu4WtN5CrrfvyOLxtJ2I94U5gkK7c9QjvSqdbjOS64/bvKG1z YnW6l++nIvQWgnJtIuw6sHICIw== X-Google-Smtp-Source: AK7set+h6EZyJDQ2tDolm16eW8pc1tTNTyJG0vgUX5YaTWIARPPPmqUYsjRR5NyGuoIFaBaZjLwMpQ== X-Received: by 2002:a17:903:2305:b0:196:10d9:dabd with SMTP id d5-20020a170903230500b0019610d9dabdmr1663249plh.4.1674665016093; Wed, 25 Jan 2023 08:43:36 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id jh6-20020a170903328600b001960cf9655fsm3763574plb.309.2023.01.25.08.43.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Jan 2023 08:43:35 -0800 (PST) Message-ID: Date: Wed, 25 Jan 2023 09:43:34 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Content-Language: en-US From: Jens Axboe Subject: [PATCH] arm64: treat PF_IO_WORKER like PF_KTHREAD for mitigations To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230125_084340_351905_2F863ED4 X-CRM114-Status: UNSURE ( 8.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Like PF_KTHREAD, PF_IO_WORKER never exit to userspace. They exist entirely within the kernel, and hence don't need any task mitigations applied. Signed-off-by: Jens Axboe diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c index fca9cc6f5581..25a21c3d446c 100644 --- a/arch/arm64/kernel/proton-pack.c +++ b/arch/arm64/kernel/proton-pack.c @@ -654,7 +654,7 @@ static void __update_pstate_ssbs(struct pt_regs *regs, bool state) void spectre_v4_enable_task_mitigation(struct task_struct *tsk) { struct pt_regs *regs = task_pt_regs(tsk); - bool ssbs = false, kthread = tsk->flags & PF_KTHREAD; + bool ssbs = false, kthread = tsk->flags & (PF_KTHREAD | PF_IO_WORKER); if (spectre_v4_mitigations_off()) ssbs = true;