public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jason Baron <jbaron@akamai.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"linux-snps-arc@lists.infradead.org"
	<linux-snps-arc@lists.infradead.org>,
	Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Subject: Re: [PATCH] ARC: ARCv2: jump label: implement jump label patching
Date: Thu, 20 Jun 2019 09:15:14 +0200	[thread overview]
Message-ID: <20190620071514.GR3419@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <C2D7FE5348E1B147BCA15975FBA2307501A252E40B@us01wembx1.internal.synopsys.com>

On Wed, Jun 19, 2019 at 11:55:41PM +0000, Vineet Gupta wrote:

> FWIW I tried to avoid all of this by using the 2 byte NOP_S and B_S variants which
> ensures we can never straddle cache line so the alignment issue goes away. There's
> a nice code size reduction too - see [1] . But I get build link errors in
> networking code around DO_ONCE where the unlikely code is too much and offset
> can't be encoded in signed 10 bits which B_S is allowed.

Yeah, so on x86 we have a 2 byte and a 5 byte relative jump and have the
exact same issue. We're currently using 5 byte jumps unconditionally for
the same reason.

Getting it to use the 2 byte one where possible is a 'fun' project for
someone with spare time at some point.  It might need a GCC plugin to
pull off, I've not put too much tought into it.

WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
	"linux-snps-arc@lists.infradead.org"
	<linux-snps-arc@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
	Jason Baron <jbaron@akamai.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
Subject: Re: [PATCH] ARC: ARCv2: jump label: implement jump label patching
Date: Thu, 20 Jun 2019 09:15:14 +0200	[thread overview]
Message-ID: <20190620071514.GR3419@hirez.programming.kicks-ass.net> (raw)
Message-ID: <20190620071514.88Yqf7kE06Uo4t3r2R4oCH9HXhyP8X6jNK6fbwI_r2E@z> (raw)
In-Reply-To: <C2D7FE5348E1B147BCA15975FBA2307501A252E40B@us01wembx1.internal.synopsys.com>

On Wed, Jun 19, 2019 at 11:55:41PM +0000, Vineet Gupta wrote:

> FWIW I tried to avoid all of this by using the 2 byte NOP_S and B_S variants which
> ensures we can never straddle cache line so the alignment issue goes away. There's
> a nice code size reduction too - see [1] . But I get build link errors in
> networking code around DO_ONCE where the unlikely code is too much and offset
> can't be encoded in signed 10 bits which B_S is allowed.

Yeah, so on x86 we have a 2 byte and a 5 byte relative jump and have the
exact same issue. We're currently using 5 byte jumps unconditionally for
the same reason.

Getting it to use the 2 byte one where possible is a 'fun' project for
someone with spare time at some point.  It might need a GCC plugin to
pull off, I've not put too much tought into it.

  parent reply	other threads:[~2019-06-20  7:15 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 16:40 [PATCH] ARC: ARCv2: jump label: implement jump label patching Eugeniy Paltsev
2019-06-14 16:40 ` Eugeniy Paltsev
2019-06-18 16:16 ` Vineet Gupta
2019-06-18 16:16   ` Vineet Gupta
2019-06-19  8:12   ` Peter Zijlstra
2019-06-19  8:12     ` Peter Zijlstra
2019-06-19 23:55     ` Vineet Gupta
2019-06-19 23:55       ` Vineet Gupta
2019-06-20  7:01       ` Peter Zijlstra
2019-06-20  7:01         ` Peter Zijlstra
2019-06-20 18:34         ` Eugeniy Paltsev
2019-06-20 18:34           ` Eugeniy Paltsev
2019-06-20 21:30           ` Peter Zijlstra
2019-06-20 21:30             ` Peter Zijlstra
2019-06-20 18:48         ` Vineet Gupta
2019-06-20 18:48           ` Vineet Gupta
2019-06-20 21:22           ` Peter Zijlstra
2019-06-20 21:22             ` Peter Zijlstra
2019-06-21 12:09             ` Peter Zijlstra
2019-06-21 12:09               ` Peter Zijlstra
2019-06-21 12:12               ` Peter Zijlstra
2019-06-21 12:12                 ` Peter Zijlstra
2019-06-21 18:37                 ` Nadav Amit
2019-06-21 18:37                   ` Nadav Amit
2019-06-20  7:15       ` Peter Zijlstra [this message]
2019-06-20  7:15         ` Peter Zijlstra
2019-06-20  7:21       ` Peter Zijlstra
2019-06-20  7:21         ` Peter Zijlstra
2019-06-20  7:52       ` Peter Zijlstra
2019-06-20  7:52         ` Peter Zijlstra
2019-06-20 20:49         ` Vineet Gupta
2019-06-20 20:49           ` Vineet Gupta
2019-06-21 15:39           ` Alexey Brodkin
2019-06-21 15:39             ` Alexey Brodkin
2019-06-20 18:34     ` Eugeniy Paltsev
2019-06-20 18:34       ` Eugeniy Paltsev
2019-06-20 21:12       ` Peter Zijlstra
2019-06-20 21:12         ` Peter Zijlstra
2019-06-28 22:59   ` Vineet Gupta
2019-06-28 22:59     ` Vineet Gupta
2019-07-03 16:15   ` Vineet Gupta
2019-07-03 16:15     ` Vineet Gupta
2019-07-17 15:09   ` Eugeniy Paltsev
2019-07-17 15:09     ` Eugeniy Paltsev
2019-07-17 17:45     ` Vineet Gupta
2019-07-17 17:45       ` Vineet Gupta
2019-07-17 18:54       ` Eugeniy Paltsev
2019-07-17 18:54         ` Eugeniy Paltsev

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=20190620071514.GR3419@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=jbaron@akamai.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=pbonzini@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox