From: Tamas K Lengyel <tamas@tklengyel.com>
To: Alexandru Isaila <aisaila@bitdefender.com>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Razvan Cojocaru <rcojocaru@bitdefender.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>,
Jan Beulich <jbeulich@suse.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v1 1/4] asm-x86/monitor: Enable svm monitor events
Date: Fri, 2 Feb 2018 08:38:03 -0700 [thread overview]
Message-ID: <CABfawhmRVEYg+VrCcxJ4c0eZJD4xvy6Erdb_FuDfUQhs7BSztQ@mail.gmail.com> (raw)
In-Reply-To: <1517564259-32305-2-git-send-email-aisaila@bitdefender.com>
On Fri, Feb 2, 2018 at 2:37 AM, Alexandru Isaila
<aisaila@bitdefender.com> wrote:
> This commit separates the svm caps from the vmx caps.
>
> Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
> ---
> xen/include/asm-x86/monitor.h | 33 ++++++++++++++++++++-------------
> 1 file changed, 20 insertions(+), 13 deletions(-)
>
> diff --git a/xen/include/asm-x86/monitor.h b/xen/include/asm-x86/monitor.h
> index a0444d1..3706b7a 100644
> --- a/xen/include/asm-x86/monitor.h
> +++ b/xen/include/asm-x86/monitor.h
> @@ -74,21 +74,28 @@ static inline uint32_t arch_monitor_get_capabilities(struct domain *d)
> * At the moment only Intel HVM domains are supported. However, event
> * delivery could be extended to AMD and PV domains.
I guess adjusting this comment here would now be also appropriate.
> */
> - if ( !is_hvm_domain(d) || !cpu_has_vmx )
> + if ( !is_hvm_domain(d) )
> return capabilities;
>
> - capabilities = (1U << XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG) |
> - (1U << XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR) |
> - (1U << XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT) |
> - (1U << XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST) |
> - (1U << XEN_DOMCTL_MONITOR_EVENT_DEBUG_EXCEPTION) |
> - (1U << XEN_DOMCTL_MONITOR_EVENT_CPUID) |
> - (1U << XEN_DOMCTL_MONITOR_EVENT_INTERRUPT) |
> - (1U << XEN_DOMCTL_MONITOR_EVENT_EMUL_UNIMPLEMENTED);
> -
> - /* Since we know this is on VMX, we can just call the hvm func */
> - if ( hvm_is_singlestep_supported() )
> - capabilities |= (1U << XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP);
> + if( cpu_has_vmx )
> + {
> + capabilities = (1U << XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG) |
> + (1U << XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR) |
> + (1U << XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT) |
> + (1U << XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST) |
> + (1U << XEN_DOMCTL_MONITOR_EVENT_DEBUG_EXCEPTION) |
> + (1U << XEN_DOMCTL_MONITOR_EVENT_CPUID) |
> + (1U << XEN_DOMCTL_MONITOR_EVENT_INTERRUPT) |
> + (1U << XEN_DOMCTL_MONITOR_EVENT_EMUL_UNIMPLEMENTED);
> +
> + /* Since we know this is on VMX, we can just call the hvm func */
> + if ( hvm_is_singlestep_supported() )
> + capabilities |= (1U << XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP);
> + }
> + else if ( cpu_has_svm )
> + {
> + capabilities = (1U << XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST);
If this is now supported on both svm and vmx, so you could just set it
outside the if blocks. We know we are dealing with an hvm domain at
this point.
Tamas
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-02-02 15:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 9:37 [PATCH v1 0/4] hvm/svm: Enable vm events for SVM Alexandru Isaila
2018-02-02 9:37 ` [PATCH v1 1/4] asm-x86/monitor: Enable svm monitor events Alexandru Isaila
2018-02-02 15:38 ` Tamas K Lengyel [this message]
2018-02-02 9:37 ` [PATCH v1 2/4] hvm/svm: Enable Breakpoint events Alexandru Isaila
2018-02-02 15:42 ` Tamas K Lengyel
2018-02-05 9:52 ` Alexandru Stefan ISAILA
2018-02-02 15:58 ` Andrew Cooper
2018-02-02 16:27 ` Alexandru Stefan ISAILA
2018-02-02 9:37 ` [PATCH v1 3/4] hvm/svm: Enable MSR events Alexandru Isaila
2018-02-02 9:37 ` [PATCH v1 4/4] hvm/svm: Enable CR events Alexandru Isaila
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=CABfawhmRVEYg+VrCcxJ4c0eZJD4xvy6Erdb_FuDfUQhs7BSztQ@mail.gmail.com \
--to=tamas@tklengyel.com \
--cc=aisaila@bitdefender.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=jbeulich@suse.com \
--cc=rcojocaru@bitdefender.com \
--cc=suravee.suthikulpanit@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).