All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: tim@xen.org, xen-devel@lists.xen.org
Subject: Re: [PATCH RFC 2/9] xen: Optimize introspection access to guest state
Date: Thu, 03 Jul 2014 11:12:20 +0300	[thread overview]
Message-ID: <53B51064.2000808@bitdefender.com> (raw)
In-Reply-To: <53B44375020000780001FADF@mail.emea.novell.com>

On 07/02/2014 06:37 PM, Jan Beulich wrote:
>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -6016,6 +6016,38 @@ int hvm_debug_op(struct vcpu *v, int32_t op)
>>      return rc;
>>  }
>>  
>> +static inline void hvm_mem_event_fill_regs(mem_event_request_t *req)
>> +{
>> +    struct cpu_user_regs *regs = guest_cpu_user_regs();
>> +    struct vcpu *v = current;
>> +
>> +    req->regs.rax = regs->eax;
>> +    req->regs.rcx = regs->ecx;
>> +    req->regs.rdx = regs->edx;
>> +    req->regs.rbx = regs->ebx;
>> +    req->regs.rsp = regs->esp;
>> +    req->regs.rbp = regs->ebp;
>> +    req->regs.rsi = regs->esi;
>> +    req->regs.rdi = regs->edi;
>> +
>> +    req->regs.r8  = regs->r8;
>> +    req->regs.r9  = regs->r9;
>> +    req->regs.r10 = regs->r10;
>> +    req->regs.r11 = regs->r11;
>> +    req->regs.r12 = regs->r12;
>> +    req->regs.r13 = regs->r13;
>> +    req->regs.r14 = regs->r14;
>> +    req->regs.r15 = regs->r15;
>> +
>> +    req->regs.rflags = regs->eflags;
>> +    req->regs.rip    = regs->eip;
>> +
>> +    req->regs.msr_efer = v->arch.hvm_vcpu.guest_efer;
>> +    req->regs.cr0 = v->arch.hvm_vcpu.guest_cr[0];
>> +    req->regs.cr3 = v->arch.hvm_vcpu.guest_cr[3];
>> +    req->regs.cr4 = v->arch.hvm_vcpu.guest_cr[4];
>> +}
> 
> This fills far not as many fields as the p2m function further down.
> Why?

That is because hvm_mem_event_fill_regs() is used for events such as CR3
changes or MSR access, and p2m_mem_event_fill_regs() is used for EPT
events, and our application needs full information while handling EPT
callbacks, and not as much for the other events.

Hence I've tried to avoid the unnecessary overhead in that case,
thinking that if somebody needed those values, they would be added then.

>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -425,6 +425,7 @@ static void vmx_vmcs_save(struct vcpu *v, struct hvm_hw_cpu *c)
>>      c->cr4 = v->arch.hvm_vcpu.guest_cr[4];
>>  
>>      c->msr_efer = v->arch.hvm_vcpu.guest_efer;
>> +    c->guest_x86_mode = vmx_guest_x86_mode(v);
> 
> This seems unrelated and/or lacking an SVM counterpart.

Yes, it does lack a SVM counterpart. Is SVM support required for acceptance?

It is, however, not unrelated. Our application required that
information, and it is cached in the mem_event (or am I missing something?).


