From: Nathan Chen <nathanc@nvidia.com>
To: Shameer Kolothum Thodi <skolothumtho@nvidia.com>,
"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "Eric Auger" <eric.auger@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Zhao Liu" <zhao1.liu@intel.com>, "Matt Ochs" <mochs@nvidia.com>,
"Nicolin Chen" <nicolinc@nvidia.com>
Subject: Re: [PATCH v3 2/7] hw/arm/smmuv3-accel: Implement "auto" value for "ats"
Date: Thu, 14 May 2026 13:06:32 -0700 [thread overview]
Message-ID: <cb3f2ace-be0d-4b5a-ad3e-9de541a2444a@nvidia.com> (raw)
In-Reply-To: <CH3PR12MB75488C9306659D939ACEE203AB072@CH3PR12MB7548.namprd12.prod.outlook.com>
On 5/14/2026 7:11 AM, Shameer Kolothum Thodi wrote:
>
>> -----Original Message-----
>> From: Nathan Chen<nathanc@nvidia.com>
>> Sent: 12 May 2026 20:35
>> To:qemu-arm@nongnu.org;qemu-devel@nongnu.org
>> Cc: Eric Auger<eric.auger@redhat.com>; Peter Maydell
>> <peter.maydell@linaro.org>; Philippe Mathieu-Daudé<philmd@linaro.org>;
>> Zhao Liu<zhao1.liu@intel.com>; Matt Ochs<mochs@nvidia.com>; Nicolin
>> Chen<nicolinc@nvidia.com>; Shameer Kolothum Thodi
>> <skolothumtho@nvidia.com>; Nathan Chen<nathanc@nvidia.com>
>> Subject: [PATCH v3 2/7] hw/arm/smmuv3-accel: Implement "auto" value for
>> "ats"
>>
>> From: Nathan Chen<nathanc@nvidia.com>
>>
>> Allow accelerated SMMUv3 Address Translation Services support property
>> to be derived from host IOMMU capabilities. Derive host values using
>> IOMMU_GET_HW_INFO, retrieving ATS capability from IDR0.
>>
>> Reviewed-by: Eric Auger<eric.auger@redhat.com>
>> Signed-off-by: Nathan Chen<nathanc@nvidia.com>
>> ---
>> hw/arm/smmuv3-accel.c | 9 +++++++++
>> hw/arm/smmuv3.c | 11 ++++-------
>> 2 files changed, 13 insertions(+), 7 deletions(-)
>>
>> diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
>> index 82c0800f4d..9fbd13c438 100644
>> --- a/hw/arm/smmuv3-accel.c
>> +++ b/hw/arm/smmuv3-accel.c
>> @@ -52,6 +52,11 @@ static void
>> smmuv3_accel_auto_finalise(SMMUv3State *s,
>> return;
>> }
>>
>> + if (s->ats == ON_OFF_AUTO_AUTO) {
>> + s->idr[0] = FIELD_DP32(s->idr[0], IDR0, ATS,
>> + FIELD_EX32(info->idr[0], IDR0, ATS));
>> + }
>> +
>> accel->auto_finalised = true;
>> }
>>
>> @@ -964,6 +969,10 @@ bool smmuv3_accel_init(SMMUv3State *s, Error
>> **errp)
>> bs->iommu_ops = &smmuv3_accel_ops;
>> smmuv3_accel_as_init(s);
>>
>> + if (s->ats == ON_OFF_AUTO_AUTO) {
>> + s->s_accel->auto_mode = true;
>> + }
>> +
>> if (s->s_accel->auto_mode) {
>> s->machine_done.notify = smmuv3_machine_done;
>> qemu_add_machine_init_done_notifier(&s->machine_done);
>> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
>> index 5c2855c377..e558f09652 100644
>> --- a/hw/arm/smmuv3.c
>> +++ b/hw/arm/smmuv3.c
>> @@ -1965,10 +1965,6 @@ static void smmu_reset_exit(Object *obj,
>> ResetType type)
>>
>> static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>> {
>> - if (s->ats == ON_OFF_AUTO_AUTO) {
>> - error_setg(errp, "ats auto mode is not supported");
>> - return false;
>> - }
>> if (s->ril == ON_OFF_AUTO_AUTO) {
>> error_setg(errp, "ril auto mode is not supported");
>> return false;
>> @@ -2170,9 +2166,10 @@ static void smmuv3_class_init(ObjectClass *klass,
>> const void *data)
>> "Disable range invalidation support (for accel=on). ril=auto "
>> "is not supported.");
>> object_class_property_set_description(klass, "ats",
>> - "Enable/disable ATS support (for accel=on). Please ensure host "
>> - "platform has ATS support before enabling this. ats=auto is not "
>> - "supported.");
>> + "Enable/disable ATS support (for accel=on). "
>> + "Valid values are on, off, and auto. Defaults to off. "
>> + "Please ensure host platform supports ATS before setting it "
>> + "to on.");
>> 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 "
> In smmuv3.c we have;
>
> case SMMU_CMD_ATC_INV:
> {
> SMMUDevice *sdev = smmu_find_sdev(bs, CMD_SID(&cmd));
>
> if (!sdev || !s->ats) {
> trace_smmuv3_unhandled_cmd(type);
> break;
> }
>
> if (!smmuv3_accel_issue_inv_cmd(s, &cmd, sdev, errp)) {
> cmd_error = SMMU_CERROR_ILL;
> break;
> }
> break;
> }
>
> The above !s->ats will be true for AUTO case, right? I think
> we should change the above check with smmuv3_ats_enabled().
>
> Also, since we modified the ats to OnOffAuto in the previous
> series, I am not sure the above should be a fix patch or not.
I see, I will use smmuv3_ats_enabled() here to account for the AUTO
case. I am not sure if it should have the Fixes tag either but let's see
if we can get any guidance on that point.
Thanks,
Nathan
next prev parent reply other threads:[~2026-05-14 20:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 19:35 [PATCH v3 0/7] hw/arm/smmuv3-accel: Resolve AUTO properties Nathan Chen
2026-05-12 19:35 ` [PATCH v3 1/7] hw/arm/smmuv3-accel: Add helper for resolving auto parameters Nathan Chen
2026-05-14 13:41 ` Shameer Kolothum Thodi
2026-05-14 17:58 ` Nathan Chen
2026-05-12 19:35 ` [PATCH v3 2/7] hw/arm/smmuv3-accel: Implement "auto" value for "ats" Nathan Chen
2026-05-14 14:11 ` Shameer Kolothum Thodi
2026-05-14 20:06 ` Nathan Chen [this message]
2026-05-15 7:55 ` Shameer Kolothum Thodi
2026-05-12 19:35 ` [PATCH v3 3/7] hw/arm/smmuv3-accel: Implement "auto" value for "ril" Nathan Chen
2026-05-14 14:15 ` Shameer Kolothum Thodi
2026-05-12 19:35 ` [PATCH v3 4/7] hw/arm/smmuv3-accel: Implement "auto" value for "ssidsize" Nathan Chen
2026-05-14 14:24 ` Shameer Kolothum Thodi
2026-05-14 20:14 ` Nathan Chen
2026-05-12 19:35 ` [PATCH v3 5/7] hw/arm/smmuv3-accel: Implement "auto" value for "oas" Nathan Chen
2026-05-14 15:11 ` Shameer Kolothum Thodi
2026-05-12 19:35 ` [PATCH v3 6/7] hw/arm/smmuv3: Set default ats, ril, ssidsize, oas to auto Nathan Chen
2026-05-14 15:45 ` Shameer Kolothum Thodi
2026-05-12 19:35 ` [PATCH v3 7/7] qemu-options.hx: Support "auto" for accel SMMUv3 properties Nathan Chen
2026-05-14 16:19 ` Shameer Kolothum Thodi
2026-05-14 17:53 ` Nathan Chen
2026-05-14 16:37 ` [PATCH v3 0/7] hw/arm/smmuv3-accel: Resolve AUTO properties Shameer Kolothum Thodi
2026-05-14 17:51 ` Nathan Chen
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=cb3f2ace-be0d-4b5a-ad3e-9de541a2444a@nvidia.com \
--to=nathanc@nvidia.com \
--cc=eric.auger@redhat.com \
--cc=mochs@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=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.