lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <952773db-4b27-c0af-f976-b14445af0276@csgroup.eu>
Date:   Mon, 22 Aug 2022 14:09:46 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Randy Dunlap <rdunlap@...radead.org>,
        Pali Rohár <pali@...nel.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Nick Child <nick.child@....com>
CC:     "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] powerpc: Add support for early debugging via Serial 16550
 console



Le 20/08/2022 à 00:34, Randy Dunlap a écrit :
> Hi--
> 
> On 8/19/22 14:12, Pali Rohár wrote:
>> Currently powerpc early debugging contains lot of platform specific
>> options, but does not support standard UART / serial 16550 console.
>>
>> Later legacy_serial.c code supports registering UART as early debug console
>> from device tree but it is not early during booting, but rather later after
>> machine description code finishes.
>>
>> So for real early debugging via UART is current code unsuitable.
>>
>> Add support for new early debugging option CONFIG_PPC_EARLY_DEBUG_16550
>> which enable Serial 16550 console on address defined by new option
>> CONFIG_PPC_EARLY_DEBUG_16550_PHYSADDR and by stride by option
>> CONFIG_PPC_EARLY_DEBUG_16550_STRIDE.
>>
>> With this change it is possible to debug powerpc machine descriptor code.
>> For example this early debugging code can print on serial console also
>> "No suitable machine description found" error which is done before
>> legacy_serial.c code.
>>
>> Signed-off-by: Pali Rohár <pali@...nel.org>
>> ---
>> Tested on P2020 board. It allowed me do debug and implement this patch series:
>> https://lore.kernel.org/linuxppc-dev/20220819191557.28116-1-pali@kernel.org/
>> ---
>>   arch/powerpc/Kconfig.debug       | 14 ++++++++++++++
>>   arch/powerpc/include/asm/udbg.h  |  1 +
>>   arch/powerpc/kernel/udbg.c       |  2 ++
>>   arch/powerpc/kernel/udbg_16550.c | 33 ++++++++++++++++++++++++++++++++
>>   4 files changed, 50 insertions(+)
>>
>> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
>> index 9f363c143d86..a4e7d90a45d2 100644
>> --- a/arch/powerpc/Kconfig.debug
>> +++ b/arch/powerpc/Kconfig.debug
>> @@ -276,6 +276,11 @@ config PPC_EARLY_DEBUG_OPAL_HVSI
>>   	  Select this to enable early debugging for the PowerNV platform
>>   	  using an "hvsi" console
>>   
>> +config PPC_EARLY_DEBUG_16550
>> +	bool "Serial 16550"
>> +	help
>> +	  Select this to enable early debugging via Serial 16550 console
>> +
>>   config PPC_EARLY_DEBUG_MEMCONS
>>   	bool "In memory console"
>>   	help
>> @@ -355,6 +360,15 @@ config PPC_EARLY_DEBUG_CPM_ADDR
>>   	  platform probing is done, all platforms selected must
>>   	  share the same address.
>>   
>> +config PPC_EARLY_DEBUG_16550_PHYSADDR
>> +	hex "Early debug Serial 16550 physical address"
>> +	depends on PPC_EARLY_DEBUG_16550
> 
> Is there any chance that you could provide a default value here
> so that 'make olddefconfig' does not end up like it does
> without having a default value?

I did a few tests and it seems that a default doesn't help. I tried 
setting 'default n' to PPC_EARLY_DEBUG_16550 but I still get a prompt 
when doing an oldconfig. But only if you have CONFIG_PPC_EARLY_DEBUG=y 
in your old config. But that's expected behaviour when doing 'make 
oldconfig', isn't it ?

Or are you meaning a defconfig ? Because I get what you describe when 
doing 83xx/mpc836x_rdk_defconfig. And I agree with you this is going to 
create problems.

> 
> CONFIG_PPC_EARLY_DEBUG_16550=y
> # CONFIG_PPC_EARLY_DEBUG_MEMCONS is not set
> CONFIG_PPC_EARLY_DEBUG_16550_PHYSADDR=
> CONFIG_PPC_EARLY_DEBUG_16550_STRIDE=1
> 
> which then causes a kconfig prompt when starting
> the build...

Maybe a solution is to make PPC_EARLY_DEBUG_MEMCONS the default, doing 
that I get no change from before. But that changes the behaviour for 
mpc885_ads_defconfig, so it is not the solution.

So I think the only solution is to provide a default value to 
PPC_EARLY_DEBUG_16550_PHYSADDR, just like it is done for 
PPC_EARLY_DEBUG_CPM_ADDR.


> 
>> +
>> +config PPC_EARLY_DEBUG_16550_STRIDE
>> +	int "Early debug Serial 16550 stride"
>> +	depends on PPC_EARLY_DEBUG_16550
>> +	default 1
>> +
>>   config FAIL_IOMMU
>>   	bool "Fault-injection capability for IOMMU"
>>   	depends on FAULT_INJECTION
> 
> Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