From: Paul Durrant <xadimgnik@gmail.com>
To: "'Jan Beulich'" <jbeulich@suse.com>
Cc: 'Igor Druzhinin' <igor.druzhinin@citrix.com>,
wl@xen.org, andrew.cooper3@citrix.com, george.dunlap@citrix.com,
xen-devel@lists.xenproject.org, roger.pau@citrix.com
Subject: RE: [PATCH for-4.14 v3] x86/svm: do not try to handle recalc NPT faults immediately
Date: Thu, 4 Jun 2020 11:50:40 +0100 [thread overview]
Message-ID: <000f01d63a5d$fe3787f0$faa697d0$@xen.org> (raw)
In-Reply-To: <4d1da8eb-a06e-c97a-09a0-e84070dc5ec8@suse.com>
> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: 04 June 2020 11:34
> To: paul@xen.org
> Cc: 'Igor Druzhinin' <igor.druzhinin@citrix.com>; xen-devel@lists.xenproject.org;
> andrew.cooper3@citrix.com; wl@xen.org; roger.pau@citrix.com; george.dunlap@citrix.com
> Subject: Re: [PATCH for-4.14 v3] x86/svm: do not try to handle recalc NPT faults immediately
>
> On 04.06.2020 09:49, Paul Durrant wrote:
> >> -----Original Message-----
> >> From: Igor Druzhinin <igor.druzhinin@citrix.com>
> >> Sent: 03 June 2020 23:42
> >> To: xen-devel@lists.xenproject.org
> >> Cc: jbeulich@suse.com; andrew.cooper3@citrix.com; wl@xen.org; roger.pau@citrix.com;
> >> george.dunlap@citrix.com; paul@xen.org; Igor Druzhinin <igor.druzhinin@citrix.com>
> >> Subject: [PATCH for-4.14 v3] x86/svm: do not try to handle recalc NPT faults immediately
> >>
> >> A recalculation NPT fault doesn't always require additional handling
> >> in hvm_hap_nested_page_fault(), moreover in general case if there is no
> >> explicit handling done there - the fault is wrongly considered fatal.
> >>
> >> This covers a specific case of migration with vGPU assigned which
> >> uses direct MMIO mappings made by XEN_DOMCTL_memory_mapping hypercall:
> >> at a moment log-dirty is enabled globally, recalculation is requested
> >> for the whole guest memory including those mapped MMIO regions
> >
> > I still think it is odd to put this in the commit comment since, as I
> > said before, Xen ensures that this situation cannot happen at
> > the moment.
>
> Aiui Igor had replaced reference to passed-through devices by reference
> to mere handing of an MMIO range to a guest. Are you saying we suppress
> log-dirty enabling in this case as well? I didn't think we do:
No, but the comment says "migration with vGPU *assigned*" (my emphasis), which surely means has_arch_pdevs() will be true.
>
> if ( has_arch_pdevs(d) && log_global )
> {
> /*
> * Refuse to turn on global log-dirty mode
> * if the domain is sharing the P2M with the IOMMU.
> */
> return -EINVAL;
> }
>
> Seeing this code I wonder about the non-sharing case: If what the
> comment says was true, the condition would need to change, but I
> think it's the comment which is wrong, and we don't want global
> log-dirty as long as an IOMMU is in use at all for a domain.
I think is the comment that is correct, not the condition. It is only when using shared EPT that enabling logdirty is clearly an unsafe thing to do. Using sync-ed IOMMU mappings should be ok.
Paul
next prev parent reply other threads:[~2020-06-04 10:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 22:41 [PATCH for-4.14 v3] x86/svm: do not try to handle recalc NPT faults immediately Igor Druzhinin
2020-06-04 7:49 ` Paul Durrant
2020-06-04 10:33 ` Jan Beulich
2020-06-04 10:50 ` Paul Durrant [this message]
2020-06-04 10:59 ` Igor Druzhinin
2020-06-04 11:47 ` Jan Beulich
2020-06-04 11:58 ` Paul Durrant
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='000f01d63a5d$fe3787f0$faa697d0$@xen.org' \
--to=xadimgnik@gmail.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=igor.druzhinin@citrix.com \
--cc=jbeulich@suse.com \
--cc=paul@xen.org \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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.