Skip to contentSkip to conversation

Minor tweaks to arm64 CoCO guest support

PATCH Applied Will Deacon 3 participants 6 messages Dec 2, 2024 – Dec 3, 2024 arm64

lore
Share & tools
lore

Will Deacon

author maintainer
#0 lore raw

cover Minor tweaks to arm64 CoCO guest support

Hi folks,

Here are a couple of minor tweaks to the CoCO guest support on arm64.

The first enables protected guests under pKVM when pvmfw is not being used (and therefore MMIO guard is not enabled). This is useful for pvmfw development and for testing a VMM outside of the Android Virtualisation Framework APIs.

The second extends the ARM64 MAINTAINERS entry to cover the CCA and pKVM guest support, as neither of them are currently caught by an existing rule.

Patches against v6.13-rc1.

Cheers,

Will

Cc Catalin Marinas <[email protected]>
Cc Keir Fraser <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Steven Price <[email protected]>
Cc Suzuki K Poulose <[email protected]>
Cc Quentin Perret <[email protected]>

---->8

Will Deacon (2):
drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails
MAINTAINERS: Add CCA and pKVM CoCO guest support to the ARM64 entry

 MAINTAINERS                                   | 2 ++
 drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c | 6 +-----
 2 files changed, 3 insertions(+), 5 deletions(-)
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#1 lore raw

PATCH 1/2 drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails

Calling the MMIO_GUARD hypercall from guests which have not been enrolled (e.g. because they are running without pvmfw) results in -EINVAL being returned. In this case, MMIO_GUARD is not active and so we can simply proceed with the normal ioremap() routine.

Don't fail ioremap() if MMIO_GUARD fails; instead WARN_ON_ONCE() to highlight that the pvm environment is slightly wonky.

Fixes 0f1269495800 ("drivers/virt: pkvm: Intercept ioremap using pKVM MMIO_GUARD hypercal")
---
 drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c +1 -5
index 56a3859dda8a..4230b817a80b 100644
@@ -87,12 +87,8 @@ static int mmio_guard_ioremap_hook(phys_addr_t phys, size_t size,
 
 	while (phys < end) {
 		const int func_id = ARM_SMCCC_VENDOR_HYP_KVM_MMIO_GUARD_FUNC_ID;
-		int err;
-
-		err = arm_smccc_do_one_page(func_id, phys);
-		if (err)
-			return err;
 
+		WARN_ON_ONCE(arm_smccc_do_one_page(func_id, phys));
 		phys += PAGE_SIZE;
 	}
 
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#2 lore raw

PATCH 2/2 MAINTAINERS: Add CCA and pKVM CoCO guest support to the ARM64 entry

In reply to Will Deacon

Commits 7999edc484ca ("virt: arm-cca-guest: TSM_REPORT support for realm") and a06c3fad49a5 ("drivers/virt: pkvm: Add initial support for running as a protected guest") added arm64 guest-side support for running in CCA and pKVM confidential computing environments respectively.

Unfortunately, these changes were not accompanied by a MAINTAINERS entry and so aren't automatically picked up by the get_maintainer.pl script. Since the initial support was merged via the arm64 tree, extend the ARM64 entry to cover the two new directories.

Cc Catalin Marinas <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Suzuki K Poulose <[email protected]>
---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
index 1e930c7a58b1..9378c0c4bbc9 100644
@@ -3376,6 +3376,8 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
 F:	Documentation/arch/arm64/
 F:	arch/arm64/
+F:	drivers/virt/coco/arm-cca-guest/
+F:	drivers/virt/coco/pkvm-guest/
 F:	tools/testing/selftests/arm64/
 X:	arch/arm64/boot/dts/
 
Signature · 1 line
2.47.0.338.g60cca15819-goog
Acked-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] MAINTAINERS: Add CCA and pKVM CoCO guest support to the ARM64 entry

Quoted 25 lines · Will Deacon

Commits 7999edc484ca ("virt: arm-cca-guest: TSM_REPORT support for realm") and a06c3fad49a5 ("drivers/virt: pkvm: Add initial support for running as a protected guest") added arm64 guest-side support for running in CCA and pKVM confidential computing environments respectively.

Unfortunately, these changes were not accompanied by a MAINTAINERS entry and so aren't automatically picked up by the get_maintainer.pl script. Since the initial support was merged via the arm64 tree, extend the ARM64 entry to cover the two new directories.

Cc Catalin Marinas <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Suzuki K Poulose <[email protected]>
---
  MAINTAINERS | 2 ++
  1 file changed, 2 insertions(+)
MAINTAINERS +0 -0
index 1e930c7a58b1..9378c0c4bbc9 100644

MAINTAINERS S: Maintained · line 3383

Quoted 8 lines
MAINTAINERS +2 -0
@@ -3376,6 +3376,8 @@ S:	Maintained
  T:	git git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
  F:	Documentation/arch/arm64/
  F:	arch/arm64/
+F:	drivers/virt/coco/arm-cca-guest/
+F:	drivers/virt/coco/pkvm-guest/
  F:	tools/testing/selftests/arm64/
  X:	arch/arm64/boot/dts/
 

FWIW,

maintainer Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] MAINTAINERS: Add CCA and pKVM CoCO guest support to the ARM64 entry

In reply to Will Deacon
Quoted 11 lines · Will Deacon

Commits 7999edc484ca ("virt: arm-cca-guest: TSM_REPORT support for realm") and a06c3fad49a5 ("drivers/virt: pkvm: Add initial support for running as a protected guest") added arm64 guest-side support for running in CCA and pKVM confidential computing environments respectively.

Unfortunately, these changes were not accompanied by a MAINTAINERS entry and so aren't automatically picked up by the get_maintainer.pl script. Since the initial support was merged via the arm64 tree, extend the ARM64 entry to cover the two new directories.

Quoted 5 lines
Cc Catalin Marinas <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Suzuki K Poulose <[email protected]>
maintainer Applied
#5 lore raw
In reply to Will Deacon
Quoted 8 lines · Will Deacon

Here are a couple of minor tweaks to the CoCO guest support on arm64.

The first enables protected guests under pKVM when pvmfw is not being used (and therefore MMIO guard is not enabled). This is useful for pvmfw development and for testing a VMM outside of the Android Virtualisation Framework APIs.

[...]

Applied to arm64 (for-next/fixes), thanks!

[1/2] drivers/virt: pkvm: Don't fail ioremap() call if MMIO_GUARD fails

      https://git.kernel.org/arm64/c/d44679fb954f
[2/2] MAINTAINERS: Add CCA and pKVM CoCO guest support to the ARM64 entry
      https://git.kernel.org/arm64/c/92230596252a
Signature · 1 line
Catalin