From: Marc Zyngier <marc.zyngier@arm.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH] arm64: KVM: debug: Remove spurious inline attributes
Date: Thu, 17 Dec 2015 16:51:39 +0000 [thread overview]
Message-ID: <5672E81B.7010400@arm.com> (raw)
In-Reply-To: <87r3ilf3ad.fsf@linaro.org>
On 17/12/15 16:28, Alex Bennée wrote:
>
> Marc Zyngier <marc.zyngier@arm.com> writes:
>
>> The debug trapping code is pretty heavy on the "inline" attribute,
>> but most functions are actually referenced in the sysreg tables,
>> making the inlining imposible.
>>
>> Removing the useless inline qualifier seems the right thing to do,
>> having verified that the output code is similar.
>>
>> Cc: Alex Bennée <alex.bennee@linaro.org>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>> arch/arm64/kvm/sys_regs.c | 58 +++++++++++++++++++++++------------------------
>> 1 file changed, 29 insertions(+), 29 deletions(-)
>>
>> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
>> index 88adebf..eec3598 100644
>> --- a/arch/arm64/kvm/sys_regs.c
>> +++ b/arch/arm64/kvm/sys_regs.c
>> @@ -220,9 +220,9 @@ static bool trap_debug_regs(struct kvm_vcpu *vcpu,
>> * All writes will set the KVM_ARM64_DEBUG_DIRTY flag to ensure the
>> * hyp.S code switches between host and guest values in future.
>> */
>> -static inline void reg_to_dbg(struct kvm_vcpu *vcpu,
>> - struct sys_reg_params *p,
>> - u64 *dbg_reg)
>> +static void reg_to_dbg(struct kvm_vcpu *vcpu,
>> + struct sys_reg_params *p,
>> + u64 *dbg_reg)
>> {
>> u64 val = p->regval;
>>
>> @@ -235,18 +235,18 @@ static inline void reg_to_dbg(struct kvm_vcpu *vcpu,
>> vcpu->arch.debug_flags |= KVM_ARM64_DEBUG_DIRTY;
>> }
>>
>> -static inline void dbg_to_reg(struct kvm_vcpu *vcpu,
>> - struct sys_reg_params *p,
>> - u64 *dbg_reg)
>> +static void dbg_to_reg(struct kvm_vcpu *vcpu,
>> + struct sys_reg_params *p,
>> + u64 *dbg_reg)
>> {
>> p->regval = *dbg_reg;
>> if (p->is_32bit)
>> p->regval &= 0xffffffffUL;
>> }
>
> Christoffer's "register keyword" comments not-withstanding I'd prefer to
> keep the reg_to_dbg/dbg_to_reg functions as inline because they really
> are just boilerplate helpers I didn't want to repeat in the actual
> access functions - although if you've looked at the code I assume that
> means GCC has been smart about it.
Indeed, GCC is smart enough to directly inline it. In general, GCC is
doing a pretty good job at inlining static functions that are small
enough not to be worth jumping to. These days, "static inline" only
really makes sense in an include file.
> The rest all make sense. I wonder why I was being so inline happy?
>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Thanks,
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
next prev parent reply other threads:[~2015-12-17 16:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-16 15:49 [PATCH] arm64: KVM: debug: Remove spurious inline attributes Marc Zyngier
2015-12-16 20:45 ` Christoffer Dall
2015-12-17 16:28 ` Alex Bennée
2015-12-17 16:51 ` Marc Zyngier [this message]
2015-12-17 20:21 ` Alex Bennée
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=5672E81B.7010400@arm.com \
--to=marc.zyngier@arm.com \
--cc=alex.bennee@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
/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).