Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1654638pxj; Wed, 19 May 2021 10:43:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvov2Imz17/hPszgKkY3rygTX/P9WEVIk8h802pfNkt13SOh8pOL8OEz6Y6biwA+oEaX99 X-Received: by 2002:a17:907:98a9:: with SMTP id ju9mr289873ejc.257.1621446217667; Wed, 19 May 2021 10:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621446217; cv=none; d=google.com; s=arc-20160816; b=kdYIzEqV6LXjmw5GCNM5FMLYgiOT4pxA2OMReBy3sVgetHZn18nbKxun+BwJbtvH2v fOZcB1F2zTy0iKXMqsqje3/65rotgDkN12r74Q3qiTur8SQCg3aGERsI+N0NBCd21nw7 aWYoap7i3uN59QXwB2Hgqpcv1l2+cx4SDdgboksVUyZ2z7s8yz1G7KXsh4n4cLDEseMm N6qGxQ7GdCWCx2IXfu8V6c9WZZN+1zvPIgCbFRYtwqyUm4qxyf4YXPSqxXobgjTKDn3G E2ZZ2okDN8DBJaY6VpwpHtagkFQqNVdrjDOYGplslu0NZoaYUHe9RCrloYz3Yg558dtE IW9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QWdJLdtbkVKcmFgSpDyUxiktHy5X5kT7KmOcrItqULQ=; b=w6Q8kzpVthdw5x/YghsH02fCB4dKmY3Og7ht66FXzOpQepRErw1EzcWOPPe0XUGWFt pkO6qMWE+HNABPwTLqj8ErzY1R1n1bM65TgQ4O9gEZMIQS34ao+oam9ScTlybBqJ81JC hCOX2Bd2ZqiSaNVHDfSOZNGv4eZrCyjiPnBecJ7XuRLVNxFPfPBgIkHaco6r2XbxfvLA mBpr2vup+wKdcgIPPH0fybpkU5NnS/UBcpvhUBcdIgwwsfgc0Gku+kWZySMk1zP3XsCF 0Su6wjUQkfsGiKFl4fpB/TUNx4sjHXocw2FEwngdtsuyOaCk23Zdyb/H2pfP41pXlaAD I/Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AD3ZY9US; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp6si384530ejc.243.2021.05.19.10.43.14; Wed, 19 May 2021 10:43:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AD3ZY9US; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348085AbhERJun (ORCPT + 99 others); Tue, 18 May 2021 05:50:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:50466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242266AbhERJt4 (ORCPT ); Tue, 18 May 2021 05:49:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADD1F613F6; Tue, 18 May 2021 09:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621331314; bh=Dh/Va0X09dy++LO+W/9hE+3xOUtyUgHSE0+ZKx7G1GY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AD3ZY9USRC7qBSNI+UlwJXnlO/hP51HMdwLExYlkSvChWUqzEezJD+4JY1iVaG3fn 0ck3hG27/ib9mDAvXmOuRnlC/QinvFDCdlolRh5L/grcfifI5uIm3n3pZXFrQL5hgG pLxQYytpQIS2wXxEka1hruQPbIRjtzlbtcdrXk4C4Z9PdTv985Utk/PHwrv1s5r3za XoZ0+WvsoDD2k8Ak1Ug1m1HwsCrS5WnqogmKBgQK+w4lThzaQWmfxSz000knyS7msW 0OmfLkLhtvSdih0E6Q1zfjT4wTHBgtW7ZXDzYG+MG1M4Dw0LnSa548pKHVlGD5VJ+f +5LlMTJ7h9ZzQ== From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Quentin Perret , Tejun Heo , Li Zefan , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , kernel-team@android.com Subject: [PATCH v6 16/21] arm64: Implement task_cpu_possible_mask() Date: Tue, 18 May 2021 10:47:20 +0100 Message-Id: <20210518094725.7701-17-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210518094725.7701-1-will@kernel.org> References: <20210518094725.7701-1-will@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Provide an implementation of task_cpu_possible_mask() so that we can prevent 64-bit-only cores being added to the 'cpus_mask' for compat tasks on systems with mismatched 32-bit support at EL0, Signed-off-by: Will Deacon --- arch/arm64/include/asm/mmu_context.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index d3cef9133539..bb9b7510f334 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -231,6 +231,19 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, update_saved_ttbr0(tsk, next); } +static inline const struct cpumask * +task_cpu_possible_mask(struct task_struct *p) +{ + if (!static_branch_unlikely(&arm64_mismatched_32bit_el0)) + return cpu_possible_mask; + + if (!is_compat_thread(task_thread_info(p))) + return cpu_possible_mask; + + return system_32bit_el0_cpumask(); +} +#define task_cpu_possible_mask task_cpu_possible_mask + void verify_cpu_asid_bits(void); void post_ttbr_update_workaround(void); -- 2.31.1.751.gd2f1c929bd-goog