Thanks,
Razvan Cojocaru

  reply	other threads:[~2014-07-03  8:12 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-02 13:33 [PATCH RFC 1/9] xen: Emulate with no writes; compute current instruction length Razvan Cojocaru
2014-07-02 13:33 ` [PATCH RFC 2/9] xen: Optimize introspection access to guest state Razvan Cojocaru
2014-07-02 15:31   ` Andrew Cooper
2014-07-07 14:50     ` Razvan Cojocaru
2014-07-10  8:05     ` Razvan Cojocaru
2014-07-10  8:17       ` Andrew Cooper
2014-07-10  8:23         ` Razvan Cojocaru
2014-07-10 11:57         ` Razvan Cojocaru
2014-07-10 12:16           ` Razvan Cojocaru
2014-07-10 13:01           ` Andrew Cooper
2014-07-02 15:37   ` Jan Beulich
2014-07-03  8:12     ` Razvan Cojocaru [this message]
2014-07-03  8:54       ` Jan Beulich
2014-07-02 13:33 ` [PATCH RFC 3/9] xen: Force-enable relevant MSR events; optimize the number of sent MSR events Razvan Cojocaru
2014-07-02 15:35   ` Andrew Cooper
2014-07-02 15:43     ` Jan Beulich
2014-07-09  8:02       ` Razvan Cojocaru
2014-07-23  7:56         ` Jan Beulich
2014-07-23  8:03           ` Razvan Cojocaru
2014-07-02 13:33 ` [PATCH RFC 4/9] xenctrl: Make the headers C++ friendly Razvan Cojocaru
2014-07-02 15:37   ` Andrew Cooper
2014-07-02 13:33 ` [PATCH RFC 5/9] xen: Support for VMCALL mem_events Razvan Cojocaru
2014-07-02 15:47   ` Jan Beulich
2014-07-02 15:54     ` Razvan Cojocaru
2014-07-02 16:11       ` Jan Beulich
2014-07-02 16:23         ` Razvan Cojocaru
2014-07-03  6:28           ` Jan Beulich
2014-07-03  7:29             ` Razvan Cojocaru
2014-07-02 15:54   ` Andrew Cooper
2014-07-02 15:59     ` Razvan Cojocaru
2014-07-02 13:33 ` [PATCH RFC 6/9] xen, libxc: Request page fault injection via libxc Razvan Cojocaru
2014-07-02 15:51   ` Jan Beulich
2014-07-02 16:00     ` Andrew Cooper
2014-07-02 16:58       ` Mihai Donțu
2014-07-02 17:07         ` Andrew Cooper
2014-07-03  8:23           ` Mihai Donțu
2014-07-03  9:32             ` Andrew Cooper
2014-07-03  9:40               ` Razvan Cojocaru
2014-07-02 16:06     ` Razvan Cojocaru
2014-07-02 16:13       ` Jan Beulich
2014-07-02 13:33 ` [PATCH RFC 7/9] xen: Handle resumed instruction based on previous mem_event reply Razvan Cojocaru
2014-07-02 15:56   ` Jan Beulich
2014-07-03  8:55     ` Razvan Cojocaru
2014-07-03  9:02       ` Jan Beulich
2014-07-03  9:12         ` Razvan Cojocaru
2014-07-03  9:18           ` Andrew Cooper
2014-07-03  9:22           ` Jan Beulich
2014-07-03  9:34             ` Razvan Cojocaru
2014-07-03 10:14               ` Jan Beulich
2014-07-02 13:34 ` [PATCH RFC 8/9] xen: Generic instruction re-execution mechanism for execute faults Razvan Cojocaru
2014-07-02 16:04   ` Andrew Cooper
2014-07-02 13:34 ` [PATCH RFC 9/9] mm: mark pages that have their permissions controlled by a domain Razvan Cojocaru
2014-07-03 10:19   ` Jan Beulich
2014-07-03 11:27     ` Razvan Cojocaru
2014-07-03 12:15       ` Jan Beulich
2014-07-02 15:20 ` [PATCH RFC 1/9] xen: Emulate with no writes; compute current instruction length Andrew Cooper
2014-07-03  7:42   ` Razvan Cojocaru
2014-07-02 15:21 ` Jan Beulich
2014-07-02 15:43   ` Razvan Cojocaru
2014-07-02 16:08     ` Jan Beulich
2014-07-02 16:18       ` Razvan Cojocaru
2014-07-03  6:24         ` Jan Beulich
2014-07-03  7:38   ` Razvan Cojocaru
2014-07-03  8:05     ` 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=53B51064.2000808@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=JBeulich@suse.com \
    --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 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.