All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tamas K Lengyel <tamas.lengyel@zentific.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Tim Deegan <tim@xen.org>, "Tian, Kevin" <kevin.tian@intel.com>,
	"wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Razvan Cojocaru <rcojocaru@bitdefender.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"Dong, Eddie" <eddie.dong@intel.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Steven Maresca <steve@zentific.com>,
	Andres Lagar-Cavilla <andres@lagarcavilla.org>,
	Jun Nakajima <jun.nakajima@intel.com>,
	"rshriram@cs.ubc.ca" <rshriram@cs.ubc.ca>,
	Keir Fraser <keir@xen.org>,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	"yanghy@cn.fujitsu.com" <yanghy@cn.fujitsu.com>
Subject: Re: [PATCH V7 07/12] xen: Introduce monitor_op domctl
Date: Thu, 26 Mar 2015 13:30:04 +0100	[thread overview]
Message-ID: <CAErYnsgVcZw+2GxRrpFk_bHrXpmRtCQaDBWseVhfCAS_3ZbiGA@mail.gmail.com> (raw)
In-Reply-To: <5513F277020000780006DD61@mail.emea.novell.com>

On Thu, Mar 26, 2015 at 11:50 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 12.03.15 at 18:58, <tamas.lengyel@zentific.com> wrote:
>> @@ -91,41 +88,55 @@ static int hvm_event_traps(uint64_t parameters, vm_event_request_t *req)
>>      return 1;
>>  }
>>
>> -static void hvm_event_cr(uint32_t reason, unsigned long value,
>> -                         unsigned long old, uint64_t parameters)
>> +static inline
>> +void hvm_event_cr(uint32_t reason, unsigned long value,
>> +                         unsigned long old, bool_t onchangeonly, bool_t sync)
>>  {
>> -    vm_event_request_t req = {
>> -        .reason = reason,
>> -        .vcpu_id = current->vcpu_id,
>> -        .u.mov_to_cr.new_value = value,
>> -        .u.mov_to_cr.old_value = old
>> -    };
>> -
>> -    if ( (parameters & HVMPME_onchangeonly) && (value == old) )
>> +    if ( onchangeonly && value == old )
>> +    {
>>          return;
>> -
>> -    hvm_event_traps(parameters, &req);
>> +    }
>> +    else
>> +    {
>> +        vm_event_request_t req = {
>> +            .reason = reason,
>> +            .vcpu_id = current->vcpu_id,
>> +            .u.mov_to_cr.new_value = value,
>> +            .u.mov_to_cr.old_value = old
>> +        };
>> +
>> +        hvm_event_traps(sync, &req);
>> +    }
>
> ... I'd really like to see such done without "else" (which would also
> have resulted in a smaller change).
>

So the reason why I have it under an else clause so that the
vm_event_request_t only gets pushed on the stack if there is a need
for it. Otherwise it would be pushed on the stack even if the function
returns right away which IMHO is not needed.

Tamas

  parent reply	other threads:[~2015-03-26 12:30 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12 17:58 [PATCH V7 00/12] xen: Clean-up of mem_event subsystem Tamas K Lengyel
2015-03-12 17:58 ` [PATCH V7 01/12] xen/mem_event: Cleanup of mem_event structures Tamas K Lengyel
2015-03-26 10:27   ` Jan Beulich
2015-03-12 17:58 ` [PATCH V7 02/12] xen/mem_event: Cleanup mem_event names in rings, functions and domctls Tamas K Lengyel
2015-03-12 17:58 ` [PATCH V7 03/12] xen/mem_paging: Convert mem_event_op to mem_paging_op and cleanup Tamas K Lengyel
2015-03-12 17:58 ` [PATCH V7 04/12] xen: Rename mem_event to vm_event Tamas K Lengyel
2015-03-12 17:58 ` [PATCH V7 05/12] tools/tests: Clean-up tools/tests/xen-access Tamas K Lengyel
2015-03-12 17:58 ` [PATCH V7 06/12] x86/hvm: factor out and rename vm_event related functions Tamas K Lengyel
2015-03-26 10:31   ` Jan Beulich
2015-03-12 17:58 ` [PATCH V7 07/12] xen: Introduce monitor_op domctl Tamas K Lengyel
2015-03-26 10:50   ` Jan Beulich
2015-03-26 11:08     ` Tamas K Lengyel
2015-03-26 11:13       ` Tim Deegan
2015-03-26 11:44         ` Tim Deegan
2015-03-26 11:47           ` Tamas Lengyel
2015-03-26 15:01           ` Tamas K Lengyel
2015-03-26 12:30     ` Tamas K Lengyel [this message]
2015-03-26 12:55       ` Jan Beulich
2015-03-26 13:51         ` Tamas Lengyel
2015-03-12 17:58 ` [PATCH V7 08/12] xen/vm_event: Deprecate VM_EVENT_FLAG_DUMMY flag Tamas K Lengyel
2015-03-12 17:58 ` [PATCH V7 09/12] xen/vm_event: Decouple vm_event and mem_access Tamas K Lengyel
2015-03-12 17:58 ` [PATCH V7 10/12] xen/vm_event: Relocate memop checks Tamas K Lengyel
2015-03-19 10:18   ` Tim Deegan
2015-03-12 17:58 ` [PATCH V7 11/12] xen/xsm: Split vm_event_op into three separate labels Tamas K Lengyel
2015-03-12 17:58 ` [PATCH V7 12/12] xen/vm_event: Add RESUME option to vm_event_op domctl Tamas K Lengyel
2015-03-26 10:56   ` Jan Beulich
2015-03-26 11:29     ` Tamas K Lengyel
2015-03-26 11:45       ` Jan Beulich
2015-03-26 11:48         ` Andrew Cooper
2015-03-26 12:53           ` Jan Beulich
2015-03-26 11:51         ` Tim Deegan

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=CAErYnsgVcZw+2GxRrpFk_bHrXpmRtCQaDBWseVhfCAS_3ZbiGA@mail.gmail.com \
    --to=tamas.lengyel@zentific.com \
    --cc=JBeulich@suse.com \
    --cc=andres@lagarcavilla.org \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=eddie.dong@intel.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=steve@zentific.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yanghy@cn.fujitsu.com \
    /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.