All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: shashi.mallela@linaro.org, Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: SMMU Stage 2 translation in QEMU
Date: Mon, 13 Sep 2021 10:19:43 +0200	[thread overview]
Message-ID: <f788c9de-17be-025a-a723-c7ba86548970@redhat.com> (raw)
In-Reply-To: <e8ccd74e89ba9d30d8588f0aa6966dc71d0ae923.camel@linaro.org>

Hi Shashi,

On 9/10/21 3:32 PM, shashi.mallela@linaro.org wrote:
> So that would be the driver code running in guest OS because i see
> tables being setup by arm-smmu driver code in linux,which is similar to
> what happens with ITS(table base addresses programmed in registers by
> linux driver).
Stage2 SMMU tables are generally not used today. Only stage 1 is used,
even with VFIO (with KVM).
SMMUv3 upstream driver does not support S1+S2 (nested). It only supports
either S1 or S2. Enabling S2 can be done through VFIO driver, if you
select the VFIO_TYPE1_NESTING_IOMMU IOMMU type. This then calls IOMMU
.enable_nesting  = arm_smmu_enable_nesting which sets smmu_domain->stage
= ARM_SMMU_DOMAIN_NESTED. But the name is misleading as it actually
forces the use of S2 instead of S1.

However if you look at QEMU VFIO code, no one uses VFIO_TYPE1_NESTING_IOMMU.

Note I have worked on 2 stage integration for years, without much
success yet:
[RFC v9 00/29] vSMMUv3/pSMMUv3 2 stage VFIO integration

[PATCH v15 00/12] SMMUv3 Nested Stage Setup (IOMMU part)
[PATCH v13 00/13] SMMUv3 Nested Stage Setup (VFIO part)


Thanks

Eric
>
> On Fri, 2021-09-10 at 13:54 +0100, Peter Maydell wrote:
>> On Fri, 10 Sept 2021 at 13:39, <shashi.mallela@linaro.org> wrote:
>>> I am referring to the latter,"purely emulated QEMU with an emulated
>>> SMMU that handles accesses to emulated devices"
>> In that case, the stage 2 tables are set up by the guest
>> code (running at emulated EL2), just as they would be if
>> it were running on real hardware.
>>
>> -- PMM



  reply	other threads:[~2021-09-13  8:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 20:17 SMMU Stage 2 translation in QEMU shashi.mallela
2021-09-10  9:25 ` Peter Maydell
2021-09-10 12:39   ` shashi.mallela
2021-09-10 12:54     ` Peter Maydell
2021-09-10 13:32       ` shashi.mallela
2021-09-13  8:19         ` Eric Auger [this message]
2021-09-14 15:57           ` shashi.mallela
2021-09-15 10:23             ` Eric Auger

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=f788c9de-17be-025a-a723-c7ba86548970@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shashi.mallela@linaro.org \
    /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.