xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Alexandru Isaila <aisaila@bitdefender.com>, xen-devel@lists.xen.org
Cc: andrew.cooper3@citrix.com, tamas@tklengyel.com,
	jbeulich@suse.com, suravee.suthikulpanit@amd.com,
	rcojocaru@bitdefender.com
Subject: Re: [PATCH v2 1/4] asm-x86/monitor: Enable svm monitor events
Date: Sat, 10 Feb 2018 14:51:25 -0500	[thread overview]
Message-ID: <112a0717-67d4-9e93-7a5c-9f75d4d3ef8f@oracle.com> (raw)
In-Reply-To: <072c38d6-3b5f-e744-7555-af98b85eb43f@oracle.com>

(Resending)

On 02/10/2018 11:30 AM, Boris Ostrovsky wrote:
>
>
> On 02/08/2018 10:25 AM, Alexandru Isaila wrote:
>> This commit separates the svm caps from the vmx caps.
>>
>> Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
>>
>> ---
>> Changes since V1:
>>     - Removed the if ( cpu_has_svm )
>> ---
>>   xen/include/asm-x86/monitor.h | 34 +++++++++++++++++++---------------
>>   1 file changed, 19 insertions(+), 15 deletions(-)
>>
>> diff --git a/xen/include/asm-x86/monitor.h
>> b/xen/include/asm-x86/monitor.h
>> index a0444d1..b2b4e6a 100644
>> --- a/xen/include/asm-x86/monitor.h
>> +++ b/xen/include/asm-x86/monitor.h
>> @@ -71,24 +71,28 @@ static inline uint32_t
>> arch_monitor_get_capabilities(struct domain *d)
>>       uint32_t capabilities = 0;
>>         /*
>> -     * At the moment only Intel HVM domains are supported. However,
>> event
>> -     * delivery could be extended to AMD and PV domains.
>> +     * At the moment only Intel and AMD HVM domains are supported.
>> However, event
>> +     * delivery could be extended to and PV domains.
>>        */
>> -    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_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);
>> +    }
>> +
>> +    capabilities |= (1U << XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST);
>
>
> It's a nit but I'd start with setting common options and the OR in
> arch-specific ones. (i.e. move the line above to right after
> !is_hvm_domain(d) test).
>
> -boris
>     
>
>
>>         if ( hvm_funcs.set_descriptor_access_exiting )
>>           capabilities |= (1U << XEN_DOMCTL_MONITOR_EVENT_DESC_ACCESS);
>>


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

  reply	other threads:[~2018-02-10 19:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 15:25 [PATCH v2 0/4] hvm/svm: Enable vm events for SVM Alexandru Isaila
2018-02-08 15:25 ` [PATCH v2 1/4] asm-x86/monitor: Enable svm monitor events Alexandru Isaila
2018-02-08 18:00   ` Tamas K Lengyel
2018-02-09 10:28   ` George Dunlap
2018-02-09 10:54     ` George Dunlap
2018-02-09 16:21     ` Tamas K Lengyel
2018-02-21 11:50       ` George Dunlap
2018-02-10 16:30   ` Boris Ostrovsky
2018-02-10 19:51     ` Boris Ostrovsky [this message]
2018-02-08 15:25 ` [PATCH v2 2/4] hvm/svm: Enable Breakpoint events Alexandru Isaila
2018-02-08 18:03   ` Tamas K Lengyel
2018-02-09 10:31   ` George Dunlap
2018-02-10 16:31   ` Boris Ostrovsky
2018-02-08 15:25 ` [PATCH v2 3/4] hvm/svm: Enable MSR events Alexandru Isaila
2018-02-08 18:04   ` Tamas K Lengyel
2018-02-09 10:37   ` George Dunlap
2018-02-09 11:03     ` Alexandru Stefan ISAILA
2018-02-10 16:33   ` Boris Ostrovsky
2018-02-10 20:26     ` Boris Ostrovsky
2018-02-08 15:25 ` [PATCH v2 4/4] hvm/svm: Enable CR events Alexandru Isaila
2018-02-08 18:06   ` Tamas K Lengyel
2018-02-09 13:10     ` Alexandru Stefan ISAILA
2018-02-09 16:24       ` Tamas K Lengyel
2018-02-09 16:41       ` George Dunlap
2018-02-09 16:25   ` Tamas K Lengyel

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=112a0717-67d4-9e93-7a5c-9f75d4d3ef8f@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=aisaila@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=suravee.suthikulpanit@amd.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 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).