Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp8987lql; Fri, 12 Apr 2024 01:43:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWU5PGwmv/vg+rs9Q60cVGkrOFOqxw5UOUenKe2q3wcYdLWTH1MgzG0bhIFzeodxzVijtbQA1nLP9JDHVIWfbtTA/wkOkK43pjl/7DMSA== X-Google-Smtp-Source: AGHT+IFR9W9TxniLplKW7hRpzsaqWwxXCypf5GIyskakM+7AEsvF13/hUcyCyN//NK6BCWzxdILK X-Received: by 2002:a17:907:2ce5:b0:a51:cbd5:1fb5 with SMTP id hz5-20020a1709072ce500b00a51cbd51fb5mr1576394ejc.36.1712911433720; Fri, 12 Apr 2024 01:43:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712911433; cv=pass; d=google.com; s=arc-20160816; b=LlJTavhQU1MM448JlrmAjCbFbK6b2CQHEXveSW8stc2EJQD6f+kpF695up+0SbxFE5 R7ZsXjhFLPQRmQp9AiMVC6TGHwdSxj9PyhO/5yjP9maIPhAdWPzM/EVcXhhfXJRluJRR yw7B/ztyGzeEeeMVjS4LavRw5KOAZDEwFzETWOiWIoNPKxpllFeDy7pWvXDZrRdXkzbt SJRs0J5RmSOmUsL4BAcvazPMkOWEImJ7WFoYBjYynmXNhXDXvKJIanxEM7SNq569nogF wqqexdJIjcXLNmvRc/jyDoxW9M7RUM/owKEWPEja0gaslXEfSa8VsuFb2fNP4wJVyJme GruA== 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=X+9OaxloGN/FSXqUSAOf4JDSUwIOKi9IUkNUOnBk0P0=; fh=NDCPdPn2hiqHaiIRDYQAzsW9PK20CTia4nECGof6enU=; b=d5lxmszFJxLtsupXDS7c2xTgw/NzYu+AByLGBxSpxl6v050iJ/Mi3QjdOnR1dBTNBU BHBmJ2jHgEJKAq6aWpyQ/mFR4coletKRZhGRnFlpMRgFBqrYmyb1NbKLDz5YZIPdlj4+ fSk+CgZl8v1pBZJeb/BHZIlYq/6gAv12Ar0QHaKezJ2ZL4/Lx5lV2SqgKNivNVCr/Vok YT8VnASqq98MHhJ5B44XWsfZ54GEA4O+TRymaTn9uEL+vPLWlF18olOy8WQ27lwFbn+l 7mzH3Fae5T6u10JGulqjnTcIQRuiiELdfafchiGPZqmPlKnglT7/I1U0lhPkOVtka1hN +D4g==; 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-142256-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142256-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ne12-20020a1709077b8c00b00a522692d99asi1182732ejc.56.2024.04.12.01.43.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 01:43:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142256-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-142256-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142256-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 72F541F237EF for ; Fri, 12 Apr 2024 08:43:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11FA553E0D; Fri, 12 Apr 2024 08:42:34 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A6BF535D2; Fri, 12 Apr 2024 08:42:31 +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=1712911353; cv=none; b=MzeST1aS/YfuKlepNZ4ScZZ1QCwWfYVl9YH4Zta3yFIbWtPRmm/nLDNwZWdjda5DftB2LNqdLc4sy9DCwYWyLmyzYlcALxn5qtaO2B2rZzD3vaX3P1Y2vA4kFFAjli2ZnON5YxGJj3O8FxDeCOiGHJFKmNQrjfE4bCsD9QQNl0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712911353; c=relaxed/simple; bh=/HhiS5Z0Bbiaa1Q0ARnRQ8/wUTv3n+FJDn/8TSK0IGQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SOppLcrvdDIVMJOrB3gsyvS5pf/KJyMK2R/FC37UXvurCMiuwqpw+9KXb/moERUrjkPBrDddpfhcAaVHeFEX3teT6Tob3hbcQU8K1icpB8SrmHjNCU3DkugaYLrornMhewCJpP0pZlgZD9ZpT52Fyr5c+48RI0C2pZ77/KUlyUw= 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 6FCB6113E; Fri, 12 Apr 2024 01:43:00 -0700 (PDT) Received: from e112269-lin.cambridge.arm.com (e112269-lin.cambridge.arm.com [10.1.194.51]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 186863F6C4; Fri, 12 Apr 2024 01:42:28 -0700 (PDT) From: Steven Price To: kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: Steven Price , Catalin Marinas , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , 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 Subject: [PATCH v2 04/14] arm64: Mark all I/O as non-secure shared Date: Fri, 12 Apr 2024 09:42:03 +0100 Message-Id: <20240412084213.1733764-5-steven.price@arm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240412084213.1733764-1-steven.price@arm.com> References: <20240412084056.1733704-1-steven.price@arm.com> <20240412084213.1733764-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 All I/O is by default considered non-secure for realms. As such mark them as shared with the host. Co-developed-by: Suzuki K Poulose Signed-off-by: Suzuki K Poulose Signed-off-by: Steven Price --- arch/arm64/include/asm/io.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index 8d825522c55c..f283c764ea20 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h @@ -145,12 +145,12 @@ extern void __memset_io(volatile void __iomem *, int, size_t); #define ioremap_prot ioremap_prot -#define _PAGE_IOREMAP PROT_DEVICE_nGnRE +#define _PAGE_IOREMAP (PROT_DEVICE_nGnRE | PROT_NS_SHARED) #define ioremap_wc(addr, size) \ - ioremap_prot((addr), (size), PROT_NORMAL_NC) + ioremap_prot((addr), (size), (PROT_NORMAL_NC | PROT_NS_SHARED)) #define ioremap_np(addr, size) \ - ioremap_prot((addr), (size), PROT_DEVICE_nGnRnE) + ioremap_prot((addr), (size), (PROT_DEVICE_nGnRnE | PROT_NS_SHARED)) /* * io{read,write}{16,32,64}be() macros -- 2.34.1