qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Roman Kapl <rka@sysgo.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH 1/1] amd_iommu: fix device entry invalidation
Date: Tue, 1 Jun 2021 16:27:02 +0200	[thread overview]
Message-ID: <d67b11e7-0e3a-f358-f0ea-99367ef26dbc@redhat.com> (raw)
In-Reply-To: <20210601141039.16104-1-rka@sysgo.com>

On 6/1/21 4:10 PM, Roman Kapl wrote:
> Since QEMU maintains TLB entries keyed by the device ID, there is no separate
> device entry cache. This means we need to invalidate all translations keyed by
> the device ID.
> 

Fixes: d29a09ca684 ("hw/i386: Introduce AMD IOMMU") ?

> Signed-off-by: Roman Kapl <rka@sysgo.com>
> ---
>  hw/i386/amd_iommu.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index 2801dff97c..62d22b220b 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -356,6 +356,7 @@ static void amdvi_update_iotlb(AMDVIState *s, uint16_t devid,
>          }
>  
>          entry->domid = domid;
> +        entry->devid = devid;
>          entry->perms = to_cache.perm;
>          entry->translated_addr = to_cache.translated_addr;
>          entry->page_mask = to_cache.addr_mask;
> @@ -399,6 +400,8 @@ static void amdvi_inval_devtab_entry(AMDVIState *s, uint64_t *cmd)
>          amdvi_log_illegalcom_error(s, extract64(cmd[0], 60, 4),
>                                     s->cmdbuf + s->cmdbuf_head);
>      }
> +    g_hash_table_foreach_remove(s->iotlb, amdvi_iotlb_remove_by_devid,
> +                                &devid);
>      trace_amdvi_devtab_inval(PCI_BUS_NUM(devid), PCI_SLOT(devid),
>                               PCI_FUNC(devid));
>  }
> 



      reply	other threads:[~2021-06-01 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 14:10 [PATCH 1/1] amd_iommu: fix device entry invalidation Roman Kapl
2021-06-01 14:27 ` Philippe Mathieu-Daudé [this message]

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=d67b11e7-0e3a-f358-f0ea-99367ef26dbc@redhat.com \
    --to=philmd@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rka@sysgo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).