[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 04/12] x86/hvm: Reduce stack usage from HVMTRACE_ND()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 21 Sep 2021 17:40:44 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=XtJm3Q2B4CxVAL6aKgs4w3/Za+id/ONdsfb0a0NlobU=; b=K3clgdSdFHPTa/vC9uKdTssjQt2NBO5O9C3rSJzRUBYk8wpAxQz4ji0pnrpaWX9rbPlF0Ix+rtHJ5Q6+EhBzDLFA8sgMWq+/u1rFsCNtcolzcTspwS2r33qf/Kp5lkelTjoTa2yOlGEWbN0fBJYvRu10V645nAC8aWhGu+JQ7dkvlq6M3YHm9YDjrBMliSp1iBtJ79qoPGr3WviP2Ert+3cTDg0jcITEGHj3Rhy+AmbR+qJ78eh4hNaC9OrgLSpNF+jxktok5eAX7ZZ1MMAcJKPmVvqFGK5blfu/1wuaMbfg7kQZXEXFUosL4qDBqJiikydIc9r9aoY0fJ0lpYVZew==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PBq3GQTpPQAASdlPCBPPiljXM06EDZ+d2qKjgFZCQA04Q2ibYZzs9i4BxLq64x8REciqbSbPyWPupS7yiY17x7ny9zbA8ZXsc2c1JTaPJPLQGDCkvt6GCzkIFymDoj1Ra5XS5r4+NJDopjBV6eCuacUMyL+KrbV6u52xus2g9w2nwnqgcqFZ+PKW0nmfZG0uVuaHfcKK0T2cdn/471MgqH/5pUUsl0ac6eeXgWooOhRSS4Ddl9GSJPq7FloZ0VatXMoB7ZGf7AEE56zdZRzAi8j+CE+YDTby+4dSstewBVeEBYqx4CfVsWi3Hb+P5ulg9UxdS9U+unZzBB9Q1whXIg==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 21 Sep 2021 15:40:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.09.2021 17:38, Andrew Cooper wrote:
> On 21/09/2021 12:00, Jan Beulich wrote:
>> On 20.09.2021 19:25, Andrew Cooper wrote:
>>> v2:
>>>  * Adjust callers of HVMTRACE_ND() too
>> What does this refer to? The sole difference to v1 that I can spot
>> is ...
> 
> Oh - its me who was confused.
> 
> I thought I had failed to include the changes in vmx.c/svm.c in v1.  In
> which case, no change to that in v2.

Good:
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

>>>  * Drop _d[] for the 0 case.
>> ... the one corresponding to this line, i.e. ...
>>
>>> --- a/xen/include/asm-x86/hvm/trace.h
>>> +++ b/xen/include/asm-x86/hvm/trace.h
>>> @@ -67,38 +67,30 @@
>>>  #define TRACE_2_LONG_4D(_e, d1, d2, d3, d4, ...) \
>>>      TRACE_6D(_e, d1, d2, d3, d4)
>>>  
>>> -#define HVMTRACE_ND(evt, modifier, cycles, count, d1, d2, d3, d4, d5, d6) \
>>> +#define HVMTRACE_ND(evt, modifier, cycles, ...)                           \
>>>      do {                                                                  \
>>>          if ( unlikely(tb_init_done) && DO_TRC_HVM_ ## evt )               \
>>>          {                                                                 \
>>> -            struct {                                                      \
>>> -                u32 d[6];                                                 \
>>> -            } _d;                                                         \
>>> -            _d.d[0]=(d1);                                                 \
>>> -            _d.d[1]=(d2);                                                 \
>>> -            _d.d[2]=(d3);                                                 \
>>> -            _d.d[3]=(d4);                                                 \
>>> -            _d.d[4]=(d5);                                                 \
>>> -            _d.d[5]=(d6);                                                 \
>>> +            uint32_t _d[] = { __VA_ARGS__ };                              \
>>>              __trace_var(TRC_HVM_ ## evt | (modifier), cycles,             \
>>> -                        sizeof(*_d.d) * count, &_d);                      \
>>> +                        sizeof(_d), sizeof(_d) ? _d : NULL);              \
>> ... the addition of a conditional operator here (which I assume was
>> something a particular compiler didn't like in v1).
> 
> And was covered in the commit message:
> 
>> The 0 case needs a little help.  All object in C must have a unique address
>> and _d is passed by pointer.  Explicitly permit the optimiser to drop the
>> array.

Right, I had associated text and change this way. It was really just
the revision log which was confusing.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.