From: Steven Price <steven.price@arm.com>
To: kvm@vger.kernel.org, kvmarm@lists.linux.dev
Cc: Steven Price <steven.price@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>,
James Morse <james.morse@arm.com>,
Oliver Upton <oliver.upton@linux.dev>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Joey Gouly <joey.gouly@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Christoffer Dall <christoffer.dall@arm.com>,
Fuad Tabba <tabba@google.com>,
linux-coco@lists.linux.dev,
Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>,
Gavin Shan <gshan@redhat.com>,
Shanker Donthineni <sdonthineni@nvidia.com>,
Alper Gun <alpergun@google.com>,
Dan Williams <dan.j.williams@intel.com>,
"Aneesh Kumar K . V" <aneesh.kumar@kernel.org>
Subject: [PATCH v6 00/11] arm64: Support for running as a guest in Arm CCA
Date: Fri, 4 Oct 2024 15:42:55 +0100 [thread overview]
Message-ID: <20241004144307.66199-1-steven.price@arm.com> (raw)
This series adds support for running Linux in a protected VM under the
Arm Confidential Compute Architecture (CCA). This is a trimmed down
series following the feedback from the v5 posting[1]. Thanks for the
feedback!
Individual patches have a change log. But things to highlight:
* Some patches have been merged already. The first two patches from v4
were borrowed from pKVM were merged as part of that series. The GIC
ITS patches[2][3] have been merged via the tip tree.
* Final RMM v1.0 spec[4] - only minor changes over the previous spec,
but we've now got a proper release.
* Probing/initialisation of the RMM is now done later. This means
there's no need for finding the PSCI conduit and can drop the patch
for that.
* The patches for set_fixmap_io() is also gone - we the RMM is detected
later it's now too late for earlycon. See below for instructions on
how to use earlycon.
* Mainline no longer uses PHYS_MASK_SHIFT for manipulating PTEs, so we
can drop the patch for making that dynamic.
* There's now some documentation! In particular this clarifies a change
in the boot requirements - memory must now be RIPAS RAM for a realm
guest.
This series is based on v6.12-rc1.
Testing
=======
Since a couple of the patches have been merged separately, and there was
also a bug[5] in -rc1 which impacts 9p filesystems, I've provided the
below git tree with everything you need for a CCA guest:
https://gitlab.arm.com/linux-arm/linux-cca cca-guest/v6
Back by popular demand is also a tree with both host and guest changes:
https://gitlab.arm.com/linux-arm/linux-cca cca-full/v5+v6
(I'll post the v5 series of the host changes shortly)
You will also need an up-to-date RMM - the necessary changes have been
merged into the 'main' branch of upstream:
https://git.trustedfirmware.org/TF-RMM/tf-rmm.git main
And you also need an updated kvmtool, there's a branch with the
necessary changes here:
https://git.gitlab.arm.com/linux-arm/kvmtool-cca.git cca/v3
earlycon
--------
If using 'earlycon' on the kernel command line it is now necessary to
pass the address of the serial port *in the unprotected IPA*. This is
because the fixmap changes were dropped (due to the late probing of the
RMM). E.g. for kvmtool you will need:
earlycon=uart,mmio,0x101000000
This is the main drawback to late probing. One potential improvement
would be an option like "earlycon=realm" to identify that the earlycon
uart is in the unprotected space without having to know the actual IPA.
I've left this out for now as I'm not sure whether there is any actual
interest in this.
[1] https://lore.kernel.org/r/20240819131924.372366-1-steven.price%40arm.com
[2] e36d4165f079 ("irqchip/gic-v3-its: Rely on genpool alignment")
[3] b08e2f42e86b ("irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor")
[4] https://developer.arm.com/documentation/den0137/1-0rel0/
[5] https://lore.kernel.org/all/cbaf141ba6c0e2e209717d02746584072844841a.1727722269.git.osandov@fb.com/
Sami Mujawar (1):
virt: arm-cca-guest: TSM_REPORT support for realms
Steven Price (4):
arm64: realm: Query IPA size from the RMM
arm64: Enforce bounce buffers for realm DMA
arm64: mm: Avoid TLBI when marking pages as valid
arm64: Document Arm Confidential Compute
Suzuki K Poulose (6):
arm64: rsi: Add RSI definitions
arm64: Detect if in a realm and set RIPAS RAM
arm64: rsi: Add support for checking whether an MMIO is protected
arm64: rsi: Map unprotected MMIO as decrypted
efi: arm64: Map Device with Prot Shared
arm64: Enable memory encrypt for Realms
Documentation/arch/arm64/arm-cca.rst | 67 ++++++
Documentation/arch/arm64/booting.rst | 3 +
Documentation/arch/arm64/index.rst | 1 +
arch/arm64/Kconfig | 3 +
arch/arm64/include/asm/io.h | 8 +
arch/arm64/include/asm/mem_encrypt.h | 9 +
arch/arm64/include/asm/pgtable-prot.h | 4 +
arch/arm64/include/asm/pgtable.h | 5 +
arch/arm64/include/asm/rsi.h | 68 ++++++
arch/arm64/include/asm/rsi_cmds.h | 160 +++++++++++++
arch/arm64/include/asm/rsi_smc.h | 193 ++++++++++++++++
arch/arm64/include/asm/set_memory.h | 3 +
arch/arm64/kernel/Makefile | 3 +-
arch/arm64/kernel/efi.c | 12 +-
arch/arm64/kernel/rsi.c | 141 ++++++++++++
arch/arm64/kernel/setup.c | 3 +
arch/arm64/mm/init.c | 10 +-
arch/arm64/mm/pageattr.c | 98 +++++++-
drivers/virt/coco/Kconfig | 2 +
drivers/virt/coco/Makefile | 1 +
drivers/virt/coco/arm-cca-guest/Kconfig | 11 +
drivers/virt/coco/arm-cca-guest/Makefile | 2 +
.../virt/coco/arm-cca-guest/arm-cca-guest.c | 211 ++++++++++++++++++
23 files changed, 1010 insertions(+), 8 deletions(-)
create mode 100644 Documentation/arch/arm64/arm-cca.rst
create mode 100644 arch/arm64/include/asm/rsi.h
create mode 100644 arch/arm64/include/asm/rsi_cmds.h
create mode 100644 arch/arm64/include/asm/rsi_smc.h
create mode 100644 arch/arm64/kernel/rsi.c
create mode 100644 drivers/virt/coco/arm-cca-guest/Kconfig
create mode 100644 drivers/virt/coco/arm-cca-guest/Makefile
create mode 100644 drivers/virt/coco/arm-cca-guest/arm-cca-guest.c
--
2.34.1
next reply other threads:[~2024-10-04 14:43 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 14:42 Steven Price [this message]
2024-10-04 14:42 ` [PATCH v6 01/11] arm64: rsi: Add RSI definitions Steven Price
2024-10-07 23:08 ` Gavin Shan
2024-10-11 14:14 ` Steven Price
2024-10-04 14:42 ` [PATCH v6 02/11] arm64: Detect if in a realm and set RIPAS RAM Steven Price
2024-10-04 15:05 ` Steven Price
2024-10-11 13:12 ` Catalin Marinas
2024-10-07 23:31 ` Gavin Shan
2024-10-11 14:14 ` Steven Price
2024-10-04 14:42 ` [PATCH v6 03/11] arm64: realm: Query IPA size from the RMM Steven Price
2024-10-07 23:33 ` Gavin Shan
2024-10-15 3:55 ` Gavin Shan
2024-10-15 9:08 ` Steven Price
2024-10-04 14:42 ` [PATCH v6 04/11] arm64: rsi: Add support for checking whether an MMIO is protected Steven Price
2024-10-08 0:24 ` Gavin Shan
2024-10-11 14:14 ` Steven Price
2024-10-04 14:43 ` [PATCH v6 05/11] arm64: rsi: Map unprotected MMIO as decrypted Steven Price
2024-10-08 0:31 ` Gavin Shan
2024-10-11 13:19 ` Catalin Marinas
2024-10-12 5:22 ` Gavin Shan
2024-10-11 13:20 ` Catalin Marinas
2024-10-04 14:43 ` [PATCH v6 06/11] efi: arm64: Map Device with Prot Shared Steven Price
2024-10-08 0:31 ` Gavin Shan
2024-10-11 13:23 ` Catalin Marinas
2024-10-04 14:43 ` [PATCH v6 07/11] arm64: Enforce bounce buffers for realm DMA Steven Price
2024-10-08 2:51 ` Gavin Shan
2024-10-04 14:43 ` [PATCH v6 08/11] arm64: mm: Avoid TLBI when marking pages as valid Steven Price
2024-10-08 2:52 ` Gavin Shan
2024-10-15 9:50 ` Suzuki K Poulose
2024-10-04 14:43 ` [PATCH v6 09/11] arm64: Enable memory encrypt for Realms Steven Price
2024-10-08 2:56 ` Gavin Shan
2024-10-04 14:43 ` [PATCH v6 10/11] virt: arm-cca-guest: TSM_REPORT support for realms Steven Price
2024-10-05 15:42 ` kernel test robot
2024-10-08 4:12 ` Gavin Shan
2024-10-11 14:14 ` Steven Price
2024-10-11 16:22 ` Suzuki K Poulose
2024-10-12 6:06 ` Gavin Shan
2024-10-14 8:56 ` Suzuki K Poulose
2024-10-14 14:41 ` Steven Price
2024-10-14 14:46 ` Suzuki K Poulose
2024-10-15 0:01 ` Gavin Shan
2024-10-04 14:43 ` [PATCH v6 11/11] arm64: Document Arm Confidential Compute Steven Price
2024-10-08 4:17 ` Gavin Shan
2024-10-08 11:05 ` Jean-Philippe Brucker
2024-10-11 14:14 ` Steven Price
2024-10-15 9:55 ` Suzuki K Poulose
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241004144307.66199-1-steven.price@arm.com \
--to=steven.price@arm.com \
--cc=alexandru.elisei@arm.com \
--cc=alpergun@google.com \
--cc=aneesh.kumar@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=christoffer.dall@arm.com \
--cc=dan.j.williams@intel.com \
--cc=gankulkarni@os.amperecomputing.com \
--cc=gshan@redhat.com \
--cc=james.morse@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=sdonthineni@nvidia.com \
--cc=suzuki.poulose@arm.com \
--cc=tabba@google.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox