From: Alex Williamson <alex.williamson@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: FelixCuioc <FelixCui-oc@zhaoxin.com>,
Eduardo Habkost <ehabkost@redhat.com>,
CobeChen-oc@zhaoxin.com, qemu-devel@nongnu.org,
TonyWWang-oc@zhaoxin.com, RockCui-oc@zhaoxin.com,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 1/1] Skip flatview_simplify() for cpu vendor zhaoxin
Date: Wed, 21 Oct 2020 12:49:08 -0600 [thread overview]
Message-ID: <20201021124908.53c7a98b@w520.home> (raw)
In-Reply-To: <783b5ef0-277c-363d-f342-7c0351f9ac16@redhat.com>
On Wed, 21 Oct 2020 09:37:53 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 21/10/20 00:44, Alex Williamson wrote:
> > Do we necessarily need a memory map ioctl for this or could it be the
> > QEMU code that compares the old and new maps to trigger map and unmap
> > ioctls? For example (aiui) our race is that if we have contiguous
> > memory regions A and B and flatview_simplify() tries to expand A and
> > delete B we'll see a series of listener notifications deleting A and B
> > and adding A'. But the vfio QEMU code could parse the memory map to
> > determine that old A + B is functionally equivalent to A' and do
> > nothing.
>
> I think the issue is a bit different, and in fact there are two sides of
> the same issue. Say you have A (large) and it is replaced by A'
> (smaller) + B, then:
>
> * the first part of A disappears for a moment before A' appears. This
> is something that QEMU can work around, by not doing anything
>
> * the second part of A disappears for a moment before B appears. This
> is the root API issue and not something that QEMU can work around; and
> in fact it is not even fixed by removing flatview_simplify.
Right, our current uAPI does not support a mechanism to atomically
change a mapping, but likewise we're probably not going to have devices
performing DMA to regions that are being remapped. We know that
removing flatview_simplify() resolves this issue and FelixCui's update
suggests we do have a case where the permission changes of an adjacent
range is triggering a range consolidation, which we see as the range
being removed and added as something else, larger or smaller.
I can understand the general benefit of flatview_simplify(), but I
wonder if the best short term solution is to skip operating on the x86
PAM range, which I understand to be a small number of memory chunks
below 1MB. I might also wonder why the EHCI controller on this
platform is choosing that range for DMA. Thanks,
Alex
next prev parent reply other threads:[~2020-10-21 18:49 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
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 [this message]
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=20201021124908.53c7a98b@w520.home \
--to=alex.williamson@redhat.com \
--cc=CobeChen-oc@zhaoxin.com \
--cc=FelixCui-oc@zhaoxin.com \
--cc=RockCui-oc@zhaoxin.com \
--cc=TonyWWang-oc@zhaoxin.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@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).