All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corneliu ZUZU <czuzu@bitdefender.com>
To: xen-devel@lists.xen.org
Cc: Kevin Tian <kevin.tian@intel.com>,
	Tamas K Lengyel <tamas@tklengyel.com>, Keir Fraser <keir@xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Razvan Cojocaru <rcojocaru@bitdefender.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events
Date: Mon, 7 Mar 2016 10:22:03 +0200	[thread overview]
Message-ID: <56DD3A2B.6060803@bitdefender.com> (raw)
In-Reply-To: <1457014210-14552-1-git-send-email-czuzu@bitdefender.com>

On 3/3/2016 4:10 PM, Corneliu ZUZU wrote:
> Then,
> QUESTIONS (FOR VM-EVENTS & ARM MAINTAINERS ESPECIALLY):
>
> Q1) [...]
>
> Q2) [...]
>
> Q3) [...]
>
> Q4) [...]

Hey all,

I have a question relating to this part of code @ vmx_update_guest_cr:

         if ( paging_mode_hap(v->domain) )
         {
             /* Manage GUEST_CR3 when CR0.PE=0. */
             uint32_t cr3_ctls = (CPU_BASED_CR3_LOAD_EXITING |
                                  CPU_BASED_CR3_STORE_EXITING);
             v->arch.hvm_vmx.exec_control &= ~cr3_ctls;
             if ( !hvm_paging_enabled(v) && !vmx_unrestricted_guest(v) )
                 v->arch.hvm_vmx.exec_control |= cr3_ctls;

             /* Trap CR3 updates if CR3 memory events are enabled. */
             if ( v->domain->arch.monitor.write_ctrlreg_enabled &
                  monitor_ctrlreg_bitmask(VM_EVENT_X86_CR3) )
                 v->arch.hvm_vmx.exec_control |= CPU_BASED_CR3_LOAD_EXITING;

             vmx_update_cpu_exec_control(v);
         }

While trying to move the check for VM_EVENT_X86_CR3 to the scheduling 
tail, a few questions came to my mind.

1). Tamas, Razvan, maybe you guys could clarify this. I noticed this 
part of code is only executed if paging_mode_hap(v->domain). Is EPT 
mandatory to monitor CR3 writes or is it just that when shadow paging is 
enabled, CR3 r/w are unconditionally trapped? If the former is true, 
shouldn't we do a check like this in vm_event_monitor_get_capabilities 
instead?

2). I was also wondering why CR3 load/stores are trapped if paging is 
disabled for a domain.

Thanks,
Corneliu.

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

  parent reply	other threads:[~2016-03-07  8:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 14:10 [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events Corneliu ZUZU
2016-03-03 14:11 ` [PATCH 1/1] arm/monitor vm-events: implement write-ctrlreg support Corneliu ZUZU
2016-03-03 16:02 ` [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events Corneliu ZUZU
2016-03-03 16:15 ` Razvan Cojocaru
2016-03-03 18:04   ` Corneliu ZUZU
2016-03-03 18:51     ` Razvan Cojocaru
2016-03-03 20:40       ` Corneliu ZUZU
2016-03-03 20:52         ` Razvan Cojocaru
2016-03-04 17:48 ` Corneliu ZUZU
2016-03-07  8:22 ` Corneliu ZUZU [this message]
2016-03-07  9:12   ` Tamas K Lengyel
2016-03-07  9:31     ` Corneliu ZUZU
2016-03-07  9:45       ` Tamas K Lengyel
2016-03-07 12:07         ` Corneliu ZUZU
2016-03-07 12:26           ` Corneliu ZUZU
2016-03-07 12:38     ` Andrew Cooper
2016-03-07 12:49       ` Corneliu ZUZU

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=56DD3A2B.6060803@bitdefender.com \
    --to=czuzu@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tamas@tklengyel.com \
    --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.