Introduce a "cmdqv" property to enable Tegra241 CMDQV support. This is only enabled for accelerated SMMUv3 devices.
Reviewed-by: Nicolin Chen <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Shameer Kolothum <[email protected]> --- hw/arm/smmuv3.c | 8 ++++++++ qemu-options.hx | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 0d111d638b..23592354ee 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -1994,6 +1994,10 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp) "bits if accel=on"); return false; } + if (s->cmdqv == ON_OFF_AUTO_ON) { + error_setg(errp, "cmdqv can only be enabled if accel=on"); + return false; + } return true; } @@ -2144,6 +2148,7 @@ static const Property smmuv3_properties[] = { DEFINE_PROP_OAS_MODE("oas", SMMUv3State, oas, OAS_MODE_AUTO), DEFINE_PROP_SSIDSIZE_MODE("ssidsize", SMMUv3State, ssidsize, SSID_SIZE_MODE_AUTO), + DEFINE_PROP_ON_OFF_AUTO("cmdqv", SMMUv3State, cmdqv, ON_OFF_AUTO_AUTO), }; static void smmuv3_instance_init(Object *obj) @@ -2194,6 +2199,9 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data) "than 0 is required to enable PASID support." "Please ensure the value does not exceed the maximum " "SubtreamID size supported by the host platform."); + object_class_property_set_description(klass, "cmdqv", + "Enable/disable CMDQV support (for accel=on). " + "Valid values are on, off, and auto. Defaults to auto."); } static int smmuv3_notify_flag_changed(IOMMUMemoryRegion *iommu, diff --git a/qemu-options.hx b/qemu-options.hx index d7e48688b5..2eee466be7 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1329,6 +1329,14 @@ SRST - With accel=off, auto is resolved to 0. + ``cmdqv=on|off|auto`` (default: auto) + Enable hardware Command Queue Virtualization (CMDQV) for the + SMMUv3 command queue. Currently only the NVIDIA Tegra241 CMDQV + implementation is supported. + + - With accel=on, auto means the value is automatically derived from the host SMMU. + - With accel=off, auto is resolved to 'off'. + ``-device amd-iommu[,option=...]`` Enables emulation of an AMD-Vi I/O Memory Management Unit (IOMMU). Only available with ``-machine q35``, it supports the following options: -- 2.43.0
