[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4dd462c8-7f0f-58c8-0f3f-757442134c90@csgroup.eu>
Date: Fri, 25 Nov 2022 05:59:02 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: "Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>
CC: Andrii Nakryiko <andrii@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Hao Luo <haoluo@...gle.com>,
John Fastabend <john.fastabend@...il.com>,
Jiri Olsa <jolsa@...nel.org>, KP Singh <kpsingh@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Stanislav Fomichev <sdf@...gle.com>,
Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>
Subject: Re: [PATCH] powerpc/bpf: Only update ldimm64 during extra pass when
it is an address
Le 25/11/2022 à 06:38, Naveen N. Rao a écrit :
> Christophe Leroy wrote:
>>
>>
>> Le 24/11/2022 à 14:49, Naveen N. Rao a écrit :
>>> Christophe Leroy wrote:
>>>>
>>>>
>>>> Le 24/11/2022 à 11:13, Naveen N. Rao a écrit :
>>>>> Christophe Leroy wrote:
>>>>
>>>> In what direction could that change in the future ?
>>>>
>>>> For me if they change that it becomes an API change.
>>>
>>> More of an extension, which is exactly what we had when
>>> BPF_PSEUDO_FUNC was introduced. Took us nearly a year before we noticed.
>>>
>>> Because we do not do a full JIT during the extra pass today like
>>> other architectures, we are the exception - there is always the risk
>>> of bpf core changes breaking our JIT. So, I still think it is better
>>> if we do a full JIT during extra pass.
>>>
>>
>> I like the idea of a full JIT during extra passes and will start
>> looking at it.
>>
>> Will it also allow us to revert your commit fab07611fb2e
>> ("powerpc32/bpf: Fix codegen for bpf-to-bpf calls") ?
>
> Not entirely. We still need those extra nops during the initial JIT so
> that we can estimate the maximum prog size. During extra pass, we can
> only emit the necessary instructions and skip extra nops. We may need to
> do two passes during extra_pass to adjust the branch targets though.
>
Before your change, the code was:
if (image && rel < 0x2000000 && rel >= -0x2000000) {
PPC_BL(func);
} else {
/* Load function address into r0 */
EMIT(PPC_RAW_LIS(_R0, IMM_H(func)));
EMIT(PPC_RAW_ORI(_R0, _R0, IMM_L(func)));
EMIT(PPC_RAW_MTCTR(_R0));
EMIT(PPC_RAW_BCTRL());
}
During the initial pass, image is NULL so the else branch is taken.
Christophe
Powered by blists - more mailing lists