Giacomo Travaglini has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/64072?usp=email )
Change subject: arch-arm: Add ArmRelease factory function to be used in KVM
mode
......................................................................
arch-arm: Add ArmRelease factory function to be used in KVM mode
From gem5 v22.0, EL2 and EL3 are automatically implemented
in the default release object [1]. This means any FS simulation
will start at EL3, which is the highest implemented EL.
Unfortunately this doesn't work in KVM mode, which is assuming
a VM does not start at EL3:
As soon as updateKvmState is called [2] gem5 tries to set
the VM PSTATE to EL3 and KVM fails the ioctl PSTATE write
[1]: https://gem5-review.googlesource.com/c/public/gem5/+/51011
[2]: https://github.com/gem5/gem5/blob/v22.0.0.2/\
src/arch/arm/kvm/armv8_cpu.cc#L237
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
Change-Id: Icf951bcfb47e0c2ff9abe64b1b9006934303ad48
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64072
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/arm/ArmSystem.py
1 file changed, 39 insertions(+), 0 deletions(-)
Approvals:
Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/arch/arm/ArmSystem.py b/src/arch/arm/ArmSystem.py
index 3994aee..936c032 100644
--- a/src/arch/arm/ArmSystem.py
+++ b/src/arch/arm/ArmSystem.py
@@ -41,6 +41,8 @@
from m5.objects.System import System
from m5.objects.ArmSemihosting import ArmSemihosting
+from typing import Any
+
class SveVectorLength(UInt8):
min = 1
@@ -108,6 +110,17 @@
else:
return True
+ @classmethod
+ def for_kvm(cls) -> Any:
+ """
+ Generates an ArmRelease for KVM. It simply extracts EL2/EL3 support
+ from the current cls object
+ """
+ release = cls()
+ release.remove(ArmExtension("SECURITY"))
+ release.remove(ArmExtension("VIRTUALIZATION"))
+ return release
+
class Armv8(ArmRelease):
extensions = ["LPAE", "VIRTUALIZATION", "SECURITY"]
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/64072?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Icf951bcfb47e0c2ff9abe64b1b9006934303ad48
Gerrit-Change-Number: 64072
Gerrit-PatchSet: 4
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Richard Cooper <richard.coo...@arm.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org