[PATCH 5/6] qoriq: new target

Stijn Tintel stijn at linux-ipv6.be
Sun Aug 22 09:01:54 PDT 2021


On 22/08/2021 17:35, Stijn Tintel wrote:
> On 22/08/2021 16:07, Hauke Mehrtens wrote:
>> On 8/22/21 1:15 AM, Stijn Tintel wrote:
>>> Add a new target named "qoriq", that will support boards using PowerPC
>>> processors from NXP's QorIQ brand.
>>>
>>> This doesn't actually add support for any board yet, so that
>>> installation instructions can go in the commit message of the commit
>>> that adds actual support for a board.
>>>
>>> Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
>>> ---
>>>   target/linux/qoriq/Makefile          |  21 ++
>>>   target/linux/qoriq/config-5.10       | 414 +++++++++++++++++++++++++++
>>>   target/linux/qoriq/generic/target.mk |   3 +
>>>   target/linux/qoriq/image/Makefile    |  34 +++
>>>   target/linux/qoriq/image/generic.mk  |   0
>>>   5 files changed, 472 insertions(+)
>>>   create mode 100644 target/linux/qoriq/Makefile
>>>   create mode 100644 target/linux/qoriq/config-5.10
>>>   create mode 100644 target/linux/qoriq/generic/target.mk
>>>   create mode 100644 target/linux/qoriq/image/Makefile
>>>   create mode 100644 target/linux/qoriq/image/generic.mk
>>>
>>> diff --git a/target/linux/qoriq/Makefile b/target/linux/qoriq/Makefile
>>> new file mode 100644
>>> index 0000000000..d9a9f4d226
>>> --- /dev/null
>>> +++ b/target/linux/qoriq/Makefile
>>> @@ -0,0 +1,21 @@
>>> +# SPDX-License-Identifier: GPL-2.0-only
>>> +#
>>> +# Copyright (C) 2021 Stijn Tintel <stijn at linux-ipv6.be>
>>> +
>>> +include $(TOPDIR)/rules.mk
>>> +
>>> +ARCH:=powerpc64
>>> +BOARD:=qoriq
>>> +BOARDNAME:=NXP QorIQ (PowerPC)
>>> +CPU_TYPE:=e6500
>>> +FEATURES:=boot-part ext4 fpu legacy-sdcard powerpc64 ramdisk
>>> root-part rtc source-only
>>> +SUBTARGETS:=generic
>>> +
>>> +KERNEL_PATCHVER:=5.10
>>> +KERNEL_TESTING_PATCHVER:=5.10
>>> +
>>> +KERNELNAME:=zImage
>>> +
>>> +include $(INCLUDE_DIR)/target.mk
>>> +
>>> +$(eval $(call BuildTarget))
>>> diff --git a/target/linux/qoriq/config-5.10
>>> b/target/linux/qoriq/config-5.10
>>> new file mode 100644
>>> index 0000000000..d9d7e9bcf4
>>> --- /dev/null
>>> +++ b/target/linux/qoriq/config-5.10
>>> @@ -0,0 +1,414 @@
>> ....
>>> +CONFIG_ASN1=y
>> Why do you need CONFIG_ASN1?
> Selected by [y]:                 
>
>   - CRYPTO_RSA [=y] && CRYPTO [=y]
>
> CRYPTO_RSA is selected by one of the CAAM symbols below.
>
>> ....
>>> +CONFIG_CRYPTO_AUTHENC=y
>>> +CONFIG_CRYPTO_CRC32C=y
>>> +# CONFIG_CRYPTO_CRC32C_VPMSUM is not set
>>> +CONFIG_CRYPTO_DES=y
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM=y
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC=y
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_COMMON=y
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI=y
>>> +# CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set
>>> +# CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
>>> +CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
>>> +# CONFIG_CRYPTO_DEV_NX is not set
>>> +CONFIG_CRYPTO_ECB=y
>>> +CONFIG_CRYPTO_ENGINE=y
>>> +CONFIG_CRYPTO_GF128MUL=y
>>> +CONFIG_CRYPTO_HW=y
>>> +CONFIG_CRYPTO_LIB_DES=y
>>> +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1
>>> +# CONFIG_CRYPTO_MD5_PPC is not set
>>> +CONFIG_CRYPTO_NULL2=y
>>> +CONFIG_CRYPTO_RNG=y
>>> +CONFIG_CRYPTO_RNG2=y
>>> +CONFIG_CRYPTO_RSA=y
>>> +# CONFIG_CRYPTO_SHA1_PPC is not set
>>> +CONFIG_CRYPTO_XTS=y
>> Do you need all this crypto stuff com,piled in or is a module also
>> sufficent?
> We don't have kmod packages for FSL CAAM, and as they are rather target
> specific, I don't want to add those. The other CRYPTO_* symbols are
> enabled as dependencies of the CONFIG_CRYPTO_DEV_FSL_CAAM_* symbols.
> This is also consistent with how it's done for the imx6 target.
>
>
>> ....
>>> +CONFIG_EXT4_FS=y
>>> +CONFIG_EXT4_FS_POSIX_ACL=y
>>> +CONFIG_EXT4_FS_SECURITY=y
>> CONFIG_EXT4_FS_SECURITY is normally activated by
>> KERNEL_EXT4_FS_SECURITY in OpenWrt.
> Disabled.
>> ....
>>> +CONFIG_GCC_PLUGINS=y
>> Why do you activate CONFIG_GCC_PLUGINS ?
> This must be a leftover from starting this at the time 5.10 kernel was
> not supported in OpenWrt yet. The generic 5.4 config also has this
> enabled. I'll remove it from the target config.
>>> +# CONFIG_GCC_PLUGIN_CYC_COMPLEXITY is not set
>>> +# CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set
>>> +# CONFIG_GCC_PLUGIN_RANDSTRUCT is not set
>>> +# CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF is not set
>>> +# CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL is not set
>>> +# CONFIG_GCC_PLUGIN_STRUCTLEAK_USER is not set
>> ....
>>> +# CONFIG_HANGCHECK_TIMER is not set
>>> +# CONFIG_HARDENED_USERCOPY is not set
>> CONFIG_HARDENED_USERCOPY should only cause crashes when it detects a
>> buffer overflow. Do you have more details about the crashes?
> Looks like cannot reproduce that now. I've enabled it again.
>
And of course, when flashing the image with CONFIG_HARDENED_USERCOPY to
my main router, I do hit it, so I'll be disabling it again for now.

