linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* linux-next: changed messages in qemu boot
@ 2022-05-20 13:36 Stephen Rothwell
  2022-05-20 18:11 ` Naveen N. Rao
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2022-05-20 13:36 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Naveen N. Rao, Linux Next Mailing List, PowerPC,
	Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

Hi all,

Today's linux-next bboot of the powerpc pseries_le_defconfig build
produced these different kernel messages (diff from yesterday's tree):

- ftrace: allocating 33658 entries in 13 pages
- ftrace: allocated 13 pages with 3 groups
+ ftrace-powerpc: Address of ftrace_regs_caller out of range of kernel_toc.

I am not sure what caused this.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: changed messages in qemu boot
  2022-05-20 13:36 linux-next: changed messages in qemu boot Stephen Rothwell
@ 2022-05-20 18:11 ` Naveen N. Rao
  2022-05-24  2:22   ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Naveen N. Rao @ 2022-05-20 18:11 UTC (permalink / raw)
  To: Michael Ellerman, Stephen Rothwell
  Cc: Linux Next Mailing List, PowerPC, Linux Kernel Mailing List

Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next bboot of the powerpc pseries_le_defconfig build
> produced these different kernel messages (diff from yesterday's tree):
> 
> - ftrace: allocating 33658 entries in 13 pages
> - ftrace: allocated 13 pages with 3 groups
> + ftrace-powerpc: Address of ftrace_regs_caller out of range of kernel_toc.

Thanks for the report. I think that is due to:
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/bb6626e884acffe87b58736291df57db3deaa9b9.1652074503.git.christophe.leroy@csgroup.eu/

The below diff fixes it for me:

diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
index 46c002a8388804..7418da705d43ac 100644
--- a/arch/powerpc/kernel/trace/ftrace.c
+++ b/arch/powerpc/kernel/trace/ftrace.c
@@ -746,7 +746,7 @@ int __init ftrace_dyn_arch_init(void)
 
        reladdr = addr - kernel_toc_addr();
 
-       if (reladdr >= SZ_2G || reladdr < -SZ_2G) {
+       if (reladdr >= SZ_2G || reladdr < -_UL(SZ_2G)) {
                pr_err("Address of %ps out of range of kernel_toc.\n",
                                (void *)addr);
                return -1;


- Naveen


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: linux-next: changed messages in qemu boot
  2022-05-20 18:11 ` Naveen N. Rao
@ 2022-05-24  2:22   ` Michael Ellerman
  2022-05-24  7:11     ` Naveen N. Rao
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2022-05-24  2:22 UTC (permalink / raw)
  To: Naveen N. Rao, Stephen Rothwell
  Cc: Linux Next Mailing List, PowerPC, Linux Kernel Mailing List

"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
> Stephen Rothwell wrote:
>> Hi all,
>> 
>> Today's linux-next bboot of the powerpc pseries_le_defconfig build
>> produced these different kernel messages (diff from yesterday's tree):
>> 
>> - ftrace: allocating 33658 entries in 13 pages
>> - ftrace: allocated 13 pages with 3 groups
>> + ftrace-powerpc: Address of ftrace_regs_caller out of range of kernel_toc.
>
> Thanks for the report. I think that is due to:
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/bb6626e884acffe87b58736291df57db3deaa9b9.1652074503.git.christophe.leroy@csgroup.eu/

Yep, I bisected it there.

I should really read my email before bisecting :)

> The below diff fixes it for me:
>
> diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
> index 46c002a8388804..7418da705d43ac 100644
> --- a/arch/powerpc/kernel/trace/ftrace.c
> +++ b/arch/powerpc/kernel/trace/ftrace.c
> @@ -746,7 +746,7 @@ int __init ftrace_dyn_arch_init(void)
>  
>         reladdr = addr - kernel_toc_addr();
>  
> -       if (reladdr >= SZ_2G || reladdr < -SZ_2G) {
> +       if (reladdr >= SZ_2G || reladdr < -_UL(SZ_2G)) {
>                 pr_err("Address of %ps out of range of kernel_toc.\n",
>                                 (void *)addr);
>                 return -1;

I did:

	if (reladdr >= SZ_2G || reladdr < -(long)SZ_2G) {


Which more closely matches what the old code did, and I think is more
obvious? ie. we don't want to negate the unsigned value, we want a
signed value, and then the negative of that.

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: changed messages in qemu boot
  2022-05-24  2:22   ` Michael Ellerman
@ 2022-05-24  7:11     ` Naveen N. Rao
  0 siblings, 0 replies; 4+ messages in thread
From: Naveen N. Rao @ 2022-05-24  7:11 UTC (permalink / raw)
  To: Michael Ellerman, Stephen Rothwell
  Cc: Linux Next Mailing List, PowerPC, Linux Kernel,  Mailing List

Michael Ellerman wrote:
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
>> Stephen Rothwell wrote:
> 
>> The below diff fixes it for me:
>>
>> diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c
>> index 46c002a8388804..7418da705d43ac 100644
>> --- a/arch/powerpc/kernel/trace/ftrace.c
>> +++ b/arch/powerpc/kernel/trace/ftrace.c
>> @@ -746,7 +746,7 @@ int __init ftrace_dyn_arch_init(void)
>>  
>>         reladdr = addr - kernel_toc_addr();
>>  
>> -       if (reladdr >= SZ_2G || reladdr < -SZ_2G) {
>> +       if (reladdr >= SZ_2G || reladdr < -_UL(SZ_2G)) {
>>                 pr_err("Address of %ps out of range of kernel_toc.\n",
>>                                 (void *)addr);
>>                 return -1;
> 
> I did:
> 
> 	if (reladdr >= SZ_2G || reladdr < -(long)SZ_2G) {

That was my first attempt.

> Which more closely matches what the old code did, and I think is more
> obvious? ie. we don't want to negate the unsigned value, we want a
> signed value, and then the negative of that.

When you put it like that... :D
In hindsight, I agree though -- _UL() isn't necessarily better.


Thanks,
Naveen


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-24  7:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-20 13:36 linux-next: changed messages in qemu boot Stephen Rothwell
2022-05-20 18:11 ` Naveen N. Rao
2022-05-24  2:22   ` Michael Ellerman
2022-05-24  7:11     ` Naveen N. Rao

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).