[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55CB9424.7030801@oracle.com>
Date: Wed, 12 Aug 2015 14:44:52 -0400
From: Boris Ostrovsky <boris.ostrovsky@...cle.com>
To: Peter Zijlstra <peterz@...radead.org>,
"H. Peter Anvin" <hpa@...or.com>
CC: Stephen Rothwell <sfr@...b.auug.org.au>,
Jeremy Fitzhardinge <jeremy@...p.org>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Stefano Stabellini <stefano.stabellini@...citrix.com>,
Xen Devel <Xen-devel@...ts.xensource.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...e.hu>, linux-next@...r.kernel.org,
linux-kernel@...r.kernel.org, Andy Lutomirski <luto@...nel.org>,
David Vrabel <david.vrabel@...rix.com>
Subject: Re: linux-next: manual merge of the xen-tip tree with the tip tree
On 08/12/2015 02:36 PM, Peter Zijlstra wrote:
> On Wed, Aug 12, 2015 at 11:26:41AM -0700, H. Peter Anvin wrote:
>> One option might be to do the addition in assembly, i.e.:
>>
>> "i" (key), "i" (index)
>>
>> ... and put the addition into the assembly source.
> Like so? Seems to build on gcc-4.6.
Yes, this builds on 4.4.4. as well.
-boris
>
> ---
> arch/x86/include/asm/jump_label.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
> index 28d7a857f9d1..5daeca3d0f9e 100644
> --- a/arch/x86/include/asm/jump_label.h
> +++ b/arch/x86/include/asm/jump_label.h
> @@ -22,9 +22,9 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
> ".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t"
> ".pushsection __jump_table, \"aw\" \n\t"
> _ASM_ALIGN "\n\t"
> - _ASM_PTR "1b, %l[l_yes], %c0 \n\t"
> + _ASM_PTR "1b, %l[l_yes], %c0 + %c1 \n\t"
> ".popsection \n\t"
> - : : "i" (&((char *)key)[branch]) : : l_yes);
> + : : "i" (key), "i" (branch) : : l_yes);
>
> return false;
> l_yes:
> @@ -38,9 +38,9 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool
> "2:\n\t"
> ".pushsection __jump_table, \"aw\" \n\t"
> _ASM_ALIGN "\n\t"
> - _ASM_PTR "1b, %l[l_yes], %c0 \n\t"
> + _ASM_PTR "1b, %l[l_yes], %c0 + %c1 \n\t"
> ".popsection \n\t"
> - : : "i" (&((char *)key)[branch]) : : l_yes);
> + : : "i" (key), "i" (branch) : : l_yes);
>
> return false;
> l_yes:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists