All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Juergen Gross <jgross@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v3 2/2] SVM: introduce a VM entry helper
Date: Mon, 7 May 2018 16:29:02 +0100	[thread overview]
Message-ID: <12f72e5d-6ce1-0fed-878d-8112c9c85d41@citrix.com> (raw)
In-Reply-To: <5AF06FD502000078001C152D@prv1-mh.provo.novell.com>

On 07/05/18 16:25, Jan Beulich wrote:
>>>> On 07.05.18 at 16:19, <andrew.cooper3@citrix.com> wrote:
>> On 07/05/18 15:11, Jan Beulich wrote:
>>>>>> On 04.05.18 at 17:11, <JBeulich@suse.com> wrote:
>>>> --- a/xen/arch/x86/hvm/svm/entry.S
>>>> +++ b/xen/arch/x86/hvm/svm/entry.S
>>>> @@ -61,23 +61,8 @@ UNLIKELY_START(ne, nsvm_hap)
>>>>          jmp  .Lsvm_do_resume
>>>>  __UNLIKELY_END(nsvm_hap)
>>>>  
>>>> -        call svm_asid_handle_vmrun
>>>> -
>>>> -        cmpb $0,tb_init_done(%rip)
>>>> -UNLIKELY_START(nz, svm_trace)
>>>> -        call svm_trace_vmentry
>>>> -UNLIKELY_END(svm_trace)
>>>> -
>>>> -        mov  VCPU_svm_vmcb(%rbx),%rcx
>>>> -        mov  UREGS_rax(%rsp),%rax
>>>> -        mov  %rax,VMCB_rax(%rcx)
>>>> -        mov  UREGS_rip(%rsp),%rax
>>>> -        mov  %rax,VMCB_rip(%rcx)
>>>> -        mov  UREGS_rsp(%rsp),%rax
>>>> -        mov  %rax,VMCB_rsp(%rcx)
>>>> -        mov  UREGS_eflags(%rsp),%rax
>>>> -        or   $X86_EFLAGS_MBS,%rax
>>>> -        mov  %rax,VMCB_rflags(%rcx)
>>>> +        mov  %rsp, %rdi
>>>> +        call svm_vmenter_helper
>>> While I had committed this earlier today, there's one concern I've just come
>>> to think of: Now that we're calling into C land with CLGI in effect (for 
>> more
>>> than just the trivial svm_trace_vmentry()) we are at risk of confusing
>>> parties using local_irq_is_enabled(), first and foremost
>>> common/spinlock.c:check_lock(). While it's some extra overhead, I wonder
>>> whether the call wouldn't better be framed by a CLI/STI pair.
>> I can't see why the SVM vmentry path uses CLGI/STGI in the first place.
>>
>> The VMX path uses plain cli/sti and our NMI/MCE handlers can cope. 
>> Furthermore, processing NMIs/MCEs at this point will be more efficient
>> that taking a vmentry then immediately exiting again.
> Perhaps you're right, i.e. we could replace all current CLGI/STGI by
> CLI/STI, adding a single STGI right after VMRUN.

We want to retain the one STGI on the svm_stgi_label, but I think all
other CLGI/STGI should be downgraded to CLI/STI.

>
>> As for running with interrupts disabled, that is already the case on the
>> VMX side, and I don't see why the SVM side needs to be different.
> Sure, as does SVM - CLGI is a superset of CLI, after all. My observation
> was just that this state of interrupts being disabled can't be observed by
> users of the normal infrastructure (inspecting EFLAGS.IF).

Ah ok.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-05-07 15:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 15:07 [PATCH v3 0/2] SVM: guest state handling adjustments Jan Beulich
2018-05-04 15:10 ` [PATCH v3 1/2] SVM: re-work VMCB sync-ing Jan Beulich
2018-05-04 15:11 ` [PATCH v3 2/2] SVM: introduce a VM entry helper Jan Beulich
2018-05-07 14:11   ` Jan Beulich
2018-05-07 14:19     ` Andrew Cooper
2018-05-07 15:25       ` Jan Beulich
2018-05-07 15:29         ` Andrew Cooper [this message]
2018-05-07 15:46           ` Boris Ostrovsky
2018-05-07 15:47             ` Jan Beulich
2018-05-07 15:49             ` Andrew Cooper
2018-05-07 16:16               ` Boris Ostrovsky
2018-05-04 17:52 ` [PATCH v3 0/2] SVM: guest state handling adjustments Andrew Cooper
2018-05-04 18:38 ` Boris Ostrovsky
     [not found] ` <5AEC77E802000078001C0BEB@suse.com>
2018-05-07  6:30   ` [PATCH v3 1/2] SVM: re-work VMCB sync-ing Juergen Gross
     [not found] ` <5AEC782902000078001C0BEE@suse.com>
2018-05-07  6:31   ` [PATCH v3 2/2] SVM: introduce a VM entry helper Juergen Gross

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=12f72e5d-6ce1-0fed-878d-8112c9c85d41@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --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.