All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Jan Beulich <JBeulich@suse.com>, Tamas K Lengyel <tlengyel@novetta.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Keir Fraser <keir@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 2/2] vm_event: consolidate hvm_event_fill_regs and p2m_vm_event_fill_regs
Date: Fri, 12 Feb 2016 12:19:06 +0200	[thread overview]
Message-ID: <56BDB19A.6050603@bitdefender.com> (raw)
In-Reply-To: <56BDBA7D02000078000D1558@prv-mh.provo.novell.com>

On 02/12/2016 11:57 AM, Jan Beulich wrote:
>>>> On 12.02.16 at 01:22, <tlengyel@novetta.com> wrote:
>> --- a/xen/arch/x86/vm_event.c
>> +++ b/xen/arch/x86/vm_event.c
>> @@ -122,6 +122,65 @@ void vm_event_set_registers(struct vcpu *v, vm_event_response_t *rsp)
>>      v->arch.user_regs.eip = rsp->data.regs.x86.rip;
>>  }
>>  
>> +void vm_event_fill_regs(vm_event_request_t *req)
>> +{
>> +    const struct cpu_user_regs *regs = guest_cpu_user_regs();
>> +    struct segment_register seg;
>> +    struct hvm_hw_cpu ctxt;
>> +    struct vcpu *curr = current;
>> +
>> +    req->data.regs.x86.rax = regs->eax;
>> +    req->data.regs.x86.rcx = regs->ecx;
>> +    req->data.regs.x86.rdx = regs->edx;
>> +    req->data.regs.x86.rbx = regs->ebx;
>> +    req->data.regs.x86.rsp = regs->esp;
>> +    req->data.regs.x86.rbp = regs->ebp;
>> +    req->data.regs.x86.rsi = regs->esi;
>> +    req->data.regs.x86.rdi = regs->edi;
>> +
>> +    req->data.regs.x86.r8  = regs->r8;
>> +    req->data.regs.x86.r9  = regs->r9;
>> +    req->data.regs.x86.r10 = regs->r10;
>> +    req->data.regs.x86.r11 = regs->r11;
>> +    req->data.regs.x86.r12 = regs->r12;
>> +    req->data.regs.x86.r13 = regs->r13;
>> +    req->data.regs.x86.r14 = regs->r14;
>> +    req->data.regs.x86.r15 = regs->r15;
>> +
>> +    req->data.regs.x86.rflags = regs->eflags;
>> +    req->data.regs.x86.rip    = regs->eip;
>> +
>> +    if ( !is_hvm_domain(curr->domain) )
>> +        return;
> 
> No such check existed in either of the two original functions. Why is
> it needed all of the sudden? And if it is needed, why do the other
> fields not get filled (as far as possible at least) for PV guests?

I can't speak for Tamas, but I suspect the check has been placed there
because calls to hvm_funcs.save_cpu_ctxt(curr, &ctxt) and
hvm_get_segment_register(curr, x86_seg_fs, &seg) follow, and he's put
vm_event_fill_regs() in xen/arch/x86/vm_event.c (a previous function was
called hvm_event_fill_regs(), in arch/x86/hvm/event.c, so no checking
for HVM was needed).

I don't think the check is needed for the current codepaths, but since
the code has been moved to xen/arch/x86/ the question about future PV
events is fair.


Thanks,
Razvan

  reply	other threads:[~2016-02-12 10:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12  0:22 [PATCH v2 1/2] hvm/vmx: save dr7 during vmx_vmcs_save Tamas K Lengyel
2016-02-12  0:22 ` [PATCH v2 2/2] vm_event: consolidate hvm_event_fill_regs and p2m_vm_event_fill_regs Tamas K Lengyel
2016-02-12  6:57   ` Razvan Cojocaru
2016-02-12  9:07   ` Jan Beulich
2016-02-12  9:57   ` Jan Beulich
2016-02-12 10:19     ` Razvan Cojocaru [this message]
2016-02-12 10:41       ` Jan Beulich
2016-02-12 12:50         ` Lengyel, Tamas
2016-02-12 14:57           ` Jan Beulich
2016-02-15 16:19             ` Lengyel, Tamas
2016-02-15 14:17   ` George Dunlap
2016-02-12  6:56 ` [PATCH v2 1/2] hvm/vmx: save dr7 during vmx_vmcs_save Razvan Cojocaru
2016-02-12  9:12 ` Jan Beulich
2016-02-12 12:57   ` Lengyel, Tamas
2016-02-12 15:00     ` Jan Beulich
2016-02-15 16:27       ` Lengyel, Tamas
2016-02-15 16:48         ` Jan Beulich
2016-02-15 16:55           ` Lengyel, Tamas
2016-02-15 17:06             ` Jan Beulich
2016-02-15 17:17               ` Lengyel, Tamas
2016-02-16  9:17                 ` Jan Beulich

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=56BDB19A.6050603@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=tlengyel@novetta.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.