All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: Nathan Chen <nathanc@nvidia.com>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Shameer Kolothum" <skolothumtho@nvidia.com>,
	"Matt Ochs" <mochs@nvidia.com>,
	"Nicolin Chen" <nicolinc@nvidia.com>
Subject: Re: [PATCH v2 5/7] hw/arm/smmuv3-accel: Implement "auto" value for "oas"
Date: Fri, 8 May 2026 13:48:29 +0200	[thread overview]
Message-ID: <36d3785c-6968-478d-9b2d-133a247cc0a4@redhat.com> (raw)
In-Reply-To: <20260422204335.23116-6-nathanc@nvidia.com>



On 4/22/26 10:43 PM, Nathan Chen wrote:
> Allow accelerated SMMUv3 OAS property to be derived from host IOMMU
> capabilities. Derive host values using IOMMU_GET_HW_INFO, retrieving
> OAS from IDR5.
>
> This keeps the OAS value advertised by the virtual SMMU compatible with
> the capabilities of the host SMMUv3, so that the intermediate physical
> addresses (IPA) consumed by host SMMU for stage-2 translation do not
> exceed the host's max supported IPA size.
>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>
> ---
>  hw/arm/smmuv3-accel.c |  8 +++++++-
>  hw/arm/smmuv3.c       | 15 ++++++++-------
>  2 files changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
> index d13d15a11d..f45e268bde 100644
> --- a/hw/arm/smmuv3-accel.c
> +++ b/hw/arm/smmuv3-accel.c
> @@ -68,6 +68,11 @@ static void smmuv3_accel_auto_finalise(SMMUv3State *s,
>                                 FIELD_EX32(info->idr[1], IDR1, SSIDSIZE));
>      }
>  
> +    if (s->oas == OAS_MODE_AUTO) {
> +        s->idr[5] = FIELD_DP32(s->idr[5], IDR5, OAS,
> +                               FIELD_EX32(info->idr[5], IDR5, OAS));
> +    }
> +
>      accel->auto_finalised = true;
>  }
>  
> @@ -988,7 +993,8 @@ void smmuv3_accel_init(SMMUv3State *s)
>  
>      if (s->ats == ON_OFF_AUTO_AUTO ||
>          s->ril == ON_OFF_AUTO_AUTO ||
> -        s->ssidsize == SSID_SIZE_MODE_AUTO) {
> +        s->ssidsize == SSID_SIZE_MODE_AUTO ||
> +        s->oas == OAS_MODE_AUTO) {
>          s->s_accel->auto_mode = true;
>      }
>  
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index 07025245e2..39a6f72938 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -1975,9 +1975,11 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>      }
>  #endif
>  
> -    if (s->oas != OAS_MODE_44 && s->oas != OAS_MODE_48) {
> -        error_setg(errp, "QEMU SMMUv3 model only implements 44 and 48 bit"
> -                   "OAS; other OasMode values are not supported");
> +    if (s->oas != OAS_MODE_44 && s->oas != OAS_MODE_48 &&
> +        s->oas != OAS_MODE_AUTO) {
> +        error_setg(errp, "QEMU SMMUv3 model only implements auto, "
> +                   "44 bit, or 48 bit OAS. Other OasMode values are "
> +                   "not supported.");
>          return false;
>      }
>  
> @@ -1991,7 +1993,7 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>              return false;
>          }
>          if (s->oas > OAS_MODE_44) {
> -            error_setg(errp, "OAS must be 44 bits when accel=off");
> +            error_setg(errp, "oas must be 44 bits when accel=off");
>              return false;
>          }
>          if (s->ssidsize > SSID_SIZE_MODE_0) {
> @@ -2173,9 +2175,8 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
>          "Valid values are on, off, and auto. Defaults to off. "
>          "Please ensure host platform supports ATS before enabling.");
>      object_class_property_set_description(klass, "oas",
> -        "Specify Output Address Size (for accel=on). Supported values "
> -        "are 44 or 48 bits. Defaults to 44 bits. oas=auto is not "
> -        "supported.");
> +        "Set Output Address Size in bits (for accel=on). "
> +        "Valid values are 44, 48, and auto. Defaults to 44 bits.");


same auto mode is not explained. It must be explainer either here of in
qemu-options.hx

when set to 'auto' the oas value is derived from host smmu value.

Besides
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric


>      object_class_property_set_description(klass, "ssidsize",
>          "Set number of bits used to represent SubstreamIDs (SSIDs). "
>          "Valid values are 0-20 and auto. Defaults to 0. "



  reply	other threads:[~2026-05-08 11:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 20:43 [PATCH v2 0/7] hw/arm/smmuv3-accel: Resolve AUTO properties Nathan Chen
2026-04-22 20:43 ` [PATCH v2 1/7] hw/arm/smmuv3-accel: Add helper for resolving auto parameters Nathan Chen
2026-05-07 17:46   ` Eric Auger
2026-04-22 20:43 ` [PATCH v2 2/7] hw/arm/smmuv3-accel: Implement "auto" value for "ats" Nathan Chen
2026-05-08 11:34   ` Eric Auger
2026-04-22 20:43 ` [PATCH v2 3/7] hw/arm/smmuv3-accel: Implement "auto" value for "ril" Nathan Chen
2026-05-08 11:37   ` Eric Auger
2026-04-22 20:43 ` [PATCH v2 4/7] hw/arm/smmuv3-accel: Implement "auto" value for "ssidsize" Nathan Chen
2026-05-08 11:43   ` Eric Auger
2026-04-22 20:43 ` [PATCH v2 5/7] hw/arm/smmuv3-accel: Implement "auto" value for "oas" Nathan Chen
2026-05-08 11:48   ` Eric Auger [this message]
2026-04-22 20:43 ` [PATCH v2 6/7] hw/arm/smmuv3: Set default ats, ril, ssidsize, oas to auto Nathan Chen
2026-05-08 11:55   ` Eric Auger
2026-04-22 20:43 ` [PATCH v2 7/7] qemu-options.hx: Support "auto" for accel SMMUv3 properties Nathan Chen
2026-05-08 12:08   ` Eric Auger
2026-05-12  0:43     ` Nathan Chen
2026-05-12  0:44     ` Nathan Chen
2026-05-04 14:58 ` [PATCH v2 0/7] hw/arm/smmuv3-accel: Resolve AUTO properties Cédric Le Goater
2026-05-05  7:59   ` Shameer Kolothum Thodi
2026-05-05  8:27     ` Cédric Le Goater

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=36d3785c-6968-478d-9b2d-133a247cc0a4@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mochs@nvidia.com \
    --cc=nathanc@nvidia.com \
    --cc=nicolinc@nvidia.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=skolothumtho@nvidia.com \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.