All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH 3/3] x86/HVM: correct error code writing during task switch
Date: Wed, 23 Nov 2016 01:33:40 -0700	[thread overview]
Message-ID: <58356274020000780012126B@prv-mh.provo.novell.com> (raw)
In-Reply-To: <ba6b3544-f4f8-00ab-5c1c-4f4c81679095@citrix.com>

>>> On 22.11.16 at 17:58, <andrew.cooper3@citrix.com> wrote:
> On 22/11/16 13:56, Jan Beulich wrote:
>> Whether to write 32 or just 16 bits depends on the D bit of the target
>> CS. The width of the stack pointer to use depends on the B bit of the
>> target SS.
>>
>> Also avoid using the no-fault copying routine.
>>
>> Finally avoid using yet another struct segment_register variable here.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -3033,9 +3033,6 @@ void hvm_task_switch(
>>              goto out;
>>      }
>>  
>> -    if ( (tss.trace & 1) && !exn_raised )
>> -        hvm_inject_hw_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE);
>> -
>>      tr.attr.fields.type = 0xb; /* busy 32-bit tss */
>>      hvm_set_segment_register(v, x86_seg_tr, &tr);
>>  
>> @@ -3051,17 +3048,32 @@ void hvm_task_switch(
>>  
>>      if ( errcode >= 0 )
>>      {
>> -        struct segment_register reg;
>>          unsigned long linear_addr;
>> -        regs->esp -= 4;
>> -        hvm_get_segment_register(current, x86_seg_ss, &reg);
>> -        /* Todo: do not ignore access faults here. */
>> -        if ( hvm_virtual_to_linear_addr(x86_seg_ss, &reg, regs->esp,
>> -                                        4, hvm_access_write, 32,
>> +        unsigned int opsz, sp;
>> +
>> +        hvm_get_segment_register(current, x86_seg_cs, &segr);
> 
> You already have current latched in v at this point.

Oh, right - I've blindly modified the old function invocation.

> Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks, Jan


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

  reply	other threads:[~2016-11-23  8:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 13:51 [PATCH 0/3] x86/HVM: XSA-192 follow-ups Jan Beulich
2016-11-22 13:55 ` [PATCH 1/3] x86/HVM: limit writes to incoming TSS during task switch Jan Beulich
2016-11-22 16:32   ` Andrew Cooper
2016-11-23  8:27     ` Jan Beulich
2016-11-23 10:59       ` Andrew Cooper
2016-11-22 13:55 ` [PATCH 2/3] x86/HVM: limit writes to outgoing " Jan Beulich
2016-11-22 16:46   ` Andrew Cooper
2016-11-23  8:30     ` Jan Beulich
2016-11-22 13:56 ` [PATCH 3/3] x86/HVM: correct error code writing " Jan Beulich
2016-11-22 16:58   ` Andrew Cooper
2016-11-23  8:33     ` Jan Beulich [this message]
2016-11-23 14:14 ` [PATCH 0/3] x86/HVM: XSA-192 follow-ups Wei Liu

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=58356274020000780012126B@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=wei.liu2@citrix.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.