[   26.333649] usercopy: Kernel memory overwrite attempt detected to
SLUB object not in SLUB page?! (offset 0, size 8)!
[   26.344273] ------------[ cut here ]------------
[   26.348908] Kernel BUG at .usercopy_abort+0x94/0x9c [verbose debug
info unavailable]
[   26.356667] Oops: Exception in kernel mode, sig: 5 [#1]
[   26.361899] BE PAGE_SIZE=4K SMP NR_CPUS=24 CoreNet Generic
[   26.367387] Modules linked in: xt_connlimit pppoe ppp_async
nf_conncount l2tp_ppp iptable_nat cdc_mbim xt_state xt_nat xt_helper
xt_conntrack xt_connmark xt_connbytes xt_REDIRECT xt_MASQUERADE
xt_FLOWOFFLOAD xt_CT wireguard pppox ppp
_generic nft_redir nft_ct nf_nat_tftp nf_nat_snmp_basic nf_nat_sip
nf_nat_pptp nf_nat_irc nf_nat_h323 nf_nat_ftp nf_nat_amanda nf_nat
nf_flow_table nf_conntrack_tftp nf_conntrack_snmp nf_conntrack_sip
nf_conntrack_pptp nf_conntrack_netl
ink nf_conntrack_irc nf_conntrack_h323 nf_conntrack_ftp
nf_conntrack_broadcast nf_conntrack_amanda nf_conntrack
libchacha20poly1305 libblake2s ipt_REJECT cdc_ncm cdc_ether xt_time
xt_tcpudp xt_tcpmss xt_string xt_statistic xt_recent xt_quota xt_policy
xt_pkttype xt_physdev xt_owner xt_multiport xt_mark xt_mac xt_limit
xt_length xt_hl xt_esp xt_ecn xt_dscp xt_comment xt_cgroup xt_bpf
xt_addrtype xt_TRACE xt_TCPMSS xt_NFQUEUE xt_LOG xt_HL xt_DSCP
xt_CLASSIFY xfrm_interface w83793 usbnet ts_kmp ts_fsm ts_bm slhc
sch_cake ptp_qoriq
[   26.367603]  nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet
nft_reject_bridge nft_reject nft_quota nft_objref nft_numgen
nft_meta_bridge nft_log nft_limit nft_hash nft_fwd_netdev nft_dup_netdev
nft_counter nfnetlink_queue nf_tables nf_reject_ipv4 nf_log_ipv4
nf_dup_netdev nf_defrag_ipv6 nf_defrag_ipv4 macvlan libpoly1305
libcurve25519_generic libcrc32c libchacha libblake2s_generic iptable_raw
iptable_mangle iptable_filter ipt_ah ipt_ECN ip6table_raw ip_tables
crc_ccitt cdc_wdm br_netfilter sch_tbf sch_ingress sch_htb sch_hfsc
em_u32 cls_u32 cls_tcindex cls_route cls_matchall cls_fw cls_flow
cls_basic act_skbedit act_mirred act_gact i2c_dev xt_set ip_set_list_set
ip_set_hash_netportnet ip_set_hash_netport ip_set_hash_netnet
ip_set_hash_netiface ip_set_hash_net ip_set_hash_mac
ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport
ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac
ip_set_bitmap_ip ip_set nfnetlink nf_log_ipv6 nf_log_common ip6table_mangle
[   26.455354]  ip6table_filter ip6_tables ip6t_REJECT x_tables
nf_reject_ipv6 hwmon_vid ifb sit l2tp_netlink l2tp_core udp_tunnel
ip6_udp_tunnel ipcomp6 xfrm6_tunnel esp6 ah6 xfrm4_tunnel ipcomp esp4
ah4 netlink_diag tunnel6 tunnel4 ip_tunnel xfrm_user xfrm_ipcomp af_key
xfrm_algo crypto_user algif_skcipher algif_rng algif_hash algif_aead
af_alg sha512_generic sha256_generic libsha256 sha1_generic seqiv
jitterentropy_rng drbg md5 hmac echainiv deflate zlib_inflate cbc
crypto_acompress leds_gpio rtc_rs5c372 ehci_platform tpm_i2c_atmel
i2c_core ptp mii tpm
[   26.591596] CPU: 5 PID: 5633 Comm: fw3 Not tainted 5.10.60 #0
[   26.597357] NIP:  c000000000203f38 LR: c000000000203f34 CTR:
c000000000038560
[   26.604503] REGS: c00000008d9c3550 TRAP: 0700   Not tainted  (5.10.60)
[   26.611035] MSR:  0000000080029002 <CE,EE,ME>  CR: 28004248  XER:
20000000
[   26.617924] IRQMASK: 0
[   26.617924] GPR00: c000000000203f34 c00000008d9c37e0 c000000000c6d400
0000000000000068
[   26.617924] GPR04: c0000000ffea0678 c0000000ffea5f40 0000000000000027
c0000000ffea0680
[   26.617924] GPR08: 0000000000000023 0000000000000000 0000000000000000
0000000000000001
[   26.617924] GPR12: 0000000024004448 c00000003fffdc40 0000000000000000
0000000000000000
[   26.617924] GPR16: 0000000000000000 0000000000000000 00003fff9d113880
00003fff9d20bb80
[   26.617924] GPR20: 0000000017c8a640 00003fff9d1137e0 0000000000000009
0000000000000001
[   26.617924] GPR24: 0000000000000000 00003ffff411d430 c0000000831b64e0
0000000000000008
[   26.617924] GPR28: 8000000001000008 0000000000000000 0000000000000008
8000000001000000
[   26.684450] NIP [c000000000203f38] .usercopy_abort+0x94/0x9c
[   26.690109] LR [c000000000203f34] .usercopy_abort+0x90/0x9c
[   26.695679] Call Trace:
[   26.698122] [c00000008d9c37e0] [c000000000203f34]
.usercopy_abort+0x90/0x9c (unreliable)
[   26.706225] [c00000008d9c3860] [c0000000001f1820]
.__check_heap_object+0x170/0x190
[   26.713800] [c00000008d9c38d0] [c0000000002040c0]
.__check_object_size+0x180/0x1f0
[   26.721384] [c00000008d9c3960] [80000000004244f4]
.ip_set_sockfn_get+0xb4/0x380 [ip_set]
[   26.729482] [c00000008d9c3a10] [c000000000774b18]
.nf_getsockopt+0x78/0xf0
[   26.736368] [c00000008d9c3ab0] [c000000000788a3c]
.ip_getsockopt+0xcc/0x120
[   26.743340] [c00000008d9c3b50] [c0000000007c358c]
.raw_getsockopt+0x10c/0x1a0
[   26.750490] [c00000008d9c3be0] [c0000000006a0d1c]
.sock_common_getsockopt+0x2c/0x40
[   26.758152] [c00000008d9c3c50] [c00000000069f240]
.__sys_getsockopt+0xa0/0x220
[   26.765380] [c00000008d9c3d00] [c00000000069f3dc]
.__se_sys_getsockopt+0x1c/0x30
[   26.772784] [c00000008d9c3d70] [c00000000000fb5c]
.system_call_exception+0x11c/0x220
[   26.780534] [c00000008d9c3e20] [c000000000000678]
system_call_common+0xf8/0x200
[   26.787848] --- interrupt: c00 at 0x3fff9d25915c
[   26.787848]     LR = 0x100077e4
[   26.795592] Instruction dump:
[   26.798558] 392929d0 48000014 3d02ffd5 3908ee40 7d074378 7d094378
f8c10070 7c661b78
[   26.806319] 3c62ffd5 38639ae0 4be9abf5 60000000 <0fe00000> 60000000
3d22ffde 81298ab8
[   26.814258] ---[ end trace 70b7c82100ca71f1 ]---





More information about the openwrt-devel mailing list