All of lore.kernel.org
 help / color / mirror / Atom feed
From: "leohou@tom.com" <leohou@tom.com>
To: virtualization <virtualization@lists.linux-foundation.org>,
	 iommu <iommu@lists.linux.dev>,  qemu-arm <qemu-arm@nongnu.org>,
	 jasowang <jasowang@redhat.com>
Cc: leohou1402 <leohou1402@gmail.com>
Subject: vIOMMU&IOMMU  gIOVA  to  HPA mapping
Date: Mon, 14 Nov 2022 20:31:49 +0800	[thread overview]
Message-ID: <2022111420314945171759@tom.com> (raw)

Hi,
     Here is my application scenario:
1. The NIC (Network Information Center) passes through to the VM(Virtual Machine);
2. The VM uses the user mode driver DPDK;

Question:
1. vIOMMU maintains the mapping gIOVA->gPA, When do you use this gPA ?
2. Physical IOMMU maintains the GIOVA->HPA mapping ?  If so, by what means (gIOVA -> HPA) mapping ?
3. What does QEMU do in NIC pass-through address translation ?


---------------------------------------------------------------------------------------------------------------------
           _____________________________________________________________________________                             
          |             ___________________________________________________________     |                            
          |            |    _____________________________________________________  |    |                            
          |            |    |                                                    | |    |                            
          |            |    |             __________________________________     | |    |                            
          |            |    |            |    ______                        |    | |    |        ______              
          |            |    |   User     |   | Mem  |-----------------------|----|-|----|-----> |      |             
          |            |    |            |   |______|        DPDK           |    | |    | (gVA) |______|             
          |            |    |            |    (gVA)                         |    | |    |        |    |              
          |            |    |            |______|___________________________|    | |    |        |    |              
          |            |    |--GuestOS----------|--------------------------------| |    |        |    |              
          |            |    |             ______\/__________________________     | |    |        |    |              
          |            | VM |            |                VFIO              |    | |    |        |    |              
          |   User     |    |   Kernel   |___________     __________________|    | |    |        |    |              
          |            |    |            | vfio-pci  |   |                  |    | |    |        |    |              
          |            |    |            |  (gIOVA)  |   | vfio_iommu_type2 |    | |    |        |    |              
Software  |            |    |            |______|____|___|__________________|    | |    |        |    |              
          |            |    |___________________|________________________________| |    |        |    |              
          |            |     ____________________________________________________  |    |        |    |              
          |            |    |             ______|____     __________________     | |    |        \/   \/             
          |            |    |            |      \/   |   |                  |    | |    |        ______              
          |            |    |            |    NIC    |   |      vIOMMU      |    | |    |       |      |             
          |            |    |   QEMU     |  Instance |   |                --|----|-|----|-----> |______|             
          |            |    |            |  (gIOVA)  |   |   (GIOVA-->GPA)  |    | |    | (gPA)  |    |              
          |            |    |            |_____|_____|   |__________________|    | |    |        |    |              
          |            |    |__________________|_________________________________| |    |        |    |              
          |            |_______________________|___________________________________|    |        |    |              
          |---HostOS---------------------------|----------------------------------------|        |    |              
          |             ___________________________________________________________     |        |    |              
          |            |                       |                                   |    |        |    |              
          |            |                       |    VFIO                           |    |        |    |              
          |   Kernel   |_______________________|_____     _________________________|    |        |    |              
          |            |                       \/    |   |                         |    |        |    |              
          |            |        vfio-pci             |   |    vfio_iommu_type1     |    |        |    |              
          |            |                       |     |   |                         |    |        |    |              
          |            |_______________________|_____|___|_________________________|    |        |    |              
          |____________________________________|________________________________________|        |    |              
-----------------------------------------------|-------------------------------------------------|----|--------------
           ____________________________________\/____     _________________________           ___\/___\/___________  
          |            |                             |   |                         |         |  |      |           | 
Hardware  |    NIC     |          DMA     (gIOVA)  --|---|->        IOMMU        --|---------|->|______|           | 
          |            |_____________________________|   |      (gIOVA-->HPA)      |   (HPA) |   Physical Memory   | 
          |__________________________________________|   |_________________________|         |_____________________| 
---------------------------------------------------------------------------------------------------------------------








leohou@tom.com



             reply	other threads:[~2022-11-14 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 12:31 leohou [this message]
2022-11-14 16:18 ` vIOMMU&IOMMU gIOVA to HPA mapping Alex Williamson
2022-11-14 16:18   ` Alex Williamson

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=2022111420314945171759@tom.com \
    --to=leohou@tom.com \
    --cc=iommu@lists.linux.dev \
    --cc=jasowang@redhat.com \
    --cc=leohou1402@gmail.com \
    --cc=qemu-arm@nongnu.org \
    --cc=virtualization@lists.linux-foundation.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.