* Re: next-20190723: bpf/seccomp - systemd/journald issue?
From: Yonghong Song @ 2019-07-26 21:05 UTC (permalink / raw)
To: sedat.dilek@gmail.com
Cc: Alexei Starovoitov, Daniel Borkmann, Martin Lau, Song Liu,
netdev@vger.kernel.org, bpf@vger.kernel.org, Clang-Built-Linux ML,
Kees Cook, Nick Desaulniers, Nathan Chancellor
In-Reply-To: <CA+icZUXYp=Jx+8aGrZmkCbSFp-cSPcoRzRdRJsPj4yYNs_mJQw@mail.gmail.com>
On 7/26/19 1:38 PM, Sedat Dilek wrote:
> Hi Yonghong Song,
>
> On Fri, Jul 26, 2019 at 5:45 PM Yonghong Song <yhs@fb.com> wrote:
>>
>>
>>
>> On 7/26/19 1:26 AM, Sedat Dilek wrote:
>>> Hi,
>>>
>>> I have opened a new issue in the ClangBuiltLinux issue tracker.
>>
>> Glad to know clang 9 has asm goto support and now It can compile
>> kernel again.
>>
>
> Yupp.
>
>>>
>>> I am seeing a problem in the area bpf/seccomp causing
>>> systemd/journald/udevd services to fail.
>>>
>>> [Fri Jul 26 08:08:43 2019] systemd[453]: systemd-udevd.service: Failed
>>> to connect stdout to the journal socket, ignoring: Connection refused
>>>
>>> This happens when I use the (LLVM) LLD ld.lld-9 linker but not with
>>> BFD linker ld.bfd on Debian/buster AMD64.
>>> In both cases I use clang-9 (prerelease).
>>
>> Looks like it is a lld bug.
>>
>> I see the stack trace has __bpf_prog_run32() which is used by
>> kernel bpf interpreter. Could you try to enable bpf jit
>> sysctl net.core.bpf_jit_enable = 1
>> If this passed, it will prove it is interpreter related.
>>
>
> After...
>
> sysctl -w net.core.bpf_jit_enable=1
>
> I can start all failed systemd services.
>
> systemd-journald.service
> systemd-udevd.service
> haveged.service
>
> This is in maintenance mode.
>
> What is next: Do set a permanent sysctl setting for net.core.bpf_jit_enable?
I do think you should set net.core.bpf_jit_enable by default. This is
more tested in production and you get better performance as well.
>
> Regards,
> - Sedat -
>
>>>
>>> Base for testing: next-20190723.
>>>
>>> The call-trace looks like this:
>>>
>>> [Fri Jul 26 08:08:42 2019] BUG: unable to handle page fault for
>>> address: ffffffff85403370
>>> [Fri Jul 26 08:08:42 2019] #PF: supervisor read access in kernel mode
>>> [Fri Jul 26 08:08:42 2019] #PF: error_code(0x0000) - not-present page
>>> [Fri Jul 26 08:08:42 2019] PGD 7620e067 P4D 7620e067 PUD 7620f063 PMD
>>> 44fe85063 PTE 800fffff8a3fc062
>>> [Fri Jul 26 08:08:42 2019] Oops: 0000 [#1] SMP PTI
>>> [Fri Jul 26 08:08:42 2019] CPU: 2 PID: 417 Comm: (journald) Not
>>> tainted 5.3.0-rc1-5-amd64-cbl-asmgoto #5~buster+dileks1
>>> [Fri Jul 26 08:08:42 2019] Hardware name: LENOVO
>>> 20HDCTO1WW/20HDCTO1WW, BIOS N1QET83W (1.58 ) 04/18/2019
>>> [Fri Jul 26 08:08:42 2019] RIP: 0010:___bpf_prog_run+0x40/0x14f0
>>> [Fri Jul 26 08:08:42 2019] Code: f3 eb 24 48 83 f8 38 0f 84 a9 0c 00
>>> 00 48 83 f8 39 0f 85 8a 14 00 00 0f 1f 00 48 0f bf 43 02 48 8d 1c c3
>>> 48 83 c3 08 0f b6 33 <48> 8b 04 f5 10 2e 40 85 48 83 f8 3b 7f 62 48 83
>>> f8 1e 0f 8f c8 00
>>> [Fri Jul 26 08:08:42 2019] RSP: 0018:ffff992ec028fcb8 EFLAGS: 00010246
>>> [Fri Jul 26 08:08:42 2019] RAX: ffff992ec028fd60 RBX: ffff992ec00e9038
>>> RCX: 0000000000000002
>>> [Fri Jul 26 08:08:42 2019] RDX: ffff992ec028fd40 RSI: 00000000000000ac
>>> RDI: ffff992ec028fce0
>>> [Fri Jul 26 08:08:42 2019] RBP: ffff992ec028fcd0 R08: 0000000000000000
>>> R09: ffff992ec028ff58
>>> [Fri Jul 26 08:08:42 2019] R10: 0000000000000000 R11: ffffffff849b8210
>>> R12: 000000007fff0000
>>> [Fri Jul 26 08:08:42 2019] R13: ffff992ec028feb8 R14: 0000000000000000
>>> R15: ffff992ec028fce0
>>> [Fri Jul 26 08:08:42 2019] FS: 00007f5d20f1d940(0000)
>>> GS:ffff8ba3d2500000(0000) knlGS:0000000000000000
>>> [Fri Jul 26 08:08:42 2019] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>>> [Fri Jul 26 08:08:42 2019] CR2: ffffffff85403370 CR3: 0000000445b3e001
>>> CR4: 00000000003606e0
>>> [Fri Jul 26 08:08:42 2019] Call Trace:
>>> [Fri Jul 26 08:08:42 2019] __bpf_prog_run32+0x44/0x70
>>> [Fri Jul 26 08:08:42 2019] ? flush_tlb_func_common+0xd8/0x230
>>> [Fri Jul 26 08:08:42 2019] ? mem_cgroup_commit_charge+0x8c/0x120
>>> [Fri Jul 26 08:08:42 2019] ? wp_page_copy+0x464/0x7a0
>>> [Fri Jul 26 08:08:42 2019] seccomp_run_filters+0x54/0x110
>>> [Fri Jul 26 08:08:42 2019] __seccomp_filter+0xf7/0x6e0
>>> [Fri Jul 26 08:08:42 2019] ? do_wp_page+0x32b/0x5d0
>>> [Fri Jul 26 08:08:42 2019] ? handle_mm_fault+0x90d/0xbf0
>>> [Fri Jul 26 08:08:42 2019] syscall_trace_enter+0x182/0x290
>>> [Fri Jul 26 08:08:42 2019] do_syscall_64+0x30/0x90
>>> [Fri Jul 26 08:08:42 2019] entry_SYSCALL_64_after_hwframe+0x44/0xa9
>>> [Fri Jul 26 08:08:42 2019] RIP: 0033:0x7f5d220d7f59
>>> [Fri Jul 26 08:08:42 2019] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00
>>> 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8
>>> 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 07 6f 0c 00
>>> f7 d8 64 89 01 48
>>> [Fri Jul 26 08:08:42 2019] RSP: 002b:00007ffd11332b48 EFLAGS: 00000246
>>> ORIG_RAX: 000000000000013d
>>> [Fri Jul 26 08:08:42 2019] RAX: ffffffffffffffda RBX: 000055bf8ab34010
>>> RCX: 00007f5d220d7f59
>>> [Fri Jul 26 08:08:42 2019] RDX: 000055bf8ab34010 RSI: 0000000000000000
>>> RDI: 0000000000000001
>>> [Fri Jul 26 08:08:42 2019] RBP: 000055bf8ab97fb0 R08: 000055bf8abbe180
>>> R09: 00000000c000003e
>>> [Fri Jul 26 08:08:42 2019] R10: 000055bf8abbe1e0 R11: 0000000000000246
>>> R12: 00007ffd11332ba0
>>> [Fri Jul 26 08:08:42 2019] R13: 00007ffd11332b98 R14: 00007f5d21f087f8
>>> R15: 000000000000002c
>>> [Fri Jul 26 08:08:42 2019] Modules linked in: i2c_dev parport_pc
>>> sunrpc ppdev lp parport efivarfs ip_tables x_tables autofs4 ext4
>>> crc32c_generic mbcache crc16 jbd2 btrfs zstd_decompress zstd_compress
>>> algif_skcipher af_alg sd_mod dm_crypt dm_mod raid10 raid456
>>> async_raid6_recov async_memcpy async_pq async_xor async_tx xor
>>> raid6_pq libcrc32c raid1 uas raid0 usb_storage multipath linear
>>> scsi_mod md_mod hid_cherry hid_generic usbhid hid crct10dif_pclmul
>>> crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64
>>> i915 glue_helper crypto_simd nvme i2c_algo_bit cryptd psmouse xhci_pci
>>> drm_kms_helper e1000e i2c_i801 xhci_hcd intel_lpss_pci nvme_core
>>> intel_lpss drm usbcore thermal wmi video button
>>> [Fri Jul 26 08:08:42 2019] CR2: ffffffff85403370
>>> [Fri Jul 26 08:08:42 2019] ---[ end trace 867b35c7d6c6705a ]---
>>> [Fri Jul 26 08:08:42 2019] RIP: 0010:___bpf_prog_run+0x40/0x14f0
>>> [Fri Jul 26 08:08:42 2019] Code: f3 eb 24 48 83 f8 38 0f 84 a9 0c 00
>>> 00 48 83 f8 39 0f 85 8a 14 00 00 0f 1f 00 48 0f bf 43 02 48 8d 1c c3
>>> 48 83 c3 08 0f b6 33 <48> 8b 04 f5 10 2e 40 85 48 83 f8 3b 7f 62 48 83
>>> f8 1e 0f 8f c8 00
>>> [Fri Jul 26 08:08:42 2019] RSP: 0018:ffff992ec028fcb8 EFLAGS: 00010246
>>> [Fri Jul 26 08:08:42 2019] RAX: ffff992ec028fd60 RBX: ffff992ec00e9038
>>> RCX: 0000000000000002
>>> [Fri Jul 26 08:08:42 2019] RDX: ffff992ec028fd40 RSI: 00000000000000ac
>>> RDI: ffff992ec028fce0
>>> [Fri Jul 26 08:08:42 2019] RBP: ffff992ec028fcd0 R08: 0000000000000000
>>> R09: ffff992ec028ff58
>>> [Fri Jul 26 08:08:42 2019] R10: 0000000000000000 R11: ffffffff849b8210
>>> R12: 000000007fff0000
>>> [Fri Jul 26 08:08:42 2019] R13: ffff992ec028feb8 R14: 0000000000000000
>>> R15: ffff992ec028fce0
>>> [Fri Jul 26 08:08:42 2019] FS: 00007f5d20f1d940(0000)
>>> GS:ffff8ba3d2500000(0000) knlGS:0000000000000000
>>> [Fri Jul 26 08:08:42 2019] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>>> [Fri Jul 26 08:08:42 2019] CR2: ffffffff85403370 CR3: 0000000445b3e001
>>> CR4: 00000000003606e0
>>>
>>> More details in [1] and what I tried (for example CONFIG_SECCOMP=n)
>>>
>>> I have no clue about BPF or SECCOMP.
>>>
>>> Can you comment on this?
>>>
>>> If this touches BPF: Can you give me some hints and instructions in debugging?
>>>
>>> My kernel-config and dmesg-log are attached.
>>>
>>> Thanks.
>>>
>>> Regards,
>>> - Sedat -
>>>
>>> [1] https://github.com/ClangBuiltLinux/linux/issues/619
>>>
^ permalink raw reply
* Re: [PATCH] qed: RDMA - Fix the hw_ver returned in device attributes
From: David Miller @ 2019-07-26 21:05 UTC (permalink / raw)
To: michal.kalderon; +Cc: ariel.elior, netdev
In-Reply-To: <20190725105955.12492-1-michal.kalderon@marvell.com>
From: Michal Kalderon <michal.kalderon@marvell.com>
Date: Thu, 25 Jul 2019 13:59:55 +0300
> The hw_ver field was initialized to zero. Return the chip revision.
> This is relevant for rdma driver.
>
> Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net: tipc: Fix a possible null-pointer dereference in tipc_publ_purge()
From: David Miller @ 2019-07-26 21:05 UTC (permalink / raw)
To: baijiaju1990; +Cc: jon.maloy, ying.xue, netdev, tipc-discussion, linux-kernel
In-Reply-To: <20190725092021.15855-1-baijiaju1990@gmail.com>
From: Jia-Ju Bai <baijiaju1990@gmail.com>
Date: Thu, 25 Jul 2019 17:20:21 +0800
> @@ -223,7 +223,8 @@ static void tipc_publ_purge(struct net *net, struct publication *publ, u32 addr)
> publ->key);
> }
>
> - kfree_rcu(p, rcu);
> + if (p)
> + kfree_rcu(p, rcu);
Please fix your automated tools if that is what found this, because as
others have nodes kfree_rcu() can take a NULL pointer argument just
fine.
Thank you.
^ permalink raw reply
* Re: [PATCH net-next 3/3] net: dsa: mt7530: Add support for port 5
From: David Miller @ 2019-07-26 21:04 UTC (permalink / raw)
To: opensource
Cc: netdev, frank-w, sean.wang, f.fainelli, linux, matthias.bgg,
andrew, vivien.didelot, john, linux-mediatek, linux-mips, robh+dt,
devicetree
In-Reply-To: <20190724192549.24615-4-opensource@vdorst.com>
From: René van Dorst <opensource@vdorst.com>
Date: Wed, 24 Jul 2019 21:25:49 +0200
> @@ -1167,6 +1236,10 @@ mt7530_setup(struct dsa_switch *ds)
> u32 id, val;
> struct device_node *dn;
> struct mt7530_dummy_poll p;
> + phy_interface_t interface;
> + struct device_node *mac_np;
> + struct device_node *phy_node;
> + const __be32 *_id;
Reverse christmas tree here please.
Thank you.
^ permalink raw reply
* Re: next-20190723: bpf/seccomp - systemd/journald issue?
From: Sedat Dilek @ 2019-07-26 21:02 UTC (permalink / raw)
To: Yonghong Song
Cc: Alexei Starovoitov, Daniel Borkmann, Martin Lau, Song Liu,
netdev@vger.kernel.org, bpf@vger.kernel.org, Clang-Built-Linux ML,
Kees Cook, Nick Desaulniers, Nathan Chancellor
In-Reply-To: <CA+icZUXYp=Jx+8aGrZmkCbSFp-cSPcoRzRdRJsPj4yYNs_mJQw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 11716 bytes --]
On Fri, Jul 26, 2019 at 10:38 PM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> Hi Yonghong Song,
>
> On Fri, Jul 26, 2019 at 5:45 PM Yonghong Song <yhs@fb.com> wrote:
> >
> >
> >
> > On 7/26/19 1:26 AM, Sedat Dilek wrote:
> > > Hi,
> > >
> > > I have opened a new issue in the ClangBuiltLinux issue tracker.
> >
> > Glad to know clang 9 has asm goto support and now It can compile
> > kernel again.
> >
>
> Yupp.
>
> > >
> > > I am seeing a problem in the area bpf/seccomp causing
> > > systemd/journald/udevd services to fail.
> > >
> > > [Fri Jul 26 08:08:43 2019] systemd[453]: systemd-udevd.service: Failed
> > > to connect stdout to the journal socket, ignoring: Connection refused
> > >
> > > This happens when I use the (LLVM) LLD ld.lld-9 linker but not with
> > > BFD linker ld.bfd on Debian/buster AMD64.
> > > In both cases I use clang-9 (prerelease).
> >
> > Looks like it is a lld bug.
> >
> > I see the stack trace has __bpf_prog_run32() which is used by
> > kernel bpf interpreter. Could you try to enable bpf jit
> > sysctl net.core.bpf_jit_enable = 1
> > If this passed, it will prove it is interpreter related.
> >
>
> After...
>
> sysctl -w net.core.bpf_jit_enable=1
>
> I can start all failed systemd services.
>
> systemd-journald.service
> systemd-udevd.service
> haveged.service
>
> This is in maintenance mode.
>
> What is next: Do set a permanent sysctl setting for net.core.bpf_jit_enable?
>
This is what I did:
Jul 26 22:43:06 iniza kernel: BUG: unable to handle page fault for
address: ffffffffa8203370
Jul 26 22:43:06 iniza kernel: #PF: supervisor read access in kernel mode
Jul 26 22:43:06 iniza kernel: #PF: error_code(0x0000) - not-present page
Jul 26 22:43:06 iniza kernel: PGD 2cfa0e067 P4D 2cfa0e067 PUD
2cfa0f063 PMD 450829063 PTE 800ffffd30bfc062
Jul 26 22:43:06 iniza kernel: Oops: 0000 [#3] SMP PTI
Jul 26 22:43:06 iniza kernel: CPU: 3 PID: 436 Comm: systemd-udevd
Tainted: G D 5.3.0-rc1-7-amd64-cbl-asmgoto
#7~buster+dileks1
Jul 26 22:43:06 iniza kernel: Hardware name: LENOVO
20HDCTO1WW/20HDCTO1WW, BIOS N1QET83W (1.58 ) 04/18/2019
Jul 26 22:43:06 iniza kernel: RIP: 0010:___bpf_prog_run+0x40/0x14f0
Jul 26 22:43:06 iniza kernel: Code: f3 eb 24 48 83 f8 38 0f 84 a9 0c
00 00 48 83 f8 39 0f 85 8a 14 00 00 0f 1f 00 48 0f bf 43 02 48 8d 1c
c3 48 83 c3 08 0f b6
33 <48> 8b 04 f5 10 2e 20 a8 48 83 f8 3b 7f 62 48 83 f8 1e 0f 8f c8 00
Jul 26 22:43:06 iniza kernel: RSP: 0018:ffffb3cec0327a88 EFLAGS: 00010246
Jul 26 22:43:06 iniza kernel: RAX: ffffb3cec0327b30 RBX:
ffffb3cec00d1038 RCX: 0000000000000000
Jul 26 22:43:06 iniza kernel: RDX: ffffb3cec0327b10 RSI:
00000000000000ac RDI: ffffb3cec0327ab0
Jul 26 22:43:06 iniza kernel: RBP: ffffb3cec0327aa0 R08:
ffff9b33c94c0a00 R09: 0000000000000000
Jul 26 22:43:06 iniza kernel: R10: ffff9b33cfe14e00 R11:
ffffffffa77b8210 R12: 0000000000000000
Jul 26 22:43:06 iniza kernel: R13: ffffb3cec00d1000 R14:
0000000000000000 R15: ffffb3cec0327ab0
Jul 26 22:43:06 iniza kernel: FS: 00007f7ac2d28d40(0000)
GS:ffff9b33d2580000(0000) knlGS:0000000000000000
Jul 26 22:43:06 iniza kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jul 26 22:43:06 iniza kernel: CR2: ffffffffa8203370 CR3:
000000044f3ea006 CR4: 00000000003606e0
Jul 26 22:43:06 iniza kernel: Call Trace:
Jul 26 22:43:06 iniza kernel: __bpf_prog_run32+0x44/0x70
Jul 26 22:43:06 iniza kernel: ? security_sock_rcv_skb+0x3f/0x60
Jul 26 22:43:06 iniza kernel: sk_filter_trim_cap+0xe4/0x220
Jul 26 22:43:06 iniza kernel: ? __skb_clone+0x2e/0x100
Jul 26 22:43:06 iniza kernel: netlink_broadcast_filtered+0x2df/0x4f0
Jul 26 22:43:06 iniza kernel: netlink_sendmsg+0x34f/0x3c0
Jul 26 22:43:06 iniza kernel: ___sys_sendmsg+0x315/0x330
Jul 26 22:43:06 iniza kernel: ? seccomp_run_filters+0x54/0x110
Jul 26 22:43:06 iniza kernel: ? filename_parentat+0x210/0x490
Jul 26 22:43:06 iniza kernel: ? __seccomp_filter+0xf7/0x6e0
Jul 26 22:43:06 iniza kernel: ? __d_alloc+0x159/0x1c0
Jul 26 22:43:06 iniza kernel: ? kmem_cache_free+0x1e/0x5c0
Jul 26 22:43:06 iniza kernel: ? fast_dput+0x73/0xb0
Jul 26 22:43:06 iniza kernel: __x64_sys_sendmsg+0x97/0xe0
Jul 26 22:43:06 iniza kernel: do_syscall_64+0x59/0x90
Jul 26 22:43:06 iniza kernel: entry_SYSCALL_64_after_hwframe+0x44/0xa9
Jul 26 22:43:06 iniza kernel: RIP: 0033:0x7f7ac3519914
Jul 26 22:43:06 iniza kernel: Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff
ff ff eb b5 0f 1f 80 00 00 00 00 48 8d 05 e9 5d 0c 00 8b 00 85 c0 75
13 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 41 54 41
89 d4 55 48 89 f5 53
Jul 26 22:43:06 iniza kernel: RSP: 002b:00007ffcfb66a478 EFLAGS:
00000246 ORIG_RAX: 000000000000002e
Jul 26 22:43:06 iniza kernel: RAX: ffffffffffffffda RBX:
0000561e28ac9390 RCX: 00007f7ac3519914
Jul 26 22:43:06 iniza kernel: RDX: 0000000000000000 RSI:
00007ffcfb66a4a0 RDI: 000000000000000d
Jul 26 22:43:06 iniza kernel: RBP: 0000561e28acd210 R08:
0000561e28990140 R09: 0000000000000002
Jul 26 22:43:06 iniza kernel: R10: 0000000000000000 R11:
0000000000000246 R12: 0000000000000000
Jul 26 22:43:06 iniza kernel: R13: 0000000000000000 R14:
000000000000005e R15: 00007ffcfb66a490
Jul 26 22:43:06 iniza kernel: Modules linked in: nfsd auth_rpcgss
nfs_acl lockd grace i2c_dev parport_pc ppdev lp parport sunrpc
efivarfs ip_tables x_tables autofs4 ext4 crc32c_generic mbcache crc16
jbd2 btrfs zstd_decompress zstd_compress algif_skcipher af_alg sd_mod
uas usb_storage scsi_mod hid_generic usbhid hid dm_crypt dm_mod raid10
raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor
raid6_pq libcrc32c raid1 raid0 multipath linear md_mod
crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel
aesni_intel i915 intel_lpss_pci nvme aes_x86_64 glue_helper
i2c_algo_bit crypto_simd cryptd xhci_pci psmouse e1000e drm_kms_helper
xhci_hcd i2c_i801 nvme_core intel_lpss drm usbcore thermal wmi video
button
Jul 26 22:43:06 iniza kernel: CR2: ffffffffa8203370
Jul 26 22:43:06 iniza kernel: ---[ end trace 312670b063bd0391 ]---
Jul 26 22:43:06 iniza kernel: RIP: 0010:___bpf_prog_run+0x40/0x14f0
Jul 26 22:43:06 iniza kernel: Code: f3 eb 24 48 83 f8 38 0f 84 a9 0c
00 00 48 83 f8 39 0f 85 8a 14 00 00 0f 1f 00 48 0f bf 43 02 48 8d 1c
c3 48 83 c3 08 0f b6 33 <48> 8b 04 f5 10 2e 20 a8 48 83 f8 3b 7f 62 48
83 f8 1e 0f 8f c8 00
Jul 26 22:43:06 iniza kernel: RSP: 0018:ffffb3cec0253cb8 EFLAGS: 00010246
Jul 26 22:43:06 iniza kernel: RAX: ffffb3cec0253d60 RBX:
ffffb3cec00e9038 RCX: 0000000000000002
Jul 26 22:43:06 iniza kernel: RDX: ffffb3cec0253d40 RSI:
00000000000000ac RDI: ffffb3cec0253ce0
Jul 26 22:43:06 iniza kernel: RBP: ffffb3cec0253cd0 R08:
0000000000000000 R09: ffffb3cec0253f58
Jul 26 22:43:06 iniza kernel: R10: 0000000000000000 R11:
ffffffffa77b8210 R12: 000000007fff0000
Jul 26 22:43:06 iniza kernel: R13: ffffb3cec0253eb8 R14:
0000000000000000 R15: ffffb3cec0253ce0
Jul 26 22:43:06 iniza kernel: FS: 00007f7ac2d28d40(0000)
GS:ffff9b33d2580000(0000) knlGS:0000000000000000
Jul 26 22:43:06 iniza kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jul 26 22:43:06 iniza kernel: CR2: ffffffffa8203370 CR3:
000000044f3ea006 CR4: 00000000003606e0
Jul 26 22:43:06 iniza kernel: BUG: unable to handle page fault for
address: ffffffffa8203370
Jul 26 22:43:06 iniza kernel: #PF: supervisor read access in kernel mode
Jul 26 22:43:06 iniza kernel: #PF: error_code(0x0000) - not-present page
Jul 26 22:43:06 iniza kernel: PGD 2cfa0e067 P4D 2cfa0e067 PUD
2cfa0f063 PMD 450829063 PTE 800ffffd30bfc062
Jul 26 22:43:06 iniza kernel: Oops: 0000 [#4] SMP PTI
Jul 26 22:43:06 iniza kernel: CPU: 0 PID: 437 Comm: systemd-udevd
Tainted: G D 5.3.0-rc1-7-amd64-cbl-asmgoto
#7~buster+dileks1
Jul 26 22:43:06 iniza kernel: Hardware name: LENOVO
20HDCTO1WW/20HDCTO1WW, BIOS N1QET83W (1.58 ) 04/18/2019
Jul 26 22:43:06 iniza kernel: RIP: 0010:___bpf_prog_run+0x40/0x14f0
Jul 26 22:43:06 iniza kernel: Code: f3 eb 24 48 83 f8 38 0f 84 a9 0c
00 00 48 83 f8 39 0f 85 8a 14 00 00 0f 1f 00 48 0f bf 43 02 48 8d 1c
c3 48 83 c3 08 0f b6 33 <48> 8b 04 f5 10 2e 20 a8 48 83 f8 3b 7f 62 48
83 f8 1e 0f 8f c8 00
Jul 26 22:43:06 iniza kernel: RSP: 0018:ffffb3cec032fa88 EFLAGS: 00010246
Jul 26 22:43:06 iniza kernel: RAX: ffffb3cec032fb30 RBX:
ffffb3cec00d1038 RCX: 0000000000000000
Jul 26 22:43:06 iniza kernel: RDX: ffffb3cec032fb10 RSI:
00000000000000ac RDI: ffffb3cec032fab0
Jul 26 22:43:06 iniza kernel: RBP: ffffb3cec032faa0 R08:
ffff9b33cf34b000 R09: 0000000000000000
Jul 26 22:43:06 iniza kernel: R10: ffff9b33cf3a3400 R11:
ffffffffa77b8210 R12: 0000000000000000
Jul 26 22:43:06 iniza kernel: R13: ffffb3cec00d1000 R14:
0000000000000000 R15: ffffb3cec032fab0
Jul 26 22:43:06 iniza kernel: FS: 00007f7ac2d28d40(0000)
GS:ffff9b33d2400000(0000) knlGS:0000000000000000
Jul 26 22:43:06 iniza kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jul 26 22:43:06 iniza kernel: CR2: ffffffffa8203370 CR3:
000000044724a001 CR4: 00000000003606f0
Jul 26 22:43:06 iniza kernel: Call Trace:
Jul 26 22:43:06 iniza kernel: __bpf_prog_run32+0x44/0x70
Jul 26 22:43:06 iniza kernel: ? prep_new_page+0x47/0x1a0
Jul 26 22:43:06 iniza kernel: ? security_sock_rcv_skb+0x3f/0x60
Jul 26 22:43:06 iniza kernel: sk_filter_trim_cap+0xe4/0x220
Jul 26 22:43:06 iniza kernel: ? __skb_clone+0x2e/0x100
Jul 26 22:43:06 iniza kernel: netlink_broadcast_filtered+0x2df/0x4f0
Jul 26 22:43:06 iniza kernel: netlink_sendmsg+0x34f/0x3c0
Jul 26 22:43:06 iniza kernel: ___sys_sendmsg+0x315/0x330
Jul 26 22:43:06 iniza kernel: ? seccomp_run_filters+0x54/0x110
Jul 26 22:43:06 iniza kernel: ? filename_parentat+0x210/0x490
Jul 26 22:43:06 iniza kernel: ? __seccomp_filter+0xf7/0x6e0
Jul 26 22:43:06 iniza kernel: ? __d_alloc+0x159/0x1c0
Jul 26 22:43:06 iniza kernel: ? kmem_cache_free+0x1e/0x5c0
Jul 26 22:43:06 iniza kernel: ? fast_dput+0x73/0xb0
Jul 26 22:43:06 iniza kernel: __x64_sys_sendmsg+0x97/0xe0
Jul 26 22:43:06 iniza kernel: do_syscall_64+0x59/0x90
Jul 26 22:43:06 iniza kernel: entry_SYSCALL_64_after_hwframe+0x44/0xa9
Jul 26 22:43:06 iniza kernel: RIP: 0033:0x7f7ac3519914
Jul 26 22:43:06 iniza kernel: Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff
ff ff eb b5 0f 1f 80 00 00 00 00 48 8d 05 e9 5d 0c 00 8b 00 85 c0 75
13 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 41 54 41
89 d4 55 48 89 f5 53
Jul 26 22:43:06 iniza kernel: RSP: 002b:00007ffcfb66a478 EFLAGS:
00000246 ORIG_RAX: 000000000000002e
Jul 26 22:43:06 iniza kernel: RAX: ffffffffffffffda RBX:
0000561e28aaa600 RCX: 00007f7ac3519914
Jul 26 22:43:06 iniza kernel: RDX: 0000000000000000 RSI:
00007ffcfb66a4a0 RDI: 000000000000000e
Jul 26 22:43:06 iniza kernel: RBP: 0000561e28aaaac0 R08:
0000561e28990140 R09: 0000000000000002
Jul 26 22:43:06 iniza kernel: R10: 0000000000000000 R11:
0000000000000246 R12: 0000000000000000
Jul 26 22:43:06 iniza kernel: R13: 0000000000000000 R14:
000000000000005d R15: 00007ffcfb66a490
Jul 26 22:43:06 iniza kernel: Modules linked in: nfsd auth_rpcgss
nfs_acl lockd grace i2c_dev parport_pc ppdev lp parport sunrpc
efivarfs ip_tables x_tables autofs4 ext4 crc32c_generic mbcache crc16
jbd2 btrfs zstd_decompress zstd_compress algif_skcipher af_alg sd_mod
uas usb_storage scsi_mod hid_generic usbhid hid dm_crypt dm_mod raid10
raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor
raid6_pq libcrc32c raid1 raid0 multipath linear md_mod
crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel
aesni_intel i915 intel_lpss_pci nvme aes_x86_64 glue_helper
i2c_algo_bit crypto_simd cryptd xhci_pci psmouse e1000e drm_kms_helper
xhci_hcd i2c_i801 nvme_core intel_lpss drm usbcore thermal wmi video
button
Jul 26 22:43:06 iniza kernel: CR2: ffffffffa8203370
Jul 26 22:43:06 iniza kernel: ---[ end trace 312670b063bd0392 ]---
Full `journalctl -xb` attached.
- Sedat -
[-- Attachment #2: journalctl-xb.txt.gz --]
[-- Type: application/gzip, Size: 26676 bytes --]
^ permalink raw reply
* Re: [PATCH net-next 1/3] net: ethernet: mediatek: Add basic PHYLINK support
From: David Miller @ 2019-07-26 21:02 UTC (permalink / raw)
To: opensource
Cc: netdev, frank-w, sean.wang, f.fainelli, linux, matthias.bgg,
andrew, vivien.didelot, john, linux-mediatek, linux-mips, robh+dt,
devicetree
In-Reply-To: <20190724192340.18978-1-opensource@vdorst.com>
From: René van Dorst <opensource@vdorst.com>
Date: Wed, 24 Jul 2019 21:23:40 +0200
> @@ -186,165 +187,219 @@ static void mtk_gmac0_rgmii_adjust(struct mtk_eth *eth, int speed)
> mtk_w32(eth, val, TRGMII_TCK_CTRL);
> }
>
> -static void mtk_phy_link_adjust(struct net_device *dev)
> +static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
> + const struct phylink_link_state *state)
> {
> - struct mtk_mac *mac = netdev_priv(dev);
> - u16 lcl_adv = 0, rmt_adv = 0;
> - u8 flowctrl;
> - u32 mcr = MAC_MCR_MAX_RX_1536 | MAC_MCR_IPG_CFG |
> - MAC_MCR_FORCE_MODE | MAC_MCR_TX_EN |
> - MAC_MCR_RX_EN | MAC_MCR_BACKOFF_EN |
> - MAC_MCR_BACKPR_EN;
> + struct mtk_mac *mac = container_of(config, struct mtk_mac,
> + phylink_config);
> + struct mtk_eth *eth = mac->hw;
>
> - if (unlikely(test_bit(MTK_RESETTING, &mac->hw->state)))
> - return;
> + u32 ge_mode = 0, val, mcr_cur, mcr_new;
Please elminiate the empty line in the middle of the local variabel
declarations and adhere to reverse christmas tree ordering.
> @@ -1798,6 +1853,13 @@ static int mtk_open(struct net_device *dev)
> {
> struct mtk_mac *mac = netdev_priv(dev);
> struct mtk_eth *eth = mac->hw;
> + int err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
Reverse christmas tree please.
> @@ -2375,9 +2407,10 @@ static const struct net_device_ops mtk_netdev_ops = {
>
> static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
> {
> + struct phylink *phylink;
> struct mtk_mac *mac;
> const __be32 *_id = of_get_property(np, "reg", NULL);
> - int id, err;
> + int phy_mode, id, err;
While you are here please fix up the reverse christmas tree ordering, and
definitely don't make it worse :)
^ permalink raw reply
* [PATCH v2] iproute2: devlink: port from sys/queue.h to list.h
From: Sergei Trofimovich @ 2019-07-26 21:01 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Sergei Trofimovich, netdev
In-Reply-To: <20190726112956.3b54f906@hermes.lan>
sys/queue.h does not exist on linux-musl targets and fails build as:
devlink.c:28:10: fatal error: sys/queue.h: No such file or directory
28 | #include <sys/queue.h>
| ^~~~~~~~~~~~~
The change ports to list.h API and drops dependency of 'sys/queue.h'.
The API maps one-to-one.
Build-tested on linux-musl and linux-glibc.
Bug: https://bugs.gentoo.org/690486
CC: Stephen Hemminger <stephen@networkplumber.org>
CC: netdev@vger.kernel.org
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
devlink/devlink.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index bb023c0c..0ea401ae 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -25,7 +25,6 @@
#include <linux/devlink.h>
#include <libmnl/libmnl.h>
#include <netinet/ether.h>
-#include <sys/queue.h>
#include "SNAPSHOT.h"
#include "list.h"
@@ -5981,13 +5980,13 @@ static int fmsg_value_show(struct dl *dl, int type, struct nlattr *nl_data)
struct nest_qentry {
int attr_type;
- TAILQ_ENTRY(nest_qentry) nest_entries;
+ struct list_head nest_entries;
};
struct fmsg_cb_data {
struct dl *dl;
uint8_t value_type;
- TAILQ_HEAD(, nest_qentry) qhead;
+ struct list_head qhead;
};
static int cmd_fmsg_nest_queue(struct fmsg_cb_data *fmsg_data,
@@ -6001,13 +6000,13 @@ static int cmd_fmsg_nest_queue(struct fmsg_cb_data *fmsg_data,
return -ENOMEM;
entry->attr_type = *attr_value;
- TAILQ_INSERT_HEAD(&fmsg_data->qhead, entry, nest_entries);
+ list_add(&fmsg_data->qhead, &entry->nest_entries);
} else {
- if (TAILQ_EMPTY(&fmsg_data->qhead))
+ if (list_empty(&fmsg_data->qhead))
return MNL_CB_ERROR;
- entry = TAILQ_FIRST(&fmsg_data->qhead);
+ entry = list_first_entry(&fmsg_data->qhead, struct nest_qentry, nest_entries);
*attr_value = entry->attr_type;
- TAILQ_REMOVE(&fmsg_data->qhead, entry, nest_entries);
+ list_del(&entry->nest_entries);
free(entry);
}
return MNL_CB_OK;
@@ -6116,7 +6115,7 @@ static int cmd_health_object_common(struct dl *dl, uint8_t cmd, uint16_t flags)
return err;
data.dl = dl;
- TAILQ_INIT(&data.qhead);
+ INIT_LIST_HEAD(&data.qhead);
err = _mnlg_socket_sndrcv(dl->nlg, nlh, cmd_fmsg_object_cb, &data);
return err;
}
--
2.22.0
^ permalink raw reply related
* Re: [PATCH 2/2] net: usb: qmi_wwan: Add the BroadMobi BM818 card
From: David Miller @ 2019-07-26 21:00 UTC (permalink / raw)
To: angus
Cc: kernel, bjorn, johan, gregkh, netdev, linux-usb, linux-kernel,
bob.ham
In-Reply-To: <20190724145227.27169-3-angus@akkea.ca>
From: "Angus Ainslie (Purism)" <angus@akkea.ca>
Date: Wed, 24 Jul 2019 07:52:27 -0700
> From: Bob Ham <bob.ham@puri.sm>
>
> The BroadMobi BM818 M.2 card uses the QMI protocol
>
> Signed-off-by: Bob Ham <bob.ham@puri.sm>
> Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next v4 6/6] net: mscc: PTP Hardware Clock (PHC) support
From: Saeed Mahameed @ 2019-07-26 20:52 UTC (permalink / raw)
To: antoine.tenart@bootlin.com, richardcochran@gmail.com,
davem@davemloft.net, UNGLinuxDriver@microchip.com,
alexandre.belloni@bootlin.com
Cc: netdev@vger.kernel.org, thomas.petazzoni@bootlin.com,
allan.nielsen@microchip.com
In-Reply-To: <20190725142707.9313-7-antoine.tenart@bootlin.com>
On Thu, 2019-07-25 at 16:27 +0200, Antoine Tenart wrote:
> This patch adds support for PTP Hardware Clock (PHC) to the Ocelot
> switch for both PTP 1-step and 2-step modes.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
> ---
> drivers/net/ethernet/mscc/ocelot.c | 394
> ++++++++++++++++++++++-
> drivers/net/ethernet/mscc/ocelot.h | 39 +++
> drivers/net/ethernet/mscc/ocelot_board.c | 111 ++++++-
> 3 files changed, 536 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/mscc/ocelot.c
> b/drivers/net/ethernet/mscc/ocelot.c
> index b71e4ecbe469..b08fcec73a30 100644
> --- a/drivers/net/ethernet/mscc/ocelot.c
> +++ b/drivers/net/ethernet/mscc/ocelot.c
> @@ -14,6 +14,7 @@
> #include <linux/module.h>
> #include <linux/netdevice.h>
> #include <linux/phy.h>
> +#include <linux/ptp_clock_kernel.h>
> #include <linux/skbuff.h>
> #include <linux/iopoll.h>
> #include <net/arp.h>
> @@ -538,7 +539,7 @@ static int ocelot_port_stop(struct net_device
> *dev)
> */
> static int ocelot_gen_ifh(u32 *ifh, struct frame_info *info)
> {
> - ifh[0] = IFH_INJ_BYPASS;
> + ifh[0] = IFH_INJ_BYPASS | ((0x1ff & info->rew_op) << 21);
> ifh[1] = (0xf00 & info->port) >> 8;
> ifh[2] = (0xff & info->port) << 24;
> ifh[3] = (info->tag_type << 16) | info->vid;
> @@ -548,6 +549,7 @@ static int ocelot_gen_ifh(u32 *ifh, struct
> frame_info *info)
>
> static int ocelot_port_xmit(struct sk_buff *skb, struct net_device
> *dev)
> {
> + struct skb_shared_info *shinfo = skb_shinfo(skb);
> struct ocelot_port *port = netdev_priv(dev);
> struct ocelot *ocelot = port->ocelot;
> u32 val, ifh[IFH_LEN];
> @@ -566,6 +568,14 @@ static int ocelot_port_xmit(struct sk_buff *skb,
> struct net_device *dev)
> info.port = BIT(port->chip_port);
> info.tag_type = IFH_TAG_TYPE_C;
> info.vid = skb_vlan_tag_get(skb);
> +
> + /* Check if timestamping is needed */
> + if (ocelot->ptp && shinfo->tx_flags & SKBTX_HW_TSTAMP) {
> + info.rew_op = port->ptp_cmd;
> + if (port->ptp_cmd == IFH_REW_OP_TWO_STEP_PTP)
> + info.rew_op |= (port->ts_id % 4) << 3;
> + }
> +
> ocelot_gen_ifh(ifh, &info);
>
> for (i = 0; i < IFH_LEN; i++)
> @@ -596,11 +606,51 @@ static int ocelot_port_xmit(struct sk_buff
> *skb, struct net_device *dev)
>
> dev->stats.tx_packets++;
> dev->stats.tx_bytes += skb->len;
> - dev_kfree_skb_any(skb);
> +
> + if (ocelot->ptp && shinfo->tx_flags & SKBTX_HW_TSTAMP &&
> + port->ptp_cmd == IFH_REW_OP_TWO_STEP_PTP) {
> + struct ocelot_skb *oskb =
> + kzalloc(sizeof(struct ocelot_skb), GFP_ATOMIC);
> +
Device drivers normally pre allocate descriptor info ring array to
avoid dynamic atomic allocations of private data on data path.
> + oskb->skb = skb;
> + oskb->id = port->ts_id % 4;
> + port->ts_id++;
missing skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; ?
see 3.1 Hardware Timestamping Implementation: Device Drivers
https://www.kernel.org/doc/Documentation/networking/timestamping.txt
> +
> + list_add_tail(&oskb->head, &port->skbs);
> + } else {
> + dev_kfree_skb_any(skb);
> + }
>
> return NETDEV_TX_OK;
> }
>
> +void ocelot_get_hwtimestamp(struct ocelot *ocelot, struct timespec64
> *ts)
> +{
> + unsigned long flags;
> + u32 val;
> +
> + spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
> +
> + /* Read current PTP time to get seconds */
> + val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN);
> +
> + val &= ~(PTP_PIN_CFG_SYNC | PTP_PIN_CFG_ACTION_MASK |
> PTP_PIN_CFG_DOM);
> + val |= PTP_PIN_CFG_ACTION(PTP_PIN_ACTION_SAVE);
> + ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN);
> + ts->tv_sec = ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_LSB,
> TOD_ACC_PIN);
> +
> + /* Read packet HW timestamp from FIFO */
> + val = ocelot_read(ocelot, SYS_PTP_TXSTAMP);
> + ts->tv_nsec = SYS_PTP_TXSTAMP_PTP_TXSTAMP(val);
> +
> + /* Sec has incremented since the ts was registered */
> + if ((ts->tv_sec & 0x1) != !!(val &
> SYS_PTP_TXSTAMP_PTP_TXSTAMP_SEC))
> + ts->tv_sec--;
> +
> + spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
> +}
> +EXPORT_SYMBOL(ocelot_get_hwtimestamp);
> +
Why EXPORT_SYMBOL? this is the last patch and it is touching one
driver.
> static int ocelot_mc_unsync(struct net_device *dev, const unsigned
> char *addr)
> {
> struct ocelot_port *port = netdev_priv(dev);
> @@ -917,6 +967,97 @@ static int ocelot_get_port_parent_id(struct
> net_device *dev,
> return 0;
> }
>
> +static int ocelot_hwstamp_get(struct ocelot_port *port, struct ifreq
> *ifr)
> +{
> + struct ocelot *ocelot = port->ocelot;
> +
> + return copy_to_user(ifr->ifr_data, &ocelot->hwtstamp_config,
> + sizeof(ocelot->hwtstamp_config)) ? -EFAULT
> : 0;
> +}
> +
> +static int ocelot_hwstamp_set(struct ocelot_port *port, struct ifreq
> *ifr)
> +{
> + struct ocelot *ocelot = port->ocelot;
> + struct hwtstamp_config cfg;
> +
> + if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
> + return -EFAULT;
> +
> + /* reserved for future extensions */
> + if (cfg.flags)
> + return -EINVAL;
> +
> + /* Tx type sanity check */
> + switch (cfg.tx_type) {
> + case HWTSTAMP_TX_ON:
> + port->ptp_cmd = IFH_REW_OP_TWO_STEP_PTP;
> + break;
> + case HWTSTAMP_TX_ONESTEP_SYNC:
> + /* IFH_REW_OP_ONE_STEP_PTP updates the correctional
> field, we
> + * need to update the origin time.
> + */
> + port->ptp_cmd = IFH_REW_OP_ORIGIN_PTP;
> + break;
> + case HWTSTAMP_TX_OFF:
> + port->ptp_cmd = 0;
> + break;
> + default:
> + return -ERANGE;
> + }
> +
> + mutex_lock(&ocelot->ptp_lock);
> +
> + switch (cfg.rx_filter) {
> + case HWTSTAMP_FILTER_NONE:
> + break;
> + case HWTSTAMP_FILTER_ALL:
> + case HWTSTAMP_FILTER_SOME:
> + case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
> + case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
> + case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
> + case HWTSTAMP_FILTER_NTP_ALL:
> + case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
> + case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
> + case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
> + case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
> + case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
> + case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ:
> + case HWTSTAMP_FILTER_PTP_V2_EVENT:
> + case HWTSTAMP_FILTER_PTP_V2_SYNC:
> + case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
> + cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
> + break;
> + default:
> + mutex_unlock(&ocelot->ptp_lock);
> + return -ERANGE;
> + }
> +
> + /* Commit back the result & save it */
> + memcpy(&ocelot->hwtstamp_config, &cfg, sizeof(cfg));
> + mutex_unlock(&ocelot->ptp_lock);
> +
> + return copy_to_user(ifr->ifr_data, &cfg, sizeof(cfg)) ? -EFAULT
> : 0;
> +}
> +
> +static int ocelot_ioctl(struct net_device *dev, struct ifreq *ifr,
> int cmd)
> +{
> + struct ocelot_port *port = netdev_priv(dev);
> + struct ocelot *ocelot = port->ocelot;
> +
> + /* The function is only used for PTP operations for now */
> + if (!ocelot->ptp)
> + return -EOPNOTSUPP;
> +
> + switch (cmd) {
> + case SIOCSHWTSTAMP:
> + return ocelot_hwstamp_set(port, ifr);
> + case SIOCGHWTSTAMP:
> + return ocelot_hwstamp_get(port, ifr);
> + default:
> + return -EOPNOTSUPP;
> + }
> +}
> +
> static const struct net_device_ops ocelot_port_netdev_ops = {
> .ndo_open = ocelot_port_open,
> .ndo_stop = ocelot_port_stop,
> @@ -933,6 +1074,7 @@ static const struct net_device_ops
> ocelot_port_netdev_ops = {
> .ndo_set_features = ocelot_set_features,
> .ndo_get_port_parent_id = ocelot_get_port_parent_id,
> .ndo_setup_tc = ocelot_setup_tc,
> + .ndo_do_ioctl = ocelot_ioctl,
> };
>
> static void ocelot_get_strings(struct net_device *netdev, u32 sset,
> u8 *data)
> @@ -1014,12 +1156,37 @@ static int ocelot_get_sset_count(struct
> net_device *dev, int sset)
> return ocelot->num_stats;
> }
>
> +static int ocelot_get_ts_info(struct net_device *dev,
> + struct ethtool_ts_info *info)
> +{
> + struct ocelot_port *ocelot_port = netdev_priv(dev);
> + struct ocelot *ocelot = ocelot_port->ocelot;
> +
> + if (!ocelot->ptp)
> + return ethtool_op_get_ts_info(dev, info);
> +
> + info->phc_index = ocelot->ptp_clock ?
> + ptp_clock_index(ocelot->ptp_clock) : -1;
> + info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE |
> + SOF_TIMESTAMPING_RX_SOFTWARE |
> + SOF_TIMESTAMPING_SOFTWARE |
> + SOF_TIMESTAMPING_TX_HARDWARE |
> + SOF_TIMESTAMPING_RX_HARDWARE |
> + SOF_TIMESTAMPING_RAW_HARDWARE;
> + info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON) |
> + BIT(HWTSTAMP_TX_ONESTEP_SYNC);
> + info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) |
> BIT(HWTSTAMP_FILTER_ALL);
> +
> + return 0;
> +}
> +
> static const struct ethtool_ops ocelot_ethtool_ops = {
> .get_strings = ocelot_get_strings,
> .get_ethtool_stats = ocelot_get_ethtool_stats,
> .get_sset_count = ocelot_get_sset_count,
> .get_link_ksettings = phy_ethtool_get_link_ksettings,
> .set_link_ksettings = phy_ethtool_set_link_ksettings,
> + .get_ts_info = ocelot_get_ts_info,
> };
>
> static int ocelot_port_attr_stp_state_set(struct ocelot_port
> *ocelot_port,
> @@ -1629,6 +1796,196 @@ struct notifier_block
> ocelot_switchdev_blocking_nb __read_mostly = {
> };
> EXPORT_SYMBOL(ocelot_switchdev_blocking_nb);
>
> +int ocelot_ptp_gettime64(struct ptp_clock_info *ptp, struct
> timespec64 *ts)
> +{
> + struct ocelot *ocelot = container_of(ptp, struct ocelot,
> ptp_info);
> + unsigned long flags;
> + time64_t s;
> + u32 val;
> + s64 ns;
> +
> + spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
> +
> + val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN);
> + val &= ~(PTP_PIN_CFG_SYNC | PTP_PIN_CFG_ACTION_MASK |
> PTP_PIN_CFG_DOM);
> + val |= PTP_PIN_CFG_ACTION(PTP_PIN_ACTION_SAVE);
> + ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN);
> +
> + s = ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_MSB, TOD_ACC_PIN) &
> 0xffff;
> + s <<= 32;
> + s += ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_LSB, TOD_ACC_PIN);
> + ns = ocelot_read_rix(ocelot, PTP_PIN_TOD_NSEC, TOD_ACC_PIN);
> +
> + spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
> +
> + /* Deal with negative values */
> + if (ns >= 0x3ffffff0 && ns <= 0x3fffffff) {
> + s--;
> + ns &= 0xf;
> + ns += 999999984;
> + }
> +
> + set_normalized_timespec64(ts, s, ns);
> + return 0;
> +}
> +EXPORT_SYMBOL(ocelot_ptp_gettime64);
> +
> +static int ocelot_ptp_settime64(struct ptp_clock_info *ptp,
> + const struct timespec64 *ts)
> +{
> + struct ocelot *ocelot = container_of(ptp, struct ocelot,
> ptp_info);
> + unsigned long flags;
> + u32 val;
> +
> + spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
> +
> + val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN);
> + val &= ~(PTP_PIN_CFG_SYNC | PTP_PIN_CFG_ACTION_MASK |
> PTP_PIN_CFG_DOM);
> + val |= PTP_PIN_CFG_ACTION(PTP_PIN_ACTION_IDLE);
> +
> + ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN);
> +
> + ocelot_write_rix(ocelot, lower_32_bits(ts->tv_sec),
> PTP_PIN_TOD_SEC_LSB,
> + TOD_ACC_PIN);
> + ocelot_write_rix(ocelot, upper_32_bits(ts->tv_sec),
> PTP_PIN_TOD_SEC_MSB,
> + TOD_ACC_PIN);
> + ocelot_write_rix(ocelot, ts->tv_nsec, PTP_PIN_TOD_NSEC,
> TOD_ACC_PIN);
> +
> + val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN);
> + val &= ~(PTP_PIN_CFG_SYNC | PTP_PIN_CFG_ACTION_MASK |
> PTP_PIN_CFG_DOM);
> + val |= PTP_PIN_CFG_ACTION(PTP_PIN_ACTION_LOAD);
> +
> + ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN);
> +
> + spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
> + return 0;
> +}
> +
> +static int ocelot_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
> +{
> + if (delta > -(NSEC_PER_SEC / 2) && delta < (NSEC_PER_SEC / 2))
> {
> + struct ocelot *ocelot = container_of(ptp, struct
> ocelot, ptp_info);
> + unsigned long flags;
> + u32 val;
> +
> + spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
> +
> + val = ocelot_read_rix(ocelot, PTP_PIN_CFG,
> TOD_ACC_PIN);
> + val &= ~(PTP_PIN_CFG_SYNC | PTP_PIN_CFG_ACTION_MASK |
> PTP_PIN_CFG_DOM);
> + val |= PTP_PIN_CFG_ACTION(PTP_PIN_ACTION_IDLE);
> +
> + ocelot_write_rix(ocelot, val, PTP_PIN_CFG,
> TOD_ACC_PIN);
> +
> + ocelot_write_rix(ocelot, 0, PTP_PIN_TOD_SEC_LSB,
> TOD_ACC_PIN);
> + ocelot_write_rix(ocelot, 0, PTP_PIN_TOD_SEC_MSB,
> TOD_ACC_PIN);
> + ocelot_write_rix(ocelot, delta, PTP_PIN_TOD_NSEC,
> TOD_ACC_PIN);
> +
> + val = ocelot_read_rix(ocelot, PTP_PIN_CFG,
> TOD_ACC_PIN);
> + val &= ~(PTP_PIN_CFG_SYNC | PTP_PIN_CFG_ACTION_MASK |
> PTP_PIN_CFG_DOM);
> + val |= PTP_PIN_CFG_ACTION(PTP_PIN_ACTION_DELTA);
> +
> + ocelot_write_rix(ocelot, val, PTP_PIN_CFG,
> TOD_ACC_PIN);
> +
> + spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
> + } else {
> + /* Fall back using ocelot_ptp_settime64 which is not
> exact. */
> + struct timespec64 ts;
> + u64 now;
> +
> + ocelot_ptp_gettime64(ptp, &ts);
> +
> + now = ktime_to_ns(timespec64_to_ktime(ts));
> + ts = ns_to_timespec64(now + delta);
> +
> + ocelot_ptp_settime64(ptp, &ts);
> + }
> + return 0;
> +}
> +
> +static int ocelot_ptp_adjfine(struct ptp_clock_info *ptp, long
> scaled_ppm)
> +{
> + struct ocelot *ocelot = container_of(ptp, struct ocelot,
> ptp_info);
> + u32 unit = 0, direction = 0;
> + unsigned long flags;
> + u64 adj = 0;
> +
> + spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
> +
> + if (!scaled_ppm)
> + goto disable_adj;
> +
> + if (scaled_ppm < 0) {
> + direction = PTP_CFG_CLK_ADJ_CFG_DIR;
> + scaled_ppm = -scaled_ppm;
> + }
> +
> + adj = PSEC_PER_SEC << 16;
> + do_div(adj, scaled_ppm);
> + do_div(adj, 1000);
> +
> + /* If the adjustment value is too large, use ns instead */
> + if (adj >= (1L << 30)) {
> + unit = PTP_CFG_CLK_ADJ_FREQ_NS;
> + do_div(adj, 1000);
> + }
> +
> + /* Still too big */
> + if (adj >= (1L << 30))
> + goto disable_adj;
> +
> + ocelot_write(ocelot, unit | adj, PTP_CLK_CFG_ADJ_FREQ);
> + ocelot_write(ocelot, PTP_CFG_CLK_ADJ_CFG_ENA | direction,
> + PTP_CLK_CFG_ADJ_CFG);
> +
> + spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
> + return 0;
> +
> +disable_adj:
> + ocelot_write(ocelot, 0, PTP_CLK_CFG_ADJ_CFG);
> +
> + spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
> + return 0;
> +}
> +
> +static struct ptp_clock_info ocelot_ptp_clock_info = {
> + .owner = THIS_MODULE,
> + .name = "ocelot ptp",
> + .max_adj = 0x7fffffff,
> + .n_alarm = 0,
> + .n_ext_ts = 0,
> + .n_per_out = 0,
> + .n_pins = 0,
> + .pps = 0,
> + .gettime64 = ocelot_ptp_gettime64,
> + .settime64 = ocelot_ptp_settime64,
> + .adjtime = ocelot_ptp_adjtime,
> + .adjfine = ocelot_ptp_adjfine,
> +};
> +
> +static int ocelot_init_timestamp(struct ocelot *ocelot)
> +{
> + ocelot->ptp_info = ocelot_ptp_clock_info;
> + ocelot->ptp_clock = ptp_clock_register(&ocelot->ptp_info,
> ocelot->dev);
> + if (IS_ERR(ocelot->ptp_clock))
> + return PTR_ERR(ocelot->ptp_clock);
> + /* Check if PHC support is missing at the configuration level
> */
> + if (!ocelot->ptp_clock)
> + return 0;
> +
> + ocelot_write(ocelot, SYS_PTP_CFG_PTP_STAMP_WID(30),
> SYS_PTP_CFG);
> + ocelot_write(ocelot, 0xffffffff, ANA_TABLES_PTP_ID_LOW);
> + ocelot_write(ocelot, 0xffffffff, ANA_TABLES_PTP_ID_HIGH);
> +
> + ocelot_write(ocelot, PTP_CFG_MISC_PTP_EN, PTP_CFG_MISC);
> +
> + /* There is no device reconfiguration, PTP Rx stamping is
> always
> + * enabled.
> + */
> + ocelot->hwtstamp_config.rx_filter =
> HWTSTAMP_FILTER_PTP_V2_EVENT;
> +
> + return 0;
> +}
> +
> int ocelot_probe_port(struct ocelot *ocelot, u8 port,
> void __iomem *regs,
> struct phy_device *phy)
> @@ -1661,6 +2018,8 @@ int ocelot_probe_port(struct ocelot *ocelot, u8
> port,
> ocelot_mact_learn(ocelot, PGID_CPU, dev->dev_addr, ocelot_port-
> >pvid,
> ENTRYTYPE_LOCKED);
>
> + INIT_LIST_HEAD(&ocelot_port->skbs);
> +
> err = register_netdev(dev);
> if (err) {
> dev_err(ocelot->dev, "register_netdev failed\n");
> @@ -1684,7 +2043,7 @@ EXPORT_SYMBOL(ocelot_probe_port);
> int ocelot_init(struct ocelot *ocelot)
> {
> u32 port;
> - int i, cpu = ocelot->num_phys_ports;
> + int i, ret, cpu = ocelot->num_phys_ports;
> char queue_name[32];
>
> ocelot->lags = devm_kcalloc(ocelot->dev, ocelot-
> >num_phys_ports,
> @@ -1699,6 +2058,8 @@ int ocelot_init(struct ocelot *ocelot)
> return -ENOMEM;
>
> mutex_init(&ocelot->stats_lock);
> + mutex_init(&ocelot->ptp_lock);
> + spin_lock_init(&ocelot->ptp_clock_lock);
> snprintf(queue_name, sizeof(queue_name), "%s-stats",
> dev_name(ocelot->dev));
> ocelot->stats_queue =
> create_singlethread_workqueue(queue_name);
> @@ -1812,15 +2173,42 @@ int ocelot_init(struct ocelot *ocelot)
> INIT_DELAYED_WORK(&ocelot->stats_work,
> ocelot_check_stats_work);
> queue_delayed_work(ocelot->stats_queue, &ocelot->stats_work,
> OCELOT_STATS_CHECK_DELAY);
> +
> + if (ocelot->ptp) {
> + ret = ocelot_init_timestamp(ocelot);
> + if (ret) {
> + dev_err(ocelot->dev,
> + "Timestamp initialization failed\n");
> + return ret;
> + }
> + }
> +
> return 0;
> }
> EXPORT_SYMBOL(ocelot_init);
>
> void ocelot_deinit(struct ocelot *ocelot)
> {
> + struct list_head *pos, *tmp;
> + struct ocelot_port *port;
> + struct ocelot_skb *entry;
> + int i;
> +
> destroy_workqueue(ocelot->stats_queue);
> mutex_destroy(&ocelot->stats_lock);
> ocelot_ace_deinit();
> +
> + for (i = 0; i < ocelot->num_phys_ports; i++) {
> + port = ocelot->ports[i];
> +
> + list_for_each_safe(pos, tmp, &port->skbs) {
> + entry = list_entry(pos, struct ocelot_skb,
> head);
> +
> + list_del(pos);
> + dev_kfree_skb_any(entry->skb);
> + kfree(entry);
> + }
> + }
> }
> EXPORT_SYMBOL(ocelot_deinit);
>
> diff --git a/drivers/net/ethernet/mscc/ocelot.h
> b/drivers/net/ethernet/mscc/ocelot.h
> index 515dee6fa8a6..e40773c01a44 100644
> --- a/drivers/net/ethernet/mscc/ocelot.h
> +++ b/drivers/net/ethernet/mscc/ocelot.h
> @@ -11,9 +11,11 @@
> #include <linux/bitops.h>
> #include <linux/etherdevice.h>
> #include <linux/if_vlan.h>
> +#include <linux/net_tstamp.h>
> #include <linux/phy.h>
> #include <linux/phy/phy.h>
> #include <linux/platform_device.h>
> +#include <linux/ptp_clock_kernel.h>
> #include <linux/regmap.h>
>
> #include "ocelot_ana.h"
> @@ -39,6 +41,8 @@
>
> #define OCELOT_STATS_CHECK_DELAY (2 * HZ)
>
> +#define OCELOT_PTP_QUEUE_SZ 128
> +
> #define IFH_LEN 4
>
> struct frame_info {
> @@ -46,6 +50,8 @@ struct frame_info {
> u16 port;
> u16 vid;
> u8 tag_type;
> + u16 rew_op;
> + u32 timestamp; /* rew_val */
> };
>
> #define IFH_INJ_BYPASS BIT(31)
> @@ -54,6 +60,12 @@ struct frame_info {
> #define IFH_TAG_TYPE_C 0
> #define IFH_TAG_TYPE_S 1
>
> +#define IFH_REW_OP_NOOP 0x0
> +#define IFH_REW_OP_DSCP 0x1
> +#define IFH_REW_OP_ONE_STEP_PTP 0x2
> +#define IFH_REW_OP_TWO_STEP_PTP 0x3
> +#define IFH_REW_OP_ORIGIN_PTP 0x5
> +
> #define OCELOT_SPEED_2500 0
> #define OCELOT_SPEED_1000 1
> #define OCELOT_SPEED_100 2
> @@ -401,6 +413,13 @@ enum ocelot_regfield {
> REGFIELD_MAX
> };
>
> +enum ocelot_clk_pins {
> + ALT_PPS_PIN = 1,
> + EXT_CLK_PIN,
> + ALT_LDST_PIN,
> + TOD_ACC_PIN
> +};
> +
> struct ocelot_multicast {
> struct list_head list;
> unsigned char addr[ETH_ALEN];
> @@ -450,6 +469,13 @@ struct ocelot {
> u64 *stats;
> struct delayed_work stats_work;
> struct workqueue_struct *stats_queue;
> +
> + u8 ptp:1;
> + struct ptp_clock *ptp_clock;
> + struct ptp_clock_info ptp_info;
> + struct hwtstamp_config hwtstamp_config;
> + struct mutex ptp_lock; /* Protects the PTP interface state */
> + spinlock_t ptp_clock_lock; /* Protects the PTP clock */
> };
>
> struct ocelot_port {
> @@ -473,6 +499,16 @@ struct ocelot_port {
> struct phy *serdes;
>
> struct ocelot_port_tc tc;
> +
> + u8 ptp_cmd;
> + struct list_head skbs;
> + u8 ts_id;
> +};
> +
> +struct ocelot_skb {
> + struct list_head head;
> + struct sk_buff *skb;
> + u8 id;
> };
>
> u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset);
> @@ -517,4 +553,7 @@ extern struct notifier_block ocelot_netdevice_nb;
> extern struct notifier_block ocelot_switchdev_nb;
> extern struct notifier_block ocelot_switchdev_blocking_nb;
>
> +int ocelot_ptp_gettime64(struct ptp_clock_info *ptp, struct
> timespec64 *ts);
> +void ocelot_get_hwtimestamp(struct ocelot *ocelot, struct timespec64
> *ts);
> +
> #endif
> diff --git a/drivers/net/ethernet/mscc/ocelot_board.c
> b/drivers/net/ethernet/mscc/ocelot_board.c
> index df8d15994a89..0b14e7110e7f 100644
> --- a/drivers/net/ethernet/mscc/ocelot_board.c
> +++ b/drivers/net/ethernet/mscc/ocelot_board.c
> @@ -31,6 +31,8 @@ static int ocelot_parse_ifh(u32 *_ifh, struct
> frame_info *info)
>
> info->len = OCELOT_BUFFER_CELL_SZ * wlen + llen - 80;
>
> + info->timestamp = IFH_EXTRACT_BITFIELD64(ifh[0], 21, 32);
> +
> info->port = IFH_EXTRACT_BITFIELD64(ifh[1], 43, 4);
>
> info->tag_type = IFH_EXTRACT_BITFIELD64(ifh[1], 16, 1);
> @@ -98,7 +100,11 @@ static irqreturn_t ocelot_xtr_irq_handler(int
> irq, void *arg)
> int sz, len, buf_len;
> u32 ifh[4];
> u32 val;
> - struct frame_info info;
> + struct frame_info info = {};
> + struct timespec64 ts;
> + struct skb_shared_hwtstamps *shhwtstamps;
> + u64 tod_in_ns;
> + u64 full_ts_in_ns;
reverse xmas tree.
>
> for (i = 0; i < IFH_LEN; i++) {
> err = ocelot_rx_frame_word(ocelot, grp, true,
> &ifh[i]);
> @@ -145,6 +151,22 @@ static irqreturn_t ocelot_xtr_irq_handler(int
> irq, void *arg)
> break;
> }
>
> + if (ocelot->ptp) {
> + ocelot_ptp_gettime64(&ocelot->ptp_info, &ts);
> +
> + tod_in_ns = ktime_set(ts.tv_sec, ts.tv_nsec);
> + if ((tod_in_ns & 0xffffffff) < info.timestamp)
> + full_ts_in_ns = (((tod_in_ns >> 32) -
> 1) << 32) |
> + info.timestamp;
> + else
> + full_ts_in_ns = (tod_in_ns &
> GENMASK_ULL(63, 32)) |
> + info.timestamp;
> +
> + shhwtstamps = skb_hwtstamps(skb);
> + memset(shhwtstamps, 0, sizeof(struct
> skb_shared_hwtstamps));
> + shhwtstamps->hwtstamp = full_ts_in_ns;
the right way to set the timestamp is by calling:
skb_tstamp_tx(skb, &tstamp);
> + }
> +
> /* Everything we see on an interface that is in the HW
> bridge
> * has already been forwarded.
> */
> @@ -164,6 +186,70 @@ static irqreturn_t ocelot_xtr_irq_handler(int
> irq, void *arg)
> return IRQ_HANDLED;
> }
>
> +static irqreturn_t ocelot_ptp_rdy_irq_handler(int irq, void *arg)
> +{
> + int budget = OCELOT_PTP_QUEUE_SZ;
> + struct ocelot *ocelot = arg;
> +
> + do {
> + struct skb_shared_hwtstamps shhwtstamps;
> + struct list_head *pos, *tmp;
> + struct sk_buff *skb = NULL;
> + struct ocelot_skb *entry;
> + struct ocelot_port *port;
> + struct timespec64 ts;
> + u32 val, id, txport;
> +
> + /* Prevent from infinite loop */
> + if (unlikely(!--budget))
> + break;
when budget gets to 1 you break, while you still have 1 to go :)
I assume OCELOT_PTP_QUEUE_SZ > 0, just make this the loop condition and
avoid infinite loops by design.
> +
> + val = ocelot_read(ocelot, SYS_PTP_STATUS);
> +
> + /* Check if a timestamp can be retrieved */
> + if (!(val & SYS_PTP_STATUS_PTP_MESS_VLD))
> + break;
> +
> + WARN_ON(val & SYS_PTP_STATUS_PTP_OVFL);
> +
> + /* Retrieve the ts ID and Tx port */
> + id = SYS_PTP_STATUS_PTP_MESS_ID_X(val);
> + txport = SYS_PTP_STATUS_PTP_MESS_TXPORT_X(val);
> +
> + /* Retrieve its associated skb */
> + port = ocelot->ports[txport];
> +
> + list_for_each_safe(pos, tmp, &port->skbs) {
> + entry = list_entry(pos, struct ocelot_skb,
> head);
> + if (entry->id != id)
> + continue;
> +
> + skb = entry->skb;
> +
> + list_del(pos);
> + kfree(entry);
> + }
> +
> + /* Next ts */
> + ocelot_write(ocelot, SYS_PTP_NXT_PTP_NXT, SYS_PTP_NXT);
> +
> + if (unlikely(!skb))
> + continue;
> +
> + /* Get the h/w timestamp */
> + ocelot_get_hwtimestamp(ocelot, &ts);
> +
> + /* Set the timestamp into the skb */
> + memset(&shhwtstamps, 0, sizeof(shhwtstamps));
> + shhwtstamps.hwtstamp = ktime_set(ts.tv_sec,
> ts.tv_nsec);
> + skb_tstamp_tx(skb, &shhwtstamps);
> +
> + dev_kfree_skb_any(skb);
> + } while (true);
> +
> + return IRQ_HANDLED;
> +}
> +
> static const struct of_device_id mscc_ocelot_match[] = {
> { .compatible = "mscc,vsc7514-switch" },
> { }
> @@ -172,8 +258,8 @@ MODULE_DEVICE_TABLE(of, mscc_ocelot_match);
>
> static int mscc_ocelot_probe(struct platform_device *pdev)
> {
> - int err, irq;
> unsigned int i;
> + int err, irq_xtr, irq_ptp_rdy;
> struct device_node *np = pdev->dev.of_node;
> struct device_node *ports, *portnp;
> struct ocelot *ocelot;
reverse xmas tree
> @@ -232,16 +318,31 @@ static int mscc_ocelot_probe(struct
> platform_device *pdev)
> if (err)
> return err;
>
> - irq = platform_get_irq_byname(pdev, "xtr");
> - if (irq < 0)
> + irq_xtr = platform_get_irq_byname(pdev, "xtr");
> + if (irq_xtr < 0)
> return -ENODEV;
>
> - err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
> + err = devm_request_threaded_irq(&pdev->dev, irq_xtr, NULL,
> ocelot_xtr_irq_handler,
> IRQF_ONESHOT,
> "frame extraction", ocelot);
> if (err)
> return err;
>
> +
> + irq_ptp_rdy = platform_get_irq_byname(pdev, "ptp_rdy");
> + if (irq_ptp_rdy > 0) {
> + err = devm_request_threaded_irq(&pdev->dev,
> irq_ptp_rdy, NULL,
> + ocelot_ptp_rdy_irq_hand
> ler,
> + IRQF_ONESHOT, "ptp
> ready",
> + ocelot);
> + if (err)
> + return err;
> +
> + /* Check if we can support PTP */
> + if (ocelot->targets[PTP])
> + ocelot->ptp = 1;
> + }
> +
> regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_INIT],
> 1);
> regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA],
> 1);
>
^ permalink raw reply
* Re: [PATCH v2 bpf] libbpf: fix missing __WORDSIZE definition
From: Arnaldo Carvalho de Melo @ 2019-07-26 20:49 UTC (permalink / raw)
To: Daniel Borkmann, Andrii Nakryiko
Cc: bpf, netdev, ast, daniel, acme, andrii.nakryiko, kernel-team
In-Reply-To: <20190718173021.2418606-1-andriin@fb.com>
Em Thu, Jul 18, 2019 at 10:30:21AM -0700, Andrii Nakryiko escreveu:
> hashmap.h depends on __WORDSIZE being defined. It is defined by
> glibc/musl in different headers. It's an explicit goal for musl to be
> "non-detectable" at compilation time, so instead include glibc header if
> glibc is explicitly detected and fall back to musl header otherwise.
>
> Fixes: e3b924224028 ("libbpf: add resizable non-thread safe internal hashmap")
> Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Couldn't find ths in the bpf tree, please consider applying it:
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
- Arnaldo
> ---
> tools/lib/bpf/hashmap.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tools/lib/bpf/hashmap.h b/tools/lib/bpf/hashmap.h
> index 03748a742146..bae8879cdf58 100644
> --- a/tools/lib/bpf/hashmap.h
> +++ b/tools/lib/bpf/hashmap.h
> @@ -10,6 +10,11 @@
>
> #include <stdbool.h>
> #include <stddef.h>
> +#ifdef __GLIBC__
> +#include <bits/wordsize.h>
> +#else
> +#include <bits/reg.h>
> +#endif
> #include "libbpf_internal.h"
>
> static inline size_t hash_bits(size_t h, int bits)
> --
> 2.17.1
--
- Arnaldo
^ permalink raw reply
* Re: [REGRESSION] 5.3-rc1: r8169: remove 1000/Half from supported modes
From: Bernhard Held @ 2019-07-26 20:45 UTC (permalink / raw)
To: Heiner Kallweit, linux-kernel, netdev; +Cc: David S. Miller
In-Reply-To: <0a48ecd7-7134-222d-833d-c1f65e055c02@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 786 bytes --]
On 26.07.19 at 22:24, Heiner Kallweit wrote:
> On 26.07.2019 22:16, Bernhard Held wrote:
>> Hi Heiner,
>>
>> with commit a6851c613fd7 "r8169: remove 1000/Half from supported modes" my RTL8111B GB-link stops working. It thinks that it established a link, however nothing is actually transmitted. Setting the mode with `mii-tool -F 100baseTx-HD` establishes a successful connection.
>>
> Can you provide standard ethtool output w/ and w/o this patch? Also a full dmesg output
> with the patch would be helpful.
> Is "100baseTx-HD" a typo and you mean GBit? And any special reason why you set half duplex?
>
The requested files are attached.
mii-tool doesn't offer GBit settings. I used HD only while playing around, both FD and HD are working.
Hope it helps!
Bernhard
[-- Attachment #2: dmesg.bad --]
[-- Type: text/plain, Size: 64574 bytes --]
[ 0.000000] Linux version 5.3.0-rc1-linus+ (berny@quad) (gcc version 9.1.1 20190723 [gcc-9-branch revision 273734] (SUSE Linux)) #597 SMP PREEMPT Fri Jul 26 21:33:15 CEST 2019
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-5.3.0-rc1-linus+ root=/dev/mapper/VGMX300-root resume=/dev/sda2 showopts radeon.dpm=1 plymouth.enable=0 memmap=1$0xe4fd net.ifnames=0 kvm-intel.vmentry_l1d_flush=never noibrs noibpb nospectre_v1 no_stf_barrier mitigations=off
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] zhaoxin Shanghai
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Enabled xstate features 0x3, context size is 576 bytes, using 'standard' format.
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009dbff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009f800-0x000000000009ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000cfedffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000cfee0000-0x00000000cfee2fff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x00000000cfee3000-0x00000000cfeeffff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x00000000cfef0000-0x00000000cfefffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000d0000000-0x00000000dfffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000ffffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x00000001afffffff] usable
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] user-defined physical RAM map:
[ 0.000000] user: [mem 0x0000000000000000-0x000000000000e4fc] usable
[ 0.000000] user: [mem 0x000000000000e4fd-0x000000000000e4fd] reserved
[ 0.000000] user: [mem 0x000000000000e4fe-0x000000000009dbff] usable
[ 0.000000] user: [mem 0x000000000009f800-0x000000000009ffff] reserved
[ 0.000000] user: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[ 0.000000] user: [mem 0x0000000000100000-0x00000000cfedffff] usable
[ 0.000000] user: [mem 0x00000000cfee0000-0x00000000cfee2fff] ACPI NVS
[ 0.000000] user: [mem 0x00000000cfee3000-0x00000000cfeeffff] ACPI data
[ 0.000000] user: [mem 0x00000000cfef0000-0x00000000cfefffff] reserved
[ 0.000000] user: [mem 0x00000000d0000000-0x00000000dfffffff] reserved
[ 0.000000] user: [mem 0x00000000fec00000-0x00000000ffffffff] reserved
[ 0.000000] user: [mem 0x0000000100000000-0x00000001afffffff] usable
[ 0.000000] SMBIOS 2.4 present.
[ 0.000000] DMI: Gigabyte Technology Co., Ltd. G33-DS3R/G33-DS3R, BIOS F7L 07/31/2009
[ 0.000000] tsc: Fast TSC calibration using PIT
[ 0.000000] tsc: Detected 3000.288 MHz processor
[ 0.003646] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[ 0.003648] e820: remove [mem 0x000a0000-0x000fffff] usable
[ 0.003651] last_pfn = 0x1b0000 max_arch_pfn = 0x400000000
[ 0.003655] MTRR default type: uncachable
[ 0.003655] MTRR fixed ranges enabled:
[ 0.003656] 00000-9FFFF write-back
[ 0.003657] A0000-BFFFF uncachable
[ 0.003657] C0000-CDFFF write-protect
[ 0.003658] CE000-EFFFF uncachable
[ 0.003658] F0000-FFFFF write-through
[ 0.003659] MTRR variable ranges enabled:
[ 0.003660] 0 base 0000000000 mask 0F00000000 write-back
[ 0.003661] 1 base 00E0000000 mask 0FE0000000 uncachable
[ 0.003662] 2 base 00D0000000 mask 0FF0000000 uncachable
[ 0.003663] 3 base 0100000000 mask 0F00000000 write-back
[ 0.003664] 4 base 01C0000000 mask 0FC0000000 uncachable
[ 0.003664] 5 base 01B0000000 mask 0FF0000000 uncachable
[ 0.003665] 6 base 00CFF00000 mask 0FFFF00000 uncachable
[ 0.003666] 7 disabled
[ 0.005930] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT
[ 0.006189] mtrr: your BIOS has configured an incorrect mask, fixing it.
[ 0.006194] mtrr: your BIOS has configured an incorrect mask, fixing it.
[ 0.006195] mtrr: your BIOS has configured an incorrect mask, fixing it.
[ 0.006196] mtrr: your BIOS has configured an incorrect mask, fixing it.
[ 0.006196] mtrr: your BIOS has configured an incorrect mask, fixing it.
[ 0.006197] mtrr: your BIOS has configured an incorrect mask, fixing it.
[ 0.006198] mtrr: your BIOS has configured an incorrect mask, fixing it.
[ 0.006203] total RAM covered: 6143M
[ 0.006525] Found optimal setting for mtrr clean up
[ 0.006527] gran_size: 64K chunk_size: 2M num_reg: 7 lose cover RAM: 0G
[ 0.007753] e820: update [mem 0xcff00000-0xffffffff] usable ==> reserved
[ 0.007757] last_pfn = 0xcfee0 max_arch_pfn = 0x400000000
[ 0.007772] Kernel/User page tables isolation: disabled on command line.
[ 0.007776] BRK [0x02601000, 0x02601fff] PGTABLE
[ 0.007778] BRK [0x02602000, 0x02602fff] PGTABLE
[ 0.007779] BRK [0x02603000, 0x02603fff] PGTABLE
[ 0.007841] BRK [0x02604000, 0x02604fff] PGTABLE
[ 0.008266] BRK [0x02605000, 0x02605fff] PGTABLE
[ 0.008277] BRK [0x02606000, 0x02606fff] PGTABLE
[ 0.008334] RAMDISK: [mem 0x36ba7000-0x375cafff]
[ 0.008339] ACPI: Early table checksum verification disabled
[ 0.008344] ACPI: RSDP 0x00000000000F6ED0 000014 (v00 GBT )
[ 0.008348] ACPI: RSDT 0x00000000CFEE3040 000038 (v01 GBT GBTUACPI 42302E31 GBTU 01010101)
[ 0.008353] ACPI: FACP 0x00000000CFEE30C0 000074 (v01 GBT GBTUACPI 42302E31 GBTU 01010101)
[ 0.008358] ACPI: DSDT 0x00000000CFEE3180 0053A1 (v01 GBT GBTUACPI 00001000 MSFT 0100000C)
[ 0.008362] ACPI: FACS 0x00000000CFEE0000 000040
[ 0.008364] ACPI: HPET 0x00000000CFEE8680 000038 (v01 GBT GBTUACPI 42302E31 GBTU 00000098)
[ 0.008367] ACPI: MCFG 0x00000000CFEE8700 00003C (v01 GBT GBTUACPI 42302E31 GBTU 01010101)
[ 0.008370] ACPI: APIC 0x00000000CFEE8580 000084 (v01 GBT GBTUACPI 42302E31 GBTU 01010101)
[ 0.008373] ACPI: SSDT 0x00000000CFEE9060 0003AB (v01 PmRef CpuPm 00003000 INTL 20040311)
[ 0.008382] ACPI: Local APIC address 0xfee00000
[ 0.008401] Zone ranges:
[ 0.008402] DMA [mem 0x0000000000001000-0x0000000000ffffff]
[ 0.008403] DMA32 [mem 0x0000000001000000-0x00000000ffffffff]
[ 0.008405] Normal [mem 0x0000000100000000-0x00000001afffffff]
[ 0.008406] Movable zone start for each node
[ 0.008407] Early memory node ranges
[ 0.008408] node 0: [mem 0x0000000000001000-0x000000000000dfff]
[ 0.008409] node 0: [mem 0x000000000000f000-0x000000000009cfff]
[ 0.008410] node 0: [mem 0x0000000000100000-0x00000000cfedffff]
[ 0.008411] node 0: [mem 0x0000000100000000-0x00000001afffffff]
[ 0.008419] Zeroed struct page in unavailable ranges: 389 pages
[ 0.008421] Initmem setup node 0 [mem 0x0000000000001000-0x00000001afffffff]
[ 0.008423] On node 0 totalpages: 1572475
[ 0.008424] DMA zone: 64 pages used for memmap
[ 0.008425] DMA zone: 20 pages reserved
[ 0.008426] DMA zone: 3995 pages, LIFO batch:0
[ 0.008480] DMA32 zone: 13244 pages used for memmap
[ 0.008481] DMA32 zone: 847584 pages, LIFO batch:63
[ 0.040854] Normal zone: 11264 pages used for memmap
[ 0.040855] Normal zone: 720896 pages, LIFO batch:63
[ 0.070497] ACPI: PM-Timer IO Port: 0x408
[ 0.070500] ACPI: Local APIC address 0xfee00000
[ 0.070506] ACPI: LAPIC_NMI (acpi_id[0x00] dfl dfl lint[0x1])
[ 0.070508] ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1])
[ 0.070509] ACPI: LAPIC_NMI (acpi_id[0x02] dfl dfl lint[0x1])
[ 0.070510] ACPI: LAPIC_NMI (acpi_id[0x03] dfl dfl lint[0x1])
[ 0.070520] IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
[ 0.070522] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[ 0.070524] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[ 0.070525] ACPI: IRQ0 used by override.
[ 0.070526] ACPI: IRQ9 used by override.
[ 0.070528] Using ACPI (MADT) for SMP configuration information
[ 0.070529] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[ 0.070534] smpboot: Allowing 4 CPUs, 0 hotplug CPUs
[ 0.070547] PM: Registered nosave memory: [mem 0x00000000-0x00000fff]
[ 0.070549] PM: Registered nosave memory: [mem 0x0000e000-0x0000efff]
[ 0.070550] PM: Registered nosave memory: [mem 0x0000e000-0x0000efff]
[ 0.070551] PM: Registered nosave memory: [mem 0x0009d000-0x0009ffff]
[ 0.070552] PM: Registered nosave memory: [mem 0x000a0000-0x000effff]
[ 0.070553] PM: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[ 0.070555] PM: Registered nosave memory: [mem 0xcfee0000-0xcfee2fff]
[ 0.070556] PM: Registered nosave memory: [mem 0xcfee3000-0xcfeeffff]
[ 0.070556] PM: Registered nosave memory: [mem 0xcfef0000-0xcfefffff]
[ 0.070557] PM: Registered nosave memory: [mem 0xcff00000-0xcfffffff]
[ 0.070558] PM: Registered nosave memory: [mem 0xd0000000-0xdfffffff]
[ 0.070559] PM: Registered nosave memory: [mem 0xe0000000-0xfebfffff]
[ 0.070560] PM: Registered nosave memory: [mem 0xfec00000-0xffffffff]
[ 0.070562] [mem 0xe0000000-0xfebfffff] available for PCI devices
[ 0.070566] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[ 0.153969] setup_percpu: NR_CPUS:4 nr_cpumask_bits:4 nr_cpu_ids:4 nr_node_ids:1
[ 0.154904] percpu: Embedded 51 pages/cpu s170328 r8192 d30376 u524288
[ 0.154911] pcpu-alloc: s170328 r8192 d30376 u524288 alloc=1*2097152
[ 0.154912] pcpu-alloc: [0] 0 1 2 3
[ 0.154931] Built 1 zonelists, mobility grouping on. Total pages: 1547883
[ 0.154934] Kernel command line: BOOT_IMAGE=/vmlinuz-5.3.0-rc1-linus+ root=/dev/mapper/VGMX300-root resume=/dev/sda2 showopts radeon.dpm=1 plymouth.enable=0 memmap=1$0xe4fd net.ifnames=0 kvm-intel.vmentry_l1d_flush=never noibrs noibpb nospectre_v1 no_stf_barrier mitigations=off
[ 0.155128] printk: log_buf_len individual max cpu contribution: 131072 bytes
[ 0.155129] printk: log_buf_len total cpu_extra contributions: 393216 bytes
[ 0.155130] printk: log_buf_len min size: 131072 bytes
[ 0.155363] printk: log_buf_len: 524288 bytes
[ 0.155364] printk: early log buf free: 120700(92%)
[ 0.158215] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[ 0.159960] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[ 0.160009] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.257128] Memory: 6078932K/6289900K available (10243K kernel code, 840K rwdata, 3308K rodata, 1016K init, 1232K bss, 210968K reserved, 0K cma-reserved)
[ 0.257193] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.257368] rcu: Preemptible hierarchical RCU implementation.
[ 0.257370] Tasks RCU enabled.
[ 0.257371] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.257566] NR_IRQS: 4352, nr_irqs: 456, preallocated irqs: 16
[ 0.257776] random: get_random_bytes called from start_kernel+0x384/0x52b with crng_init=0
[ 0.258900] Console: colour VGA+ 80x25
[ 0.262225] printk: console [tty0] enabled
[ 0.262258] ACPI: Core revision 20190703
[ 0.262359] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133484882848 ns
[ 0.262405] APIC: Switch to symmetric I/O mode setup
[ 0.262781] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[ 0.282401] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x2b3f554673f, max_idle_ns: 440795296282 ns
[ 0.282439] Calibrating delay loop (skipped), value calculated using timer frequency.. 6000.57 BogoMIPS (lpj=12001152)
[ 0.282475] pid_max: default: 32768 minimum: 301
[ 0.282516] LSM: Security Framework initializing
[ 0.282568] AppArmor: AppArmor initialized
[ 0.282687] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 0.282804] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 0.282989] *** VALIDATE proc ***
[ 0.283047] *** VALIDATE cgroup1 ***
[ 0.283075] *** VALIDATE cgroup2 ***
[ 0.283149] mce: CPU0: Thermal monitoring enabled (TM2)
[ 0.283179] process: using mwait in idle threads
[ 0.283210] Last level iTLB entries: 4KB 128, 2MB 4, 4MB 4
[ 0.283237] Last level dTLB entries: 4KB 256, 2MB 0, 4MB 32, 1GB 0
[ 0.283267] Speculative Store Bypass: Vulnerable
[ 0.283399] Freeing SMP alternatives memory: 28K
[ 0.286435] smpboot: CPU0: Intel(R) Xeon(R) CPU E5450 @ 3.00GHz (family: 0x6, model: 0x17, stepping: 0xa)
[ 0.306448] Performance Events: PEBS fmt0+, Core2 events, 4-deep LBR, Intel PMU driver.
[ 0.306492] ... version: 2
[ 0.306521] ... bit width: 40
[ 0.306556] ... generic registers: 2
[ 0.306583] ... value mask: 000000ffffffffff
[ 0.306611] ... max period: 000000007fffffff
[ 0.306638] ... fixed-purpose events: 3
[ 0.306665] ... event mask: 0000000700000003
[ 0.314439] rcu: Hierarchical SRCU implementation.
[ 0.330438] smp: Bringing up secondary CPUs ...
[ 0.362451] x86: Booting SMP configuration:
[ 0.362482] .... node #0, CPUs: #1 #2 #3
[ 0.429312] smp: Brought up 1 node, 4 CPUs
[ 0.429312] smpboot: Max logical packages: 1
[ 0.429312] smpboot: Total of 4 processors activated (24002.30 BogoMIPS)
[ 0.434688] devtmpfs: initialized
[ 0.434688] PM: Registering ACPI NVS region [mem 0xcfee0000-0xcfee2fff] (12288 bytes)
[ 0.435132] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.435132] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[ 0.435132] NET: Registered protocol family 16
[ 0.435132] audit: initializing netlink subsys (disabled)
[ 0.435132] audit: type=2000 audit(1564170709.172:1): state=initialized audit_enabled=0 res=1
[ 0.435132] cpuidle: using governor teo
[ 0.435132] ACPI: bus type PCI registered
[ 0.435132] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xd0000000-0xdfffffff] (base 0xd0000000)
[ 0.435132] PCI: MMCONFIG at [mem 0xd0000000-0xdfffffff] reserved in E820
[ 0.435132] PCI: Using configuration type 1 for base access
[ 0.435180] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.786933] ACPI: Added _OSI(Module Device)
[ 0.786933] ACPI: Added _OSI(Processor Device)
[ 0.786933] ACPI: Added _OSI(3.0 _SCP Extensions)
[ 0.786933] ACPI: Added _OSI(Processor Aggregator Device)
[ 0.786933] ACPI: Added _OSI(Linux-Dell-Video)
[ 0.786933] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[ 0.786933] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
[ 0.788439] ACPI: 2 ACPI AML tables successfully acquired and loaded
[ 0.790603] ACPI: Dynamic OEM Table Load:
[ 0.790642] ACPI: SSDT 0xFFFF8881A8AB7C00 00022A (v01 PmRef Cpu0Ist 00003000 INTL 20040311)
[ 0.790930] ACPI: Dynamic OEM Table Load:
[ 0.790959] ACPI: SSDT 0xFFFF8881A8B6E200 000152 (v01 PmRef Cpu1Ist 00003000 INTL 20040311)
[ 0.791208] ACPI: Dynamic OEM Table Load:
[ 0.791238] ACPI: SSDT 0xFFFF8881A8B6E400 000152 (v01 PmRef Cpu2Ist 00003000 INTL 20040311)
[ 0.791486] ACPI: Dynamic OEM Table Load:
[ 0.791516] ACPI: SSDT 0xFFFF8881A8B6E600 000152 (v01 PmRef Cpu3Ist 00003000 INTL 20040311)
[ 0.791898] ACPI: Interpreter enabled
[ 0.791942] ACPI: (supports S0 S3 S4 S5)
[ 0.791970] ACPI: Using IOAPIC for interrupt routing
[ 0.792021] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[ 0.792182] ACPI: Enabled 11 GPEs in block 00 to 3F
[ 0.798443] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[ 0.798443] acpi PNP0A03:00: _OSC: OS supports [ExtendedConfig Segments MSI HPX-Type3]
[ 0.798443] PCI host bridge to bus 0000:00
[ 0.798443] pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window]
[ 0.798443] pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window]
[ 0.798443] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[ 0.798443] pci_bus 0000:00: root bus resource [mem 0x000c0000-0x000dffff window]
[ 0.798443] pci_bus 0000:00: root bus resource [mem 0xcff00000-0xfebfffff window]
[ 0.798443] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 0.798443] pci 0000:00:00.0: [8086:29c0] type 00 class 0x060000
[ 0.798443] pci 0000:00:01.0: [8086:29c1] type 01 class 0x060400
[ 0.798443] pci 0000:00:01.0: PME# supported from D0 D3hot D3cold
[ 0.798443] pci 0000:00:1a.0: [8086:2937] type 00 class 0x0c0300
[ 0.798443] pci 0000:00:1a.0: reg 0x20: [io 0xe100-0xe11f]
[ 0.798443] pci 0000:00:1a.1: [8086:2938] type 00 class 0x0c0300
[ 0.798443] pci 0000:00:1a.1: reg 0x20: [io 0xe200-0xe21f]
[ 0.798443] pci 0000:00:1a.2: [8086:2939] type 00 class 0x0c0300
[ 0.798443] pci 0000:00:1a.2: reg 0x20: [io 0xe000-0xe01f]
[ 0.798443] pci 0000:00:1a.7: [8086:293c] type 00 class 0x0c0320
[ 0.798443] pci 0000:00:1a.7: reg 0x10: [mem 0xf4205000-0xf42053ff]
[ 0.798443] pci 0000:00:1b.0: [8086:293e] type 00 class 0x040300
[ 0.798443] pci 0000:00:1b.0: reg 0x10: [mem 0xf4200000-0xf4203fff 64bit]
[ 0.798443] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold
[ 0.798443] pci 0000:00:1c.0: [8086:2940] type 01 class 0x060400
[ 0.798443] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
[ 0.798443] pci 0000:00:1c.3: [8086:2946] type 01 class 0x060400
[ 0.798483] pci 0000:00:1c.3: PME# supported from D0 D3hot D3cold
[ 0.798588] pci 0000:00:1c.4: [8086:2948] type 01 class 0x060400
[ 0.798679] pci 0000:00:1c.4: PME# supported from D0 D3hot D3cold
[ 0.798785] pci 0000:00:1d.0: [8086:2934] type 00 class 0x0c0300
[ 0.798847] pci 0000:00:1d.0: reg 0x20: [io 0xe300-0xe31f]
[ 0.798969] pci 0000:00:1d.1: [8086:2935] type 00 class 0x0c0300
[ 0.799032] pci 0000:00:1d.1: reg 0x20: [io 0xe400-0xe41f]
[ 0.799152] pci 0000:00:1d.2: [8086:2936] type 00 class 0x0c0300
[ 0.799215] pci 0000:00:1d.2: reg 0x20: [io 0xe500-0xe51f]
[ 0.799340] pci 0000:00:1d.7: [8086:293a] type 00 class 0x0c0320
[ 0.799384] pci 0000:00:1d.7: reg 0x10: [mem 0xf4204000-0xf42043ff]
[ 0.799535] pci 0000:00:1e.0: [8086:244e] type 01 class 0x060401
[ 0.799674] pci 0000:00:1f.0: [8086:2916] type 00 class 0x060100
[ 0.799770] pci 0000:00:1f.0: quirk: [io 0x0400-0x047f] claimed by ICH6 ACPI/GPIO/TCO
[ 0.799805] pci 0000:00:1f.0: quirk: [io 0x0480-0x04bf] claimed by ICH6 GPIO
[ 0.799835] pci 0000:00:1f.0: ICH7 LPC Generic IO decode 1 PIO at 0800 (mask 000f)
[ 0.799869] pci 0000:00:1f.0: ICH7 LPC Generic IO decode 2 PIO at 0290 (mask 000f)
[ 0.799987] pci 0000:00:1f.2: [8086:2922] type 00 class 0x010601
[ 0.800028] pci 0000:00:1f.2: reg 0x10: [io 0xe600-0xe607]
[ 0.800061] pci 0000:00:1f.2: reg 0x14: [io 0xe700-0xe703]
[ 0.800094] pci 0000:00:1f.2: reg 0x18: [io 0xe800-0xe807]
[ 0.800126] pci 0000:00:1f.2: reg 0x1c: [io 0xe900-0xe903]
[ 0.800158] pci 0000:00:1f.2: reg 0x20: [io 0xea00-0xea1f]
[ 0.800191] pci 0000:00:1f.2: reg 0x24: [mem 0xf4206000-0xf42067ff]
[ 0.800250] pci 0000:00:1f.2: PME# supported from D3hot
[ 0.800347] pci 0000:00:1f.3: [8086:2930] type 00 class 0x0c0500
[ 0.800389] pci 0000:00:1f.3: reg 0x10: [mem 0xf4207000-0xf42070ff 64bit]
[ 0.800431] pci 0000:00:1f.3: reg 0x20: [io 0x0500-0x051f]
[ 0.800559] pci 0000:01:00.0: [1002:68f9] type 00 class 0x030000
[ 0.800602] pci 0000:01:00.0: reg 0x10: [mem 0xe0000000-0xefffffff 64bit pref]
[ 0.800640] pci 0000:01:00.0: reg 0x18: [mem 0xf1000000-0xf101ffff 64bit]
[ 0.800673] pci 0000:01:00.0: reg 0x20: [io 0xb000-0xb0ff]
[ 0.800710] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0001ffff pref]
[ 0.800742] pci 0000:01:00.0: enabling Extended Tags
[ 0.800795] pci 0000:01:00.0: supports D1 D2
[ 0.800864] pci 0000:01:00.1: [1002:aa68] type 00 class 0x040300
[ 0.800906] pci 0000:01:00.1: reg 0x10: [mem 0xf1020000-0xf1023fff 64bit]
[ 0.800958] pci 0000:01:00.1: enabling Extended Tags
[ 0.801012] pci 0000:01:00.1: supports D1 D2
[ 0.801075] pci 0000:00:01.0: PCI bridge to [bus 01]
[ 0.801104] pci 0000:00:01.0: bridge window [io 0xb000-0xbfff]
[ 0.801133] pci 0000:00:01.0: bridge window [mem 0xf0000000-0xf1ffffff]
[ 0.801163] pci 0000:00:01.0: bridge window [mem 0xe0000000-0xefffffff 64bit pref]
[ 0.801225] pci 0000:00:1c.0: PCI bridge to [bus 02]
[ 0.801254] pci 0000:00:1c.0: bridge window [io 0xa000-0xafff]
[ 0.801329] pci 0000:03:00.0: [197b:2363] type 00 class 0x010185
[ 0.801442] pci 0000:03:00.0: reg 0x24: [mem 0xf4000000-0xf4001fff]
[ 0.801551] pci 0000:03:00.0: PME# supported from D3hot
[ 0.801649] pci 0000:03:00.1: [197b:2363] type 00 class 0x010185
[ 0.801699] pci 0000:03:00.1: reg 0x10: [io 0xc000-0xc007]
[ 0.801734] pci 0000:03:00.1: reg 0x14: [io 0xc100-0xc103]
[ 0.801770] pci 0000:03:00.1: reg 0x18: [io 0xc200-0xc207]
[ 0.801805] pci 0000:03:00.1: reg 0x1c: [io 0xc300-0xc303]
[ 0.801840] pci 0000:03:00.1: reg 0x20: [io 0xc400-0xc40f]
[ 0.801965] pci 0000:00:1c.3: PCI bridge to [bus 03]
[ 0.801994] pci 0000:00:1c.3: bridge window [io 0xc000-0xcfff]
[ 0.802024] pci 0000:00:1c.3: bridge window [mem 0xf4000000-0xf40fffff]
[ 0.802101] pci 0000:04:00.0: [10ec:8168] type 00 class 0x020000
[ 0.802157] pci 0000:04:00.0: reg 0x10: [io 0xd000-0xd0ff]
[ 0.802210] pci 0000:04:00.0: reg 0x18: [mem 0xf3000000-0xf3000fff 64bit]
[ 0.802269] pci 0000:04:00.0: reg 0x30: [mem 0x00000000-0x0001ffff pref]
[ 0.802305] pci 0000:04:00.0: enabling Extended Tags
[ 0.802416] pci 0000:04:00.0: supports D1 D2
[ 0.802438] pci 0000:04:00.0: PME# supported from D1 D2 D3hot D3cold
[ 0.802526] pci 0000:00:1c.4: PCI bridge to [bus 04]
[ 0.802556] pci 0000:00:1c.4: bridge window [io 0xd000-0xdfff]
[ 0.802586] pci 0000:00:1c.4: bridge window [mem 0xf2000000-0xf3ffffff]
[ 0.802629] pci_bus 0000:05: extended config space not accessible
[ 0.802677] pci 0000:05:01.0: [104c:8020] type 00 class 0x0c0010
[ 0.802719] pci 0000:05:01.0: reg 0x10: [mem 0xf4104000-0xf41047ff]
[ 0.802754] pci 0000:05:01.0: reg 0x14: [mem 0xf4100000-0xf4103fff]
[ 0.802842] pci 0000:05:01.0: supports D2
[ 0.802870] pci 0000:05:01.0: PME# supported from D2 D3hot
[ 0.802959] pci 0000:00:1e.0: PCI bridge to [bus 05] (subtractive decode)
[ 0.802991] pci 0000:00:1e.0: bridge window [mem 0xf4100000-0xf41fffff]
[ 0.803022] pci 0000:00:1e.0: bridge window [io 0x0000-0x0cf7 window] (subtractive decode)
[ 0.803055] pci 0000:00:1e.0: bridge window [io 0x0d00-0xffff window] (subtractive decode)
[ 0.803088] pci 0000:00:1e.0: bridge window [mem 0x000a0000-0x000bffff window] (subtractive decode)
[ 0.803122] pci 0000:00:1e.0: bridge window [mem 0x000c0000-0x000dffff window] (subtractive decode)
[ 0.803155] pci 0000:00:1e.0: bridge window [mem 0xcff00000-0xfebfffff window] (subtractive decode)
[ 0.803204] pci_bus 0000:00: on NUMA node 0
[ 0.803625] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
[ 0.803702] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 *10 11 12 14 15)
[ 0.803776] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *7 9 10 11 12 14 15)
[ 0.803851] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 9 10 11 12 14 *15)
[ 0.803926] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
[ 0.804001] ACPI: PCI Interrupt Link [LNKF] (IRQs *3 4 5 6 7 9 10 11 12 14 15)
[ 0.804076] ACPI: PCI Interrupt Link [LNK0] (IRQs 3 4 5 6 7 9 10 11 12 *14 15)
[ 0.804151] ACPI: PCI Interrupt Link [LNK1] (IRQs 3 4 *5 6 7 9 10 11 12 14 15)
[ 0.806453] pci 0000:01:00.0: vgaarb: setting as boot VGA device
[ 0.806476] pci 0000:01:00.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[ 0.806509] pci 0000:01:00.0: vgaarb: bridge control possible
[ 0.807068] vgaarb: loaded
[ 0.807156] SCSI subsystem initialized
[ 0.807206] libata version 3.00 loaded.
[ 0.807206] ACPI: bus type USB registered
[ 0.807206] usbcore: registered new interface driver usbfs
[ 0.807206] usbcore: registered new interface driver hub
[ 0.807206] usbcore: registered new device driver usb
[ 0.807206] PCI: Using ACPI for IRQ routing
[ 0.810200] PCI: pci_cache_line_size set to 64 bytes
[ 0.810245] e820: reserve RAM buffer [mem 0x0000e4fd-0x0000ffff]
[ 0.810247] e820: reserve RAM buffer [mem 0x0009dc00-0x0009ffff]
[ 0.810248] e820: reserve RAM buffer [mem 0xcfee0000-0xcfffffff]
[ 0.810524] hpet: 4 channels of 0 reserved for per-cpu timers
[ 0.810554] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0, 0
[ 0.810584] hpet0: 4 comparators, 64-bit 14.318180 MHz counter
[ 0.815461] clocksource: Switched to clocksource tsc-early
[ 0.821564] *** VALIDATE hugetlbfs ***
[ 0.821676] AppArmor: AppArmor Filesystem Enabled
[ 0.821719] pnp: PnP ACPI init
[ 0.821888] system 00:00: [io 0x04d0-0x04d1] has been reserved
[ 0.821918] system 00:00: [io 0x0290-0x029f] has been reserved
[ 0.821946] system 00:00: [io 0x0800-0x087f] has been reserved
[ 0.821975] system 00:00: [io 0x0290-0x0294] has been reserved
[ 0.822003] system 00:00: [io 0x0880-0x088f] has been reserved
[ 0.822035] system 00:00: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 0.822090] pnp 00:01: Plug and Play ACPI device, IDs PNP0b00 (active)
[ 0.822302] pnp 00:02: Plug and Play ACPI device, IDs PNP0501 (active)
[ 0.822438] pnp 00:03: Plug and Play ACPI device, IDs PNP0f13 (active)
[ 0.822468] pnp 00:04: Plug and Play ACPI device, IDs PNP0303 (active)
[ 0.822517] system 00:05: [io 0x0400-0x04bf] could not be reserved
[ 0.822549] system 00:05: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 0.822703] system 00:06: [mem 0xd0000000-0xdfffffff] has been reserved
[ 0.822735] system 00:06: Plug and Play ACPI device, IDs PNP0c02 (active)
[ 0.822864] system 00:07: [mem 0x000d2a00-0x000d3fff] has been reserved
[ 0.822894] system 00:07: [mem 0x000f0000-0x000f7fff] could not be reserved
[ 0.822923] system 00:07: [mem 0x000f8000-0x000fbfff] could not be reserved
[ 0.822952] system 00:07: [mem 0x000fc000-0x000fffff] could not be reserved
[ 0.822981] system 00:07: [mem 0xcfee0000-0xcfefffff] could not be reserved
[ 0.823010] system 00:07: [mem 0x00000000-0x0009ffff] could not be reserved
[ 0.823039] system 00:07: [mem 0x00100000-0xcfedffff] could not be reserved
[ 0.823068] system 00:07: [mem 0xfec00000-0xfec00fff] could not be reserved
[ 0.823097] system 00:07: [mem 0xfed10000-0xfed1dfff] has been reserved
[ 0.823126] system 00:07: [mem 0xfed20000-0xfed8ffff] has been reserved
[ 0.823155] system 00:07: [mem 0xfee00000-0xfee00fff] has been reserved
[ 0.823184] system 00:07: [mem 0xffb00000-0xffb7ffff] has been reserved
[ 0.823213] system 00:07: [mem 0xfff00000-0xffffffff] has been reserved
[ 0.823241] system 00:07: [mem 0x000e0000-0x000effff] has been reserved
[ 0.823273] system 00:07: Plug and Play ACPI device, IDs PNP0c01 (active)
[ 0.823277] pnp: PnP ACPI: found 8 devices
[ 0.824612] thermal_sys: Registered thermal governor 'step_wise'
[ 0.824613] thermal_sys: Registered thermal governor 'user_space'
[ 0.829136] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[ 0.829204] pci 0000:00:1c.0: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 02] add_size 200000 add_align 100000
[ 0.829239] pci 0000:00:1c.0: bridge window [mem 0x00100000-0x000fffff] to [bus 02] add_size 200000 add_align 100000
[ 0.829274] pci 0000:00:1c.3: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 03] add_size 200000 add_align 100000
[ 0.829309] pci 0000:00:1c.4: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 04] add_size 200000 add_align 100000
[ 0.829351] pci 0000:00:1c.0: BAR 8: assigned [mem 0xf4300000-0xf44fffff]
[ 0.829382] pci 0000:00:1c.0: BAR 9: assigned [mem 0xf4500000-0xf46fffff 64bit pref]
[ 0.829421] pci 0000:00:1c.3: BAR 9: assigned [mem 0xf4700000-0xf48fffff 64bit pref]
[ 0.829456] pci 0000:00:1c.4: BAR 9: assigned [mem 0xf4900000-0xf4afffff 64bit pref]
[ 0.829491] pci 0000:01:00.0: BAR 6: assigned [mem 0xf0000000-0xf001ffff pref]
[ 0.829524] pci 0000:00:01.0: PCI bridge to [bus 01]
[ 0.829552] pci 0000:00:01.0: bridge window [io 0xb000-0xbfff]
[ 0.829582] pci 0000:00:01.0: bridge window [mem 0xf0000000-0xf1ffffff]
[ 0.829611] pci 0000:00:01.0: bridge window [mem 0xe0000000-0xefffffff 64bit pref]
[ 0.829645] pci 0000:00:1c.0: PCI bridge to [bus 02]
[ 0.829673] pci 0000:00:1c.0: bridge window [io 0xa000-0xafff]
[ 0.829704] pci 0000:00:1c.0: bridge window [mem 0xf4300000-0xf44fffff]
[ 0.829734] pci 0000:00:1c.0: bridge window [mem 0xf4500000-0xf46fffff 64bit pref]
[ 0.829769] pci 0000:00:1c.3: PCI bridge to [bus 03]
[ 0.829797] pci 0000:00:1c.3: bridge window [io 0xc000-0xcfff]
[ 0.829828] pci 0000:00:1c.3: bridge window [mem 0xf4000000-0xf40fffff]
[ 0.829858] pci 0000:00:1c.3: bridge window [mem 0xf4700000-0xf48fffff 64bit pref]
[ 0.829893] pci 0000:04:00.0: BAR 6: assigned [mem 0xf2000000-0xf201ffff pref]
[ 0.829926] pci 0000:00:1c.4: PCI bridge to [bus 04]
[ 0.829954] pci 0000:00:1c.4: bridge window [io 0xd000-0xdfff]
[ 0.829984] pci 0000:00:1c.4: bridge window [mem 0xf2000000-0xf3ffffff]
[ 0.830014] pci 0000:00:1c.4: bridge window [mem 0xf4900000-0xf4afffff 64bit pref]
[ 0.830050] pci 0000:00:1e.0: PCI bridge to [bus 05]
[ 0.830079] pci 0000:00:1e.0: bridge window [mem 0xf4100000-0xf41fffff]
[ 0.830113] pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7 window]
[ 0.830141] pci_bus 0000:00: resource 5 [io 0x0d00-0xffff window]
[ 0.830169] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window]
[ 0.830198] pci_bus 0000:00: resource 7 [mem 0x000c0000-0x000dffff window]
[ 0.830227] pci_bus 0000:00: resource 8 [mem 0xcff00000-0xfebfffff window]
[ 0.830256] pci_bus 0000:01: resource 0 [io 0xb000-0xbfff]
[ 0.830284] pci_bus 0000:01: resource 1 [mem 0xf0000000-0xf1ffffff]
[ 0.830312] pci_bus 0000:01: resource 2 [mem 0xe0000000-0xefffffff 64bit pref]
[ 0.830345] pci_bus 0000:02: resource 0 [io 0xa000-0xafff]
[ 0.830373] pci_bus 0000:02: resource 1 [mem 0xf4300000-0xf44fffff]
[ 0.830401] pci_bus 0000:02: resource 2 [mem 0xf4500000-0xf46fffff 64bit pref]
[ 0.830433] pci_bus 0000:03: resource 0 [io 0xc000-0xcfff]
[ 0.830461] pci_bus 0000:03: resource 1 [mem 0xf4000000-0xf40fffff]
[ 0.830490] pci_bus 0000:03: resource 2 [mem 0xf4700000-0xf48fffff 64bit pref]
[ 0.830522] pci_bus 0000:04: resource 0 [io 0xd000-0xdfff]
[ 0.830550] pci_bus 0000:04: resource 1 [mem 0xf2000000-0xf3ffffff]
[ 0.830579] pci_bus 0000:04: resource 2 [mem 0xf4900000-0xf4afffff 64bit pref]
[ 0.830611] pci_bus 0000:05: resource 1 [mem 0xf4100000-0xf41fffff]
[ 0.830639] pci_bus 0000:05: resource 4 [io 0x0000-0x0cf7 window]
[ 0.830668] pci_bus 0000:05: resource 5 [io 0x0d00-0xffff window]
[ 0.830696] pci_bus 0000:05: resource 6 [mem 0x000a0000-0x000bffff window]
[ 0.830725] pci_bus 0000:05: resource 7 [mem 0x000c0000-0x000dffff window]
[ 0.830754] pci_bus 0000:05: resource 8 [mem 0xcff00000-0xfebfffff window]
[ 0.830842] NET: Registered protocol family 2
[ 0.830970] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[ 0.831027] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[ 0.831241] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[ 0.831725] TCP: Hash tables configured (established 65536 bind 65536)
[ 0.831812] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[ 0.831903] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[ 0.832025] NET: Registered protocol family 1
[ 0.832983] pci 0000:01:00.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[ 0.833024] pci 0000:01:00.1: D0 power state depends on 0000:01:00.0
[ 0.833081] pci 0000:03:00.0: async suspend disabled to avoid multi-function power-on ordering issue
[ 0.833117] pci 0000:03:00.1: async suspend disabled to avoid multi-function power-on ordering issue
[ 0.833157] PCI: CLS 32 bytes, default 64
[ 0.833219] Unpacking initramfs...
[ 1.807433] Freeing initrd memory: 10384K
[ 1.807471] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[ 1.807500] software IO TLB: mapped [mem 0xcbee0000-0xcfee0000] (64MB)
[ 1.808533] Initialise system trusted keyrings
[ 1.808625] workingset: timestamp_bits=62 max_order=21 bucket_order=0
[ 1.809897] fuse: init (API version 7.31)
[ 1.815051] Key type asymmetric registered
[ 1.815080] Asymmetric key parser 'x509' registered
[ 1.815114] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 1.815146] io scheduler mq-deadline registered
[ 1.815203] io scheduler bfq registered
[ 1.815924] input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
[ 1.815967] ACPI: Power Button [PWRB]
[ 1.816060] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input1
[ 1.818461] ACPI: Power Button [PWRF]
[ 1.818825] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 1.839182] 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 1.839390] Linux agpgart interface v0.103
[ 1.839504] [drm] radeon kernel modesetting enabled.
[ 1.839571] radeon 0000:01:00.0: remove_conflicting_pci_framebuffers: bar 0: 0xe0000000 -> 0xefffffff
[ 1.839605] radeon 0000:01:00.0: remove_conflicting_pci_framebuffers: bar 2: 0xf1000000 -> 0xf101ffff
[ 1.839639] radeon 0000:01:00.0: vgaarb: deactivate vga console
[ 1.840068] Console: switching to colour dummy device 80x25
[ 1.840236] [drm] initializing kernel modesetting (CEDAR 0x1002:0x68F9 0x174B:0xE153 0x00).
[ 1.840262] resource sanity check: requesting [mem 0x000c0000-0x000dffff], which spans more than pnp 00:07 [mem 0x000d2a00-0x000d3fff]
[ 1.840272] caller pci_map_rom+0x65/0x178 mapping multiple BARs
[ 1.840408] ATOM BIOS: BASS
[ 1.840455] radeon 0000:01:00.0: VRAM: 512M 0x0000000000000000 - 0x000000001FFFFFFF (512M used)
[ 1.840459] radeon 0000:01:00.0: GTT: 1024M 0x0000000020000000 - 0x000000005FFFFFFF
[ 1.840464] [drm] Detected VRAM RAM=512M, BAR=256M
[ 1.840466] [drm] RAM width 64bits DDR
[ 1.840524] [TTM] Zone kernel: Available graphics memory: 3044672 KiB
[ 1.840527] [TTM] Zone dma32: Available graphics memory: 2097152 KiB
[ 1.840529] [TTM] Initializing pool allocator
[ 1.840533] [TTM] Initializing DMA pool allocator
[ 1.840559] [drm] radeon: 512M of VRAM memory ready
[ 1.840562] [drm] radeon: 1024M of GTT memory ready.
[ 1.840570] [drm] Loading CEDAR Microcode
[ 1.840575] [drm] Internal thermal controller with fan control
[ 1.840614] == power state 0 ==
[ 1.840616] ui class: none
[ 1.840618] internal class: boot
[ 1.840620] caps: video
[ 1.840622] uvd vclk: 0 dclk: 0
[ 1.840625] power level 0 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840628] power level 1 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840631] power level 2 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840633] status: c r b
[ 1.840636] == power state 1 ==
[ 1.840637] ui class: performance
[ 1.840639] internal class: none
[ 1.840641] caps: single_disp video
[ 1.840643] uvd vclk: 0 dclk: 0
[ 1.840646] power level 0 sclk: 15700 mclk: 20000 vddc: 900 vddci: 0
[ 1.840648] power level 1 sclk: 40000 mclk: 50000 vddc: 950 vddci: 0
[ 1.840651] power level 2 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840653] status:
[ 1.840655] == power state 2 ==
[ 1.840657] ui class: none
[ 1.840658] internal class: uvd
[ 1.840660] caps: video
[ 1.840662] uvd vclk: 54000 dclk: 40000
[ 1.840665] power level 0 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840668] power level 1 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840670] power level 2 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840673] status:
[ 1.840674] == power state 3 ==
[ 1.840676] ui class: performance
[ 1.840677] internal class: none
[ 1.840680] caps: video
[ 1.840682] uvd vclk: 0 dclk: 0
[ 1.840684] power level 0 sclk: 15700 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840687] power level 1 sclk: 40000 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840689] power level 2 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 1.840692] status:
[ 1.855368] [drm] radeon: dpm initialized
[ 1.855384] [drm] GART: num cpu pages 262144, num gpu pages 262144
[ 1.869667] [drm] PCIE GART of 1024M enabled (table at 0x000000000014C000).
[ 1.869756] radeon 0000:01:00.0: WB enabled
[ 1.869760] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000020000c00 and cpu addr 0x(____ptrval____)
[ 1.869765] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000020000c0c and cpu addr 0x(____ptrval____)
[ 1.870169] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x000000000005c418 and cpu addr 0x(____ptrval____)
[ 1.870173] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.870176] [drm] Driver supports precise vblank timestamp query.
[ 1.870179] radeon 0000:01:00.0: radeon: MSI limited to 32-bit
[ 1.870216] radeon 0000:01:00.0: radeon: using MSI.
[ 1.870238] [drm] radeon: irq initialized.
[ 1.886379] [drm] ring test on 0 succeeded in 1 usecs
[ 1.886386] [drm] ring test on 3 succeeded in 2 usecs
[ 2.071965] [drm] ring test on 5 succeeded in 1 usecs
[ 2.071971] [drm] UVD initialized successfully.
[ 2.072087] [drm] ib test on ring 0 succeeded in 0 usecs
[ 2.072130] [drm] ib test on ring 3 succeeded in 0 usecs
[ 2.758459] [drm] ib test on ring 5 succeeded
[ 2.758804] [drm] Radeon Display Connectors
[ 2.758807] [drm] Connector 0:
[ 2.758808] [drm] HDMI-A-1
[ 2.758810] [drm] HPD2
[ 2.758812] [drm] DDC: 0x6460 0x6460 0x6464 0x6464 0x6468 0x6468 0x646c 0x646c
[ 2.758815] [drm] Encoders:
[ 2.758817] [drm] DFP1: INTERNAL_UNIPHY1
[ 2.758819] [drm] Connector 1:
[ 2.758821] [drm] DVI-I-1
[ 2.758822] [drm] HPD4
[ 2.758824] [drm] DDC: 0x6450 0x6450 0x6454 0x6454 0x6458 0x6458 0x645c 0x645c
[ 2.758827] [drm] Encoders:
[ 2.758829] [drm] DFP2: INTERNAL_UNIPHY
[ 2.758831] [drm] CRT1: INTERNAL_KLDSCP_DAC1
[ 2.758832] [drm] Connector 2:
[ 2.758834] [drm] VGA-1
[ 2.758836] [drm] DDC: 0x6430 0x6430 0x6434 0x6434 0x6438 0x6438 0x643c 0x643c
[ 2.758839] [drm] Encoders:
[ 2.758841] [drm] CRT2: INTERNAL_KLDSCP_DAC2
[ 2.758901] switching from power state:
[ 2.758903] ui class: none
[ 2.758905] internal class: boot
[ 2.758907] caps: video
[ 2.758910] uvd vclk: 0 dclk: 0
[ 2.758912] power level 0 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 2.758915] power level 1 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 2.758918] power level 2 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 2.758920] status: c b
[ 2.758922] switching to power state:
[ 2.758924] ui class: performance
[ 2.758926] internal class: none
[ 2.758928] caps: single_disp video
[ 2.758930] uvd vclk: 0 dclk: 0
[ 2.758933] power level 0 sclk: 15700 mclk: 20000 vddc: 900 vddci: 0
[ 2.758935] power level 1 sclk: 40000 mclk: 50000 vddc: 950 vddci: 0
[ 2.758938] power level 2 sclk: 65000 mclk: 80000 vddc: 1000 vddci: 0
[ 2.758940] status: r
[ 2.820677] [drm] fb mappable at 0xE034D000
[ 2.820680] [drm] vram apper at 0xE0000000
[ 2.820682] [drm] size 14745600
[ 2.820683] [drm] fb depth is 24
[ 2.820685] [drm] pitch is 10240
[ 2.820731] fbcon: radeondrmfb (fb0) is primary device
[ 2.822443] tsc: Refined TSC clocksource calibration: 2999.999 MHz
[ 2.822454] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2b3e44b2357, max_idle_ns: 440795324996 ns
[ 2.822483] clocksource: Switched to clocksource tsc
[ 2.905886] Console: switching to colour frame buffer device 320x90
[ 2.913438] radeon 0000:01:00.0: fb0: radeondrmfb frame buffer device
[ 2.918515] [drm] Initialized radeon 2.50.0 20080528 for 0000:01:00.0 on minor 0
[ 2.918840] ahci 0000:00:1f.2: version 3.0
[ 2.919000] ahci 0000:00:1f.2: SSS flag set, parallel bus scan disabled
[ 2.919054] ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
[ 2.919083] ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pmp pio slum part ccc ems
[ 2.978906] scsi host0: ahci
[ 2.979070] scsi host1: ahci
[ 2.979223] scsi host2: ahci
[ 2.979388] scsi host3: ahci
[ 2.979537] scsi host4: ahci
[ 2.979696] scsi host5: ahci
[ 2.979759] ata1: SATA max UDMA/133 abar m2048@0xf4206000 port 0xf4206100 irq 29
[ 2.979786] ata2: SATA max UDMA/133 abar m2048@0xf4206000 port 0xf4206180 irq 29
[ 2.979813] ata3: SATA max UDMA/133 abar m2048@0xf4206000 port 0xf4206200 irq 29
[ 2.979839] ata4: SATA max UDMA/133 abar m2048@0xf4206000 port 0xf4206280 irq 29
[ 2.979865] ata5: SATA max UDMA/133 abar m2048@0xf4206000 port 0xf4206300 irq 29
[ 2.979892] ata6: SATA max UDMA/133 abar m2048@0xf4206000 port 0xf4206380 irq 29
[ 2.990093] ahci 0000:03:00.0: AHCI 0001.0000 32 slots 2 ports 3 Gbps 0x3 impl SATA mode
[ 2.990137] ahci 0000:03:00.0: flags: 64bit ncq pm led clo pmp pio slum part
[ 2.990485] scsi host6: ahci
[ 2.990644] scsi host7: ahci
[ 2.990706] ata7: SATA max UDMA/133 abar m8192@0xf4000000 port 0xf4000100 irq 19
[ 2.990734] ata8: SATA max UDMA/133 abar m8192@0xf4000000 port 0xf4000180 irq 19
[ 2.990827] pata_jmicron 0000:03:00.1: enabling device (0000 -> 0001)
[ 2.991433] scsi host8: pata_jmicron
[ 2.991577] scsi host9: pata_jmicron
[ 2.991625] ata9: PATA max UDMA/100 cmd 0xc000 ctl 0xc100 bmdma 0xc400 irq 16
[ 2.991651] ata10: PATA max UDMA/100 cmd 0xc200 ctl 0xc300 bmdma 0xc408 irq 16
[ 2.991717] usbcore: registered new interface driver usblp
[ 2.991787] usbcore: registered new interface driver usb-storage
[ 2.991852] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[ 2.992245] serio: i8042 KBD port at 0x60,0x64 irq 1
[ 2.992302] serio: i8042 AUX port at 0x60,0x64 irq 12
[ 2.992402] mousedev: PS/2 mouse device common for all mice
[ 2.992477] input: PC Speaker as /devices/platform/pcspkr/input/input3
[ 2.992525] rtc_cmos 00:01: RTC can wake from S4
[ 2.992651] rtc_cmos 00:01: registered as rtc0
[ 2.992683] rtc_cmos 00:01: alarms up to one month, 242 bytes nvram, hpet irqs
[ 2.992870] device-mapper: uevent: version 1.0.3
[ 2.992933] device-mapper: ioctl: 4.40.0-ioctl (2019-01-18) initialised: dm-devel@redhat.com
[ 2.992964] intel_pstate: CPU model not supported
[ 2.992990] hidraw: raw HID events driver (C) Jiri Kosina
[ 2.993021] usbcore: registered new interface driver usbhid
[ 2.993041] usbhid: USB HID core driver
[ 2.993220] NET: Registered protocol family 10
[ 2.993463] Segment Routing with IPv6
[ 2.993493] NET: Registered protocol family 17
[ 2.993761] microcode: sig=0x1067a, pf=0x40, revision=0xa0b
[ 2.993829] microcode: Microcode Update Driver: v2.2.
[ 2.993839] sched_clock: Marking stable (2989127799, 4697229)->(3102433889, -108608861)
[ 2.994023] registered taskstats version 1
[ 2.994040] Loading compiled-in X.509 certificates
[ 3.018422] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
[ 3.042542] Loaded X.509 cert 'Build time autogenerated kernel key: f849ae0907d8be617aa00a74df3051a2885a5811'
[ 3.046060] Key type encrypted registered
[ 3.046242] rtc_cmos 00:01: setting system clock to 2019-07-26T19:51:52 UTC (1564170712)
[ 3.292478] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 3.292712] ata1.00: supports DRM functions and may not be fully accessible
[ 3.293468] ata1.00: ATA-10: Crucial_CT525MX300SSD1, M0CR070, max UDMA/133
[ 3.293506] ata1.00: 1025610768 sectors, multi 16: LBA48 NCQ (depth 32), AA
[ 3.295600] ata1.00: supports DRM functions and may not be fully accessible
[ 3.299777] ata1.00: configured for UDMA/133
[ 3.301460] scsi 0:0:0:0: Direct-Access ATA Crucial_CT525MX3 R070 PQ: 0 ANSI: 5
[ 3.303213] ata1.00: Enabling discard_zeroes_data
[ 3.303215] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 3.304476] ata7: SATA link down (SStatus 0 SControl 300)
[ 3.304855] ata8: SATA link down (SStatus 0 SControl 300)
[ 3.306550] sd 0:0:0:0: [sda] 1025610768 512-byte logical blocks: (525 GB/489 GiB)
[ 3.311314] sd 0:0:0:0: [sda] Write Protect is off
[ 3.312929] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 3.312943] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 3.314704] ata1.00: Enabling discard_zeroes_data
[ 3.316635] sda: sda1 sda2 sda3
[ 3.318529] ata1.00: Enabling discard_zeroes_data
[ 3.320294] sd 0:0:0:0: [sda] Attached SCSI disk
[ 3.620470] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 3.623111] ata2.00: ATA-8: Hitachi HUA722050CLA330, JP2OA39C, max UDMA/133
[ 3.624808] ata2.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 32), AA
[ 3.627544] ata2.00: configured for UDMA/133
[ 3.629333] scsi 1:0:0:0: Direct-Access ATA Hitachi HUA72205 A39C PQ: 0 ANSI: 5
[ 3.631158] sd 1:0:0:0: Attached scsi generic sg1 type 0
[ 3.631169] sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[ 3.634633] sd 1:0:0:0: [sdb] Write Protect is off
[ 3.636405] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[ 3.636416] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 3.649286] sdb: sdb1 sdb2 sdb3 sdb4
[ 3.651327] sd 1:0:0:0: [sdb] Attached SCSI disk
[ 3.944474] ata3: SATA link down (SStatus 0 SControl 300)
[ 4.260471] ata4: SATA link down (SStatus 0 SControl 300)
[ 4.576476] ata5: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 4.578451] ata5.00: ATAPI: PLEXTOR DVDR PX-880SA, 1.12, max UDMA/100
[ 4.580737] ata5.00: configured for UDMA/100
[ 4.583976] scsi 4:0:0:0: CD-ROM PLEXTOR DVDR PX-880SA 1.12 PQ: 0 ANSI: 5
[ 4.641017] sr 4:0:0:0: [sr0] scsi3-mmc drive: 48x/48x writer dvd-ram cd/rw xa/form2 cdda tray
[ 4.642785] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 4.644607] sr 4:0:0:0: Attached scsi CD-ROM sr0
[ 4.644675] sr 4:0:0:0: Attached scsi generic sg2 type 5
[ 4.960464] ata6: SATA link down (SStatus 0 SControl 300)
[ 5.130067] PM: Image not found (code -22)
[ 5.130430] Freeing unused kernel image memory: 1016K
[ 5.142443] Write protecting the kernel read-only data: 16384k
[ 5.144878] Freeing unused kernel image memory: 2008K
[ 5.146894] Freeing unused kernel image memory: 788K
[ 5.148660] Run /init as init process
[ 5.156620] systemd[1]: Inserted module 'autofs4'
[ 5.162614] systemd[1]: systemd +suse.135.g0f9271c133 running in system mode. (+PAM -AUDIT +SELINUX -IMA +APPARMOR -SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[ 5.182498] systemd[1]: Detected architecture x86-64.
[ 5.184407] systemd[1]: Running in initial RAM disk.
[ 5.192684] systemd[1]: Set hostname to <quad>.
[ 5.246034] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.248076] systemd[1]: Listening on udev Control Socket.
[ 5.252088] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.254196] systemd[1]: Created slice system-systemd\x2dhibernate\x2dresume.slice.
[ 5.258245] random: systemd: uninitialized urandom read (16 bytes read)
[ 5.260290] systemd[1]: Listening on udev Kernel Socket.
[ 5.264389] systemd[1]: Listening on Journal Socket (/dev/log).
[ 5.268527] systemd[1]: Listening on Journal Socket.
[ 5.273061] systemd[1]: Starting Create list of required static device nodes for the current kernel...
[ 5.452995] systemd[273]: systemd-udevd.service: ProtectHostname=yes is configured, but the kernel does not support UTS namespaces, ignoring namespace setup.
[ 5.557564] random: crng init done
[ 5.559608] random: 7 urandom warning(s) missed due to ratelimiting
[ 5.910837] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 5.914026] ehci-pci: EHCI PCI platform driver
[ 5.916486] ehci-pci 0000:00:1a.7: EHCI Host Controller
[ 5.918988] ehci-pci 0000:00:1a.7: new USB bus registered, assigned bus number 1
[ 5.925048] ehci-pci 0000:00:1a.7: cache line size of 32 is not supported
[ 5.927346] ehci-pci 0000:00:1a.7: irq 18, io mem 0xf4205000
[ 5.942782] ehci-pci 0000:00:1a.7: USB 2.0 started, EHCI 1.00
[ 5.945819] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.03
[ 5.948633] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 5.951223] usb usb1: Product: EHCI Host Controller
[ 5.954094] usb usb1: Manufacturer: Linux 5.3.0-rc1-linus+ ehci_hcd
[ 5.962649] usb usb1: SerialNumber: 0000:00:1a.7
[ 5.965012] hub 1-0:1.0: USB hub found
[ 5.968137] hub 1-0:1.0: 6 ports detected
[ 5.970729] ehci-pci 0000:00:1d.7: EHCI Host Controller
[ 5.970736] ehci-pci 0000:00:1d.7: new USB bus registered, assigned bus number 2
[ 5.974672] ehci-pci 0000:00:1d.7: cache line size of 32 is not supported
[ 5.974688] ehci-pci 0000:00:1d.7: irq 23, io mem 0xf4204000
[ 5.990463] ehci-pci 0000:00:1d.7: USB 2.0 started, EHCI 1.00
[ 5.990614] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.03
[ 5.990616] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 5.990617] usb usb2: Product: EHCI Host Controller
[ 5.990618] usb usb2: Manufacturer: Linux 5.3.0-rc1-linus+ ehci_hcd
[ 5.990619] usb usb2: SerialNumber: 0000:00:1d.7
[ 5.991160] hub 2-0:1.0: USB hub found
[ 5.991229] hub 2-0:1.0: 6 ports detected
[ 5.994964] firewire_ohci 0000:05:01.0: added OHCI v1.0 device as card 0, 4 IR + 8 IT contexts, quirks 0x2
[ 6.054122] PM: Image not found (code -22)
[ 6.302460] usb 1-3: new high-speed USB device number 2 using ehci-pci
[ 6.462842] usb 1-3: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= 0.00
[ 6.464668] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 6.467431] hub 1-3:1.0: USB hub found
[ 6.469516] hub 1-3:1.0: 3 ports detected
[ 6.502536] firewire_core 0000:05:01.0: created device fw0: GUID 00309526b0132229, S400
[ 6.543005] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[ 6.762452] usb 1-3.1: new high-speed USB device number 3 using ehci-pci
[ 6.836199] systemd-journald[171]: Received SIGTERM from PID 1 (systemd).
[ 6.850738] printk: systemd: 28 output lines suppressed due to ratelimiting
[ 6.870826] usb 1-3.1: New USB device found, idVendor=0424, idProduct=2640, bcdDevice= 0.00
[ 6.872417] usb 1-3.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 6.874222] hub 1-3.1:1.0: USB hub found
[ 6.875951] hub 1-3.1:1.0: 3 ports detected
[ 6.994770] systemd[1]: systemd +suse.135.g0f9271c133 running in system mode. (+PAM -AUDIT +SELINUX -IMA +APPARMOR -SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[ 7.014496] systemd[1]: Detected architecture x86-64.
[ 7.022500] systemd[1]: Set hostname to <quad>.
[ 7.061130] systemd-fstab-generator[470]: Checking was requested for "/home/bernyBulk/Bilder", but it is not a device.
[ 7.062991] systemd-fstab-generator[470]: Checking was requested for "/home/bernyBulk/Downloads", but it is not a device.
[ 7.064767] systemd-fstab-generator[470]: Checking was requested for "/home/bernyBulk/Musik", but it is not a device.
[ 7.066551] systemd-fstab-generator[470]: Checking was requested for "/home/bernyBulk/Videos", but it is not a device.
[ 7.136567] systemd[1]: /usr/lib/systemd/system/auditd.service:12: PIDFile= references a path below legacy directory /var/run/, updating /var/run/auditd.pid → /run/auditd.pid; please update the unit file accordingly.
[ 7.166448] usb 1-3.1.1: new high-speed USB device number 4 using ehci-pci
[ 7.178334] systemd[1]: /usr/lib/systemd/system/display-manager.service:12: PIDFile= references a path below legacy directory /var/run/, updating /var/run/displaymanager.pid → /run/displaymanager.pid; please update the unit file accordingly.
[ 7.212180] systemd[1]: /usr/lib/systemd/system/virtlockd.socket:6: ListenStream= references a path below legacy directory /var/run/, updating /var/run/libvirt/virtlockd-sock → /run/libvirt/virtlockd-sock; please update the unit file accordingly.
[ 7.214662] systemd[1]: /usr/lib/systemd/system/virtlockd-admin.socket:6: ListenStream= references a path below legacy directory /var/run/, updating /var/run/libvirt/virtlockd-admin-sock → /run/libvirt/virtlockd-admin-sock; please update the unit file accordingly.
[ 7.217045] systemd[1]: /usr/lib/systemd/system/virtlogd.socket:6: ListenStream= references a path below legacy directory /var/run/, updating /var/run/libvirt/virtlogd-sock → /run/libvirt/virtlogd-sock; please update the unit file accordingly.
[ 7.219669] systemd[1]: /usr/lib/systemd/system/virtlogd-admin.socket:6: ListenStream= references a path below legacy directory /var/run/, updating /var/run/libvirt/virtlogd-admin-sock → /run/libvirt/virtlogd-admin-sock; please update the unit file accordingly.
[ 7.272507] systemd[1]: /usr/lib/systemd/system/pcscd.socket:5: ListenStream= references a path below legacy directory /var/run/, updating /var/run/pcscd/pcscd.comm → /run/pcscd/pcscd.comm; please update the unit file accordingly.
[ 7.297822] usb 1-3.1.1: New USB device found, idVendor=0424, idProduct=4063, bcdDevice= 1.91
[ 7.299937] usb 1-3.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7.302000] usb 1-3.1.1: Product: Ultra Fast Media Reader
[ 7.304060] usb 1-3.1.1: Manufacturer: Generic
[ 7.306125] usb 1-3.1.1: SerialNumber: 1004261000FE
[ 7.308470] usb-storage 1-3.1.1:1.0: USB Mass Storage device detected
[ 7.314623] scsi host10: usb-storage 1-3.1.1:1.0
[ 7.358460] Adding 15624188k swap on /dev/sda2. Priority:-2 extents:1 across:15624188k SSFS
[ 7.384198] EXT4-fs (dm-0): re-mounted. Opts: acl,user_xattr
[ 7.398451] usb 1-3.1.3: new full-speed USB device number 5 using ehci-pci
[ 7.407613] audit: type=1400 audit(1564170716.859:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ping" pid=510 comm="apparmor_parser"
[ 7.449779] audit: type=1400 audit(1564170716.899:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ghostscript" pid=529 comm="apparmor_parser"
[ 7.449781] audit: type=1400 audit(1564170716.899:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ghostscript///usr/bin/basename" pid=529 comm="apparmor_parser"
[ 7.449783] audit: type=1400 audit(1564170716.899:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ghostscript///usr/bin/dirname" pid=529 comm="apparmor_parser"
[ 7.449784] audit: type=1400 audit(1564170716.899:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ghostscript///usr/bin/hpijs" pid=529 comm="apparmor_parser"
[ 7.449785] audit: type=1400 audit(1564170716.899:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ghostscript//tempdir" pid=529 comm="apparmor_parser"
[ 7.475911] audit: type=1400 audit(1564170716.927:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lsb_release" pid=545 comm="apparmor_parser"
[ 7.504768] audit: type=1400 audit(1564170716.955:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=555 comm="apparmor_parser"
[ 7.507445] audit: type=1400 audit(1564170716.955:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=555 comm="apparmor_parser"
[ 7.519307] systemd[560]: systemd-udevd.service: ProtectHostname=yes is configured, but the kernel does not support UTS namespaces, ignoring namespace setup.
[ 7.521820] usb 1-3.1.3: New USB device found, idVendor=046d, idProduct=c52b, bcdDevice=12.08
[ 7.526020] usb 1-3.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 7.526021] usb 1-3.1.3: Product: USB Receiver
[ 7.526022] usb 1-3.1.3: Manufacturer: Logitech
[ 7.533657] audit: type=1400 audit(1564170716.983:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="klogd" pid=563 comm="apparmor_parser"
[ 7.793928] systemd-journald[509]: Received request to flush runtime journal from PID 1
[ 8.076704] ACPI Warning: SystemIO range 0x0000000000000428-0x000000000000042F conflicts with OpRegion 0x000000000000042C-0x000000000000042D (\GP2C) (20190703/utaddress-204)
[ 8.097217] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[ 8.098574] i801_smbus 0000:00:1f.3: SMBus using PCI interrupt
[ 8.100772] lpc_ich: Resource conflict(s) found affecting gpio_ich
[ 8.117734] libphy: r8169: probed
[ 8.121617] r8169 0000:04:00.0 eth0: RTL8168b/8111b, 00:1a:4d:57:e3:87, XID 380, IRQ 31
[ 8.124620] r8169 0000:04:00.0 eth0: jumbo features [frames: 4080 bytes, tx checksumming: ko]
[ 8.130197] input: HDA ATI HDMI HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input6
[ 8.144663] snd_hda_codec_realtek hdaudioC0D2: autoconfig for ALC889A: line_outs=4 (0x14/0x15/0x16/0x17/0x0) type:line
[ 8.152541] snd_hda_codec_realtek hdaudioC0D2: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 8.168507] snd_hda_codec_realtek hdaudioC0D2: hp_outs=1 (0x1b/0x0/0x0/0x0/0x0)
[ 8.172900] iTCO_wdt: Intel TCO WatchDog Timer Driver v1.11
[ 8.174463] snd_hda_codec_realtek hdaudioC0D2: mono: mono_out=0x0
[ 8.175905] iTCO_wdt: Found a ICH9R TCO device (Version=2, TCOBASE=0x0460)
[ 8.178892] snd_hda_codec_realtek hdaudioC0D2: dig-out=0x1e/0x0
[ 8.185019] snd_hda_codec_realtek hdaudioC0D2: inputs:
[ 8.186622] iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)
[ 8.193212] snd_hda_codec_realtek hdaudioC0D2: Rear Mic=0x18
[ 8.196391] snd_hda_codec_realtek hdaudioC0D2: Front Mic=0x19
[ 8.201192] snd_hda_codec_realtek hdaudioC0D2: Line=0x1a
[ 8.210771] snd_hda_codec_realtek hdaudioC0D2: CD=0x1c
[ 8.217122] snd_hda_codec_realtek hdaudioC0D2: dig-in=0x1f
[ 8.251235] input: HDA Intel Rear Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input7
[ 8.251316] input: HDA Intel Front Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input8
[ 8.251365] input: HDA Intel Line as /devices/pci0000:00/0000:00:1b.0/sound/card0/input9
[ 8.251410] input: HDA Intel Line Out Front as /devices/pci0000:00/0000:00:1b.0/sound/card0/input10
[ 8.251454] input: HDA Intel Line Out Surround as /devices/pci0000:00/0000:00:1b.0/sound/card0/input11
[ 8.251500] input: HDA Intel Line Out CLFE as /devices/pci0000:00/0000:00:1b.0/sound/card0/input12
[ 8.251545] input: HDA Intel Line Out Side as /devices/pci0000:00/0000:00:1b.0/sound/card0/input13
[ 8.277690] psmouse serio1: logips2pp: Detected unknown Logitech mouse model 57
[ 8.328149] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.0/0003:046D:C52B.0001/input/input14
[ 8.334731] usbcore: registered new interface driver uas
[ 8.338068] scsi 10:0:0:0: Direct-Access Generic Ultra HS-SD/MMC 1.91 PQ: 0 ANSI: 0
[ 8.341577] sd 10:0:0:0: Attached scsi generic sg3 type 0
[ 8.353497] sd 10:0:0:0: [sdc] Attached SCSI removable disk
[ 8.386594] hid-generic 0003:046D:C52B.0001: input,hidraw0: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-0000:00:1a.7-3.1.3/input0
[ 8.393011] input: Logitech USB Receiver Mouse as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.1/0003:046D:C52B.0002/input/input15
[ 8.397348] input: Logitech USB Receiver Consumer Control as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.1/0003:046D:C52B.0002/input/input16
[ 8.462568] input: Logitech USB Receiver System Control as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.1/0003:046D:C52B.0002/input/input17
[ 8.467176] hid-generic 0003:046D:C52B.0002: input,hidraw1: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:1a.7-3.1.3/input1
[ 8.469940] hid-generic 0003:046D:C52B.0003: hidraw2: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1a.7-3.1.3/input2
[ 8.671663] logitech-djreceiver 0003:046D:C52B.0003: hidraw0: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:1a.7-3.1.3/input2
[ 8.722640] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 8.749863] input: ImExPS/2 Logitech Explorer Mouse as /devices/platform/i8042/serio1/input/input5
[ 8.797545] input: Logitech Unifying Device. Wireless PID:4055 Mouse as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.2/0003:046D:C52B.0003/0003:046D:4055.0004/input/input19
[ 8.801331] hid-generic 0003:046D:4055.0004: input,hidraw1: USB HID v1.11 Mouse [Logitech Unifying Device. Wireless PID:4055] on usb-0000:00:1a.7-3.1.3/input2:1
[ 8.815764] input: Logitech Unifying Device. Wireless PID:2011 Keyboard as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.2/0003:046D:C52B.0003/0003:046D:2011.0005/input/input23
[ 8.818468] input: Logitech Unifying Device. Wireless PID:2011 Consumer Control as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.2/0003:046D:C52B.0003/0003:046D:2011.0005/input/input24
[ 8.822114] input: Logitech Unifying Device. Wireless PID:2011 System Control as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.2/0003:046D:C52B.0003/0003:046D:2011.0005/input/input25
[ 8.824860] hid-generic 0003:046D:2011.0005: input,hidraw2: USB HID v1.11 Keyboard [Logitech Unifying Device. Wireless PID:2011] on usb-0000:00:1a.7-3.1.3/input2:2
[ 8.932878] input: Logitech Unifying Device. Wireless PID:4055 as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.2/0003:046D:C52B.0003/0003:046D:4055.0004/input/input29
[ 8.939069] logitech-hidpp-device 0003:046D:4055.0004: input,hidraw1: USB HID v1.11 Mouse [Logitech Unifying Device. Wireless PID:4055] on usb-0000:00:1a.7-3.1.3/input2:1
[ 9.124998] input: Logitech K520 as /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1.3/1-3.1.3:1.2/0003:046D:C52B.0003/0003:046D:2011.0005/input/input30
[ 9.128751] logitech-hidpp-device 0003:046D:2011.0005: input,hidraw2: USB HID v1.11 Keyboard [Logitech K520] on usb-0000:00:1a.7-3.1.3/input2:2
[ 9.343920] br0: port 1(eth0) entered blocking state
[ 9.343922] br0: port 1(eth0) entered disabled state
[ 9.343982] device eth0 entered promiscuous mode
[ 9.344894] RTL8211B Gigabit Ethernet r8169-400:00: attached PHY driver [RTL8211B Gigabit Ethernet] (mii_bus:phy_addr=r8169-400:00, irq=IGNORE)
[ 9.462800] br0: port 1(eth0) entered blocking state
[ 9.463507] r8169 0000:04:00.0 eth0: Link is Down
[ 9.466414] br0: port 1(eth0) entered forwarding state
[ 9.474981] IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
[ 9.974193] EXT4-fs (dm-2): mounted filesystem with ordered data mode. Opts: acl,user_xattr
[ 10.342477] br0: port 1(eth0) entered disabled state
[ 10.425184] EXT4-fs (dm-3): mounted filesystem with ordered data mode. Opts: acl,user_xattr
[ 11.550380] r8169 0000:04:00.0 eth0: Link is Up - 1Gbps/Full - flow control off
[ 11.550390] br0: port 1(eth0) entered blocking state
[ 11.550392] br0: port 1(eth0) entered forwarding state
[ 16.452855] logitech-hidpp-device 0003:046D:2011.0005: HID++ 1.0 device connected.
[ 22.342835] logitech-hidpp-device 0003:046D:4055.0004: HID++ 4.5 device connected.
[-- Attachment #3: ethtool.bad --]
[-- Type: text/plain, Size: 1135 bytes --]
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Link partner advertised FEC modes: Not reported
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes
[-- Attachment #4: ethtool.good --]
[-- Type: text/plain, Size: 838 bytes --]
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes
[-- Attachment #5: mii-tool.bad --]
[-- Type: text/plain, Size: 382 bytes --]
eth0: negotiated 100baseTx-FD, link ok
product info: vendor 00:07:32, model 17 rev 2
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
[-- Attachment #6: mii-tool.good --]
[-- Type: text/plain, Size: 317 bytes --]
eth0: 100 Mbit, full duplex, link ok
product info: vendor 00:07:32, model 17 rev 2
basic mode: 100 Mbit, full duplex
basic status: link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 100baseTx-HD
^ permalink raw reply
* Re: next-20190723: bpf/seccomp - systemd/journald issue?
From: Sedat Dilek @ 2019-07-26 20:38 UTC (permalink / raw)
To: Yonghong Song
Cc: Alexei Starovoitov, Daniel Borkmann, Martin Lau, Song Liu,
netdev@vger.kernel.org, bpf@vger.kernel.org, Clang-Built-Linux ML,
Kees Cook, Nick Desaulniers, Nathan Chancellor
In-Reply-To: <c2524c96-d71c-d7db-22ec-12da905dc180@fb.com>
Hi Yonghong Song,
On Fri, Jul 26, 2019 at 5:45 PM Yonghong Song <yhs@fb.com> wrote:
>
>
>
> On 7/26/19 1:26 AM, Sedat Dilek wrote:
> > Hi,
> >
> > I have opened a new issue in the ClangBuiltLinux issue tracker.
>
> Glad to know clang 9 has asm goto support and now It can compile
> kernel again.
>
Yupp.
> >
> > I am seeing a problem in the area bpf/seccomp causing
> > systemd/journald/udevd services to fail.
> >
> > [Fri Jul 26 08:08:43 2019] systemd[453]: systemd-udevd.service: Failed
> > to connect stdout to the journal socket, ignoring: Connection refused
> >
> > This happens when I use the (LLVM) LLD ld.lld-9 linker but not with
> > BFD linker ld.bfd on Debian/buster AMD64.
> > In both cases I use clang-9 (prerelease).
>
> Looks like it is a lld bug.
>
> I see the stack trace has __bpf_prog_run32() which is used by
> kernel bpf interpreter. Could you try to enable bpf jit
> sysctl net.core.bpf_jit_enable = 1
> If this passed, it will prove it is interpreter related.
>
After...
sysctl -w net.core.bpf_jit_enable=1
I can start all failed systemd services.
systemd-journald.service
systemd-udevd.service
haveged.service
This is in maintenance mode.
What is next: Do set a permanent sysctl setting for net.core.bpf_jit_enable?
Regards,
- Sedat -
> >
> > Base for testing: next-20190723.
> >
> > The call-trace looks like this:
> >
> > [Fri Jul 26 08:08:42 2019] BUG: unable to handle page fault for
> > address: ffffffff85403370
> > [Fri Jul 26 08:08:42 2019] #PF: supervisor read access in kernel mode
> > [Fri Jul 26 08:08:42 2019] #PF: error_code(0x0000) - not-present page
> > [Fri Jul 26 08:08:42 2019] PGD 7620e067 P4D 7620e067 PUD 7620f063 PMD
> > 44fe85063 PTE 800fffff8a3fc062
> > [Fri Jul 26 08:08:42 2019] Oops: 0000 [#1] SMP PTI
> > [Fri Jul 26 08:08:42 2019] CPU: 2 PID: 417 Comm: (journald) Not
> > tainted 5.3.0-rc1-5-amd64-cbl-asmgoto #5~buster+dileks1
> > [Fri Jul 26 08:08:42 2019] Hardware name: LENOVO
> > 20HDCTO1WW/20HDCTO1WW, BIOS N1QET83W (1.58 ) 04/18/2019
> > [Fri Jul 26 08:08:42 2019] RIP: 0010:___bpf_prog_run+0x40/0x14f0
> > [Fri Jul 26 08:08:42 2019] Code: f3 eb 24 48 83 f8 38 0f 84 a9 0c 00
> > 00 48 83 f8 39 0f 85 8a 14 00 00 0f 1f 00 48 0f bf 43 02 48 8d 1c c3
> > 48 83 c3 08 0f b6 33 <48> 8b 04 f5 10 2e 40 85 48 83 f8 3b 7f 62 48 83
> > f8 1e 0f 8f c8 00
> > [Fri Jul 26 08:08:42 2019] RSP: 0018:ffff992ec028fcb8 EFLAGS: 00010246
> > [Fri Jul 26 08:08:42 2019] RAX: ffff992ec028fd60 RBX: ffff992ec00e9038
> > RCX: 0000000000000002
> > [Fri Jul 26 08:08:42 2019] RDX: ffff992ec028fd40 RSI: 00000000000000ac
> > RDI: ffff992ec028fce0
> > [Fri Jul 26 08:08:42 2019] RBP: ffff992ec028fcd0 R08: 0000000000000000
> > R09: ffff992ec028ff58
> > [Fri Jul 26 08:08:42 2019] R10: 0000000000000000 R11: ffffffff849b8210
> > R12: 000000007fff0000
> > [Fri Jul 26 08:08:42 2019] R13: ffff992ec028feb8 R14: 0000000000000000
> > R15: ffff992ec028fce0
> > [Fri Jul 26 08:08:42 2019] FS: 00007f5d20f1d940(0000)
> > GS:ffff8ba3d2500000(0000) knlGS:0000000000000000
> > [Fri Jul 26 08:08:42 2019] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > [Fri Jul 26 08:08:42 2019] CR2: ffffffff85403370 CR3: 0000000445b3e001
> > CR4: 00000000003606e0
> > [Fri Jul 26 08:08:42 2019] Call Trace:
> > [Fri Jul 26 08:08:42 2019] __bpf_prog_run32+0x44/0x70
> > [Fri Jul 26 08:08:42 2019] ? flush_tlb_func_common+0xd8/0x230
> > [Fri Jul 26 08:08:42 2019] ? mem_cgroup_commit_charge+0x8c/0x120
> > [Fri Jul 26 08:08:42 2019] ? wp_page_copy+0x464/0x7a0
> > [Fri Jul 26 08:08:42 2019] seccomp_run_filters+0x54/0x110
> > [Fri Jul 26 08:08:42 2019] __seccomp_filter+0xf7/0x6e0
> > [Fri Jul 26 08:08:42 2019] ? do_wp_page+0x32b/0x5d0
> > [Fri Jul 26 08:08:42 2019] ? handle_mm_fault+0x90d/0xbf0
> > [Fri Jul 26 08:08:42 2019] syscall_trace_enter+0x182/0x290
> > [Fri Jul 26 08:08:42 2019] do_syscall_64+0x30/0x90
> > [Fri Jul 26 08:08:42 2019] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> > [Fri Jul 26 08:08:42 2019] RIP: 0033:0x7f5d220d7f59
> > [Fri Jul 26 08:08:42 2019] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00
> > 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8
> > 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 07 6f 0c 00
> > f7 d8 64 89 01 48
> > [Fri Jul 26 08:08:42 2019] RSP: 002b:00007ffd11332b48 EFLAGS: 00000246
> > ORIG_RAX: 000000000000013d
> > [Fri Jul 26 08:08:42 2019] RAX: ffffffffffffffda RBX: 000055bf8ab34010
> > RCX: 00007f5d220d7f59
> > [Fri Jul 26 08:08:42 2019] RDX: 000055bf8ab34010 RSI: 0000000000000000
> > RDI: 0000000000000001
> > [Fri Jul 26 08:08:42 2019] RBP: 000055bf8ab97fb0 R08: 000055bf8abbe180
> > R09: 00000000c000003e
> > [Fri Jul 26 08:08:42 2019] R10: 000055bf8abbe1e0 R11: 0000000000000246
> > R12: 00007ffd11332ba0
> > [Fri Jul 26 08:08:42 2019] R13: 00007ffd11332b98 R14: 00007f5d21f087f8
> > R15: 000000000000002c
> > [Fri Jul 26 08:08:42 2019] Modules linked in: i2c_dev parport_pc
> > sunrpc ppdev lp parport efivarfs ip_tables x_tables autofs4 ext4
> > crc32c_generic mbcache crc16 jbd2 btrfs zstd_decompress zstd_compress
> > algif_skcipher af_alg sd_mod dm_crypt dm_mod raid10 raid456
> > async_raid6_recov async_memcpy async_pq async_xor async_tx xor
> > raid6_pq libcrc32c raid1 uas raid0 usb_storage multipath linear
> > scsi_mod md_mod hid_cherry hid_generic usbhid hid crct10dif_pclmul
> > crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64
> > i915 glue_helper crypto_simd nvme i2c_algo_bit cryptd psmouse xhci_pci
> > drm_kms_helper e1000e i2c_i801 xhci_hcd intel_lpss_pci nvme_core
> > intel_lpss drm usbcore thermal wmi video button
> > [Fri Jul 26 08:08:42 2019] CR2: ffffffff85403370
> > [Fri Jul 26 08:08:42 2019] ---[ end trace 867b35c7d6c6705a ]---
> > [Fri Jul 26 08:08:42 2019] RIP: 0010:___bpf_prog_run+0x40/0x14f0
> > [Fri Jul 26 08:08:42 2019] Code: f3 eb 24 48 83 f8 38 0f 84 a9 0c 00
> > 00 48 83 f8 39 0f 85 8a 14 00 00 0f 1f 00 48 0f bf 43 02 48 8d 1c c3
> > 48 83 c3 08 0f b6 33 <48> 8b 04 f5 10 2e 40 85 48 83 f8 3b 7f 62 48 83
> > f8 1e 0f 8f c8 00
> > [Fri Jul 26 08:08:42 2019] RSP: 0018:ffff992ec028fcb8 EFLAGS: 00010246
> > [Fri Jul 26 08:08:42 2019] RAX: ffff992ec028fd60 RBX: ffff992ec00e9038
> > RCX: 0000000000000002
> > [Fri Jul 26 08:08:42 2019] RDX: ffff992ec028fd40 RSI: 00000000000000ac
> > RDI: ffff992ec028fce0
> > [Fri Jul 26 08:08:42 2019] RBP: ffff992ec028fcd0 R08: 0000000000000000
> > R09: ffff992ec028ff58
> > [Fri Jul 26 08:08:42 2019] R10: 0000000000000000 R11: ffffffff849b8210
> > R12: 000000007fff0000
> > [Fri Jul 26 08:08:42 2019] R13: ffff992ec028feb8 R14: 0000000000000000
> > R15: ffff992ec028fce0
> > [Fri Jul 26 08:08:42 2019] FS: 00007f5d20f1d940(0000)
> > GS:ffff8ba3d2500000(0000) knlGS:0000000000000000
> > [Fri Jul 26 08:08:42 2019] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > [Fri Jul 26 08:08:42 2019] CR2: ffffffff85403370 CR3: 0000000445b3e001
> > CR4: 00000000003606e0
> >
> > More details in [1] and what I tried (for example CONFIG_SECCOMP=n)
> >
> > I have no clue about BPF or SECCOMP.
> >
> > Can you comment on this?
> >
> > If this touches BPF: Can you give me some hints and instructions in debugging?
> >
> > My kernel-config and dmesg-log are attached.
> >
> > Thanks.
> >
> > Regards,
> > - Sedat -
> >
> > [1] https://github.com/ClangBuiltLinux/linux/issues/619
> >
^ permalink raw reply
* [PATCH bpf-next 5/9] selftest/bpf: centralize libbpf logging management for test_progs
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
In-Reply-To: <20190726203747.1124677-1-andriin@fb.com>
Make test_progs test runner own libbpf logging. Also introduce two
levels of verbosity: -v and -vv. First one will be used in subsequent
patches to enable test log output always. Second one increases verbosity
level of libbpf logging further to include debug output as well.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
.../bpf/prog_tests/bpf_verif_scale.c | 6 +++-
.../bpf/prog_tests/reference_tracking.c | 15 +++-------
tools/testing/selftests/bpf/test_progs.c | 29 +++++++++++++++++++
3 files changed, 38 insertions(+), 12 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
index e1b55261526f..2c4d9ef099b4 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
@@ -70,10 +70,11 @@ void test_bpf_verif_scale(void)
const char *cg_sysctl[] = {
"./test_sysctl_loop1.o", "./test_sysctl_loop2.o",
};
+ libbpf_print_fn_t old_print_fn = NULL;
int err, i;
if (verifier_stats)
- libbpf_set_print(libbpf_debug_print);
+ old_print_fn = libbpf_swap_print(libbpf_debug_print);
err = check_load("./loop3.o", BPF_PROG_TYPE_RAW_TRACEPOINT);
printf("test_scale:loop3:%s\n", err ? (error_cnt--, "OK") : "FAIL");
@@ -97,4 +98,7 @@ void test_bpf_verif_scale(void)
err = check_load("./test_seg6_loop.o", BPF_PROG_TYPE_LWT_SEG6LOCAL);
printf("test_scale:test_seg6_loop:%s\n", err ? "FAIL" : "OK");
+
+ if (verifier_stats)
+ libbpf_set_print(old_print_fn);
}
diff --git a/tools/testing/selftests/bpf/prog_tests/reference_tracking.c b/tools/testing/selftests/bpf/prog_tests/reference_tracking.c
index 5633be43828f..c9a6ef809bd1 100644
--- a/tools/testing/selftests/bpf/prog_tests/reference_tracking.c
+++ b/tools/testing/selftests/bpf/prog_tests/reference_tracking.c
@@ -1,15 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <test_progs.h>
-static int libbpf_debug_print(enum libbpf_print_level level,
- const char *format, va_list args)
-{
- if (level == LIBBPF_DEBUG)
- return 0;
-
- return vfprintf(stderr, format, args);
-}
-
void test_reference_tracking(void)
{
const char *file = "./test_sk_lookup_kern.o";
@@ -36,9 +27,11 @@ void test_reference_tracking(void)
/* Expect verifier failure if test name has 'fail' */
if (strstr(title, "fail") != NULL) {
- libbpf_set_print(NULL);
+ libbpf_print_fn_t old_print_fn;
+
+ old_print_fn = libbpf_swap_print(NULL);
err = !bpf_program__load(prog, "GPL", 0);
- libbpf_set_print(libbpf_debug_print);
+ libbpf_set_print(old_print_fn);
} else {
err = bpf_program__load(prog, "GPL", 0);
}
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index 6e04b9f83777..94b6951b90b3 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -186,6 +186,8 @@ enum ARG_KEYS {
ARG_TEST_NUM = 'n',
ARG_TEST_NAME = 't',
ARG_VERIFIER_STATS = 's',
+
+ ARG_VERBOSE = 'v',
};
static const struct argp_option opts[] = {
@@ -195,6 +197,8 @@ static const struct argp_option opts[] = {
"Run tests with names containing NAME" },
{ "verifier-stats", ARG_VERIFIER_STATS, NULL, 0,
"Output verifier statistics", },
+ { "verbose", ARG_VERBOSE, "LEVEL", OPTION_ARG_OPTIONAL,
+ "Verbose output (use -vv for extra verbose output)" },
{},
};
@@ -202,12 +206,22 @@ struct test_env {
int test_num_selector;
const char *test_name_selector;
bool verifier_stats;
+ bool verbose;
+ bool very_verbose;
};
static struct test_env env = {
.test_num_selector = -1,
};
+static int libbpf_print_fn(enum libbpf_print_level level,
+ const char *format, va_list args)
+{
+ if (!env.very_verbose && level == LIBBPF_DEBUG)
+ return 0;
+ return vfprintf(stderr, format, args);
+}
+
static error_t parse_arg(int key, char *arg, struct argp_state *state)
{
struct test_env *env = state->input;
@@ -229,6 +243,19 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
case ARG_VERIFIER_STATS:
env->verifier_stats = true;
break;
+ case ARG_VERBOSE:
+ if (arg) {
+ if (strcmp(arg, "v") == 0) {
+ env->very_verbose = true;
+ } else {
+ fprintf(stderr,
+ "Unrecognized verbosity setting ('%s'), only -v and -vv are supported\n",
+ arg);
+ return -EINVAL;
+ }
+ }
+ env->verbose = true;
+ break;
case ARGP_KEY_ARG:
argp_usage(state);
break;
@@ -255,6 +282,8 @@ int main(int argc, char **argv)
if (err)
return err;
+ libbpf_set_print(libbpf_print_fn);
+
srand(time(NULL));
jit_enabled = is_jit_enabled();
--
2.17.1
^ permalink raw reply related
* [PATCH bpf-next 9/9] selftests/bpf: convert send_signal.c to use subtests
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
In-Reply-To: <20190726203747.1124677-1-andriin@fb.com>
Convert send_signal set of tests to be exposed as three sub-tests.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
tools/testing/selftests/bpf/prog_tests/send_signal.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/send_signal.c b/tools/testing/selftests/bpf/prog_tests/send_signal.c
index d950f4558897..461b423d0584 100644
--- a/tools/testing/selftests/bpf/prog_tests/send_signal.c
+++ b/tools/testing/selftests/bpf/prog_tests/send_signal.c
@@ -219,7 +219,10 @@ void test_send_signal(void)
{
int ret = 0;
- ret |= test_send_signal_tracepoint();
- ret |= test_send_signal_perf();
- ret |= test_send_signal_nmi();
+ if (test__start_subtest("send_signal_tracepoint"))
+ ret |= test_send_signal_tracepoint();
+ if (test__start_subtest("send_signal_perf"))
+ ret |= test_send_signal_perf();
+ if (test__start_subtest("send_signal_nmi"))
+ ret |= test_send_signal_nmi();
}
--
2.17.1
^ permalink raw reply related
* [PATCH bpf-next 8/9] selftests/bpf: convert bpf_verif_scale.c to sub-tests API
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
In-Reply-To: <20190726203747.1124677-1-andriin@fb.com>
Expose each BPF verifier scale test as individual sub-test to allow
independent results output and test selection.
Test run results now look like this:
$ sudo ./test_progs -t verif/
#3/1 loop3.o:OK
#3/2 test_verif_scale1.o:OK
#3/3 test_verif_scale2.o:OK
#3/4 test_verif_scale3.o:OK
#3/5 pyperf50.o:OK
#3/6 pyperf100.o:OK
#3/7 pyperf180.o:OK
#3/8 pyperf600.o:OK
#3/9 pyperf600_nounroll.o:OK
#3/10 loop1.o:OK
#3/11 loop2.o:OK
#3/12 strobemeta.o:OK
#3/13 strobemeta_nounroll1.o:OK
#3/14 strobemeta_nounroll2.o:OK
#3/15 test_sysctl_loop1.o:OK
#3/16 test_sysctl_loop2.o:OK
#3/17 test_xdp_loop.o:OK
#3/18 test_seg6_loop.o:OK
#3 bpf_verif_scale:OK
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
.../bpf/prog_tests/bpf_verif_scale.c | 77 ++++++++++---------
1 file changed, 40 insertions(+), 37 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
index 95f012c417fe..a77c52395a2f 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
@@ -33,14 +33,25 @@ static int check_load(const char *file, enum bpf_prog_type type)
return err;
}
+struct scale_test_def {
+ const char *file;
+ enum bpf_prog_type attach_type;
+ bool fails;
+};
+
void test_bpf_verif_scale(void)
{
- const char *sched_cls[] = {
- "./test_verif_scale1.o", "./test_verif_scale2.o", "./test_verif_scale3.o",
- };
- const char *raw_tp[] = {
+ struct scale_test_def tests[] = {
+ { "loop3.o", BPF_PROG_TYPE_RAW_TRACEPOINT, true /* fails */ },
+
+ { "test_verif_scale1.o", BPF_PROG_TYPE_SCHED_CLS },
+ { "test_verif_scale2.o", BPF_PROG_TYPE_SCHED_CLS },
+ { "test_verif_scale3.o", BPF_PROG_TYPE_SCHED_CLS },
+
/* full unroll by llvm */
- "./pyperf50.o", "./pyperf100.o", "./pyperf180.o",
+ { "pyperf50.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
+ { "pyperf100.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
+ { "pyperf180.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
/* partial unroll. llvm will unroll loop ~150 times.
* C loop count -> 600.
@@ -48,7 +59,7 @@ void test_bpf_verif_scale(void)
* 16k insns in loop body.
* Total of 5 such loops. Total program size ~82k insns.
*/
- "./pyperf600.o",
+ { "pyperf600.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
/* no unroll at all.
* C loop count -> 600.
@@ -56,22 +67,26 @@ void test_bpf_verif_scale(void)
* ~110 insns in loop body.
* Total of 5 such loops. Total program size ~1500 insns.
*/
- "./pyperf600_nounroll.o",
+ { "pyperf600_nounroll.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
- "./loop1.o", "./loop2.o",
+ { "loop1.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
+ { "loop2.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
/* partial unroll. 19k insn in a loop.
* Total program size 20.8k insn.
* ~350k processed_insns
*/
- "./strobemeta.o",
+ { "strobemeta.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
/* no unroll, tiny loops */
- "./strobemeta_nounroll1.o",
- "./strobemeta_nounroll2.o",
- };
- const char *cg_sysctl[] = {
- "./test_sysctl_loop1.o", "./test_sysctl_loop2.o",
+ { "strobemeta_nounroll1.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
+ { "strobemeta_nounroll2.o", BPF_PROG_TYPE_RAW_TRACEPOINT },
+
+ { "test_sysctl_loop1.o", BPF_PROG_TYPE_CGROUP_SYSCTL },
+ { "test_sysctl_loop2.o", BPF_PROG_TYPE_CGROUP_SYSCTL },
+
+ { "test_xdp_loop.o", BPF_PROG_TYPE_XDP },
+ { "test_seg6_loop.o", BPF_PROG_TYPE_LWT_SEG6LOCAL },
};
libbpf_print_fn_t old_print_fn = NULL;
int err, i;
@@ -81,33 +96,21 @@ void test_bpf_verif_scale(void)
old_print_fn = libbpf_swap_print(libbpf_debug_print);
}
- err = check_load("./loop3.o", BPF_PROG_TYPE_RAW_TRACEPOINT);
- test__printf("test_scale:loop3:%s\n",
- err ? (error_cnt--, "OK") : "FAIL");
+ for (i = 0; i < ARRAY_SIZE(tests); i++) {
+ const struct scale_test_def *test = &tests[i];
- for (i = 0; i < ARRAY_SIZE(sched_cls); i++) {
- err = check_load(sched_cls[i], BPF_PROG_TYPE_SCHED_CLS);
- test__printf("test_scale:%s:%s\n", sched_cls[i],
- err ? "FAIL" : "OK");
- }
+ if (!test__start_subtest(test->file))
+ continue;
- for (i = 0; i < ARRAY_SIZE(raw_tp); i++) {
- err = check_load(raw_tp[i], BPF_PROG_TYPE_RAW_TRACEPOINT);
- test__printf("test_scale:%s:%s\n", raw_tp[i],
- err ? "FAIL" : "OK");
+ err = check_load(test->file, test->attach_type);
+ if (test->fails) { /* expected to fail */
+ if (err)
+ error_cnt--;
+ else
+ error_cnt++;
+ }
}
- for (i = 0; i < ARRAY_SIZE(cg_sysctl); i++) {
- err = check_load(cg_sysctl[i], BPF_PROG_TYPE_CGROUP_SYSCTL);
- test__printf("test_scale:%s:%s\n", cg_sysctl[i],
- err ? "FAIL" : "OK");
- }
- err = check_load("./test_xdp_loop.o", BPF_PROG_TYPE_XDP);
- test__printf("test_scale:test_xdp_loop:%s\n", err ? "FAIL" : "OK");
-
- err = check_load("./test_seg6_loop.o", BPF_PROG_TYPE_LWT_SEG6LOCAL);
- test__printf("test_scale:test_seg6_loop:%s\n", err ? "FAIL" : "OK");
-
if (env.verifier_stats)
libbpf_set_print(old_print_fn);
}
--
2.17.1
^ permalink raw reply related
* [PATCH bpf-next 6/9] selftests/bpf: abstract away test log output
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
In-Reply-To: <20190726203747.1124677-1-andriin@fb.com>
This patch changes how test output is printed out. By default, if test
had no errors, the only output will be a single line with test number,
name, and verdict at the end, e.g.:
#31 xdp:OK
If test had any errors, all log output captured during test execution
will be output after test completes.
It's possible to force output of log with `-v` (`--verbose`) option, in
which case output won't be buffered and will be output immediately.
To support this, individual tests are required to use helper methods for
logging: `test__printf()` and `test__vprintf()`.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
.../selftests/bpf/prog_tests/bpf_obj_id.c | 6 +-
.../bpf/prog_tests/bpf_verif_scale.c | 31 ++--
.../bpf/prog_tests/get_stack_raw_tp.c | 4 +-
.../selftests/bpf/prog_tests/l4lb_all.c | 2 +-
.../selftests/bpf/prog_tests/map_lock.c | 10 +-
.../selftests/bpf/prog_tests/send_signal.c | 8 +-
.../selftests/bpf/prog_tests/spinlock.c | 2 +-
.../bpf/prog_tests/stacktrace_build_id.c | 4 +-
.../bpf/prog_tests/stacktrace_build_id_nmi.c | 4 +-
.../selftests/bpf/prog_tests/xdp_noinline.c | 3 +-
tools/testing/selftests/bpf/test_progs.c | 135 +++++++++++++-----
tools/testing/selftests/bpf/test_progs.h | 37 ++++-
12 files changed, 173 insertions(+), 73 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_obj_id.c b/tools/testing/selftests/bpf/prog_tests/bpf_obj_id.c
index cb827383db4d..fb5840a62548 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_obj_id.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_obj_id.c
@@ -106,8 +106,8 @@ void test_bpf_obj_id(void)
if (CHECK(err ||
prog_infos[i].type != BPF_PROG_TYPE_SOCKET_FILTER ||
info_len != sizeof(struct bpf_prog_info) ||
- (jit_enabled && !prog_infos[i].jited_prog_len) ||
- (jit_enabled &&
+ (env.jit_enabled && !prog_infos[i].jited_prog_len) ||
+ (env.jit_enabled &&
!memcmp(jited_insns, zeros, sizeof(zeros))) ||
!prog_infos[i].xlated_prog_len ||
!memcmp(xlated_insns, zeros, sizeof(zeros)) ||
@@ -121,7 +121,7 @@ void test_bpf_obj_id(void)
err, errno, i,
prog_infos[i].type, BPF_PROG_TYPE_SOCKET_FILTER,
info_len, sizeof(struct bpf_prog_info),
- jit_enabled,
+ env.jit_enabled,
prog_infos[i].jited_prog_len,
prog_infos[i].xlated_prog_len,
!!memcmp(jited_insns, zeros, sizeof(zeros)),
diff --git a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
index 2c4d9ef099b4..95f012c417fe 100644
--- a/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
+++ b/tools/testing/selftests/bpf/prog_tests/bpf_verif_scale.c
@@ -4,12 +4,15 @@
static int libbpf_debug_print(enum libbpf_print_level level,
const char *format, va_list args)
{
- if (level != LIBBPF_DEBUG)
- return vfprintf(stderr, format, args);
+ if (level != LIBBPF_DEBUG) {
+ test__vprintf(format, args);
+ return 0;
+ }
if (!strstr(format, "verifier log"))
return 0;
- return vfprintf(stderr, "%s", args);
+ test__vprintf("%s", args);
+ return 0;
}
static int check_load(const char *file, enum bpf_prog_type type)
@@ -73,32 +76,38 @@ void test_bpf_verif_scale(void)
libbpf_print_fn_t old_print_fn = NULL;
int err, i;
- if (verifier_stats)
+ if (env.verifier_stats) {
+ test__force_log();
old_print_fn = libbpf_swap_print(libbpf_debug_print);
+ }
err = check_load("./loop3.o", BPF_PROG_TYPE_RAW_TRACEPOINT);
- printf("test_scale:loop3:%s\n", err ? (error_cnt--, "OK") : "FAIL");
+ test__printf("test_scale:loop3:%s\n",
+ err ? (error_cnt--, "OK") : "FAIL");
for (i = 0; i < ARRAY_SIZE(sched_cls); i++) {
err = check_load(sched_cls[i], BPF_PROG_TYPE_SCHED_CLS);
- printf("test_scale:%s:%s\n", sched_cls[i], err ? "FAIL" : "OK");
+ test__printf("test_scale:%s:%s\n", sched_cls[i],
+ err ? "FAIL" : "OK");
}
for (i = 0; i < ARRAY_SIZE(raw_tp); i++) {
err = check_load(raw_tp[i], BPF_PROG_TYPE_RAW_TRACEPOINT);
- printf("test_scale:%s:%s\n", raw_tp[i], err ? "FAIL" : "OK");
+ test__printf("test_scale:%s:%s\n", raw_tp[i],
+ err ? "FAIL" : "OK");
}
for (i = 0; i < ARRAY_SIZE(cg_sysctl); i++) {
err = check_load(cg_sysctl[i], BPF_PROG_TYPE_CGROUP_SYSCTL);
- printf("test_scale:%s:%s\n", cg_sysctl[i], err ? "FAIL" : "OK");
+ test__printf("test_scale:%s:%s\n", cg_sysctl[i],
+ err ? "FAIL" : "OK");
}
err = check_load("./test_xdp_loop.o", BPF_PROG_TYPE_XDP);
- printf("test_scale:test_xdp_loop:%s\n", err ? "FAIL" : "OK");
+ test__printf("test_scale:test_xdp_loop:%s\n", err ? "FAIL" : "OK");
err = check_load("./test_seg6_loop.o", BPF_PROG_TYPE_LWT_SEG6LOCAL);
- printf("test_scale:test_seg6_loop:%s\n", err ? "FAIL" : "OK");
+ test__printf("test_scale:test_seg6_loop:%s\n", err ? "FAIL" : "OK");
- if (verifier_stats)
+ if (env.verifier_stats)
libbpf_set_print(old_print_fn);
}
diff --git a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c
index 9d73a8f932ac..3d59b3c841fe 100644
--- a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c
+++ b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c
@@ -41,7 +41,7 @@ static void get_stack_print_output(void *ctx, int cpu, void *data, __u32 size)
* just assume it is good if the stack is not empty.
* This could be improved in the future.
*/
- if (jit_enabled) {
+ if (env.jit_enabled) {
found = num_stack > 0;
} else {
for (i = 0; i < num_stack; i++) {
@@ -58,7 +58,7 @@ static void get_stack_print_output(void *ctx, int cpu, void *data, __u32 size)
}
} else {
num_stack = e->kern_stack_size / sizeof(__u64);
- if (jit_enabled) {
+ if (env.jit_enabled) {
good_kern_stack = num_stack > 0;
} else {
for (i = 0; i < num_stack; i++) {
diff --git a/tools/testing/selftests/bpf/prog_tests/l4lb_all.c b/tools/testing/selftests/bpf/prog_tests/l4lb_all.c
index 20ddca830e68..5ce572c03a5f 100644
--- a/tools/testing/selftests/bpf/prog_tests/l4lb_all.c
+++ b/tools/testing/selftests/bpf/prog_tests/l4lb_all.c
@@ -74,7 +74,7 @@ static void test_l4lb(const char *file)
}
if (bytes != MAGIC_BYTES * NUM_ITER * 2 || pkts != NUM_ITER * 2) {
error_cnt++;
- printf("test_l4lb:FAIL:stats %lld %lld\n", bytes, pkts);
+ test__printf("test_l4lb:FAIL:stats %lld %lld\n", bytes, pkts);
}
out:
bpf_object__close(obj);
diff --git a/tools/testing/selftests/bpf/prog_tests/map_lock.c b/tools/testing/selftests/bpf/prog_tests/map_lock.c
index ee99368c595c..2e78217ed3fd 100644
--- a/tools/testing/selftests/bpf/prog_tests/map_lock.c
+++ b/tools/testing/selftests/bpf/prog_tests/map_lock.c
@@ -9,12 +9,12 @@ static void *parallel_map_access(void *arg)
for (i = 0; i < 10000; i++) {
err = bpf_map_lookup_elem_flags(map_fd, &key, vars, BPF_F_LOCK);
if (err) {
- printf("lookup failed\n");
+ test__printf("lookup failed\n");
error_cnt++;
goto out;
}
if (vars[0] != 0) {
- printf("lookup #%d var[0]=%d\n", i, vars[0]);
+ test__printf("lookup #%d var[0]=%d\n", i, vars[0]);
error_cnt++;
goto out;
}
@@ -22,8 +22,8 @@ static void *parallel_map_access(void *arg)
for (j = 2; j < 17; j++) {
if (vars[j] == rnd)
continue;
- printf("lookup #%d var[1]=%d var[%d]=%d\n",
- i, rnd, j, vars[j]);
+ test__printf("lookup #%d var[1]=%d var[%d]=%d\n",
+ i, rnd, j, vars[j]);
error_cnt++;
goto out;
}
@@ -43,7 +43,7 @@ void test_map_lock(void)
err = bpf_prog_load(file, BPF_PROG_TYPE_CGROUP_SKB, &obj, &prog_fd);
if (err) {
- printf("test_map_lock:bpf_prog_load errno %d\n", errno);
+ test__printf("test_map_lock:bpf_prog_load errno %d\n", errno);
goto close_prog;
}
map_fd[0] = bpf_find_map(__func__, obj, "hash_map");
diff --git a/tools/testing/selftests/bpf/prog_tests/send_signal.c b/tools/testing/selftests/bpf/prog_tests/send_signal.c
index 54218ee3c004..d950f4558897 100644
--- a/tools/testing/selftests/bpf/prog_tests/send_signal.c
+++ b/tools/testing/selftests/bpf/prog_tests/send_signal.c
@@ -202,8 +202,8 @@ static int test_send_signal_nmi(void)
-1 /* cpu */, -1 /* group_fd */, 0 /* flags */);
if (pmu_fd == -1) {
if (errno == ENOENT) {
- printf("%s:SKIP:no PERF_COUNT_HW_CPU_CYCLES\n",
- __func__);
+ test__printf("%s:SKIP:no PERF_COUNT_HW_CPU_CYCLES\n",
+ __func__);
return 0;
}
/* Let the test fail with a more informative message */
@@ -222,8 +222,4 @@ void test_send_signal(void)
ret |= test_send_signal_tracepoint();
ret |= test_send_signal_perf();
ret |= test_send_signal_nmi();
- if (!ret)
- printf("test_send_signal:OK\n");
- else
- printf("test_send_signal:FAIL\n");
}
diff --git a/tools/testing/selftests/bpf/prog_tests/spinlock.c b/tools/testing/selftests/bpf/prog_tests/spinlock.c
index 114ebe6a438e..deb2db5b85b0 100644
--- a/tools/testing/selftests/bpf/prog_tests/spinlock.c
+++ b/tools/testing/selftests/bpf/prog_tests/spinlock.c
@@ -12,7 +12,7 @@ void test_spinlock(void)
err = bpf_prog_load(file, BPF_PROG_TYPE_CGROUP_SKB, &obj, &prog_fd);
if (err) {
- printf("test_spin_lock:bpf_prog_load errno %d\n", errno);
+ test__printf("test_spin_lock:bpf_prog_load errno %d\n", errno);
goto close_prog;
}
for (i = 0; i < 4; i++)
diff --git a/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c b/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c
index ac44fda84833..356d2c017a9c 100644
--- a/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c
+++ b/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id.c
@@ -109,8 +109,8 @@ void test_stacktrace_build_id(void)
if (build_id_matches < 1 && retry--) {
bpf_link__destroy(link);
bpf_object__close(obj);
- printf("%s:WARN:Didn't find expected build ID from the map, retrying\n",
- __func__);
+ test__printf("%s:WARN:Didn't find expected build ID from the map, retrying\n",
+ __func__);
goto retry;
}
diff --git a/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id_nmi.c b/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id_nmi.c
index 9557b7dfb782..f44f2c159714 100644
--- a/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id_nmi.c
+++ b/tools/testing/selftests/bpf/prog_tests/stacktrace_build_id_nmi.c
@@ -140,8 +140,8 @@ void test_stacktrace_build_id_nmi(void)
if (build_id_matches < 1 && retry--) {
bpf_link__destroy(link);
bpf_object__close(obj);
- printf("%s:WARN:Didn't find expected build ID from the map, retrying\n",
- __func__);
+ test__printf("%s:WARN:Didn't find expected build ID from the map, retrying\n",
+ __func__);
goto retry;
}
diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_noinline.c b/tools/testing/selftests/bpf/prog_tests/xdp_noinline.c
index 09e6b46f5515..b5404494b8aa 100644
--- a/tools/testing/selftests/bpf/prog_tests/xdp_noinline.c
+++ b/tools/testing/selftests/bpf/prog_tests/xdp_noinline.c
@@ -75,7 +75,8 @@ void test_xdp_noinline(void)
}
if (bytes != MAGIC_BYTES * NUM_ITER * 2 || pkts != NUM_ITER * 2) {
error_cnt++;
- printf("test_xdp_noinline:FAIL:stats %lld %lld\n", bytes, pkts);
+ test__printf("test_xdp_noinline:FAIL:stats %lld %lld\n",
+ bytes, pkts);
}
out:
bpf_object__close(obj);
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index 94b6951b90b3..3cf3ebda1d31 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -6,9 +6,75 @@
#include <argp.h>
#include <string.h>
+/* defined in test_progs.h */
+struct test_env env = {
+ .test_num_selector = -1,
+};
int error_cnt, pass_cnt;
-bool jit_enabled;
-bool verifier_stats = false;
+
+struct prog_test_def {
+ const char *test_name;
+ int test_num;
+ void (*run_test)(void);
+ bool force_log;
+ int pass_cnt;
+ int error_cnt;
+ bool tested;
+};
+
+void test__force_log() {
+ env.test->force_log = true;
+}
+
+void test__vprintf(const char *fmt, va_list args)
+{
+ size_t rem_sz;
+ int ret;
+
+ if (env.verbose || (env.test && env.test->force_log)) {
+ vfprintf(stderr, fmt, args);
+ return;
+ }
+
+try_again:
+ rem_sz = env.log_cap - env.log_cnt;
+ if (rem_sz) {
+ ret = vsnprintf(env.log_buf + env.log_cnt, rem_sz, fmt, args);
+ if (ret < 0) {
+ fprintf(stderr, "failed to log message w/ fmt '%s'\n", fmt);
+ return;
+ }
+ }
+
+ if (ret >= rem_sz) {
+ size_t new_sz = env.log_cap * 3 / 2;
+ char *new_buf;
+
+ if (new_sz < 4096)
+ new_sz = 4096;
+
+ new_buf = realloc(env.log_buf, new_sz);
+ if (!new_buf) {
+ fprintf(stderr, "failed to realloc log buffer: %d\n",
+ errno);
+ return;
+ }
+ env.log_buf = new_buf;
+ env.log_cap = new_sz;
+ goto try_again;
+ }
+
+ env.log_cnt += ret + 1;
+}
+
+void test__printf(const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ test__vprintf(fmt, args);
+ va_end(args);
+}
struct ipv4_packet pkt_v4 = {
.eth.h_proto = __bpf_constant_htons(ETH_P_IP),
@@ -163,20 +229,15 @@ void *spin_lock_thread(void *arg)
#include <prog_tests/tests.h>
#undef DEFINE_TEST
-struct prog_test_def {
- const char *test_name;
- int test_num;
- void (*run_test)(void);
-};
-
static struct prog_test_def prog_test_defs[] = {
-#define DEFINE_TEST(name) { \
- .test_name = #name, \
- .run_test = &test_##name, \
+#define DEFINE_TEST(name) { \
+ .test_name = #name, \
+ .run_test = &test_##name, \
},
#include <prog_tests/tests.h>
#undef DEFINE_TEST
};
+const int prog_test_cnt = ARRAY_SIZE(prog_test_defs);
const char *argp_program_version = "test_progs 0.1";
const char *argp_program_bug_address = "<bpf@vger.kernel.org>";
@@ -186,7 +247,6 @@ enum ARG_KEYS {
ARG_TEST_NUM = 'n',
ARG_TEST_NAME = 't',
ARG_VERIFIER_STATS = 's',
-
ARG_VERBOSE = 'v',
};
@@ -202,24 +262,13 @@ static const struct argp_option opts[] = {
{},
};
-struct test_env {
- int test_num_selector;
- const char *test_name_selector;
- bool verifier_stats;
- bool verbose;
- bool very_verbose;
-};
-
-static struct test_env env = {
- .test_num_selector = -1,
-};
-
static int libbpf_print_fn(enum libbpf_print_level level,
const char *format, va_list args)
{
if (!env.very_verbose && level == LIBBPF_DEBUG)
return 0;
- return vfprintf(stderr, format, args);
+ test__vprintf(format, args);
+ return 0;
}
static error_t parse_arg(int key, char *arg, struct argp_state *state)
@@ -267,7 +316,6 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
return 0;
}
-
int main(int argc, char **argv)
{
static const struct argp argp = {
@@ -275,7 +323,6 @@ int main(int argc, char **argv)
.parser = parse_arg,
.doc = argp_program_doc,
};
- struct prog_test_def *test;
int err, i;
err = argp_parse(&argp, argc, argv, 0, NULL, &env);
@@ -286,13 +333,14 @@ int main(int argc, char **argv)
srand(time(NULL));
- jit_enabled = is_jit_enabled();
+ env.jit_enabled = is_jit_enabled();
- verifier_stats = env.verifier_stats;
-
- for (i = 0; i < ARRAY_SIZE(prog_test_defs); i++) {
- test = &prog_test_defs[i];
+ for (i = 0; i < prog_test_cnt; i++) {
+ struct prog_test_def *test = &prog_test_defs[i];
+ int old_pass_cnt = pass_cnt;
+ int old_error_cnt = error_cnt;
+ env.test = test;
test->test_num = i + 1;
if (env.test_num_selector >= 0 &&
@@ -303,8 +351,29 @@ int main(int argc, char **argv)
continue;
test->run_test();
+ test->tested = true;
+ test->pass_cnt = pass_cnt - old_pass_cnt;
+ test->error_cnt = error_cnt - old_error_cnt;
+ if (test->error_cnt)
+ env.fail_cnt++;
+ else
+ env.succ_cnt++;
+
+ if (env.verbose || test->force_log || test->error_cnt) {
+ if (env.log_cnt) {
+ fprintf(stdout, "%s", env.log_buf);
+ if (env.log_buf[env.log_cnt - 1] != '\n')
+ fprintf(stdout, "\n");
+ }
+ }
+ env.log_cnt = 0;
+
+ printf("#%d %s:%s\n", test->test_num, test->test_name,
+ test->error_cnt ? "FAIL" : "OK");
}
+ printf("Summary: %d PASSED, %d FAILED\n", env.succ_cnt, env.fail_cnt);
+
+ free(env.log_buf);
- printf("Summary: %d PASSED, %d FAILED\n", pass_cnt, error_cnt);
return error_cnt ? EXIT_FAILURE : EXIT_SUCCESS;
}
diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h
index 49e0f7d85643..62f55a4231e9 100644
--- a/tools/testing/selftests/bpf/test_progs.h
+++ b/tools/testing/selftests/bpf/test_progs.h
@@ -38,9 +38,33 @@ typedef __u16 __sum16;
#include "trace_helpers.h"
#include "flow_dissector_load.h"
-extern int error_cnt, pass_cnt;
-extern bool jit_enabled;
-extern bool verifier_stats;
+struct prog_test_def;
+
+struct test_env {
+ int test_num_selector;
+ const char *test_name_selector;
+ bool verifier_stats;
+ bool verbose;
+ bool very_verbose;
+
+ bool jit_enabled;
+
+ struct prog_test_def *test;
+ char *log_buf;
+ size_t log_cnt;
+ size_t log_cap;
+
+ int succ_cnt;
+ int fail_cnt;
+};
+
+extern int error_cnt;
+extern int pass_cnt;
+extern struct test_env env;
+
+extern void test__printf(const char *fmt, ...);
+extern void test__vprintf(const char *fmt, va_list args);
+extern void test__force_log();
#define MAGIC_BYTES 123
@@ -64,11 +88,12 @@ extern struct ipv6_packet pkt_v6;
int __ret = !!(condition); \
if (__ret) { \
error_cnt++; \
- printf("%s:FAIL:%s ", __func__, tag); \
- printf(format); \
+ test__printf("%s:FAIL:%s ", __func__, tag); \
+ test__printf(format); \
} else { \
pass_cnt++; \
- printf("%s:PASS:%s %d nsec\n", __func__, tag, duration);\
+ test__printf("%s:PASS:%s %d nsec\n", \
+ __func__, tag, duration); \
} \
__ret; \
})
--
2.17.1
^ permalink raw reply related
* [PATCH bpf-next 7/9] selftests/bpf: add sub-tests support for test_progs
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
In-Reply-To: <20190726203747.1124677-1-andriin@fb.com>
Allow tests to have their own set of sub-tests. Also add ability to do
test/subtest selection using `-t <test-name>/<subtest-name>` and `-n
<test-nums-set>/<subtest-nums-set>`, as an extension of existing -t/-n
selector options. For the <test-num-set> format: it's a comma-separated
list of either individual test numbers (1-based), or range of test
numbers. E.g., all of the following are valid sets of test numbers:
- 10
- 1,2,3
- 1-3
- 5-10,1,3-4
'/<subtest' part is optional, but has the same format. E.g., to select
test #3 and its sub-tests #10 through #15, use: -t 3/10-15.
Similarly, to select tests by name, use `-t verif/strobe`:
$ sudo ./test_progs -t verif/strobe
#3/12 strobemeta.o:OK
#3/13 strobemeta_nounroll1.o:OK
#3/14 strobemeta_nounroll2.o:OK
#3 bpf_verif_scale:OK
Summary: 1/3 PASSED, 0 FAILED
Example of using subtest API is in the next patch, converting
bpf_verif_scale.c tests to use sub-tests.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
tools/testing/selftests/bpf/test_progs.c | 198 ++++++++++++++++++++---
tools/testing/selftests/bpf/test_progs.h | 16 +-
2 files changed, 185 insertions(+), 29 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index 3cf3ebda1d31..7a2db48b6fd1 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -7,9 +7,7 @@
#include <string.h>
/* defined in test_progs.h */
-struct test_env env = {
- .test_num_selector = -1,
-};
+struct test_env env;
int error_cnt, pass_cnt;
struct prog_test_def {
@@ -20,8 +18,82 @@ struct prog_test_def {
int pass_cnt;
int error_cnt;
bool tested;
+
+ const char *subtest_name;
+ int subtest_num;
+
+ /* store counts before subtest started */
+ int old_pass_cnt;
+ int old_error_cnt;
};
+static bool should_run(struct test_selector *sel, int num, const char *name)
+{
+ if (sel->name && sel->name[0] && !strstr(name, sel->name))
+ return false;
+
+ if (!sel->num_set)
+ return true;
+
+ return num < sel->num_set_len && sel->num_set[num];
+}
+
+static void dump_test_log(const struct prog_test_def *test, bool failed)
+{
+ if (env.verbose || test->force_log || failed) {
+ if (env.log_cnt) {
+ fprintf(stdout, "%s", env.log_buf);
+ if (env.log_buf[env.log_cnt - 1] != '\n')
+ fprintf(stdout, "\n");
+ }
+ env.log_cnt = 0;
+ }
+}
+
+void test__end_subtest()
+{
+ struct prog_test_def *test = env.test;
+ int sub_error_cnt = error_cnt - test->old_error_cnt;
+
+ if (sub_error_cnt)
+ env.fail_cnt++;
+ else
+ env.sub_succ_cnt++;
+
+ dump_test_log(test, sub_error_cnt);
+
+ printf("#%d/%d %s:%s\n",
+ test->test_num, test->subtest_num,
+ test->subtest_name, sub_error_cnt ? "FAIL" : "OK");
+}
+
+bool test__start_subtest(const char *name)
+{
+ struct prog_test_def *test = env.test;
+
+ if (test->subtest_name) {
+ test__end_subtest();
+ test->subtest_name = NULL;
+ }
+
+ test->subtest_num++;
+
+ if (!name || !name[0]) {
+ fprintf(stderr, "Subtest #%d didn't provide sub-test name!\n",
+ test->subtest_num);
+ return false;
+ }
+
+ if (!should_run(&env.subtest_selector, test->subtest_num, name))
+ return false;
+
+ test->subtest_name = name;
+ env.test->old_pass_cnt = pass_cnt;
+ env.test->old_error_cnt = error_cnt;
+
+ return true;
+}
+
void test__force_log() {
env.test->force_log = true;
}
@@ -271,24 +343,103 @@ static int libbpf_print_fn(enum libbpf_print_level level,
return 0;
}
+int parse_num_list(const char *s, struct test_selector *sel)
+{
+ int i, set_len = 0, num, start = 0, end = -1;
+ bool *set = NULL, *tmp, parsing_end = false;
+ char *next;
+
+ while (s[0]) {
+ errno = 0;
+ num = strtol(s, &next, 10);
+ if (errno)
+ return -errno;
+
+ if (parsing_end)
+ end = num;
+ else
+ start = num;
+
+ if (!parsing_end && *next == '-') {
+ s = next + 1;
+ parsing_end = true;
+ continue;
+ } else if (*next == ',') {
+ parsing_end = false;
+ s = next + 1;
+ end = num;
+ } else if (*next == '\0') {
+ parsing_end = false;
+ s = next;
+ end = num;
+ } else {
+ return -EINVAL;
+ }
+
+ if (start > end)
+ return -EINVAL;
+
+ if (end + 1 > set_len) {
+ set_len = end + 1;
+ tmp = realloc(set, set_len);
+ if (!tmp) {
+ free(set);
+ return -ENOMEM;
+ }
+ set = tmp;
+ }
+ for (i = start; i <= end; i++) {
+ set[i] = true;
+ }
+
+ }
+
+ if (!set)
+ return -EINVAL;
+
+ sel->num_set = set;
+ sel->num_set_len = set_len;
+
+ return 0;
+}
+
static error_t parse_arg(int key, char *arg, struct argp_state *state)
{
struct test_env *env = state->input;
switch (key) {
case ARG_TEST_NUM: {
- int test_num;
+ char *subtest_str = strchr(arg, '/');
- errno = 0;
- test_num = strtol(arg, NULL, 10);
- if (errno)
- return -errno;
- env->test_num_selector = test_num;
+ if (subtest_str) {
+ *subtest_str = '\0';
+ if (parse_num_list(subtest_str + 1,
+ &env->subtest_selector)) {
+ fprintf(stderr,
+ "Failed to parse subtest numbers.\n");
+ return -EINVAL;
+ }
+ }
+ if (parse_num_list(arg, &env->test_selector)) {
+ fprintf(stderr, "Failed to parse test numbers.\n");
+ return -EINVAL;
+ }
break;
}
- case ARG_TEST_NAME:
- env->test_name_selector = arg;
+ case ARG_TEST_NAME: {
+ char *subtest_str = strchr(arg, '/');
+
+ if (subtest_str) {
+ *subtest_str = '\0';
+ env->subtest_selector.name = strdup(subtest_str + 1);
+ if (!env->subtest_selector.name)
+ return -ENOMEM;
+ }
+ env->test_selector.name = strdup(arg);
+ if (!env->test_selector.name)
+ return -ENOMEM;
break;
+ }
case ARG_VERIFIER_STATS:
env->verifier_stats = true;
break;
@@ -343,14 +494,15 @@ int main(int argc, char **argv)
env.test = test;
test->test_num = i + 1;
- if (env.test_num_selector >= 0 &&
- test->test_num != env.test_num_selector)
- continue;
- if (env.test_name_selector &&
- !strstr(test->test_name, env.test_name_selector))
+ if (!should_run(&env.test_selector,
+ test->test_num, test->test_name))
continue;
test->run_test();
+ /* ensure last sub-test is finalized properly */
+ if (test->subtest_name)
+ test__end_subtest();
+
test->tested = true;
test->pass_cnt = pass_cnt - old_pass_cnt;
test->error_cnt = error_cnt - old_error_cnt;
@@ -359,21 +511,17 @@ int main(int argc, char **argv)
else
env.succ_cnt++;
- if (env.verbose || test->force_log || test->error_cnt) {
- if (env.log_cnt) {
- fprintf(stdout, "%s", env.log_buf);
- if (env.log_buf[env.log_cnt - 1] != '\n')
- fprintf(stdout, "\n");
- }
- }
- env.log_cnt = 0;
+ dump_test_log(test, test->error_cnt);
printf("#%d %s:%s\n", test->test_num, test->test_name,
test->error_cnt ? "FAIL" : "OK");
}
- printf("Summary: %d PASSED, %d FAILED\n", env.succ_cnt, env.fail_cnt);
+ printf("Summary: %d/%d PASSED, %d FAILED\n",
+ env.succ_cnt, env.sub_succ_cnt, env.fail_cnt);
free(env.log_buf);
+ free(env.test_selector.num_set);
+ free(env.subtest_selector.num_set);
return error_cnt ? EXIT_FAILURE : EXIT_SUCCESS;
}
diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h
index 62f55a4231e9..afd14962456f 100644
--- a/tools/testing/selftests/bpf/test_progs.h
+++ b/tools/testing/selftests/bpf/test_progs.h
@@ -40,9 +40,15 @@ typedef __u16 __sum16;
struct prog_test_def;
+struct test_selector {
+ const char *name;
+ bool *num_set;
+ int num_set_len;
+};
+
struct test_env {
- int test_num_selector;
- const char *test_name_selector;
+ struct test_selector test_selector;
+ struct test_selector subtest_selector;
bool verifier_stats;
bool verbose;
bool very_verbose;
@@ -54,8 +60,9 @@ struct test_env {
size_t log_cnt;
size_t log_cap;
- int succ_cnt;
- int fail_cnt;
+ int succ_cnt; /* successful tests */
+ int sub_succ_cnt; /* successful sub-tests */
+ int fail_cnt; /* total failed tests + sub-tests */
};
extern int error_cnt;
@@ -65,6 +72,7 @@ extern struct test_env env;
extern void test__printf(const char *fmt, ...);
extern void test__vprintf(const char *fmt, va_list args);
extern void test__force_log();
+extern bool test__start_subtest(const char *name);
#define MAGIC_BYTES 123
--
2.17.1
^ permalink raw reply related
* [PATCH bpf-next 4/9] libbpf: add libbpf_swap_print to get previous print func
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
In-Reply-To: <20190726203747.1124677-1-andriin@fb.com>
libbpf_swap_print allows to restore previously set print function.
This is useful when running many independent test with one default print
function, but overriding log verbosity for particular subset of tests.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
tools/lib/bpf/libbpf.c | 8 ++++++++
tools/lib/bpf/libbpf.h | 1 +
tools/lib/bpf/libbpf.map | 5 +++++
3 files changed, 14 insertions(+)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 8741c39adb1c..0c254b6c9685 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -79,6 +79,14 @@ void libbpf_set_print(libbpf_print_fn_t fn)
__libbpf_pr = fn;
}
+libbpf_print_fn_t libbpf_swap_print(libbpf_print_fn_t fn)
+{
+ libbpf_print_fn_t old_print_fn = __libbpf_pr;
+
+ __libbpf_pr = fn;
+ return old_print_fn;
+}
+
__printf(2, 3)
void libbpf_print(enum libbpf_print_level level, const char *format, ...)
{
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 5cbf459ece0b..4e0aa893571f 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -58,6 +58,7 @@ typedef int (*libbpf_print_fn_t)(enum libbpf_print_level level,
const char *, va_list ap);
LIBBPF_API void libbpf_set_print(libbpf_print_fn_t fn);
+LIBBPF_API libbpf_print_fn_t libbpf_swap_print(libbpf_print_fn_t fn);
/* Hide internal to user */
struct bpf_object;
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map
index f9d316e873d8..e211c38ddc43 100644
--- a/tools/lib/bpf/libbpf.map
+++ b/tools/lib/bpf/libbpf.map
@@ -184,3 +184,8 @@ LIBBPF_0.0.4 {
perf_buffer__new_raw;
perf_buffer__poll;
} LIBBPF_0.0.3;
+
+LIBBPF_0.0.5 {
+ global:
+ libbpf_swap_print;
+} LIBBPF_0.0.4;
--
2.17.1
^ permalink raw reply related
* [PATCH bpf-next 3/9] selftests/bpf: add test selectors by number and name to test_progs
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
In-Reply-To: <20190726203747.1124677-1-andriin@fb.com>
Add ability to specify either test number or test name substring to
narrow down a set of test to run.
Usage:
sudo ./test_progs -n 1
sudo ./test_progs -t attach_probe
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
tools/testing/selftests/bpf/test_progs.c | 43 +++++++++++++++++++++---
1 file changed, 39 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index eea88ba59225..6e04b9f83777 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -4,6 +4,7 @@
#include "test_progs.h"
#include "bpf_rlimit.h"
#include <argp.h>
+#include <string.h>
int error_cnt, pass_cnt;
bool jit_enabled;
@@ -164,6 +165,7 @@ void *spin_lock_thread(void *arg)
struct prog_test_def {
const char *test_name;
+ int test_num;
void (*run_test)(void);
};
@@ -181,26 +183,49 @@ const char *argp_program_bug_address = "<bpf@vger.kernel.org>";
const char argp_program_doc[] = "BPF selftests test runner";
enum ARG_KEYS {
+ ARG_TEST_NUM = 'n',
+ ARG_TEST_NAME = 't',
ARG_VERIFIER_STATS = 's',
};
static const struct argp_option opts[] = {
+ { "num", ARG_TEST_NUM, "NUM", 0,
+ "Run test number NUM only " },
+ { "name", ARG_TEST_NAME, "NAME", 0,
+ "Run tests with names containing NAME" },
{ "verifier-stats", ARG_VERIFIER_STATS, NULL, 0,
"Output verifier statistics", },
{},
};
struct test_env {
+ int test_num_selector;
+ const char *test_name_selector;
bool verifier_stats;
};
-static struct test_env env = {};
+static struct test_env env = {
+ .test_num_selector = -1,
+};
static error_t parse_arg(int key, char *arg, struct argp_state *state)
{
struct test_env *env = state->input;
switch (key) {
+ case ARG_TEST_NUM: {
+ int test_num;
+
+ errno = 0;
+ test_num = strtol(arg, NULL, 10);
+ if (errno)
+ return -errno;
+ env->test_num_selector = test_num;
+ break;
+ }
+ case ARG_TEST_NAME:
+ env->test_name_selector = arg;
+ break;
case ARG_VERIFIER_STATS:
env->verifier_stats = true;
break;
@@ -223,7 +248,7 @@ int main(int argc, char **argv)
.parser = parse_arg,
.doc = argp_program_doc,
};
- const struct prog_test_def *def;
+ struct prog_test_def *test;
int err, i;
err = argp_parse(&argp, argc, argv, 0, NULL, &env);
@@ -237,8 +262,18 @@ int main(int argc, char **argv)
verifier_stats = env.verifier_stats;
for (i = 0; i < ARRAY_SIZE(prog_test_defs); i++) {
- def = &prog_test_defs[i];
- def->run_test();
+ test = &prog_test_defs[i];
+
+ test->test_num = i + 1;
+
+ if (env.test_num_selector >= 0 &&
+ test->test_num != env.test_num_selector)
+ continue;
+ if (env.test_name_selector &&
+ !strstr(test->test_name, env.test_name_selector))
+ continue;
+
+ test->run_test();
}
printf("Summary: %d PASSED, %d FAILED\n", pass_cnt, error_cnt);
--
2.17.1
^ permalink raw reply related
* [PATCH bpf-next 2/9] selftests/bpf: revamp test_progs to allow more control
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
In-Reply-To: <20190726203747.1124677-1-andriin@fb.com>
Refactor test_progs to allow better control on what's being run.
Also use argp to do argument parsing, so that it's easier to keep adding
more options.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
tools/testing/selftests/bpf/Makefile | 8 +--
tools/testing/selftests/bpf/test_progs.c | 84 +++++++++++++++++++++---
2 files changed, 77 insertions(+), 15 deletions(-)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index bb66cc4a7f34..3bd0f4a0336a 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -239,14 +239,8 @@ $(OUTPUT)/test_progs: test_progs.c $(PROG_TESTS_FILES) | $(PROG_TESTS_H)
$(PROG_TESTS_H): $(PROG_TESTS_FILES) | $(PROG_TESTS_DIR)
$(shell ( cd prog_tests/; \
echo '/* Generated header, do not edit */'; \
- echo '#ifdef DECLARE'; \
ls *.c 2> /dev/null | \
- sed -e 's@\([^\.]*\)\.c@extern void test_\1(void);@'; \
- echo '#endif'; \
- echo '#ifdef CALL'; \
- ls *.c 2> /dev/null | \
- sed -e 's@\([^\.]*\)\.c@test_\1();@'; \
- echo '#endif' \
+ sed -e 's@\([^\.]*\)\.c@DEFINE_TEST(\1)@'; \
) > $(PROG_TESTS_H))
MAP_TESTS_DIR = $(OUTPUT)/map_tests
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c
index dae0819b1141..eea88ba59225 100644
--- a/tools/testing/selftests/bpf/test_progs.c
+++ b/tools/testing/selftests/bpf/test_progs.c
@@ -3,6 +3,7 @@
*/
#include "test_progs.h"
#include "bpf_rlimit.h"
+#include <argp.h>
int error_cnt, pass_cnt;
bool jit_enabled;
@@ -156,22 +157,89 @@ void *spin_lock_thread(void *arg)
pthread_exit(arg);
}
-#define DECLARE
+/* extern declarations for test funcs */
+#define DEFINE_TEST(name) extern void test_##name();
#include <prog_tests/tests.h>
-#undef DECLARE
+#undef DEFINE_TEST
-int main(int ac, char **av)
+struct prog_test_def {
+ const char *test_name;
+ void (*run_test)(void);
+};
+
+static struct prog_test_def prog_test_defs[] = {
+#define DEFINE_TEST(name) { \
+ .test_name = #name, \
+ .run_test = &test_##name, \
+},
+#include <prog_tests/tests.h>
+#undef DEFINE_TEST
+};
+
+const char *argp_program_version = "test_progs 0.1";
+const char *argp_program_bug_address = "<bpf@vger.kernel.org>";
+const char argp_program_doc[] = "BPF selftests test runner";
+
+enum ARG_KEYS {
+ ARG_VERIFIER_STATS = 's',
+};
+
+static const struct argp_option opts[] = {
+ { "verifier-stats", ARG_VERIFIER_STATS, NULL, 0,
+ "Output verifier statistics", },
+ {},
+};
+
+struct test_env {
+ bool verifier_stats;
+};
+
+static struct test_env env = {};
+
+static error_t parse_arg(int key, char *arg, struct argp_state *state)
{
+ struct test_env *env = state->input;
+
+ switch (key) {
+ case ARG_VERIFIER_STATS:
+ env->verifier_stats = true;
+ break;
+ case ARGP_KEY_ARG:
+ argp_usage(state);
+ break;
+ case ARGP_KEY_END:
+ break;
+ default:
+ return ARGP_ERR_UNKNOWN;
+ }
+ return 0;
+}
+
+
+int main(int argc, char **argv)
+{
+ static const struct argp argp = {
+ .options = opts,
+ .parser = parse_arg,
+ .doc = argp_program_doc,
+ };
+ const struct prog_test_def *def;
+ int err, i;
+
+ err = argp_parse(&argp, argc, argv, 0, NULL, &env);
+ if (err)
+ return err;
+
srand(time(NULL));
jit_enabled = is_jit_enabled();
- if (ac == 2 && strcmp(av[1], "-s") == 0)
- verifier_stats = true;
+ verifier_stats = env.verifier_stats;
-#define CALL
-#include <prog_tests/tests.h>
-#undef CALL
+ for (i = 0; i < ARRAY_SIZE(prog_test_defs); i++) {
+ def = &prog_test_defs[i];
+ def->run_test();
+ }
printf("Summary: %d PASSED, %d FAILED\n", pass_cnt, error_cnt);
return error_cnt ? EXIT_FAILURE : EXIT_SUCCESS;
--
2.17.1
^ permalink raw reply related
* [PATCH bpf-next 1/9] selftests/bpf: prevent headers to be compiled as C code
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
In-Reply-To: <20190726203747.1124677-1-andriin@fb.com>
Apprently listing header as a normal dependency for a binary output
makes it go through compilation as if it was C code. This currently
works without a problem, but in subsequent commits causes problems for
differently generated test.h for test_progs. Marking those headers as
order-only dependency solves the issue.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
tools/testing/selftests/bpf/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 11c9c62c3362..bb66cc4a7f34 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -235,7 +235,7 @@ PROG_TESTS_H := $(PROG_TESTS_DIR)/tests.h
PROG_TESTS_FILES := $(wildcard prog_tests/*.c)
test_progs.c: $(PROG_TESTS_H)
$(OUTPUT)/test_progs: CFLAGS += $(TEST_PROGS_CFLAGS)
-$(OUTPUT)/test_progs: test_progs.c $(PROG_TESTS_H) $(PROG_TESTS_FILES)
+$(OUTPUT)/test_progs: test_progs.c $(PROG_TESTS_FILES) | $(PROG_TESTS_H)
$(PROG_TESTS_H): $(PROG_TESTS_FILES) | $(PROG_TESTS_DIR)
$(shell ( cd prog_tests/; \
echo '/* Generated header, do not edit */'; \
@@ -256,7 +256,7 @@ MAP_TESTS_H := $(MAP_TESTS_DIR)/tests.h
MAP_TESTS_FILES := $(wildcard map_tests/*.c)
test_maps.c: $(MAP_TESTS_H)
$(OUTPUT)/test_maps: CFLAGS += $(TEST_MAPS_CFLAGS)
-$(OUTPUT)/test_maps: test_maps.c $(MAP_TESTS_H) $(MAP_TESTS_FILES)
+$(OUTPUT)/test_maps: test_maps.c $(MAP_TESTS_FILES) | $(MAP_TESTS_H)
$(MAP_TESTS_H): $(MAP_TESTS_FILES) | $(MAP_TESTS_DIR)
$(shell ( cd map_tests/; \
echo '/* Generated header, do not edit */'; \
@@ -277,7 +277,7 @@ VERIFIER_TESTS_H := $(VERIFIER_TESTS_DIR)/tests.h
VERIFIER_TEST_FILES := $(wildcard verifier/*.c)
test_verifier.c: $(VERIFIER_TESTS_H)
$(OUTPUT)/test_verifier: CFLAGS += $(TEST_VERIFIER_CFLAGS)
-$(OUTPUT)/test_verifier: test_verifier.c $(VERIFIER_TESTS_H)
+$(OUTPUT)/test_verifier: test_verifier.c | $(VERIFIER_TEST_FILES) $(VERIFIER_TESTS_H)
$(VERIFIER_TESTS_H): $(VERIFIER_TEST_FILES) | $(VERIFIER_TESTS_DIR)
$(shell ( cd verifier/; \
echo '/* Generated header, do not edit */'; \
--
2.17.1
^ permalink raw reply related
* [PATCH bpf-next 0/9] Revamp test_progs as a test running framework
From: Andrii Nakryiko @ 2019-07-26 20:37 UTC (permalink / raw)
To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko
This patch set makes a number of changes to test_progs selftest, which is
a collection of many other tests (and sometimes sub-tests as well), to provide
better testing experience and allow to start convering many individual test
programs under selftests/bpf into a single and convenient test runner.
Patch #1 fixes issue with Makefile, which makes prog_tests/test.h compiled as
a C code. This fix allows to change how test.h is generated, providing ability
to have more control on what and how tests are run.
Patch #2 changes how test.h is auto-generated, which allows to have test
definitions, instead of just running test functions. This gives ability to do
more complicated test run policies.
Patch #3 adds `-t <test-name>` and `-n <test-num>` selectors to run only
subset of tests.
Patch #4 adds libbpf_swap_print() API allowing to temporarily replace current
print callback and then set it back. This is necessary for some tests that
want more control over libbpf logging.
Patch #5 sets up and takes over libbpf logging from individual tests to
test_prog runner, adding -vv verbosity to capture debug output from libbpf.
This is useful when debugging failing tests.
Patch #6 furthers test output management and buffers it by default, emitting
log output only if test fails. This give succinct and clean default test
output. It's possible to bypass this behavior with -v flag, which will turn
off test output buffering.
Patch #7 adds support for sub-tests. It also enhances -t and -n selectors to
both support ability to specify sub-test selectors, as well as enhancing
number selector to accept sets of test, instead of just individual test
number.
Patch #8 converts bpf_verif_scale.c test to use sub-test APIs.
Patch #9 converts send_signal.c tests to use sub-test APIs.
Andrii Nakryiko (9):
selftests/bpf: prevent headers to be compiled as C code
selftests/bpf: revamp test_progs to allow more control
selftests/bpf: add test selectors by number and name to test_progs
libbpf: add libbpf_swap_print to get previous print func
selftest/bpf: centralize libbpf logging management for test_progs
selftests/bpf: abstract away test log output
selftests/bpf: add sub-tests support for test_progs
selftests/bpf: convert bpf_verif_scale.c to sub-tests API
selftests/bpf: convert send_signal.c to use subtests
tools/lib/bpf/libbpf.c | 8 +
tools/lib/bpf/libbpf.h | 1 +
tools/lib/bpf/libbpf.map | 5 +
tools/testing/selftests/bpf/Makefile | 14 +-
.../selftests/bpf/prog_tests/bpf_obj_id.c | 6 +-
.../bpf/prog_tests/bpf_verif_scale.c | 90 +++--
.../bpf/prog_tests/get_stack_raw_tp.c | 4 +-
.../selftests/bpf/prog_tests/l4lb_all.c | 2 +-
.../selftests/bpf/prog_tests/map_lock.c | 10 +-
.../bpf/prog_tests/reference_tracking.c | 15 +-
.../selftests/bpf/prog_tests/send_signal.c | 17 +-
.../selftests/bpf/prog_tests/spinlock.c | 2 +-
.../bpf/prog_tests/stacktrace_build_id.c | 4 +-
.../bpf/prog_tests/stacktrace_build_id_nmi.c | 4 +-
.../selftests/bpf/prog_tests/xdp_noinline.c | 3 +-
tools/testing/selftests/bpf/test_progs.c | 373 +++++++++++++++++-
tools/testing/selftests/bpf/test_progs.h | 45 ++-
17 files changed, 501 insertions(+), 102 deletions(-)
--
2.17.1
^ permalink raw reply
* Re: [REGRESSION] 5.3-rc1: r8169: remove 1000/Half from supported modes
From: Heiner Kallweit @ 2019-07-26 20:24 UTC (permalink / raw)
To: Bernhard Held, linux-kernel, netdev; +Cc: David S. Miller
In-Reply-To: <a291af45-310c-8b60-ae7e-392e73e3bad1@gmx.de>
On 26.07.2019 22:16, Bernhard Held wrote:
> Hi Heiner,
>
> with commit a6851c613fd7 "r8169: remove 1000/Half from supported modes" my RTL8111B GB-link stops working. It thinks that it established a link, however nothing is actually transmitted. Setting the mode with `mii-tool -F 100baseTx-HD` establishes a successful connection.
>
Can you provide standard ethtool output w/ and w/o this patch? Also a full dmesg output
with the patch would be helpful.
Is "100baseTx-HD" a typo and you mean GBit? And any special reason why you set half duplex?
> Reverting a6851c613fd7 (while considering the file name change) fixes autonegotiation for me.
>
> Kind regards
> Bernhard
>
Heiner
^ permalink raw reply
* [REGRESSION] 5.3-rc1: r8169: remove 1000/Half from supported modes
From: Bernhard Held @ 2019-07-26 20:16 UTC (permalink / raw)
To: linux-kernel, Heiner Kallweit, netdev; +Cc: David S. Miller
Hi Heiner,
with commit a6851c613fd7 "r8169: remove 1000/Half from supported modes" my RTL8111B GB-link stops working. It thinks that it established a link, however nothing is actually transmitted. Setting the mode with `mii-tool -F 100baseTx-HD` establishes a successful connection.
Reverting a6851c613fd7 (while considering the file name change) fixes autonegotiation for me.
Kind regards
Bernhard
^ permalink raw reply
* Re: [PATCH] net: key: af_key: Fix possible null-pointer dereferences in pfkey_send_policy_notify()
From: Jeremy Sowden @ 2019-07-26 20:15 UTC (permalink / raw)
To: Steffen Klassert; +Cc: Jia-Ju Bai, herbert, davem, netdev, linux-kernel
In-Reply-To: <20190726094514.GD14601@gauss3.secunet.de>
[-- Attachment #1: Type: text/plain, Size: 2003 bytes --]
On 2019-07-26, at 11:45:14 +0200, Steffen Klassert wrote:
> On Wed, Jul 24, 2019 at 05:35:09PM +0800, Jia-Ju Bai wrote:
> > In pfkey_send_policy_notify(), there is an if statement on line 3081
> > to check whether xp is NULL:
> > if (xp && xp->type != XFRM_POLICY_TYPE_MAIN)
> >
> > When xp is NULL, it is used by key_notify_policy() on line 3090:
> > key_notify_policy(xp, ...)
> > pfkey_xfrm_policy2msg_prep(xp) -- line 2211
> > pfkey_xfrm_policy2msg_size(xp) -- line 2046
> > for (i=0; i<xp->xfrm_nr; i++) -- line 2026
> > t = xp->xfrm_vec + i; -- line 2027
> > key_notify_policy(xp, ...)
> > xp_net(xp) -- line 2231
> > return read_pnet(&xp->xp_net); -- line 534
>
> Please don't quote random code lines, explain the problem instead.
>
> >
> > Thus, possible null-pointer dereferences may occur.
> >
> > To fix these bugs, xp is checked before calling key_notify_policy().
> >
> > These bugs are found by a static analysis tool STCheck written by
> > us.
> >
> > Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> > ---
> > net/key/af_key.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/net/key/af_key.c b/net/key/af_key.c
> > index b67ed3a8486c..ced54144d5fd 100644
> > --- a/net/key/af_key.c
> > +++ b/net/key/af_key.c
> > @@ -3087,6 +3087,8 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, const struc
> > case XFRM_MSG_DELPOLICY:
> > case XFRM_MSG_NEWPOLICY:
> > case XFRM_MSG_UPDPOLICY:
> > + if (!xp)
> > + break;
>
> I think this can not happen. Who sends one of these notifications
> without a pointer to the policy?
I had a quick grep and found two places where km_policy_notify is passed
NULL as the policy:
$ grep -rn '\<km_policy_notify(NULL,' net/
net/xfrm/xfrm_user.c:2154: km_policy_notify(NULL, 0, &c);
net/key/af_key.c:2788: km_policy_notify(NULL, 0, &c);
They occur in xfrm_flush_policy() and pfkey_spdflush() respectively.
J.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox