Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp173146lqr; Wed, 5 Jun 2024 02:32:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUplwJpnmIGUbV0tgwe5CMs/6GBp7YVlf6vtsOcolLLJ0jmfEcM9i1SGrN24RkRfNyIFnLCmax9T5kQRTMmZmtOCpiruSRoD7lDcuSOVg== X-Google-Smtp-Source: AGHT+IE4ZHYQiIg2Xl4FW98zH4TSp1+Otz31s/ykMzEiaf9kX/nqyIcOrn/XFngF2ol02hRGVw/T X-Received: by 2002:ac2:5b89:0:b0:52b:8343:618f with SMTP id 2adb3069b0e04-52bab4dc99dmr1688345e87.24.1717579970276; Wed, 05 Jun 2024 02:32:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717579970; cv=pass; d=google.com; s=arc-20160816; b=wSFt6JFAVGMOQ33mQZh63562zvpDWc38uvipq9nxN6KeCbwkRuhaqjpOnXDxnDv9ny yXhhk70mNzXX6+rzYNjWTVl15YZ8bkslCJqQPHUaNc/kcFS2i+VBMKui8dU7rRntEQGE KhRljd8m67LoSbHLLrCwbFCWF/3Nk6jCIc4LDT0VSiR4Q9r7ue72gDKotu+S1Rgh28Uw 0jLn5CYd7fSw1M7QVCHdrtFqLCGe4Xo/vviSVH/Q9xqEvpfNa6frGzWdNp/PYPvaqOJj UJY9G/8XZlgfKTsEaeSUV4Wk0hjhol7lOa9DVBP4zyU6AGRImRtFoigdZOjiEX5UZsgc iwvw== 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=ONz2xYE87o2lShbSqyodDdarAPRdiNwgpK8u9Jxid3M=; fh=NDCPdPn2hiqHaiIRDYQAzsW9PK20CTia4nECGof6enU=; b=zDDX5T78Wnj+WQFz53aCIHzQ7tFCH9poKBUBpEc/0f7bgw4Rtu2LibPW5VfT55xHsz jOcIfJpekToG883fskUqB5aLVv4KKoxMMQAsw6mArwYKpPR/Xydn1pyT3Q929WYESJRI sh8OoHF5zRkm7c6db0TYIJVdAhTn314Q6DqDm0oWygEuJi789zs/K/6UNTPUpefu95b0 RStwuNVz7YbIukpycvRpW+U4VRixiDY3NX9Rx0E7HT5nPw8auILDzaLvmz93m1AV/uBH 0SdsPFKQVPHW2iKhSMuhElT2BO+gIRkp/EkDIucQqIfA4LQ7GUMW8BOhEZnbn99RPGBA ijXw==; 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-202103-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202103-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. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6916cc45ffsi263188966b.935.2024.06.05.02.32.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 02:32:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202103-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-202103-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202103-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 BDBA31F23B49 for ; Wed, 5 Jun 2024 09:32:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43D7A192B93; Wed, 5 Jun 2024 09:30:38 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 64E041922F6; Wed, 5 Jun 2024 09:30:36 +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=1717579837; cv=none; b=jr//HUTB0xycUJ/fi+bSq3FmHRSXyH/azMV5ssEiYxxkc+qQPobRF0fP9Sqw5mxf+EW3Rno/Fklc1f+/kbXWuSdLEPkONO6eqYZkkfkvQRjOT1E5vmkjywvCjaLByWe2nIex/MBWLXRN1Typn23U403ITUsNrZD7rkNOipmftIw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717579837; c=relaxed/simple; bh=lcv5jQHOzbvD5tItKPgAf7HGEAMiOJSOKh0fBlyK4hE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ioH+TwJzAkLGtrc5ODfR+t8Pnx+/9w99pqjOanoqAEvzQJRWgPrEcPnzZO+4xigEKiq7bjyKl62a2ihznDo6IaidNYvezPNrl2Mz/H9quTbQFE2R/qYSii/Q6Vl4FJdHmK6ny0XkoHUgCzh3C8f57hk1PMI1bgauXjU/5DNfsnA= 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 4C793FEC; Wed, 5 Jun 2024 02:31:00 -0700 (PDT) Received: from e122027.arm.com (unknown [10.57.39.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3F2943F792; Wed, 5 Jun 2024 02:30:32 -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 v3 04/14] arm64: Mark all I/O as non-secure shared Date: Wed, 5 Jun 2024 10:29:56 +0100 Message-Id: <20240605093006.145492-5-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 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 4ff0ae3f6d66..0a219c03750b 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h @@ -277,12 +277,12 @@ static inline void __const_iowrite64_copy(void __iomem *to, const void *from, #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