Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp174328lqr; Wed, 5 Jun 2024 02:34:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8liEGlhnxLDWo/pBVKqFqm4peFZltROcIafki9rm/RUyckHngEYKECc77wSpl/XXWQFNSVl4cTO/jlk0+yimGb/VYgiFu2JmvRpHcTw== X-Google-Smtp-Source: AGHT+IE+5e8fwmupqAL9SwzuhrqMUK0y4bnLR4hlorcXzEFS2SO9mI30EZvkB6jYLcwnW+hdxZzj X-Received: by 2002:a81:ad45:0:b0:627:d23a:44ff with SMTP id 00721157ae682-62cbb4a952dmr18672717b3.3.1717580099678; Wed, 05 Jun 2024 02:34:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717580099; cv=pass; d=google.com; s=arc-20160816; b=uFkTtGocOlU1NKjsREtc/XEiPRlEHNUQXqwMTCSfLAdQHb5HMUdTjoI/hJ2mnlyAIu YA1yYfkRDBn+4+N7nUDndfU35fbdZKnvvVhyCFJuY1HlVkefcPvkCjX4gDZ8XEN8WnbN cD4Y8tV+b7LFRumeNoUTpgDmPLqSxB/Qq/akJD88SzSvPcLXHByUdIAeVV9d/jiSHchD iJS7oxqtSTjKtZMkKD3N+6FTtoUfLdDMKp9akZgSOQK1PWip7WLH3v0liSkjnhjKa2jS o0D3gYJMrBrX8vVi+eDwrwB8XT8Ohn4O+0M2gENvUixjfGqIZZ79WNs6pk4yzKyTuMWo +Qng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=/Ck3Un7YZkfsySsfVMTs2f11CK1X+c6EjB+ledaFdHQ=; fh=mU6xl5FN63PgqIKyLHx/u5uRervM0V89cYoVjXl22Bs=; b=TgICksmhm+Y3x0i+2A0i1pyqEbQOmw/ir9qK8w+TaYfvGTzuIwbHU8gcPRNafCFNEN UER7cS6rruEpknvzgYZkuCk0fEvlam/km7S+eY9UVZfuR8NG9HtNpeNftSmsGCCH40Su 5G206BVY1l7kdtrhFbAFMcAzLIuYBqGexhCqarCPP8fdne1snHIul8Jhp8DjJ+ntuSlK Xap7Qvp6gb0Jt/Tp6uKaSjp0zA+IFwAJgbPgOQOMbISiaGc+1mE3TjBgVSQHiTRH7YY5 uoR1vKPdw+J2iqpGKMmY95jAJokMHTXghiUGC4Wu/UN8ClGAkGhqGqrZreip8OajtC0J IVjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-202109-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202109-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b43d977si133019196d6.586.2024.06.05.02.34.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 02:34:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202109-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-202109-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202109-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 64C9C1C233E0 for ; Wed, 5 Jun 2024 09:34:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26392195FC7; Wed, 5 Jun 2024 09:31:01 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 606D0194A79; Wed, 5 Jun 2024 09:30:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717579860; cv=none; b=t/PCuKhNg7jWUmR9NVx797ZNDVMRi/XT4HXkR/y7WsDoB3xX3nJlCm5Un3RO4dbbcqXPx5hy5ZvdaqVpjRPIWgdixwxOJ7yfFl2iG9fGcpypdohRd8cp1vFh7ast+/+sfnMQYYCj9GYUJejI+YaqkOI0Qs9r7Gf7j0+f7ELdsSM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717579860; c=relaxed/simple; bh=Q2499N6OdZJ/cJEaYbIq4tcinJZWFqeeGizcFcsU/zY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M1FI4t5WGCE/k7RSDjvXn2pWnlbFWcUIOtYt/8WZxssrsOUvl1ye7SF1KXKw6DrZrGa65Li/BLrQqcVuX+z20/r6/VNiHz9VZRk7iOidAIhWOu+CdV67WN4Cv4WS+yU1mFItagsX5UuCmKZeFOKHCJ6rK8U4bqVUt+CGbsqf+4M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4CFF2DA7; Wed, 5 Jun 2024 02:31:23 -0700 (PDT) Received: from e122027.arm.com (unknown [10.57.39.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C60533F792; Wed, 5 Jun 2024 02:30:55 -0700 (PDT) From: Steven Price To: kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Suzuki K Poulose , Catalin Marinas , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni , Steven Price Subject: [PATCH v3 10/14] arm64: Force device mappings to be non-secure shared Date: Wed, 5 Jun 2024 10:30:02 +0100 Message-Id: <20240605093006.145492-11-steven.price@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240605093006.145492-1-steven.price@arm.com> References: <20240605093006.145492-1-steven.price@arm.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 From: Suzuki K Poulose Device mappings (currently) need to be emulated by the VMM so must be mapped shared with the host. Signed-off-by: Suzuki K Poulose Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 11d614d83317..c986fde262c0 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -644,7 +644,7 @@ static inline void set_pud_at(struct mm_struct *mm, unsigned long addr, #define pgprot_writecombine(prot) \ __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) #define pgprot_device(prot) \ - __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_PXN | PTE_UXN) + __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_PXN | PTE_UXN | PROT_NS_SHARED) #define pgprot_tagged(prot) \ __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_TAGGED)) #define pgprot_mhp pgprot_tagged -- 2.34.1