qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: FelixCuioc <FelixCui-oc@zhaoxin.com>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>
Cc: TonyWWang-oc@zhaoxin.com,
	Alex Williamson <alex.williamson@redhat.com>,
	RockCui-oc@zhaoxin.com, qemu-devel@nongnu.org,
	CobeChen-oc@zhaoxin.com
Subject: Re: [PATCH 1/1] Skip flatview_simplify() for cpu vendor zhaoxin
Date: Fri, 16 Oct 2020 13:42:29 +0200	[thread overview]
Message-ID: <a971c9db-469f-ddc0-1a27-3e21958f6ff7@redhat.com> (raw)
In-Reply-To: <20201016112933.14856-2-FelixCui-oc@zhaoxin.com>

On 16/10/20 13:29, FelixCuioc wrote:
> The issue here is that an assinged EHCI device accesses
> an adjacent mapping between the delete and add phases
> of the VFIO MemoryListener.
> We want to skip flatview_simplify() is to prevent EHCI
> device IOVA mappings from being unmapped.

Hi,

there is indeed a bug, but I have already explained last month
(https://mail.gnu.org/archive/html/qemu-devel/2020-09/msg01279.html)
that this patch is conceptually wrong:

1) you're adding host_get_vendor conditioned on compiling the x86
emulator, so you are breaking compilation on non-x86 machines.

2) you're adding a check for the host, but the bug applies to all hosts.
 If there is a bug on x86 hardware emulation, it should be fixed even
when emulating x86 from ARM.  It should also apply to all CPU vendors.

Alex, the issue here is that the delete+add passes are racing against an
assigned device's DMA. For KVM we were thinking of changing the whole
memory map with a single ioctl, but that's much easier because KVM
builds its page tables lazily. It would be possible for the IOMMU too
but it would require a relatively complicated comparison of the old and
new memory maps in the kernel.

Paolo



  reply	other threads:[~2020-10-16 11:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 11:29 [PATCH 0/1] Skip flatview_simplify() for cpu vendor zhaoxin FelixCuioc
2020-10-16 11:29 ` [PATCH 1/1] " FelixCuioc
2020-10-16 11:42   ` Paolo Bonzini [this message]
2020-10-19  6:55     ` 答复: " FelixCui-oc
2020-10-19 19:02     ` Alex Williamson
2020-10-20  9:24       ` Paolo Bonzini
2020-10-20 22:44         ` Alex Williamson
2020-10-21  7:37           ` Paolo Bonzini
2020-10-21 13:16             ` 答复: " FelixCui-oc
2020-10-21 18:49             ` Alex Williamson
2020-10-21 19:50               ` Paolo Bonzini
2020-10-22  3:02                 ` 答复: " FelixCui-oc
2020-10-22  3:30                   ` Paolo Bonzini
2020-10-22  6:31                     ` 答复: " FelixCui-oc
2020-10-27  3:18                       ` FelixCui-oc

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=a971c9db-469f-ddc0-1a27-3e21958f6ff7@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=CobeChen-oc@zhaoxin.com \
    --cc=FelixCui-oc@zhaoxin.com \
    --cc=RockCui-oc@zhaoxin.com \
    --cc=TonyWWang-oc@zhaoxin.com \
    --cc=alex.williamson@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).