xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ben Catterall <Ben.Catterall@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, Tim Deegan <tim@xen.org>
Cc: xen-devel@lists.xensource.com, keir@xen.org,
	ian.campbell@citrix.com, george.dunlap@eu.citrix.com,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
	jbeulich@suse.com, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: Re: [RFC 3/4] HVM x86 deprivileged mode: Code for switching into/out of deprivileged mode
Date: Wed, 19 Aug 2015 11:36:51 +0100	[thread overview]
Message-ID: <55D45C43.7050700@citrix.com> (raw)
In-Reply-To: <55D36374.6060805@citrix.com>



On 18/08/15 17:55, Andrew Cooper wrote:
>
>
> On 17/08/15 08:07, Tim Deegan wrote:
>> At 14:53 +0100 on 17 Aug (1439823232), Ben Catterall wrote:
>>> On 12/08/15 14:33, Andrew Cooper wrote:
>>>> On 12/08/15 14:29, Andrew Cooper wrote:
>>>>> On 11/08/15 19:29, Boris Ostrovsky wrote:
>>>>>> Would switching TR only when we know that we need to enter this
>>>>>> deprivileged mode help?
>>>>> This is an absolute must.  It is not safe to use syscall/sysexit
>>>>> without
>>>>> IST in place for NMIs and MCEs.
>>>>>
>>>>>> Assuming that it is less expensive than copying the stack.
>>>>> I was referring to the stack overflow issue, and whether it might be
>>>>> sensible to pro-actively which TR.
>>>> Ahem! s/which/switch/
>>>>
>>>> ~Andrew
>>>>
>>> So, have we arrived at a decision for this? Thanks!
>
> Apologies for the delay - I am currently at the Xen Developer Summit.
>
No worries! Hope you're enjoying the summit. :)
>> Seems to have stalled a bit.  OK, I propose that:
>>   - we use TR/IST to make Xen take interrupts/exceptions at a
>> different SP;
>
> Xen re-enables interrupts in most interrupt handlers, which means that
> they must not have an IST set.  If an IST was set, a second interrupt
> would clobber the frame of the first.
>
> However, just adjusting tss->rsp0 and syscall top-of-stack to the
> current rsp when entering depriv mode should be sufficient, and will
> avoid needing to copy the stack.
Got it, thanks!
>
>>   - we make that SP be an extension of the main stack, so that things
>>     like current() Just Work[tm];
>>   - we set this up and tear it down when we enter/leave depriv mode.
>>   - someone ought to look at the case where IST handlers copy
>>     themselves to the main stack, and see if we need to adjust that too.
>
> They will need adjusting, but just disabling the copy entirely should be
> ok.
ok.
>
>>
>> Any other proposals?
>>
>> I think we can leave the question of TR switching on VMEXIT as a
>> separate issue.
>
> Agreed.  It is orthogonal to this problem.
>
> ~Andrew

  reply	other threads:[~2015-08-19 10:36 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 16:45 [RFC 0/4] HVM x86 enhancements to run Xen deprivileged mode operations Ben Catterall
2015-08-06 16:45 ` [RFC 1/4] HVM x86 deprivileged mode: Page allocation helper Ben Catterall
2015-08-06 19:22   ` Andrew Cooper
2015-08-07  9:57     ` Ben Catterall
2015-08-07 13:14       ` Andrew Cooper
2015-08-10  8:50       ` Tim Deegan
2015-08-10  8:52         ` Tim Deegan
2015-08-10  8:55           ` Andrew Cooper
2015-08-10 10:08             ` Tim Deegan
2015-08-06 16:45 ` [RFC 2/4] HVM x86 deprivileged mode: Create deprivileged page tables Ben Catterall
2015-08-06 19:52   ` Andrew Cooper
2015-08-07 13:19     ` Ben Catterall
2015-08-07 15:20       ` Andrew Cooper
2015-08-06 16:45 ` [RFC 3/4] HVM x86 deprivileged mode: Code for switching into/out of deprivileged mode Ben Catterall
2015-08-06 20:55   ` Andrew Cooper
2015-08-07 12:51     ` Ben Catterall
2015-08-07 13:08       ` David Vrabel
2015-08-07 14:24       ` Andrew Cooper
2015-08-11  9:45     ` Ian Campbell
2015-08-10  9:49   ` Tim Deegan
2015-08-10 10:14     ` Andrew Cooper
2015-08-11  9:55       ` Tim Deegan
2015-08-11 16:51         ` Ben Catterall
2015-08-11 17:05           ` Tim Deegan
2015-08-11 17:19             ` Andrew Cooper
2015-08-11 18:29               ` Boris Ostrovsky
2015-08-12 13:29                 ` Andrew Cooper
2015-08-12 13:33                   ` Andrew Cooper
2015-08-17 13:53                     ` Ben Catterall
2015-08-17 15:07                       ` Tim Deegan
2015-08-17 15:17                         ` Jan Beulich
2015-08-18 10:25                           ` Ben Catterall
2015-08-18 10:26                             ` Ben Catterall
2015-08-18 14:22                               ` Jan Beulich
2015-08-18 16:55                         ` Andrew Cooper
2015-08-19 10:36                           ` Ben Catterall [this message]
2015-08-12 10:10               ` Jan Beulich
2015-08-12 13:22             ` Ben Catterall
2015-08-12 13:26               ` Tim Deegan
2015-08-20 14:42       ` Ben Catterall
2015-08-11 10:35     ` Ben Catterall
2015-08-06 16:45 ` [RFC 4/4] HVM x86 deprivileged mode: Trap handlers for " Ben Catterall
2015-08-06 21:24   ` Andrew Cooper
2015-08-07 12:32     ` Ben Catterall
2015-08-07 13:19       ` Andrew Cooper
2015-08-07 13:26         ` Ben Catterall
2015-08-10 10:07   ` Tim Deegan
2015-08-11 10:33     ` Ben Catterall
2015-08-17 13:59       ` Ben Catterall
2015-08-17 14:58         ` Tim Deegan
2015-08-17 15:14           ` Jan Beulich
2015-08-12  9:50 ` [RFC 0/4] HVM x86 enhancements to run Xen deprivileged mode operations Jan Beulich
2015-08-12 11:27   ` Ben Catterall

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=55D45C43.7050700@citrix.com \
    --to=ben.catterall@citrix.com \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xensource.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).