All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <JBeulich@suse.com>, xen-devel@lists.xen.org
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
	George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, tim@xen.org, julien.grall@arm.com
Subject: Re: [PATCH 2/2] xen: add update indicator to vcpu_runstate_info
Date: Fri, 20 May 2016 17:04:24 +0200	[thread overview]
Message-ID: <573F2778.9010209@suse.com> (raw)
In-Reply-To: <573F402602000078000ED4AD@suse.com>

On 20/05/16 16:49, Jan Beulich wrote:
>>>> On 20.05.16 at 15:22, <JGross@suse.com> wrote:
>> --- a/xen/arch/x86/domain.c
>> +++ b/xen/arch/x86/domain.c
>> @@ -1925,13 +1925,37 @@ static void paravirt_ctxt_switch_to(struct vcpu *v)
>>  bool_t update_runstate_area(struct vcpu *v)
>>  {
>>      bool_t rc;
>> +    bool_t update_flag;
> 
> I think this variable is superfluous (and causes more register pressure
> in the compiler), since ...
> 
>>      smap_check_policy_t smap_policy;
>> +    void __user *guest_handle = NULL;
> 
> ... you can key off of this being non-NULL or ...
> 
>> +    unsigned off = 0;
> 
> ... this being non-zero in the second if().

Okay. Will change.

> 
>>      if ( guest_handle_is_null(runstate_guest(v)) )
>>          return 1;
>>  
>> +    update_flag = VM_ASSIST(v->domain, runstate_update_flag);
>> +
>>      smap_policy = smap_policy_change(v, SMAP_CHECK_ENABLED);
>>  
>> +    if ( update_flag )
>> +    {
>> +        off = offsetof(struct vcpu_runstate_info, state_entry_time) + 7;
> 
> How come this is outside the following if()? Also sizeof(...) - 1 please
> instead of the literal 7.

I'm using off for the source address in __raw_copy_to_guest(), too.
Regarding sizeof(): okay.

> 
>> --- a/xen/include/public/vcpu.h
>> +++ b/xen/include/public/vcpu.h
>> @@ -84,6 +84,12 @@ struct vcpu_runstate_info {
>>      /* When was current state entered (system time, ns)? */
>>      uint64_t state_entry_time;
>>      /*
>> +     * Update indicator set in state_entry_time:
>> +     * When activated via VMASST_TYPE_runstate_update_flag, set during
>> +     * updates in guest memory mapped copy of vcpu_runstate_info.
>> +     */
>> +#define XEN_RUNSTATE_UPDATE          (1ULL << 63)
> 
> I think this should be UINT64_C(1), as ULL is not a C89 compatible
> suffix, but by requiring uint64_t I think we can imply that along with
> that C99 type the platform also surfaces respective macros.

Okay.


Juergen

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

  parent reply	other threads:[~2016-05-20 15:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20 13:22 [PATCH 0/2] Support consistent reads of mapped vcpu_runstate_info Juergen Gross
2016-05-20 13:22 ` [PATCH 1/2] xen/arm: add support for vm_assist hypercall Juergen Gross
2016-05-20 13:58   ` Julien Grall
2016-05-20 14:34   ` Jan Beulich
     [not found]   ` <573F3C9702000078000ED477@suse.com>
2016-05-20 14:42     ` Juergen Gross
2016-05-20 14:51       ` Jan Beulich
     [not found]       ` <573F409702000078000ED4C9@suse.com>
2016-05-20 15:08         ` Juergen Gross
2016-05-20 15:33           ` Jan Beulich
     [not found]           ` <573F4A7302000078000ED510@suse.com>
2016-05-20 16:02             ` Juergen Gross
2016-05-21 13:27   ` Stefano Stabellini
2016-05-21 13:59     ` Julien Grall
2016-05-21 14:03       ` Stefano Stabellini
2016-05-20 13:22 ` [PATCH 2/2] xen: add update indicator to vcpu_runstate_info Juergen Gross
2016-05-20 13:34   ` Andrew Cooper
2016-05-20 13:38     ` Juergen Gross
2016-05-20 14:49   ` Jan Beulich
     [not found]   ` <573F402602000078000ED4AD@suse.com>
2016-05-20 15:04     ` Juergen Gross [this message]
2016-05-20 15:36       ` Jan Beulich
     [not found]       ` <573F4B2F02000078000ED513@suse.com>
2016-05-20 15:54         ` Juergen Gross
2016-05-20 16:16           ` Jan Beulich
2016-05-21 14:00             ` Stefano Stabellini
     [not found]           ` <573F549602000078000ED57C@suse.com>
2016-05-21  4:50             ` Juergen Gross
2016-05-20 14:10 ` [PATCH 0/2] Support consistent reads of mapped vcpu_runstate_info Julien Grall
2016-05-20 14:19   ` Juergen Gross

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=573F2778.9010209@suse.com \
    --to=jgross@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.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.