xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	chegger@amazon.de, Tim Deegan <tim@xen.org>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH 1/1] x86/AMD: Fix nested svm crash due to assertion in __virt_to_maddr
Date: Fri, 5 Jul 2013 16:38:04 -0500	[thread overview]
Message-ID: <51D73CBC.7000305@amd.com> (raw)
In-Reply-To: <51D697A102000078000E2E55@nat28.tlf.novell.com>

On 7/5/2013 2:53 AM, Jan Beulich wrote:
>>>> On 04.07.13 at 23:48, Tim Deegan <tim@xen.org> wrote:
>> At 20:42 +0100 on 04 Jul (1372970576), Andrew Cooper wrote:
>>> On 04/07/13 20:36, suravee.suthikulpanit@amd.com wrote:
>>>> +static inline void nestedsvm_vmload(uint64_t vmcb)
>>> unsigned long if this is actually an address.
>> IIUC this is a physical address, so paddr_t is the correct type.  Also,
>> it might be nicer to call these svm_vm{save,load}_by_paddr() or similar
>> to make it clear what they do.
> So would I think. And the existing functions then could simply
> wrap the new ones.
>
> However, looking at the call sites of svm_vmexit_do_vm(), I don't
> think this is a host physical address in all cases: At least the uses
> from svm_vmexit_do_vm*() in svm.c suggest that these are GPAs,
> and hence can't be passed to vmload/vmsave without translation.
>
>>> But more importantly, if virt_to_maddr() fails an assertion because the
>>> virtual address is not a persistent mapping, what is going to happen
>>> when the virtual mapping (potentially) changes while the vvmcx is in use?
>> I think the virtual mapping is ok from that point of view -- it's mapped
>> with map_domain_page_global().
> And anyway, the virtual mapping isn't being used in the resulting
> code.
>
>> I worry that we might run out of mapping
>> slots if we keep a lot of these permanent mappings around, though.
> Afaict there's a single such mapping per vCPU, so not that much to
> worry about I think.
>
> Jan
>
>
Thank you all for comments. I am sending out V2 in a separate thread.

Suravee

      reply	other threads:[~2013-07-05 21:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04 19:36 [PATCH 1/1] x86/AMD: Fix nested svm crash due to assertion in __virt_to_maddr suravee.suthikulpanit
2013-07-04 19:42 ` Andrew Cooper
2013-07-04 21:48   ` Tim Deegan
2013-07-05  7:47     ` Egger, Christoph
2013-07-05  7:54       ` Jan Beulich
2013-07-05  7:53     ` Jan Beulich
2013-07-05 21:38       ` Suravee Suthikulanit [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=51D73CBC.7000305@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=chegger@amazon.de \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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 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).