* [renesas-devel:master] BUILD SUCCESS 2b913e80d50bfd17088670569460220937257212
From: kernel test robot @ 2020-07-18 1:05 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-renesas-soc
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git master
branch HEAD: 2b913e80d50bfd17088670569460220937257212 Merge branch 'renesas-next' into renesas-devel
elapsed time: 765m
configs tested: 98
configs skipped: 2
The following configs have been built successfully.
More configs may be tested in the coming days.
arm defconfig
arm allyesconfig
arm allmodconfig
arm allnoconfig
arm64 allyesconfig
arm64 defconfig
arm64 allmodconfig
arm64 allnoconfig
nds32 allnoconfig
powerpc ppc64e_defconfig
arm viper_defconfig
ia64 alldefconfig
sh se7721_defconfig
ia64 tiger_defconfig
mips jmr3927_defconfig
arm xcep_defconfig
h8300 allyesconfig
powerpc linkstation_defconfig
sparc sparc32_defconfig
arm badge4_defconfig
powerpc pmac32_defconfig
riscv rv32_defconfig
i386 allyesconfig
i386 defconfig
i386 debian-10.3
i386 allnoconfig
ia64 allmodconfig
ia64 defconfig
ia64 allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k allnoconfig
m68k sun3_defconfig
m68k defconfig
m68k allyesconfig
nios2 defconfig
nios2 allyesconfig
openrisc defconfig
c6x allyesconfig
c6x allnoconfig
openrisc allyesconfig
nds32 defconfig
csky allyesconfig
csky defconfig
alpha defconfig
alpha allyesconfig
xtensa allyesconfig
h8300 allmodconfig
xtensa defconfig
arc defconfig
arc allyesconfig
sh allmodconfig
sh allnoconfig
microblaze allnoconfig
mips allyesconfig
mips allnoconfig
mips allmodconfig
parisc allnoconfig
parisc defconfig
parisc allyesconfig
parisc allmodconfig
powerpc defconfig
powerpc allyesconfig
powerpc rhel-kconfig
powerpc allmodconfig
powerpc allnoconfig
i386 randconfig-a016-20200717
i386 randconfig-a011-20200717
i386 randconfig-a015-20200717
i386 randconfig-a012-20200717
i386 randconfig-a013-20200717
i386 randconfig-a014-20200717
x86_64 randconfig-a005-20200717
x86_64 randconfig-a006-20200717
x86_64 randconfig-a002-20200717
x86_64 randconfig-a001-20200717
x86_64 randconfig-a003-20200717
x86_64 randconfig-a004-20200717
riscv allyesconfig
riscv allnoconfig
riscv defconfig
riscv allmodconfig
s390 allyesconfig
s390 allnoconfig
s390 allmodconfig
s390 defconfig
sparc allyesconfig
sparc defconfig
sparc64 defconfig
sparc64 allnoconfig
sparc64 allyesconfig
sparc64 allmodconfig
x86_64 rhel-7.6-kselftests
x86_64 rhel-8.3
x86_64 kexec
x86_64 rhel
x86_64 lkp
x86_64 fedora-25
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* Re: [RFT PATCH v3 1/9] RISC-V: Move DT mapping outof fixmap
From: Atish Patra @ 2020-07-18 1:05 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Mark Rutland, linux-efi, Kees Cook, Heinrich Schuchardt,
Masahiro Yamada, Anup Patel, linux-kernel@vger.kernel.org,
Mike Rapoport, Atish Patra, Palmer Dabbelt, Zong Li,
Paul Walmsley, Greentime Hu, linux-riscv, Will Deacon,
Ard Biesheuvel, Linux ARM
In-Reply-To: <CAK8P3a2EesjQAs-YGrCO=cYfUVWFQ3CbJfVXJx3qZjCS_XW+wA@mail.gmail.com>
On Thu, Jul 16, 2020 at 11:32 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Fri, Jul 17, 2020 at 1:41 AM Atish Patra <atish.patra@wdc.com> wrote:
> >
> > From: Anup Patel <anup.patel@wdc.com>
> >
> > Currently, RISC-V reserves 1MB of fixmap memory for device tree. However,
> > it maps only single PMD (2MB) space for fixmap which leaves only < 1MB space
> > left for other kernel features such as early ioremap which requires fixmap
> > as well. The fixmap size can be increased by another 2MB but it brings
> > additional complexity and changes the virtual memory layout as well.
> > If we require some additional feature requiring fixmap again, it has to be
> > moved again.
> >
> > Technically, DT doesn't need a fixmap as the memory occupied by the DT is
> > only used during boot. Thus, init memory section can be used for the same
> > purpose as well. This simplifies fixmap implementation.
> >
> > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > Signed-off-by: Atish Patra <atish.patra@wdc.com>
>
> The patch seems fine for the moment, but I have one concern for the
> long run:
>
> > +#define DTB_EARLY_SIZE SZ_1M
> > +static char early_dtb[DTB_EARLY_SIZE] __initdata;
>
> Hardcoding the size in .bss seems slightly problematic both for
> small and for big systems. On machines with very little memory,
> this can lead to running out of free pages before .initdata gets freed,
> and it increases the size of the uncompressed vmlinux file by quite
> a bit.
>
> On some systems, the 1MB limit may get too small. While most dtbs
> would fall into the range between 10KB and 100KB, it can also be
> much larger than that, e.g. when there are DT properties that include
> blobs like device firmware that gets loaded into hardware by a kernel
> driver.
>
I was not aware that we can do such things. Is there a current example of that ?
> Is there anything stopping you from parsing the FDT in its original
> location without the extra copy before it gets unflattened?
>
That's what the original code was doing. A fixmap entry was added to
map the original fdt
location to a virtual so that parse_dtb can be operated on a virtual
address. But we can't map
both FDT & early ioremap within a single PMD region( 2MB ). That's why
we removed the DT
mapping from the fixmap to .bss section. The other alternate option is
to increase the fixmap space to
4MB which seems more fragile.
> Arnd
--
Regards,
Atish
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply
* Re: [RFT PATCH v3 1/9] RISC-V: Move DT mapping outof fixmap
From: Atish Patra @ 2020-07-18 1:05 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Atish Patra, linux-kernel@vger.kernel.org, Anup Patel,
Ard Biesheuvel, Greentime Hu, Kees Cook, linux-efi, linux-riscv,
Mark Rutland, Masahiro Yamada, Mike Rapoport, Palmer Dabbelt,
Paul Walmsley, Will Deacon, Zong Li, Heinrich Schuchardt,
Linux ARM
In-Reply-To: <CAK8P3a2EesjQAs-YGrCO=cYfUVWFQ3CbJfVXJx3qZjCS_XW+wA@mail.gmail.com>
On Thu, Jul 16, 2020 at 11:32 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Fri, Jul 17, 2020 at 1:41 AM Atish Patra <atish.patra@wdc.com> wrote:
> >
> > From: Anup Patel <anup.patel@wdc.com>
> >
> > Currently, RISC-V reserves 1MB of fixmap memory for device tree. However,
> > it maps only single PMD (2MB) space for fixmap which leaves only < 1MB space
> > left for other kernel features such as early ioremap which requires fixmap
> > as well. The fixmap size can be increased by another 2MB but it brings
> > additional complexity and changes the virtual memory layout as well.
> > If we require some additional feature requiring fixmap again, it has to be
> > moved again.
> >
> > Technically, DT doesn't need a fixmap as the memory occupied by the DT is
> > only used during boot. Thus, init memory section can be used for the same
> > purpose as well. This simplifies fixmap implementation.
> >
> > Signed-off-by: Anup Patel <anup.patel@wdc.com>
> > Signed-off-by: Atish Patra <atish.patra@wdc.com>
>
> The patch seems fine for the moment, but I have one concern for the
> long run:
>
> > +#define DTB_EARLY_SIZE SZ_1M
> > +static char early_dtb[DTB_EARLY_SIZE] __initdata;
>
> Hardcoding the size in .bss seems slightly problematic both for
> small and for big systems. On machines with very little memory,
> this can lead to running out of free pages before .initdata gets freed,
> and it increases the size of the uncompressed vmlinux file by quite
> a bit.
>
> On some systems, the 1MB limit may get too small. While most dtbs
> would fall into the range between 10KB and 100KB, it can also be
> much larger than that, e.g. when there are DT properties that include
> blobs like device firmware that gets loaded into hardware by a kernel
> driver.
>
I was not aware that we can do such things. Is there a current example of that ?
> Is there anything stopping you from parsing the FDT in its original
> location without the extra copy before it gets unflattened?
>
That's what the original code was doing. A fixmap entry was added to
map the original fdt
location to a virtual so that parse_dtb can be operated on a virtual
address. But we can't map
both FDT & early ioremap within a single PMD region( 2MB ). That's why
we removed the DT
mapping from the fixmap to .bss section. The other alternate option is
to increase the fixmap space to
4MB which seems more fragile.
> Arnd
--
Regards,
Atish
^ permalink raw reply
* Re: [PATCH] tools/memory-model: document the "one-time init" pattern
From: Eric Biggers @ 2020-07-18 1:02 UTC (permalink / raw)
To: Alan Stern
Cc: Matthew Wilcox, linux-kernel, linux-arch, Paul E . McKenney,
linux-fsdevel, Akira Yokosawa, Andrea Parri, Boqun Feng,
Daniel Lustig, Darrick J . Wong, Dave Chinner, David Howells,
Jade Alglave, Luc Maranget, Nicholas Piggin, Peter Zijlstra,
Will Deacon
In-Reply-To: <20200717175138.GB1156312@rowland.harvard.edu>
On Fri, Jul 17, 2020 at 01:51:38PM -0400, Alan Stern wrote:
> On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote:
> > On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote:
> ...
> > > + /* on success, pairs with smp_load_acquire() above and below */
> > > + if (cmpxchg_release(&foo, NULL, p) != NULL) {
> >
> > Why do we have cmpxchg_release() anyway? Under what circumstances is
> > cmpxchg() useful _without_ having release semantics?
>
> To answer just the last question: cmpxchg() is useful for lock
> acquisition, in which case it needs to have acquire semantics rather
> than release semantics.
>
To clarify, there are 4 versions of cmpxchg:
cmpxchg(): does ACQUIRE and RELEASE (on success)
cmpxchg_acquire(): does ACQUIRE only (on success)
cmpxchg_release(): does RELEASE only (on success)
cmpxchg_relaxed(): no barriers
The problem here is that here we need RELEASE on success and ACQUIRE on failure.
But no version guarantees any barrier on failure.
So as far as I can tell, the best we can do is use cmpxchg_release() (or
cmpxchg() which would be stronger but unnecessary), followed by a separate
ACQUIRE on failure.
- Eric
^ permalink raw reply
* warning unloading wmi
From: Matteo Croce @ 2020-07-18 0:58 UTC (permalink / raw)
To: Peter Zijlstra, Daniel Vetter, Bjorn Andersson, Arnd Bergmann,
Kelsey Skunberg
Cc: platform-driver-x86, linux-kernel
Hi,
I get this warning when unloading wmi:
[ 246.219255] ------------[ cut here ]------------
[ 246.219257] sysfs group 'power' not found for kobject '1F13AB7F-6220-4210-8F8E-8BB5E71EE969'
[ 246.219271] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219271] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219291] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fuse [last unloaded: intel_wmi_thunderbolt]
[ 246.219312] CPU: 4 PID: 1744 Comm: rmmod Not tainted 5.7.8-200.fc32.x86_64 #1
[ 246.219312] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219315] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219317] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219318] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219319] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219320] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219320] RBP: 0000000000000000 R08: 00000000000004dd R09: 0000000000000003
[ 246.219321] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb505c00
[ 246.219322] R13: ffff9527fb505c80 R14: ffff9527fb423000 R15: 0000000000000000
[ 246.219323] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219324] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219325] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219326] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219326] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219327] Call Trace:
[ 246.219334] device_del+0x97/0x3f0
[ 246.219338] ? acpi_os_signal_semaphore+0x29/0x40
[ 246.219341] ? acpi_ut_release_mutex+0x70/0x75
[ 246.219343] device_unregister+0x16/0x60
[ 246.219346] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219348] platform_drv_remove+0x24/0x40
[ 246.219350] __device_release_driver+0x15c/0x210
[ 246.219352] driver_detach+0xcb/0x10d
[ 246.219353] bus_remove_driver+0x58/0xcc
[ 246.219356] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219358] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219362] do_syscall_64+0x5b/0xf0
[ 246.219366] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219368] RIP: 0033:0x7fcfa6f9031b
[ 246.219369] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219370] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219371] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219372] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219373] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219373] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219374] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219376] ---[ end trace e72269a76e8f7465 ]---
[ 246.219420] ------------[ cut here ]------------
[ 246.219421] sysfs group 'power' not found for kobject '2BC49DEF-7B15-4F05-8BB7-EE37B9547C0B'
[ 246.219431] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219431] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219445] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fuse [last unloaded: intel_wmi_thunderbolt]
[ 246.219459] CPU: 4 PID: 1744 Comm: rmmod Tainted: G W 5.7.8-200.fc32.x86_64 #1
[ 246.219459] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219461] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219462] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219463] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219464] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219465] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219466] RBP: 0000000000000000 R08: 0000000000000508 R09: 0000000000000003
[ 246.219466] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb507400
[ 246.219467] R13: ffff9527fb507480 R14: ffff9527fb420800 R15: 0000000000000000
[ 246.219468] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219469] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219469] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219470] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219471] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219471] Call Trace:
[ 246.219474] device_del+0x97/0x3f0
[ 246.219477] ? acpi_os_signal_semaphore+0x29/0x40
[ 246.219478] ? acpi_ut_release_mutex+0x70/0x75
[ 246.219480] device_unregister+0x16/0x60
[ 246.219483] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219485] platform_drv_remove+0x24/0x40
[ 246.219486] __device_release_driver+0x15c/0x210
[ 246.219488] driver_detach+0xcb/0x10d
[ 246.219489] bus_remove_driver+0x58/0xcc
[ 246.219491] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219493] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219496] do_syscall_64+0x5b/0xf0
[ 246.219498] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219499] RIP: 0033:0x7fcfa6f9031b
[ 246.219500] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219501] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219502] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219503] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219503] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219504] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219505] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219506] ---[ end trace e72269a76e8f7466 ]---
[ 246.219515] ------------[ cut here ]------------
[ 246.219515] sysfs group 'power' not found for kobject 'A6FEA33E-DABF-46F5-BFC8-460D961BEC9F'
[ 246.219525] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219525] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219538] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fuse [last unloaded: intel_wmi_thunderbolt]
[ 246.219552] CPU: 4 PID: 1744 Comm: rmmod Tainted: G W 5.7.8-200.fc32.x86_64 #1
[ 246.219552] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219554] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219555] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219556] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219557] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219557] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219558] RBP: 0000000000000000 R08: 0000000000000533 R09: 0000000000000003
[ 246.219559] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb501c00
[ 246.219559] R13: ffff9527fb501c80 R14: ffff9527fb420800 R15: 0000000000000000
[ 246.219560] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219561] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219562] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219562] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219563] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219563] Call Trace:
[ 246.219566] device_del+0x97/0x3f0
[ 246.219568] device_unregister+0x16/0x60
[ 246.219570] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219572] platform_drv_remove+0x24/0x40
[ 246.219574] __device_release_driver+0x15c/0x210
[ 246.219575] driver_detach+0xcb/0x10d
[ 246.219577] bus_remove_driver+0x58/0xcc
[ 246.219579] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219580] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219583] do_syscall_64+0x5b/0xf0
[ 246.219585] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219586] RIP: 0033:0x7fcfa6f9031b
[ 246.219587] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219587] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219589] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219589] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219590] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219591] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219591] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219593] ---[ end trace e72269a76e8f7467 ]---
[ 246.219600] ------------[ cut here ]------------
[ 246.219601] sysfs group 'power' not found for kobject '05901221-D566-11D1-B2F0-00A0C9062910'
[ 246.219610] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219610] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219623] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fuse [last unloaded: intel_wmi_thunderbolt]
[ 246.219637] CPU: 4 PID: 1744 Comm: rmmod Tainted: G W 5.7.8-200.fc32.x86_64 #1
[ 246.219637] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219639] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219640] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219641] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219642] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219642] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219643] RBP: 0000000000000000 R08: 000000000000055c R09: 0000000000000003
[ 246.219643] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb502400
[ 246.219644] R13: ffff9527fb502480 R14: ffff9527fb420800 R15: 0000000000000000
[ 246.219645] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219646] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219646] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219647] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219648] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219648] Call Trace:
[ 246.219651] device_del+0x97/0x3f0
[ 246.219653] device_unregister+0x16/0x60
[ 246.219654] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219656] platform_drv_remove+0x24/0x40
[ 246.219658] __device_release_driver+0x15c/0x210
[ 246.219659] driver_detach+0xcb/0x10d
[ 246.219660] bus_remove_driver+0x58/0xcc
[ 246.219662] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219664] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219666] do_syscall_64+0x5b/0xf0
[ 246.219668] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219669] RIP: 0033:0x7fcfa6f9031b
[ 246.219671] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219671] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219672] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219673] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219673] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219674] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219675] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219676] ---[ end trace e72269a76e8f7468 ]---
[ 246.219719] ------------[ cut here ]------------
[ 246.219720] sysfs group 'power' not found for kobject '86CCFD48-205E-4A77-9C48-2021CBEDE341'
[ 246.219730] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219730] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219744] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fuse [last unloaded: intel_wmi_thunderbolt]
[ 246.219757] CPU: 4 PID: 1744 Comm: rmmod Tainted: G W 5.7.8-200.fc32.x86_64 #1
[ 246.219758] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219760] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219761] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219761] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219762] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219763] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219763] RBP: 0000000000000000 R08: 0000000000000585 R09: 0000000000000003
[ 246.219764] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb505000
[ 246.219765] R13: ffff9527fb505080 R14: ffff9527fb41b800 R15: 0000000000000000
[ 246.219766] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219767] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219767] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219768] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219769] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219769] Call Trace:
[ 246.219772] device_del+0x97/0x3f0
[ 246.219774] ? acpi_os_signal_semaphore+0x29/0x40
[ 246.219776] ? acpi_ut_release_mutex+0x70/0x75
[ 246.219778] device_unregister+0x16/0x60
[ 246.219780] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219782] platform_drv_remove+0x24/0x40
[ 246.219783] __device_release_driver+0x15c/0x210
[ 246.219784] driver_detach+0xcb/0x10d
[ 246.219786] bus_remove_driver+0x58/0xcc
[ 246.219788] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219789] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219791] do_syscall_64+0x5b/0xf0
[ 246.219794] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219795] RIP: 0033:0x7fcfa6f9031b
[ 246.219796] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219796] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219797] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219798] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219799] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219799] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219800] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219801] ---[ end trace e72269a76e8f7469 ]---
$ uname -a
Linux t490s 5.7.8-200.fc32.x86_64 #1 SMP Thu Jul 9 14:34:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Regards,
--
per aspera ad upstream
^ permalink raw reply
* Re: [PATCH] tools/memory-model: document the "one-time init" pattern
From: Eric Biggers @ 2020-07-18 0:58 UTC (permalink / raw)
To: Darrick J. Wong
Cc: linux-kernel, linux-arch, Paul E . McKenney, linux-fsdevel,
Akira Yokosawa, Alan Stern, Andrea Parri, Boqun Feng,
Daniel Lustig, Dave Chinner, David Howells, Jade Alglave,
Luc Maranget, Nicholas Piggin, Peter Zijlstra, Will Deacon
In-Reply-To: <20200717205340.GR7625@magnolia>
On Fri, Jul 17, 2020 at 01:53:40PM -0700, Darrick J. Wong wrote:
> > +There are also cases in which the smp_load_acquire() can be replaced by
> > +the more lightweight READ_ONCE(). (smp_store_release() is still
> > +required.) Specifically, if all initialized memory is transitively
> > +reachable from the pointer itself, then there is no control dependency
>
> I don't quite understand what "transitively reachable from the pointer
> itself" means? Does that describe the situation where all the objects
> reachable through the object that the global struct foo pointer points
> at are /only/ reachable via that global pointer?
>
The intent is that "transitively reachable" means that all initialized memory
can be reached by dereferencing the pointer in some way, e.g. p->a->b[5]->c.
It could also be the case that allocating the object initializes some global or
static data, which isn't reachable in that way. Access to that data would then
be a control dependency, which a data dependency barrier wouldn't work for.
It's possible I misunderstood something. (Note the next paragraph does say that
using READ_ONCE() is discouraged, exactly for this reason -- it can be hard to
tell whether it's correct.) Suggestions of what to write here are appreciated.
- Eric
^ permalink raw reply
* warning unloading wmi
From: Matteo Croce @ 2020-07-18 0:58 UTC (permalink / raw)
To: Peter Zijlstra, Daniel Vetter, Bjorn Andersson, Arnd Bergmann,
Kelsey Skunberg
Cc: platform-driver-x86, linux-kernel
Hi,
I get this warning when unloading wmi:
[ 246.219255] ------------[ cut here ]------------
[ 246.219257] sysfs group 'power' not found for kobject '1F13AB7F-6220-4210-8F8E-8BB5E71EE969'
[ 246.219271] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219271] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp
snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219291] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fus
e [last unloaded: intel_wmi_thunderbolt]
[ 246.219312] CPU: 4 PID: 1744 Comm: rmmod Not tainted 5.7.8-200.fc32.x86_64 #1
[ 246.219312] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219315] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219317] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219318] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219319] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219320] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219320] RBP: 0000000000000000 R08: 00000000000004dd R09: 0000000000000003
[ 246.219321] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb505c00
[ 246.219322] R13: ffff9527fb505c80 R14: ffff9527fb423000 R15: 0000000000000000
[ 246.219323] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219324] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219325] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219326] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219326] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219327] Call Trace:
[ 246.219334] device_del+0x97/0x3f0
[ 246.219338] ? acpi_os_signal_semaphore+0x29/0x40
[ 246.219341] ? acpi_ut_release_mutex+0x70/0x75
[ 246.219343] device_unregister+0x16/0x60
[ 246.219346] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219348] platform_drv_remove+0x24/0x40
[ 246.219350] __device_release_driver+0x15c/0x210
[ 246.219352] driver_detach+0xcb/0x10d
[ 246.219353] bus_remove_driver+0x58/0xcc
[ 246.219356] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219358] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219362] do_syscall_64+0x5b/0xf0
[ 246.219366] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219368] RIP: 0033:0x7fcfa6f9031b
[ 246.219369] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219370] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219371] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219372] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219373] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219373] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219374] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219376] ---[ end trace e72269a76e8f7465 ]---
[ 246.219420] ------------[ cut here ]------------
[ 246.219421] sysfs group 'power' not found for kobject '2BC49DEF-7B15-4F05-8BB7-EE37B9547C0B'
[ 246.219431] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219431] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp
snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219445] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fus
e [last unloaded: intel_wmi_thunderbolt]
[ 246.219459] CPU: 4 PID: 1744 Comm: rmmod Tainted: G W 5.7.8-200.fc32.x86_64 #1
[ 246.219459] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219461] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219462] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219463] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219464] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219465] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219466] RBP: 0000000000000000 R08: 0000000000000508 R09: 0000000000000003
[ 246.219466] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb507400
[ 246.219467] R13: ffff9527fb507480 R14: ffff9527fb420800 R15: 0000000000000000
[ 246.219468] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219469] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219469] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219470] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219471] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219471] Call Trace:
[ 246.219474] device_del+0x97/0x3f0
[ 246.219477] ? acpi_os_signal_semaphore+0x29/0x40
[ 246.219478] ? acpi_ut_release_mutex+0x70/0x75
[ 246.219480] device_unregister+0x16/0x60
[ 246.219483] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219485] platform_drv_remove+0x24/0x40
[ 246.219486] __device_release_driver+0x15c/0x210
[ 246.219488] driver_detach+0xcb/0x10d
[ 246.219489] bus_remove_driver+0x58/0xcc
[ 246.219491] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219493] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219496] do_syscall_64+0x5b/0xf0
[ 246.219498] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219499] RIP: 0033:0x7fcfa6f9031b
[ 246.219500] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219501] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219502] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219503] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219503] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219504] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219505] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219506] ---[ end trace e72269a76e8f7466 ]---
[ 246.219515] ------------[ cut here ]------------
[ 246.219515] sysfs group 'power' not found for kobject 'A6FEA33E-DABF-46F5-BFC8-460D961BEC9F'
[ 246.219525] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219525] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp
snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219538] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fus
e [last unloaded: intel_wmi_thunderbolt]
[ 246.219552] CPU: 4 PID: 1744 Comm: rmmod Tainted: G W 5.7.8-200.fc32.x86_64 #1
[ 246.219552] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219554] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219555] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219556] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219557] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219557] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219558] RBP: 0000000000000000 R08: 0000000000000533 R09: 0000000000000003
[ 246.219559] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb501c00
[ 246.219559] R13: ffff9527fb501c80 R14: ffff9527fb420800 R15: 0000000000000000
[ 246.219560] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219561] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219562] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219562] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219563] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219563] Call Trace:
[ 246.219566] device_del+0x97/0x3f0
[ 246.219568] device_unregister+0x16/0x60
[ 246.219570] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219572] platform_drv_remove+0x24/0x40
[ 246.219574] __device_release_driver+0x15c/0x210
[ 246.219575] driver_detach+0xcb/0x10d
[ 246.219577] bus_remove_driver+0x58/0xcc
[ 246.219579] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219580] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219583] do_syscall_64+0x5b/0xf0
[ 246.219585] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219586] RIP: 0033:0x7fcfa6f9031b
[ 246.219587] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219587] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219589] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219589] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219590] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219591] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219591] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219593] ---[ end trace e72269a76e8f7467 ]---
[ 246.219600] ------------[ cut here ]------------
[ 246.219601] sysfs group 'power' not found for kobject '05901221-D566-11D1-B2F0-00A0C9062910'
[ 246.219610] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219610] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp
snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219623] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fus
e [last unloaded: intel_wmi_thunderbolt]
[ 246.219637] CPU: 4 PID: 1744 Comm: rmmod Tainted: G W 5.7.8-200.fc32.x86_64 #1
[ 246.219637] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219639] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219640] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219641] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219642] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219642] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219643] RBP: 0000000000000000 R08: 000000000000055c R09: 0000000000000003
[ 246.219643] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb502400
[ 246.219644] R13: ffff9527fb502480 R14: ffff9527fb420800 R15: 0000000000000000
[ 246.219645] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219646] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219646] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219647] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219648] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219648] Call Trace:
[ 246.219651] device_del+0x97/0x3f0
[ 246.219653] device_unregister+0x16/0x60
[ 246.219654] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219656] platform_drv_remove+0x24/0x40
[ 246.219658] __device_release_driver+0x15c/0x210
[ 246.219659] driver_detach+0xcb/0x10d
[ 246.219660] bus_remove_driver+0x58/0xcc
[ 246.219662] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219664] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219666] do_syscall_64+0x5b/0xf0
[ 246.219668] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219669] RIP: 0033:0x7fcfa6f9031b
[ 246.219671] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219671] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219672] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219673] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219673] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219674] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219675] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219676] ---[ end trace e72269a76e8f7468 ]---
[ 246.219719] ------------[ cut here ]------------
[ 246.219720] sysfs group 'power' not found for kobject '86CCFD48-205E-4A77-9C48-2021CBEDE341'
[ 246.219730] WARNING: CPU: 4 PID: 1744 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80
[ 246.219730] Modules linked in: ccm rfcomm xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_counter tun bridge stp llc nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip6_tables nft_compat ip_set nf_tables nfnetlink cmac bnep vfat fat elan_i2c mei_hdcp mei_wdt intel_rapl_msr iTCO_wdt iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm snd_sof_pci snd_sof_intel_byt snd_sof_intel_ipc irqbypass snd_sof_intel_hda_common snd_soc_hdac_hda snd_sof_xtensa_dsp intel_cstate snd_sof_intel_hda snd_sof intel_uncore snd_hda_codec_hdmi intel_rapl_perf snd_soc_skl snd_soc_sst_ipc snd_soc_sst_dsp
snd_hda_ext_core iwlmvm snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core snd_hda_codec_realtek snd_hda_codec_generic snd_compress ac97_bus mac80211 snd_pcm_dmaengine snd_hda_intel uvcvideo
[ 246.219744] snd_intel_dspcfg btusb snd_hda_codec btrtl videobuf2_vmalloc pcspkr btbcm videobuf2_memops btintel libarc4 snd_hda_core bluetooth videobuf2_v4l2 videobuf2_common snd_hwdep iwlwifi videodev joydev thunderbolt snd_seq mc snd_seq_device ecdh_generic ecc cfg80211 snd_pcm ucsi_acpi mei_me processor_thermal_device intel_rapl_common snd_timer mei intel_soc_dts_iosf i2c_i801 intel_pch_thermal typec_ucsi typec thinkpad_acpi ledtrig_audio snd soundcore rfkill int3403_thermal int340x_thermal_zone int3400_thermal acpi_thermal_rel acpi_pad i2c_dev ip_tables i915 hid_multitouch rtsx_pci_sdmmc mmc_core crct10dif_pclmul crc32_pclmul crc32c_intel i2c_algo_bit cec drm_kms_helper e1000e ghash_clmulni_intel nvme drm serio_raw nvme_core rtsx_pci wmi(-) video pinctrl_cannonlake pinctrl_intel fus
e [last unloaded: intel_wmi_thunderbolt]
[ 246.219757] CPU: 4 PID: 1744 Comm: rmmod Tainted: G W 5.7.8-200.fc32.x86_64 #1
[ 246.219758] Hardware name: LENOVO 20NYSA084G/20NYSA084G, BIOS N2JET88W (1.66 ) 04/22/2020
[ 246.219760] RIP: 0010:sysfs_remove_group+0x6f/0x80
[ 246.219761] Code: ff 5b 48 89 ef 5d 41 5c e9 8e c3 ff ff 48 89 ef e8 e6 bc ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 f0 68 39 9e e8 a8 09 d1 ff <0f> 0b 5b 5d 41 5c c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00
[ 246.219761] RSP: 0018:ffffac1580de3dc8 EFLAGS: 00010292
[ 246.219762] RAX: 0000000000000050 RBX: ffffffff9e0f6400 RCX: 0000000000000007
[ 246.219763] RDX: 00000000fffffff8 RSI: 0000000000000092 RDI: ffff9527fe719cc0
[ 246.219763] RBP: 0000000000000000 R08: 0000000000000585 R09: 0000000000000003
[ 246.219764] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9527fb505000
[ 246.219765] R13: ffff9527fb505080 R14: ffff9527fb41b800 R15: 0000000000000000
[ 246.219766] FS: 00007fcfa6e60740(0000) GS:ffff9527fe700000(0000) knlGS:0000000000000000
[ 246.219767] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 246.219767] CR2: 000055b55a202078 CR3: 000000047a64e005 CR4: 00000000003606e0
[ 246.219768] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 246.219769] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 246.219769] Call Trace:
[ 246.219772] device_del+0x97/0x3f0
[ 246.219774] ? acpi_os_signal_semaphore+0x29/0x40
[ 246.219776] ? acpi_ut_release_mutex+0x70/0x75
[ 246.219778] device_unregister+0x16/0x60
[ 246.219780] acpi_wmi_remove+0xf0/0x110 [wmi]
[ 246.219782] platform_drv_remove+0x24/0x40
[ 246.219783] __device_release_driver+0x15c/0x210
[ 246.219784] driver_detach+0xcb/0x10d
[ 246.219786] bus_remove_driver+0x58/0xcc
[ 246.219788] acpi_wmi_exit+0xc/0xfac [wmi]
[ 246.219789] __do_sys_delete_module.constprop.0+0x14e/0x2d0
[ 246.219791] do_syscall_64+0x5b/0xf0
[ 246.219794] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 246.219795] RIP: 0033:0x7fcfa6f9031b
[ 246.219796] Code: 73 01 c3 48 8b 0d 7d 0b 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 4d 0b 0c 00 f7 d8 64 89 01 48
[ 246.219796] RSP: 002b:00007ffcb61b3f28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 246.219797] RAX: ffffffffffffffda RBX: 000055b55a1f7760 RCX: 00007fcfa6f9031b
[ 246.219798] RDX: 000000000000000a RSI: 0000000000000800 RDI: 000055b55a1f77c8
[ 246.219799] RBP: 000055b55a1f72a0 R08: 1999999999999999 R09: 0000000000000000
[ 246.219799] R10: 00007fcfa7004ac0 R11: 0000000000000206 R12: 00007ffcb61b471e
[ 246.219800] R13: 0000000000000000 R14: 00007ffcb61b4150 R15: 000055b55a1f7760
[ 246.219801] ---[ end trace e72269a76e8f7469 ]---
$ uname -a
Linux t490s 5.7.8-200.fc32.x86_64 #1 SMP Thu Jul 9 14:34:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Regards,
--
per aspera ad upstream
^ permalink raw reply
* [Intel-gfx] ✗ Fi.CI.BAT: failure for Allow privileged user to map the OA buffer (rev2)
From: Patchwork @ 2020-07-18 0:52 UTC (permalink / raw)
To: Umesh Nerlige Ramappa; +Cc: intel-gfx
In-Reply-To: <20200718000437.69033-1-umesh.nerlige.ramappa@intel.com>
[-- Attachment #1.1: Type: text/plain, Size: 15235 bytes --]
== Series Details ==
Series: Allow privileged user to map the OA buffer (rev2)
URL : https://patchwork.freedesktop.org/series/79460/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8761 -> Patchwork_18209
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_18209 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_18209, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_18209:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@workarounds:
- fi-tgl-u2: [PASS][1] -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-tgl-u2/igt@i915_selftest@live@workarounds.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-tgl-u2/igt@i915_selftest@live@workarounds.html
- fi-skl-6700k2: [PASS][3] -> [DMESG-FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-skl-6700k2/igt@i915_selftest@live@workarounds.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-skl-6700k2/igt@i915_selftest@live@workarounds.html
- fi-cml-s: [PASS][5] -> [DMESG-FAIL][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-cml-s/igt@i915_selftest@live@workarounds.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-cml-s/igt@i915_selftest@live@workarounds.html
- fi-icl-y: [PASS][7] -> [DMESG-FAIL][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-icl-y/igt@i915_selftest@live@workarounds.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-icl-y/igt@i915_selftest@live@workarounds.html
- fi-kbl-x1275: [PASS][9] -> [DMESG-FAIL][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-x1275/igt@i915_selftest@live@workarounds.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-x1275/igt@i915_selftest@live@workarounds.html
- fi-cfl-guc: [PASS][11] -> [DMESG-FAIL][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-cfl-guc/igt@i915_selftest@live@workarounds.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-cfl-guc/igt@i915_selftest@live@workarounds.html
- fi-tgl-y: [PASS][13] -> [DMESG-FAIL][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-tgl-y/igt@i915_selftest@live@workarounds.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-tgl-y/igt@i915_selftest@live@workarounds.html
- fi-skl-guc: [PASS][15] -> [DMESG-FAIL][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-skl-guc/igt@i915_selftest@live@workarounds.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-skl-guc/igt@i915_selftest@live@workarounds.html
- fi-skl-6600u: [PASS][17] -> [DMESG-FAIL][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-skl-6600u/igt@i915_selftest@live@workarounds.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-skl-6600u/igt@i915_selftest@live@workarounds.html
- fi-kbl-8809g: [PASS][19] -> [DMESG-FAIL][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-8809g/igt@i915_selftest@live@workarounds.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-8809g/igt@i915_selftest@live@workarounds.html
- fi-cfl-8700k: [PASS][21] -> [DMESG-FAIL][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-cfl-8700k/igt@i915_selftest@live@workarounds.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-cfl-8700k/igt@i915_selftest@live@workarounds.html
- fi-kbl-r: [PASS][23] -> [DMESG-FAIL][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-r/igt@i915_selftest@live@workarounds.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-r/igt@i915_selftest@live@workarounds.html
- fi-icl-u2: [PASS][25] -> [DMESG-FAIL][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-icl-u2/igt@i915_selftest@live@workarounds.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-icl-u2/igt@i915_selftest@live@workarounds.html
- fi-cfl-8109u: [PASS][27] -> [DMESG-FAIL][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-cfl-8109u/igt@i915_selftest@live@workarounds.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-cfl-8109u/igt@i915_selftest@live@workarounds.html
- fi-skl-lmem: [PASS][29] -> [DMESG-FAIL][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-skl-lmem/igt@i915_selftest@live@workarounds.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-skl-lmem/igt@i915_selftest@live@workarounds.html
- fi-kbl-7500u: [PASS][31] -> [DMESG-FAIL][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-7500u/igt@i915_selftest@live@workarounds.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-7500u/igt@i915_selftest@live@workarounds.html
- fi-kbl-guc: [PASS][33] -> [DMESG-FAIL][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-guc/igt@i915_selftest@live@workarounds.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-guc/igt@i915_selftest@live@workarounds.html
- fi-kbl-soraka: [PASS][35] -> [DMESG-FAIL][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-soraka/igt@i915_selftest@live@workarounds.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-soraka/igt@i915_selftest@live@workarounds.html
- fi-cml-u2: [PASS][37] -> [DMESG-FAIL][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-cml-u2/igt@i915_selftest@live@workarounds.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-cml-u2/igt@i915_selftest@live@workarounds.html
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses.
They do not affect the overall result.
* igt@i915_selftest@live@workarounds:
- {fi-tgl-dsi}: [PASS][39] -> [DMESG-FAIL][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-tgl-dsi/igt@i915_selftest@live@workarounds.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-tgl-dsi/igt@i915_selftest@live@workarounds.html
- {fi-ehl-1}: [PASS][41] -> [DMESG-FAIL][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-ehl-1/igt@i915_selftest@live@workarounds.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-ehl-1/igt@i915_selftest@live@workarounds.html
- {fi-kbl-7560u}: [PASS][43] -> [DMESG-FAIL][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-7560u/igt@i915_selftest@live@workarounds.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-7560u/igt@i915_selftest@live@workarounds.html
Known issues
------------
Here are the changes found in Patchwork_18209 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_flink_basic@double-flink:
- fi-tgl-y: [PASS][45] -> [DMESG-WARN][46] ([i915#402])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-tgl-y/igt@gem_flink_basic@double-flink.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-tgl-y/igt@gem_flink_basic@double-flink.html
* igt@i915_module_load@reload:
- fi-tgl-u2: [PASS][47] -> [DMESG-WARN][48] ([i915#402])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-tgl-u2/igt@i915_module_load@reload.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-tgl-u2/igt@i915_module_load@reload.html
- fi-bsw-n3050: [PASS][49] -> [DMESG-WARN][50] ([i915#1982])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-bsw-n3050/igt@i915_module_load@reload.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-bsw-n3050/igt@i915_module_load@reload.html
* igt@i915_selftest@live@gem_contexts:
- fi-tgl-u2: [PASS][51] -> [INCOMPLETE][52] ([i915#2045])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-tgl-u2/igt@i915_selftest@live@gem_contexts.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-tgl-u2/igt@i915_selftest@live@gem_contexts.html
* igt@i915_selftest@live@workarounds:
- fi-apl-guc: [PASS][53] -> [DMESG-FAIL][54] ([i915#1635])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-apl-guc/igt@i915_selftest@live@workarounds.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-apl-guc/igt@i915_selftest@live@workarounds.html
- fi-bxt-dsi: [PASS][55] -> [DMESG-FAIL][56] ([i915#1635])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-bxt-dsi/igt@i915_selftest@live@workarounds.html
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-bxt-dsi/igt@i915_selftest@live@workarounds.html
* igt@kms_busy@basic@flip:
- fi-tgl-y: [PASS][57] -> [DMESG-WARN][58] ([i915#1982])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-tgl-y/igt@kms_busy@basic@flip.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-tgl-y/igt@kms_busy@basic@flip.html
#### Possible fixes ####
* igt@gem_render_linear_blits@basic:
- fi-tgl-y: [DMESG-WARN][59] ([i915#402]) -> [PASS][60] +1 similar issue
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-tgl-y/igt@gem_render_linear_blits@basic.html
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-tgl-y/igt@gem_render_linear_blits@basic.html
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-bsw-kefka: [DMESG-WARN][61] ([i915#1982]) -> [PASS][62]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html
* igt@i915_pm_rpm@module-reload:
- fi-kbl-guc: [FAIL][63] ([i915#138]) -> [PASS][64]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-guc/igt@i915_pm_rpm@module-reload.html
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-guc/igt@i915_pm_rpm@module-reload.html
* igt@i915_selftest@live@execlists:
- fi-cfl-8700k: [INCOMPLETE][65] ([i915#2089]) -> [PASS][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-cfl-8700k/igt@i915_selftest@live@execlists.html
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-cfl-8700k/igt@i915_selftest@live@execlists.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-icl-u2: [DMESG-WARN][67] ([i915#1982]) -> [PASS][68] +1 similar issue
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-icl-u2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-icl-u2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
* igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
- fi-tgl-u2: [DMESG-WARN][69] ([i915#402]) -> [PASS][70]
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-tgl-u2/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-tgl-u2/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html
#### Warnings ####
* igt@gem_exec_suspend@basic-s3:
- fi-kbl-x1275: [DMESG-WARN][71] ([i915#62] / [i915#92]) -> [DMESG-WARN][72] ([i915#1982] / [i915#62] / [i915#92] / [i915#95])
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-x1275/igt@gem_exec_suspend@basic-s3.html
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-x1275/igt@gem_exec_suspend@basic-s3.html
* igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size:
- fi-kbl-x1275: [DMESG-WARN][73] ([i915#62] / [i915#92]) -> [DMESG-WARN][74] ([i915#62] / [i915#92] / [i915#95]) +2 similar issues
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-x1275/igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size.html
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-x1275/igt@kms_cursor_legacy@basic-flip-after-cursor-varying-size.html
* igt@kms_force_connector_basic@force-edid:
- fi-kbl-x1275: [DMESG-WARN][75] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][76] ([i915#62] / [i915#92]) +3 similar issues
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8761/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[i915#138]: https://gitlab.freedesktop.org/drm/intel/issues/138
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2045]: https://gitlab.freedesktop.org/drm/intel/issues/2045
[i915#2089]: https://gitlab.freedesktop.org/drm/intel/issues/2089
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (47 -> 40)
------------------------------
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* IGT: IGT_5739 -> IGTPW_4776
* Linux: CI_DRM_8761 -> Patchwork_18209
CI-20190529: 20190529
CI_DRM_8761: b665aabc40b8c7e86f10a74171d3d3fd71251781 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_4776: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4776/index.html
IGT_5739: 9b964d7359db9799f2b5b905403dda668ae28c87 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18209: dac9a1608e77996c41690a5972dfc0b8122130e1 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
dac9a1608e77 drm/i915/perf: Map OA buffer to user space for gen12 performance query
829409416d4b drm/i915/perf: Whitelist OA counter and buffer registers
216ee54f6578 drm/i915/perf: Whitelist OA report trigger registers
24740597e5f9 drm/i915/perf: Ensure observation logic is not clock gated
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18209/index.html
[-- Attachment #1.2: Type: text/html, Size: 17937 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* [Linux-kernel-mentees] [PATCH v2] lib: Convert test_user_copy to KUnit test
From: Vitor Massaru Iha @ 2020-07-18 0:51 UTC (permalink / raw)
To: kunit-dev
Cc: linux-kselftest, brendanhiggins, linux-kernel, davidgow,
linux-kernel-mentees, keescook
This adds the conversion of the runtime tests of test_user_copy fuctions,
from `lib/test_user_copy.c` to KUnit tests.
Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
---
v2:
* splitted patch in 3:
- Allows to install and load modules in root filesystem;
- Provides an userspace memory context when tests are compiled
as module;
- Convert test_user_copy to KUnit test;
* removed entry for CONFIG_TEST_USER_COPY;
* replaced pr_warn to KUNIT_EXPECT_FALSE_MSG in test macro to
decrease the diff;
---
lib/Kconfig.debug | 28 ++++++++------
lib/Makefile | 2 +-
lib/{test_user_copy.c => user_copy_kunit.c} | 42 +++++++++------------
3 files changed, 35 insertions(+), 37 deletions(-)
rename lib/{test_user_copy.c => user_copy_kunit.c} (91%)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 9ad9210d70a1..f699a3624ae7 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2078,18 +2078,6 @@ config TEST_VMALLOC
If unsure, say N.
-config TEST_USER_COPY
- tristate "Test user/kernel boundary protections"
- depends on m
- help
- This builds the "test_user_copy" module that runs sanity checks
- on the copy_to/from_user infrastructure, making sure basic
- user/kernel boundary testing is working. If it fails to load,
- a regression has been detected in the user/kernel memory boundary
- protections.
-
- If unsure, say N.
-
config TEST_BPF
tristate "Test BPF filter functionality"
depends on m && NET
@@ -2154,6 +2142,22 @@ config SYSCTL_KUNIT_TEST
If unsure, say N.
+config USER_COPY_KUNIT
+ tristate "KUnit Test for user/kernel boundary protections"
+ depends on KUNIT
+ depends on m
+ help
+ This builds the "user_copy_kunit" module that runs sanity checks
+ on the copy_to/from_user infrastructure, making sure basic
+ user/kernel boundary testing is working. If it fails to load,
+ a regression has been detected in the user/kernel memory boundary
+ protections.
+
+ For more information on KUnit and unit tests in general please refer
+ to the KUnit documentation in Documentation/dev-tools/kunit/.
+
+ If unsure, say N.
+
config LIST_KUNIT_TEST
tristate "KUnit Test for Kernel Linked-list structures" if !KUNIT_ALL_TESTS
depends on KUNIT
diff --git a/lib/Makefile b/lib/Makefile
index b1c42c10073b..8c145f85accc 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -78,7 +78,6 @@ obj-$(CONFIG_TEST_VMALLOC) += test_vmalloc.o
obj-$(CONFIG_TEST_OVERFLOW) += test_overflow.o
obj-$(CONFIG_TEST_RHASHTABLE) += test_rhashtable.o
obj-$(CONFIG_TEST_SORT) += test_sort.o
-obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o
obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_keys.o
obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_key_base.o
obj-$(CONFIG_TEST_PRINTF) += test_printf.o
@@ -318,3 +317,4 @@ obj-$(CONFIG_OBJAGG) += objagg.o
# KUnit tests
obj-$(CONFIG_LIST_KUNIT_TEST) += list-test.o
obj-$(CONFIG_LINEAR_RANGES_TEST) += test_linear_ranges.o
+obj-$(CONFIG_USER_COPY_KUNIT) += user_copy_kunit.o
diff --git a/lib/test_user_copy.c b/lib/user_copy_kunit.c
similarity index 91%
rename from lib/test_user_copy.c
rename to lib/user_copy_kunit.c
index 5ff04d8fe971..a10ddd15b4cd 100644
--- a/lib/test_user_copy.c
+++ b/lib/user_copy_kunit.c
@@ -16,6 +16,7 @@
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
+#include <kunit/test.h>
/*
* Several 32-bit architectures support 64-bit {get,put}_user() calls.
@@ -35,7 +36,7 @@
({ \
int cond = (condition); \
if (cond) \
- pr_warn("[%d] " msg "\n", __LINE__, ##__VA_ARGS__); \
+ KUNIT_EXPECT_FALSE_MSG(test, cond, msg, ##__VA_ARGS__); \
cond; \
})
@@ -44,7 +45,7 @@ static bool is_zeroed(void *from, size_t size)
return memchr_inv(from, 0x0, size) == NULL;
}
-static int test_check_nonzero_user(char *kmem, char __user *umem, size_t size)
+static int test_check_nonzero_user(struct kunit *test, char *kmem, char __user *umem, size_t size)
{
int ret = 0;
size_t start, end, i, zero_start, zero_end;
@@ -102,7 +103,7 @@ static int test_check_nonzero_user(char *kmem, char __user *umem, size_t size)
return ret;
}
-static int test_copy_struct_from_user(char *kmem, char __user *umem,
+static int test_copy_struct_from_user(struct kunit *test, char *kmem, char __user *umem,
size_t size)
{
int ret = 0;
@@ -177,7 +178,7 @@ static int test_copy_struct_from_user(char *kmem, char __user *umem,
return ret;
}
-static int __init test_user_copy_init(void)
+static void user_copy_test(struct kunit *test)
{
int ret = 0;
char *kmem;
@@ -192,16 +193,14 @@ static int __init test_user_copy_init(void)
#endif
kmem = kmalloc(PAGE_SIZE * 2, GFP_KERNEL);
- if (!kmem)
- return -ENOMEM;
+ KUNIT_EXPECT_FALSE_MSG(test, kmem == NULL, "kmalloc failed");
user_addr = vm_mmap(NULL, 0, PAGE_SIZE * 2,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_ANONYMOUS | MAP_PRIVATE, 0);
if (user_addr >= (unsigned long)(TASK_SIZE)) {
- pr_warn("Failed to allocate user memory\n");
kfree(kmem);
- return -ENOMEM;
+ KUNIT_FAIL(test, "Failed to allocate user memory");
}
usermem = (char __user *)user_addr;
@@ -245,9 +244,9 @@ static int __init test_user_copy_init(void)
#undef test_legit
/* Test usage of check_nonzero_user(). */
- ret |= test_check_nonzero_user(kmem, usermem, 2 * PAGE_SIZE);
+ ret |= test_check_nonzero_user(test, kmem, usermem, 2 * PAGE_SIZE);
/* Test usage of copy_struct_from_user(). */
- ret |= test_copy_struct_from_user(kmem, usermem, 2 * PAGE_SIZE);
+ ret |= test_copy_struct_from_user(test, kmem, usermem, 2 * PAGE_SIZE);
/*
* Invalid usage: none of these copies should succeed.
@@ -309,23 +308,18 @@ static int __init test_user_copy_init(void)
vm_munmap(user_addr, PAGE_SIZE * 2);
kfree(kmem);
-
- if (ret == 0) {
- pr_info("tests passed.\n");
- return 0;
- }
-
- return -EINVAL;
}
-module_init(test_user_copy_init);
-
-static void __exit test_user_copy_exit(void)
-{
- pr_info("unloaded.\n");
-}
+static struct kunit_case user_copy_test_cases[] = {
+ KUNIT_CASE(user_copy_test),
+ {}
+};
-module_exit(test_user_copy_exit);
+static struct kunit_suite user_copy_test_suite = {
+ .name = "user_copy",
+ .test_cases = user_copy_test_cases,
+};
+kunit_test_suites(&user_copy_test_suite);
MODULE_AUTHOR("Kees Cook <keescook@chromium.org>");
MODULE_LICENSE("GPL");
base-commit: 725aca9585956676687c4cb803e88f770b0df2b2
prerequisite-patch-id: 5e5f9a8a05c5680fda1b04c9ab1b95ce91dc88b2
prerequisite-patch-id: 4d997940f4a9f303424af9bac412de1af861f9d9
prerequisite-patch-id: 582b6d9d28ce4b71628890ec832df6522ca68de0
prerequisite-patch-id: 5cd745ed9bbb0b36010c5de8adc19bfa86ad8be0
prerequisite-patch-id: 42f17b389ec15baf50dd1c43f6e30b8d2dff7964
--
2.26.2
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply related
* [PATCH v2] lib: Convert test_user_copy to KUnit test
From: Vitor Massaru Iha @ 2020-07-18 0:51 UTC (permalink / raw)
To: kunit-dev
Cc: linux-kselftest, linux-kernel, brendanhiggins, keescook, davidgow,
skhan, linux-kernel-mentees
This adds the conversion of the runtime tests of test_user_copy fuctions,
from `lib/test_user_copy.c` to KUnit tests.
Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
---
v2:
* splitted patch in 3:
- Allows to install and load modules in root filesystem;
- Provides an userspace memory context when tests are compiled
as module;
- Convert test_user_copy to KUnit test;
* removed entry for CONFIG_TEST_USER_COPY;
* replaced pr_warn to KUNIT_EXPECT_FALSE_MSG in test macro to
decrease the diff;
---
lib/Kconfig.debug | 28 ++++++++------
lib/Makefile | 2 +-
lib/{test_user_copy.c => user_copy_kunit.c} | 42 +++++++++------------
3 files changed, 35 insertions(+), 37 deletions(-)
rename lib/{test_user_copy.c => user_copy_kunit.c} (91%)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 9ad9210d70a1..f699a3624ae7 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2078,18 +2078,6 @@ config TEST_VMALLOC
If unsure, say N.
-config TEST_USER_COPY
- tristate "Test user/kernel boundary protections"
- depends on m
- help
- This builds the "test_user_copy" module that runs sanity checks
- on the copy_to/from_user infrastructure, making sure basic
- user/kernel boundary testing is working. If it fails to load,
- a regression has been detected in the user/kernel memory boundary
- protections.
-
- If unsure, say N.
-
config TEST_BPF
tristate "Test BPF filter functionality"
depends on m && NET
@@ -2154,6 +2142,22 @@ config SYSCTL_KUNIT_TEST
If unsure, say N.
+config USER_COPY_KUNIT
+ tristate "KUnit Test for user/kernel boundary protections"
+ depends on KUNIT
+ depends on m
+ help
+ This builds the "user_copy_kunit" module that runs sanity checks
+ on the copy_to/from_user infrastructure, making sure basic
+ user/kernel boundary testing is working. If it fails to load,
+ a regression has been detected in the user/kernel memory boundary
+ protections.
+
+ For more information on KUnit and unit tests in general please refer
+ to the KUnit documentation in Documentation/dev-tools/kunit/.
+
+ If unsure, say N.
+
config LIST_KUNIT_TEST
tristate "KUnit Test for Kernel Linked-list structures" if !KUNIT_ALL_TESTS
depends on KUNIT
diff --git a/lib/Makefile b/lib/Makefile
index b1c42c10073b..8c145f85accc 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -78,7 +78,6 @@ obj-$(CONFIG_TEST_VMALLOC) += test_vmalloc.o
obj-$(CONFIG_TEST_OVERFLOW) += test_overflow.o
obj-$(CONFIG_TEST_RHASHTABLE) += test_rhashtable.o
obj-$(CONFIG_TEST_SORT) += test_sort.o
-obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o
obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_keys.o
obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_key_base.o
obj-$(CONFIG_TEST_PRINTF) += test_printf.o
@@ -318,3 +317,4 @@ obj-$(CONFIG_OBJAGG) += objagg.o
# KUnit tests
obj-$(CONFIG_LIST_KUNIT_TEST) += list-test.o
obj-$(CONFIG_LINEAR_RANGES_TEST) += test_linear_ranges.o
+obj-$(CONFIG_USER_COPY_KUNIT) += user_copy_kunit.o
diff --git a/lib/test_user_copy.c b/lib/user_copy_kunit.c
similarity index 91%
rename from lib/test_user_copy.c
rename to lib/user_copy_kunit.c
index 5ff04d8fe971..a10ddd15b4cd 100644
--- a/lib/test_user_copy.c
+++ b/lib/user_copy_kunit.c
@@ -16,6 +16,7 @@
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
+#include <kunit/test.h>
/*
* Several 32-bit architectures support 64-bit {get,put}_user() calls.
@@ -35,7 +36,7 @@
({ \
int cond = (condition); \
if (cond) \
- pr_warn("[%d] " msg "\n", __LINE__, ##__VA_ARGS__); \
+ KUNIT_EXPECT_FALSE_MSG(test, cond, msg, ##__VA_ARGS__); \
cond; \
})
@@ -44,7 +45,7 @@ static bool is_zeroed(void *from, size_t size)
return memchr_inv(from, 0x0, size) == NULL;
}
-static int test_check_nonzero_user(char *kmem, char __user *umem, size_t size)
+static int test_check_nonzero_user(struct kunit *test, char *kmem, char __user *umem, size_t size)
{
int ret = 0;
size_t start, end, i, zero_start, zero_end;
@@ -102,7 +103,7 @@ static int test_check_nonzero_user(char *kmem, char __user *umem, size_t size)
return ret;
}
-static int test_copy_struct_from_user(char *kmem, char __user *umem,
+static int test_copy_struct_from_user(struct kunit *test, char *kmem, char __user *umem,
size_t size)
{
int ret = 0;
@@ -177,7 +178,7 @@ static int test_copy_struct_from_user(char *kmem, char __user *umem,
return ret;
}
-static int __init test_user_copy_init(void)
+static void user_copy_test(struct kunit *test)
{
int ret = 0;
char *kmem;
@@ -192,16 +193,14 @@ static int __init test_user_copy_init(void)
#endif
kmem = kmalloc(PAGE_SIZE * 2, GFP_KERNEL);
- if (!kmem)
- return -ENOMEM;
+ KUNIT_EXPECT_FALSE_MSG(test, kmem == NULL, "kmalloc failed");
user_addr = vm_mmap(NULL, 0, PAGE_SIZE * 2,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_ANONYMOUS | MAP_PRIVATE, 0);
if (user_addr >= (unsigned long)(TASK_SIZE)) {
- pr_warn("Failed to allocate user memory\n");
kfree(kmem);
- return -ENOMEM;
+ KUNIT_FAIL(test, "Failed to allocate user memory");
}
usermem = (char __user *)user_addr;
@@ -245,9 +244,9 @@ static int __init test_user_copy_init(void)
#undef test_legit
/* Test usage of check_nonzero_user(). */
- ret |= test_check_nonzero_user(kmem, usermem, 2 * PAGE_SIZE);
+ ret |= test_check_nonzero_user(test, kmem, usermem, 2 * PAGE_SIZE);
/* Test usage of copy_struct_from_user(). */
- ret |= test_copy_struct_from_user(kmem, usermem, 2 * PAGE_SIZE);
+ ret |= test_copy_struct_from_user(test, kmem, usermem, 2 * PAGE_SIZE);
/*
* Invalid usage: none of these copies should succeed.
@@ -309,23 +308,18 @@ static int __init test_user_copy_init(void)
vm_munmap(user_addr, PAGE_SIZE * 2);
kfree(kmem);
-
- if (ret == 0) {
- pr_info("tests passed.\n");
- return 0;
- }
-
- return -EINVAL;
}
-module_init(test_user_copy_init);
-
-static void __exit test_user_copy_exit(void)
-{
- pr_info("unloaded.\n");
-}
+static struct kunit_case user_copy_test_cases[] = {
+ KUNIT_CASE(user_copy_test),
+ {}
+};
-module_exit(test_user_copy_exit);
+static struct kunit_suite user_copy_test_suite = {
+ .name = "user_copy",
+ .test_cases = user_copy_test_cases,
+};
+kunit_test_suites(&user_copy_test_suite);
MODULE_AUTHOR("Kees Cook <keescook@chromium.org>");
MODULE_LICENSE("GPL");
base-commit: 725aca9585956676687c4cb803e88f770b0df2b2
prerequisite-patch-id: 5e5f9a8a05c5680fda1b04c9ab1b95ce91dc88b2
prerequisite-patch-id: 4d997940f4a9f303424af9bac412de1af861f9d9
prerequisite-patch-id: 582b6d9d28ce4b71628890ec832df6522ca68de0
prerequisite-patch-id: 5cd745ed9bbb0b36010c5de8adc19bfa86ad8be0
prerequisite-patch-id: 42f17b389ec15baf50dd1c43f6e30b8d2dff7964
--
2.26.2
^ permalink raw reply related
* [PATCH v2] goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
From: Jessica Clarke @ 2020-07-18 0:49 UTC (permalink / raw)
To: qemu-riscv; +Cc: Alistair Francis, Anup Patel, Jessica Clarke, qemu-devel
In-Reply-To: <20200718002027.82300-1-jrtc27@jrtc27.com>
The specification says:
0x00 TIME_LOW R: Get current time, then return low-order 32-bits.
0x04 TIME_HIGH R: Return high 32-bits from previous TIME_LOW read.
...
To read the value, the kernel must perform an IO_READ(TIME_LOW),
which returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH),
which returns a signed 32-bit value, corresponding to the higher half
of the full value.
However, we were just returning the current time for both. If the guest
is unlucky enough to read TIME_LOW and TIME_HIGH either side of an
overflow of the lower half, it will see time be in the future, before
jumping backwards on the next read, and Linux currently relies on the
atomicity guaranteed by the spec so is affected by this. Fix this
violation of the spec by caching the correct value for TIME_HIGH
whenever TIME_LOW is read, and returning that value for any TIME_HIGH
read.
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
---
Changes since v1:
* Add time_high to goldfish_rtc_vmstate and increment version.
hw/rtc/goldfish_rtc.c | 17 ++++++++++++++---
include/hw/rtc/goldfish_rtc.h | 1 +
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/hw/rtc/goldfish_rtc.c b/hw/rtc/goldfish_rtc.c
index 01e9d2b083..6ddd45cce0 100644
--- a/hw/rtc/goldfish_rtc.c
+++ b/hw/rtc/goldfish_rtc.c
@@ -94,12 +94,22 @@ static uint64_t goldfish_rtc_read(void *opaque, hwaddr offset,
GoldfishRTCState *s = opaque;
uint64_t r = 0;
+ /*
+ * From the documentation linked at the top of the file:
+ *
+ * To read the value, the kernel must perform an IO_READ(TIME_LOW), which
+ * returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH), which
+ * returns a signed 32-bit value, corresponding to the higher half of the
+ * full value.
+ */
switch (offset) {
case RTC_TIME_LOW:
- r = goldfish_rtc_get_count(s) & 0xffffffff;
+ r = goldfish_rtc_get_count(s);
+ s->time_high = r >> 32;
+ r &= 0xffffffff;
break;
case RTC_TIME_HIGH:
- r = goldfish_rtc_get_count(s) >> 32;
+ r = s->time_high;
break;
case RTC_ALARM_LOW:
r = s->alarm_next & 0xffffffff;
@@ -216,7 +226,7 @@ static const MemoryRegionOps goldfish_rtc_ops = {
static const VMStateDescription goldfish_rtc_vmstate = {
.name = TYPE_GOLDFISH_RTC,
- .version_id = 1,
+ .version_id = 2,
.pre_save = goldfish_rtc_pre_save,
.post_load = goldfish_rtc_post_load,
.fields = (VMStateField[]) {
@@ -225,6 +235,7 @@ static const VMStateDescription goldfish_rtc_vmstate = {
VMSTATE_UINT32(alarm_running, GoldfishRTCState),
VMSTATE_UINT32(irq_pending, GoldfishRTCState),
VMSTATE_UINT32(irq_enabled, GoldfishRTCState),
+ VMSTATE_UINT32(time_high, GoldfishRTCState),
VMSTATE_END_OF_LIST()
}
};
diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h
index 16f9f9e29d..9bd8924f5f 100644
--- a/include/hw/rtc/goldfish_rtc.h
+++ b/include/hw/rtc/goldfish_rtc.h
@@ -41,6 +41,7 @@ typedef struct GoldfishRTCState {
uint32_t alarm_running;
uint32_t irq_pending;
uint32_t irq_enabled;
+ uint32_t time_high;
} GoldfishRTCState;
#endif
--
2.20.1
^ permalink raw reply related
* [Linux-kernel-mentees] [PATCH v2] lib: kunit: Provides a userspace memory context when tests are compiled as module
From: Vitor Massaru Iha @ 2020-07-18 0:50 UTC (permalink / raw)
To: kunit-dev
Cc: linux-kselftest, brendanhiggins, linux-kernel, davidgow,
linux-kernel-mentees, keescook
KUnit test cases run on kthreads, and kthreads don't have an
adddress space (current->mm is NULL), but processes have mm.
The purpose of this patch is to allow to borrow mm to KUnit kthread
after userspace is brought up, because we know that there are processes
running, at least the process that loaded the module to borrow mm.
This allows, for example, tests such as user_copy_kunit, which uses
vm_mmap, which needs current->mm.
Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
---
v2:
* splitted patch in 3:
- Allows to install and load modules in root filesystem;
- Provides an userspace memory context when tests are compiled
as module;
- Convert test_user_copy to KUnit test;
* added documentation;
* added more explanation;
* tested a pointer;
* released mput();
---
Documentation/dev-tools/kunit/usage.rst | 14 ++++++++++++++
include/kunit/test.h | 12 ++++++++++++
lib/kunit/try-catch.c | 15 ++++++++++++++-
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/Documentation/dev-tools/kunit/usage.rst b/Documentation/dev-tools/kunit/usage.rst
index 3c3fe8b5fecc..9f909157be34 100644
--- a/Documentation/dev-tools/kunit/usage.rst
+++ b/Documentation/dev-tools/kunit/usage.rst
@@ -448,6 +448,20 @@ We can now use it to test ``struct eeprom_buffer``:
.. _kunit-on-non-uml:
+User-space context
+------------------
+
+I case you need a user-space context, for now this is only possible through
+tests compiled as a module. And it will be necessary to use a root filesystem
+and uml_utilities.
+
+Example:
+
+.. code-block:: bash
+
+ ./tools/testing/kunit/kunit.py run --timeout=60 --uml_rootfs_dir=.uml_rootfs
+
+
KUnit on non-UML architectures
==============================
diff --git a/include/kunit/test.h b/include/kunit/test.h
index 59f3144f009a..ae3337139c65 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -222,6 +222,18 @@ struct kunit {
* protect it with some type of lock.
*/
struct list_head resources; /* Protected by lock. */
+ /*
+ * KUnit test cases run on kthreads, and kthreads don't have an
+ * adddress space (current->mm is NULL), but processes have mm.
+ *
+ * The purpose of this mm_struct is to allow to borrow mm to KUnit kthread
+ * after userspace is brought up, because we know that there are processes
+ * running, at least the process that loaded the module to borrow mm.
+ *
+ * This allows, for example, tests such as user_copy_kunit, which uses
+ * vm_mmap, which needs current->mm.
+ */
+ struct mm_struct *mm;
};
void kunit_init_test(struct kunit *test, const char *name, char *log);
diff --git a/lib/kunit/try-catch.c b/lib/kunit/try-catch.c
index 0dd434e40487..d03e2093985b 100644
--- a/lib/kunit/try-catch.c
+++ b/lib/kunit/try-catch.c
@@ -11,7 +11,8 @@
#include <linux/completion.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
-
+#include <linux/sched/mm.h>
+#include <linux/sched/task.h>
#include "try-catch-impl.h"
void __noreturn kunit_try_catch_throw(struct kunit_try_catch *try_catch)
@@ -24,8 +25,17 @@ EXPORT_SYMBOL_GPL(kunit_try_catch_throw);
static int kunit_generic_run_threadfn_adapter(void *data)
{
struct kunit_try_catch *try_catch = data;
+ struct kunit *test = try_catch->test;
+
+ if (test != NULL && test->mm != NULL)
+ kthread_use_mm(test->mm);
try_catch->try(try_catch->context);
+ if (test != NULL && test->mm != NULL) {
+ kthread_unuse_mm(test->mm);
+ mmput(test->mm);
+ test->mm = NULL;
+ }
complete_and_exit(try_catch->try_completion, 0);
}
@@ -65,6 +75,9 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context)
try_catch->context = context;
try_catch->try_completion = &try_completion;
try_catch->try_result = 0;
+
+ test->mm = get_task_mm(current);
+
task_struct = kthread_run(kunit_generic_run_threadfn_adapter,
try_catch,
"kunit_try_catch_thread");
base-commit: 725aca9585956676687c4cb803e88f770b0df2b2
prerequisite-patch-id: 5e5f9a8a05c5680fda1b04c9ab1b95ce91dc88b2
prerequisite-patch-id: 4d997940f4a9f303424af9bac412de1af861f9d9
prerequisite-patch-id: 582b6d9d28ce4b71628890ec832df6522ca68de0
--
2.26.2
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply related
* [PATCH v2] lib: kunit: Provides a userspace memory context when tests are compiled as module
From: Vitor Massaru Iha @ 2020-07-18 0:50 UTC (permalink / raw)
To: kunit-dev
Cc: linux-kselftest, linux-kernel, brendanhiggins, keescook, davidgow,
skhan, linux-kernel-mentees
KUnit test cases run on kthreads, and kthreads don't have an
adddress space (current->mm is NULL), but processes have mm.
The purpose of this patch is to allow to borrow mm to KUnit kthread
after userspace is brought up, because we know that there are processes
running, at least the process that loaded the module to borrow mm.
This allows, for example, tests such as user_copy_kunit, which uses
vm_mmap, which needs current->mm.
Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
---
v2:
* splitted patch in 3:
- Allows to install and load modules in root filesystem;
- Provides an userspace memory context when tests are compiled
as module;
- Convert test_user_copy to KUnit test;
* added documentation;
* added more explanation;
* tested a pointer;
* released mput();
---
Documentation/dev-tools/kunit/usage.rst | 14 ++++++++++++++
include/kunit/test.h | 12 ++++++++++++
lib/kunit/try-catch.c | 15 ++++++++++++++-
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/Documentation/dev-tools/kunit/usage.rst b/Documentation/dev-tools/kunit/usage.rst
index 3c3fe8b5fecc..9f909157be34 100644
--- a/Documentation/dev-tools/kunit/usage.rst
+++ b/Documentation/dev-tools/kunit/usage.rst
@@ -448,6 +448,20 @@ We can now use it to test ``struct eeprom_buffer``:
.. _kunit-on-non-uml:
+User-space context
+------------------
+
+I case you need a user-space context, for now this is only possible through
+tests compiled as a module. And it will be necessary to use a root filesystem
+and uml_utilities.
+
+Example:
+
+.. code-block:: bash
+
+ ./tools/testing/kunit/kunit.py run --timeout=60 --uml_rootfs_dir=.uml_rootfs
+
+
KUnit on non-UML architectures
==============================
diff --git a/include/kunit/test.h b/include/kunit/test.h
index 59f3144f009a..ae3337139c65 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -222,6 +222,18 @@ struct kunit {
* protect it with some type of lock.
*/
struct list_head resources; /* Protected by lock. */
+ /*
+ * KUnit test cases run on kthreads, and kthreads don't have an
+ * adddress space (current->mm is NULL), but processes have mm.
+ *
+ * The purpose of this mm_struct is to allow to borrow mm to KUnit kthread
+ * after userspace is brought up, because we know that there are processes
+ * running, at least the process that loaded the module to borrow mm.
+ *
+ * This allows, for example, tests such as user_copy_kunit, which uses
+ * vm_mmap, which needs current->mm.
+ */
+ struct mm_struct *mm;
};
void kunit_init_test(struct kunit *test, const char *name, char *log);
diff --git a/lib/kunit/try-catch.c b/lib/kunit/try-catch.c
index 0dd434e40487..d03e2093985b 100644
--- a/lib/kunit/try-catch.c
+++ b/lib/kunit/try-catch.c
@@ -11,7 +11,8 @@
#include <linux/completion.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
-
+#include <linux/sched/mm.h>
+#include <linux/sched/task.h>
#include "try-catch-impl.h"
void __noreturn kunit_try_catch_throw(struct kunit_try_catch *try_catch)
@@ -24,8 +25,17 @@ EXPORT_SYMBOL_GPL(kunit_try_catch_throw);
static int kunit_generic_run_threadfn_adapter(void *data)
{
struct kunit_try_catch *try_catch = data;
+ struct kunit *test = try_catch->test;
+
+ if (test != NULL && test->mm != NULL)
+ kthread_use_mm(test->mm);
try_catch->try(try_catch->context);
+ if (test != NULL && test->mm != NULL) {
+ kthread_unuse_mm(test->mm);
+ mmput(test->mm);
+ test->mm = NULL;
+ }
complete_and_exit(try_catch->try_completion, 0);
}
@@ -65,6 +75,9 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context)
try_catch->context = context;
try_catch->try_completion = &try_completion;
try_catch->try_result = 0;
+
+ test->mm = get_task_mm(current);
+
task_struct = kthread_run(kunit_generic_run_threadfn_adapter,
try_catch,
"kunit_try_catch_thread");
base-commit: 725aca9585956676687c4cb803e88f770b0df2b2
prerequisite-patch-id: 5e5f9a8a05c5680fda1b04c9ab1b95ce91dc88b2
prerequisite-patch-id: 4d997940f4a9f303424af9bac412de1af861f9d9
prerequisite-patch-id: 582b6d9d28ce4b71628890ec832df6522ca68de0
--
2.26.2
^ permalink raw reply related
* [PATCH BlueZ] adapter: Don't remove temporary devices on disconnect
From: Luiz Augusto von Dentz @ 2020-07-18 0:49 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes the disconnect logic just update last seen field of the
device so in case it is temporary it would trigger its timer and be
removed after the timeout which is consistent with the discovery
session givin a grace time for application to react to such events.
---
src/adapter.c | 7 -------
src/device.c | 2 ++
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index c757447e2..5e896a9f0 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -6837,13 +6837,6 @@ static void adapter_remove_connection(struct btd_adapter *adapter,
return;
adapter->connections = g_slist_remove(adapter->connections, device);
-
- if (device_is_temporary(device) && !device_is_retrying(device)) {
- const char *path = device_get_path(device);
-
- DBG("Removing temporary device %s", path);
- btd_adapter_remove_device(adapter, device);
- }
}
static void adapter_stop(struct btd_adapter *adapter)
diff --git a/src/device.c b/src/device.c
index 470596ee4..2237a7670 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3039,6 +3039,8 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type)
if (device->bredr_state.connected || device->le_state.connected)
return;
+ device_update_last_seen(device, bdaddr_type);
+
g_dbus_emit_property_changed(dbus_conn, device->path,
DEVICE_INTERFACE, "Connected");
}
--
2.26.2
^ permalink raw reply related
* [PATCH v2] goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
From: Jessica Clarke @ 2020-07-18 0:49 UTC (permalink / raw)
To: qemu-riscv; +Cc: Jessica Clarke, qemu-devel, Anup Patel, Alistair Francis
In-Reply-To: <20200718002027.82300-1-jrtc27@jrtc27.com>
The specification says:
0x00 TIME_LOW R: Get current time, then return low-order 32-bits.
0x04 TIME_HIGH R: Return high 32-bits from previous TIME_LOW read.
...
To read the value, the kernel must perform an IO_READ(TIME_LOW),
which returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH),
which returns a signed 32-bit value, corresponding to the higher half
of the full value.
However, we were just returning the current time for both. If the guest
is unlucky enough to read TIME_LOW and TIME_HIGH either side of an
overflow of the lower half, it will see time be in the future, before
jumping backwards on the next read, and Linux currently relies on the
atomicity guaranteed by the spec so is affected by this. Fix this
violation of the spec by caching the correct value for TIME_HIGH
whenever TIME_LOW is read, and returning that value for any TIME_HIGH
read.
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
---
Changes since v1:
* Add time_high to goldfish_rtc_vmstate and increment version.
hw/rtc/goldfish_rtc.c | 17 ++++++++++++++---
include/hw/rtc/goldfish_rtc.h | 1 +
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/hw/rtc/goldfish_rtc.c b/hw/rtc/goldfish_rtc.c
index 01e9d2b083..6ddd45cce0 100644
--- a/hw/rtc/goldfish_rtc.c
+++ b/hw/rtc/goldfish_rtc.c
@@ -94,12 +94,22 @@ static uint64_t goldfish_rtc_read(void *opaque, hwaddr offset,
GoldfishRTCState *s = opaque;
uint64_t r = 0;
+ /*
+ * From the documentation linked at the top of the file:
+ *
+ * To read the value, the kernel must perform an IO_READ(TIME_LOW), which
+ * returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH), which
+ * returns a signed 32-bit value, corresponding to the higher half of the
+ * full value.
+ */
switch (offset) {
case RTC_TIME_LOW:
- r = goldfish_rtc_get_count(s) & 0xffffffff;
+ r = goldfish_rtc_get_count(s);
+ s->time_high = r >> 32;
+ r &= 0xffffffff;
break;
case RTC_TIME_HIGH:
- r = goldfish_rtc_get_count(s) >> 32;
+ r = s->time_high;
break;
case RTC_ALARM_LOW:
r = s->alarm_next & 0xffffffff;
@@ -216,7 +226,7 @@ static const MemoryRegionOps goldfish_rtc_ops = {
static const VMStateDescription goldfish_rtc_vmstate = {
.name = TYPE_GOLDFISH_RTC,
- .version_id = 1,
+ .version_id = 2,
.pre_save = goldfish_rtc_pre_save,
.post_load = goldfish_rtc_post_load,
.fields = (VMStateField[]) {
@@ -225,6 +235,7 @@ static const VMStateDescription goldfish_rtc_vmstate = {
VMSTATE_UINT32(alarm_running, GoldfishRTCState),
VMSTATE_UINT32(irq_pending, GoldfishRTCState),
VMSTATE_UINT32(irq_enabled, GoldfishRTCState),
+ VMSTATE_UINT32(time_high, GoldfishRTCState),
VMSTATE_END_OF_LIST()
}
};
diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h
index 16f9f9e29d..9bd8924f5f 100644
--- a/include/hw/rtc/goldfish_rtc.h
+++ b/include/hw/rtc/goldfish_rtc.h
@@ -41,6 +41,7 @@ typedef struct GoldfishRTCState {
uint32_t alarm_running;
uint32_t irq_pending;
uint32_t irq_enabled;
+ uint32_t time_high;
} GoldfishRTCState;
#endif
--
2.20.1
^ permalink raw reply related
* Re: [PATCH v3] folds tests from test_current_pid_tgid_new_ns into test_progs.
From: Carlos Antonio Neira Bustos @ 2020-07-18 0:49 UTC (permalink / raw)
To: netdev; +Cc: yhs, ebiederm, brouer, bpf
In-Reply-To: <20200718004122.37775-1-cneirabustos@gmail.com>
My last email was missing what changed from V2.
Changes from V2:
- Test that does not create a new namespace has been included in test_progs
- Test creating a new pid namespace is a standalone test.
- Skeleton is used in both tests.
On Fri, Jul 17, 2020 at 08:41:22PM -0400, Carlos Neira wrote:
> Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
> ---
> tools/testing/selftests/bpf/.gitignore | 2 +-
> tools/testing/selftests/bpf/Makefile | 3 +-
> .../bpf/prog_tests/ns_current_pid_tgid.c | 85 -----------------
> .../bpf/prog_tests/ns_current_pidtgid.c | 59 ++++++++++++
> .../bpf/progs/test_ns_current_pid_tgid.c | 37 --------
> .../bpf/progs/test_ns_current_pidtgid.c | 25 +++++
> ...new_ns.c => test_current_pidtgid_new_ns.c} | 0
> .../bpf/test_ns_current_pidtgid_newns.c | 91 +++++++++++++++++++
> 8 files changed, 178 insertions(+), 124 deletions(-)
> delete mode 100644 tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c
> create mode 100644 tools/testing/selftests/bpf/prog_tests/ns_current_pidtgid.c
> delete mode 100644 tools/testing/selftests/bpf/progs/test_ns_current_pid_tgid.c
> create mode 100644 tools/testing/selftests/bpf/progs/test_ns_current_pidtgid.c
> rename tools/testing/selftests/bpf/{test_current_pid_tgid_new_ns.c => test_current_pidtgid_new_ns.c} (100%)
> create mode 100644 tools/testing/selftests/bpf/test_ns_current_pidtgid_newns.c
>
> diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore
> index 1bb204cee853..022055f23592 100644
> --- a/tools/testing/selftests/bpf/.gitignore
> +++ b/tools/testing/selftests/bpf/.gitignore
> @@ -30,8 +30,8 @@ test_tcpnotify_user
> test_libbpf
> test_tcp_check_syncookie_user
> test_sysctl
> -test_current_pid_tgid_new_ns
> xdping
> +test_ns_current_pidtgid_newns
> test_cpp
> *.skel.h
> /no_alu32
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index e7a8cf83ba48..c1ba9c947196 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -37,7 +37,7 @@ TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test
> test_cgroup_storage \
> test_netcnt test_tcpnotify_user test_sock_fields test_sysctl \
> test_progs-no_alu32 \
> - test_current_pid_tgid_new_ns
> + test_ns_current_pidtgid_newns
>
> # Also test bpf-gcc, if present
> ifneq ($(BPF_GCC),)
> @@ -163,6 +163,7 @@ $(OUTPUT)/test_cgroup_storage: cgroup_helpers.c
> $(OUTPUT)/test_netcnt: cgroup_helpers.c
> $(OUTPUT)/test_sock_fields: cgroup_helpers.c
> $(OUTPUT)/test_sysctl: cgroup_helpers.c
> +$(OUTPUT)/test_ns_current_pidtgid_newns: test_ns_current_pidtgid_newns.c
>
> DEFAULT_BPFTOOL := $(SCRATCH_DIR)/sbin/bpftool
> BPFTOOL ?= $(DEFAULT_BPFTOOL)
> diff --git a/tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c b/tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c
> deleted file mode 100644
> index e74dc501b27f..000000000000
> --- a/tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c
> +++ /dev/null
> @@ -1,85 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -/* Copyright (c) 2020 Carlos Neira cneirabustos@gmail.com */
> -#include <test_progs.h>
> -#include <sys/stat.h>
> -#include <sys/types.h>
> -#include <unistd.h>
> -#include <sys/syscall.h>
> -
> -struct bss {
> - __u64 dev;
> - __u64 ino;
> - __u64 pid_tgid;
> - __u64 user_pid_tgid;
> -};
> -
> -void test_ns_current_pid_tgid(void)
> -{
> - const char *probe_name = "raw_tracepoint/sys_enter";
> - const char *file = "test_ns_current_pid_tgid.o";
> - int err, key = 0, duration = 0;
> - struct bpf_link *link = NULL;
> - struct bpf_program *prog;
> - struct bpf_map *bss_map;
> - struct bpf_object *obj;
> - struct bss bss;
> - struct stat st;
> - __u64 id;
> -
> - obj = bpf_object__open_file(file, NULL);
> - if (CHECK(IS_ERR(obj), "obj_open", "err %ld\n", PTR_ERR(obj)))
> - return;
> -
> - err = bpf_object__load(obj);
> - if (CHECK(err, "obj_load", "err %d errno %d\n", err, errno))
> - goto cleanup;
> -
> - bss_map = bpf_object__find_map_by_name(obj, "test_ns_.bss");
> - if (CHECK(!bss_map, "find_bss_map", "failed\n"))
> - goto cleanup;
> -
> - prog = bpf_object__find_program_by_title(obj, probe_name);
> - if (CHECK(!prog, "find_prog", "prog '%s' not found\n",
> - probe_name))
> - goto cleanup;
> -
> - memset(&bss, 0, sizeof(bss));
> - pid_t tid = syscall(SYS_gettid);
> - pid_t pid = getpid();
> -
> - id = (__u64) tid << 32 | pid;
> - bss.user_pid_tgid = id;
> -
> - if (CHECK_FAIL(stat("/proc/self/ns/pid", &st))) {
> - perror("Failed to stat /proc/self/ns/pid");
> - goto cleanup;
> - }
> -
> - bss.dev = st.st_dev;
> - bss.ino = st.st_ino;
> -
> - err = bpf_map_update_elem(bpf_map__fd(bss_map), &key, &bss, 0);
> - if (CHECK(err, "setting_bss", "failed to set bss : %d\n", err))
> - goto cleanup;
> -
> - link = bpf_program__attach_raw_tracepoint(prog, "sys_enter");
> - if (CHECK(IS_ERR(link), "attach_raw_tp", "err %ld\n",
> - PTR_ERR(link))) {
> - link = NULL;
> - goto cleanup;
> - }
> -
> - /* trigger some syscalls */
> - usleep(1);
> -
> - err = bpf_map_lookup_elem(bpf_map__fd(bss_map), &key, &bss);
> - if (CHECK(err, "set_bss", "failed to get bss : %d\n", err))
> - goto cleanup;
> -
> - if (CHECK(id != bss.pid_tgid, "Compare user pid/tgid vs. bpf pid/tgid",
> - "User pid/tgid %llu BPF pid/tgid %llu\n", id, bss.pid_tgid))
> - goto cleanup;
> -cleanup:
> - bpf_link__destroy(link);
> - bpf_object__close(obj);
> -}
> diff --git a/tools/testing/selftests/bpf/prog_tests/ns_current_pidtgid.c b/tools/testing/selftests/bpf/prog_tests/ns_current_pidtgid.c
> new file mode 100644
> index 000000000000..49578c0afbe0
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/prog_tests/ns_current_pidtgid.c
> @@ -0,0 +1,59 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2020 Carlos Neira cneirabustos@gmail.com */
> +
> +#define _GNU_SOURCE
> +#include <test_progs.h>
> +#include "test_ns_current_pidtgid.skel.h"
> +#include <sys/stat.h>
> +#include <sys/types.h>
> +#include <unistd.h>
> +#include <sys/syscall.h>
> +#include <sched.h>
> +#include <sys/wait.h>
> +#include <sys/mount.h>
> +#include <sys/fcntl.h>
> +
> +void test_ns_current_pidtgid(void)
> +{
> + int err, duration = 0;
> + struct test_ns_current_pidtgid *skel;
> + struct test_ns_current_pidtgid__bss *bss;
> + struct stat st;
> + __u64 id;
> +
> + skel = test_ns_current_pidtgid__open();
> + if (CHECK(!skel, "skel_open", "failed to open skeleton\n"))
> + return;
> +
> + err = test_ns_current_pidtgid__load(skel);
> + if (CHECK(err, "skel_load", "failed to load skeleton: %d\n", err))
> + goto cleanup;
> +
> + pid_t tid = syscall(SYS_gettid);
> + pid_t pid = getpid();
> +
> + id = (__u64) tid << 32 | pid;
> +
> + if (CHECK_FAIL(stat("/proc/self/ns/pid", &st))) {
> + perror("Failed to stat /proc/self/ns/pid");
> + goto cleanup;
> + }
> +
> + bss = skel->bss;
> + bss->dev = st.st_dev;
> + bss->ino = st.st_ino;
> + bss->user_pid_tgid = 0;
> +
> + err = test_ns_current_pidtgid__attach(skel);
> + if (CHECK(err, "skel_attach", "skeleton attach failed: %d\n", err))
> + goto cleanup;
> +
> + /* trigger tracepoint */
> + usleep(1);
> +
> + CHECK(bss->user_pid_tgid != id, "pid/tgid", "got %llu != exp %llu\n",
> + bss->user_pid_tgid, id);
> +cleanup:
> + test_ns_current_pidtgid__destroy(skel);
> +
> +}
> diff --git a/tools/testing/selftests/bpf/progs/test_ns_current_pid_tgid.c b/tools/testing/selftests/bpf/progs/test_ns_current_pid_tgid.c
> deleted file mode 100644
> index 1dca70a6de2f..000000000000
> --- a/tools/testing/selftests/bpf/progs/test_ns_current_pid_tgid.c
> +++ /dev/null
> @@ -1,37 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0
> -/* Copyright (c) 2019 Carlos Neira cneirabustos@gmail.com */
> -
> -#include <linux/bpf.h>
> -#include <stdint.h>
> -#include <bpf/bpf_helpers.h>
> -
> -static volatile struct {
> - __u64 dev;
> - __u64 ino;
> - __u64 pid_tgid;
> - __u64 user_pid_tgid;
> -} res;
> -
> -SEC("raw_tracepoint/sys_enter")
> -int trace(void *ctx)
> -{
> - __u64 ns_pid_tgid, expected_pid;
> - struct bpf_pidns_info nsdata;
> - __u32 key = 0;
> -
> - if (bpf_get_ns_current_pid_tgid(res.dev, res.ino, &nsdata,
> - sizeof(struct bpf_pidns_info)))
> - return 0;
> -
> - ns_pid_tgid = (__u64)nsdata.tgid << 32 | nsdata.pid;
> - expected_pid = res.user_pid_tgid;
> -
> - if (expected_pid != ns_pid_tgid)
> - return 0;
> -
> - res.pid_tgid = ns_pid_tgid;
> -
> - return 0;
> -}
> -
> -char _license[] SEC("license") = "GPL";
> diff --git a/tools/testing/selftests/bpf/progs/test_ns_current_pidtgid.c b/tools/testing/selftests/bpf/progs/test_ns_current_pidtgid.c
> new file mode 100644
> index 000000000000..9818a56510d9
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/test_ns_current_pidtgid.c
> @@ -0,0 +1,25 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2019 Carlos Neira cneirabustos@gmail.com */
> +
> +#include <linux/bpf.h>
> +#include <stdint.h>
> +#include <bpf/bpf_helpers.h>
> +
> +__u64 user_pid_tgid = 0;
> +__u64 dev = 0;
> +__u64 ino = 0;
> +
> +SEC("raw_tracepoint/sys_enter")
> +int handler(const void *ctx)
> +{
> + struct bpf_pidns_info nsdata;
> +
> + if (bpf_get_ns_current_pid_tgid(dev, ino, &nsdata,
> + sizeof(struct bpf_pidns_info)))
> + return 0;
> + user_pid_tgid = (__u64)nsdata.tgid << 32 | nsdata.pid;
> +
> + return 0;
> +}
> +
> +char _license[] SEC("license") = "GPL";
> diff --git a/tools/testing/selftests/bpf/test_current_pid_tgid_new_ns.c b/tools/testing/selftests/bpf/test_current_pidtgid_new_ns.c
> similarity index 100%
> rename from tools/testing/selftests/bpf/test_current_pid_tgid_new_ns.c
> rename to tools/testing/selftests/bpf/test_current_pidtgid_new_ns.c
> diff --git a/tools/testing/selftests/bpf/test_ns_current_pidtgid_newns.c b/tools/testing/selftests/bpf/test_ns_current_pidtgid_newns.c
> new file mode 100644
> index 000000000000..3bca38941c99
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/test_ns_current_pidtgid_newns.c
> @@ -0,0 +1,91 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2020 Carlos Neira cneirabustos@gmail.com */
> +
> +#define _GNU_SOURCE
> +#include <test_progs.h>
> +#include "test_ns_current_pidtgid.skel.h"
> +#include <sys/stat.h>
> +#include <sys/types.h>
> +#include <unistd.h>
> +#include <sys/syscall.h>
> +#include <sched.h>
> +#include <sys/wait.h>
> +#include <sys/mount.h>
> +#include <sys/fcntl.h>
> +
> +#define STACK_SIZE (1024 * 1024)
> +static char child_stack[STACK_SIZE];
> +
> +static int newns_pidtgid(void *arg)
> +{
> + struct test_ns_current_pidtgid__bss *bss;
> + struct test_ns_current_pidtgid *skel;
> + int pidns_fd = 0, err = 0;
> + pid_t pid, tid;
> + struct stat st;
> + __u64 id;
> +
> + skel = test_ns_current_pidtgid__open();
> + err = test_ns_current_pidtgid__load(skel);
> + if (err) {
> + perror("Failed to load skeleton");
> + goto cleanup;
> + }
> +
> + tid = syscall(SYS_gettid);
> + pid = getpid();
> + id = (__u64) tid << 32 | pid;
> +
> + if (stat("/proc/self/ns/pid", &st)) {
> + printf("Failed to stat /proc/self/ns/pid: %s\n",
> + strerror(errno));
> + goto cleanup;
> + }
> +
> + bss = skel->bss;
> + bss->dev = st.st_dev;
> + bss->ino = st.st_ino;
> + bss->user_pid_tgid = 0;
> +
> + err = test_ns_current_pidtgid__attach(skel);
> + if (err) {
> + printf("Failed to attach: %s err: %d\n", strerror(errno), err);
> + goto cleanup;
> + }
> + /* trigger tracepoint */
> + usleep(1);
> +
> + if (bss->user_pid_tgid != id) {
> + printf("test_ns_current_pidtgid_newns:FAIL\n");
> + err = EXIT_FAILURE;
> + } else {
> + printf("test_ns_current_pidtgid_newns:PASS\n");
> + err = EXIT_SUCCESS;
> + }
> +
> +cleanup:
> + setns(pidns_fd, CLONE_NEWPID);
> + test_ns_current_pidtgid__destroy(skel);
> +
> + return 0;
> +}
> +
> +int main(int argc, char **argv)
> +{
> + pid_t cpid;
> + int wstatus;
> +
> + cpid = clone(newns_pidtgid,
> + child_stack + STACK_SIZE,
> + CLONE_NEWPID | SIGCHLD, NULL);
> + if (cpid == -1) {
> + printf("test_ns_current_pidtgid_newns:Failed on CLONE: %s\n",
> + strerror(errno));
> + exit(EXIT_FAILURE);
> + }
> + if (waitpid(cpid, &wstatus, 0) == -1) {
> + printf("test_ns_current_pidtgid_newns:Failed on waitpid: %s\n",
> + strerror(errno));
> + }
> + return (WEXITSTATUS(wstatus));
> +}
> --
> 2.20.1
>
^ permalink raw reply
* [Linux-kernel-mentees] [RFC v2] kunit: tool: Allows to install and load modules in root filesystem
From: Vitor Massaru Iha @ 2020-07-18 0:49 UTC (permalink / raw)
To: kunit-dev
Cc: linux-kselftest, brendanhiggins, linux-kernel, davidgow,
linux-kernel-mentees, keescook
This makes possible to install and load KUnit tests
as modules in a root filesystem and boot UML with
this filesystem.
The filesystem was created using debootstrap:
sudo debootstrap buster .uml_rootfs
And change the owner of the root filesystem files
for your user:
sudo chown -R $USER:$USER .uml_rootfs
For the kunit-tool to correctly capture the test results,
uml_utilities must be installed on the host to halt uml.
Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
---
v2:
* splitted patch in 3:
- Allows to install and load modules in root filesystem;
- Provides an userspace memory context when tests are compiled
as module;
- Convert test_user_copy to KUnit test;
* added documentation;
* removed the use of global variable;
* capitalized make_cmd to look like a constant;
* adjusted unit tests to the new parameter (--uml_rootfs_dir);
---
Documentation/dev-tools/kunit/start.rst | 15 ++++
tools/testing/kunit/kunit.py | 40 +++++++--
tools/testing/kunit/kunit_kernel.py | 106 ++++++++++++++++++++----
tools/testing/kunit/kunit_tool_test.py | 16 ++--
4 files changed, 146 insertions(+), 31 deletions(-)
diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
index bb112cf70624..af2b6b9f870f 100644
--- a/Documentation/dev-tools/kunit/start.rst
+++ b/Documentation/dev-tools/kunit/start.rst
@@ -9,6 +9,21 @@ Installing dependencies
KUnit has the same dependencies as the Linux kernel. As long as you can build
the kernel, you can run KUnit.
+Unless you need to run the tests with a root filesystem, in this case you will
+need to install debootsrap and uml_tools (uml-tools in Debian flavor distro).
+
+To install the root filesystem:
+
+.. code-block:: bash
+
+ sudo debootstrap buster .uml_rootfs
+
+And change the owner of the root filesystem for your user:
+
+.. code-block:: bash
+
+ sudo chown -R $USER:$USER .uml_rootfs
+
Running tests with the KUnit Wrapper
====================================
Included with KUnit is a simple Python wrapper which runs tests under User Mode
diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index 2ece17e9eab5..8abe3a61f798 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -23,16 +23,16 @@ import kunit_parser
KunitResult = namedtuple('KunitResult', ['status','result','elapsed_time'])
KunitConfigRequest = namedtuple('KunitConfigRequest',
- ['build_dir', 'make_options'])
+ ['build_dir', 'uml_rootfs_path', 'make_options'])
KunitBuildRequest = namedtuple('KunitBuildRequest',
- ['jobs', 'build_dir', 'alltests',
+ ['jobs', 'build_dir', 'uml_rootfs_path', 'alltests',
'make_options'])
KunitExecRequest = namedtuple('KunitExecRequest',
- ['timeout', 'build_dir', 'alltests'])
+ ['timeout', 'build_dir', 'uml_rootfs_path', 'alltests'])
KunitParseRequest = namedtuple('KunitParseRequest',
['raw_output', 'input_data'])
KunitRequest = namedtuple('KunitRequest', ['raw_output','timeout', 'jobs',
- 'build_dir', 'alltests',
+ 'build_dir', 'uml_rootfs_path', 'alltests',
'make_options'])
KernelDirectoryPath = sys.argv[0].split('tools/testing/kunit/')[0]
@@ -47,7 +47,6 @@ def create_default_kunitconfig():
if not os.path.exists(kunit_kernel.kunitconfig_path):
shutil.copyfile('arch/um/configs/kunit_defconfig',
kunit_kernel.kunitconfig_path)
-
def get_kernel_root_path():
parts = sys.argv[0] if not __file__ else __file__
parts = os.path.realpath(parts).split('tools/testing/kunit')
@@ -61,7 +60,8 @@ def config_tests(linux: kunit_kernel.LinuxSourceTree,
config_start = time.time()
create_default_kunitconfig()
- success = linux.build_reconfig(request.build_dir, request.make_options)
+
+ success = linux.build_reconfig(request.build_dir, request.uml_rootfs_path, request.make_options)
config_end = time.time()
if not success:
return KunitResult(KunitStatus.CONFIG_FAILURE,
@@ -79,10 +79,9 @@ def build_tests(linux: kunit_kernel.LinuxSourceTree,
success = linux.build_um_kernel(request.alltests,
request.jobs,
request.build_dir,
+ request.uml_rootfs_path,
request.make_options)
build_end = time.time()
- if not success:
- return KunitResult(KunitStatus.BUILD_FAILURE, 'could not build kernel')
if not success:
return KunitResult(KunitStatus.BUILD_FAILURE,
'could not build kernel',
@@ -97,7 +96,8 @@ def exec_tests(linux: kunit_kernel.LinuxSourceTree,
test_start = time.time()
result = linux.run_kernel(
timeout=None if request.alltests else request.timeout,
- build_dir=request.build_dir)
+ build_dir=request.build_dir,
+ uml_rootfs_path=request.uml_rootfs_path)
test_end = time.time()
@@ -130,12 +130,14 @@ def run_tests(linux: kunit_kernel.LinuxSourceTree,
run_start = time.time()
config_request = KunitConfigRequest(request.build_dir,
+ request.uml_rootfs_path,
request.make_options)
config_result = config_tests(linux, config_request)
if config_result.status != KunitStatus.SUCCESS:
return config_result
build_request = KunitBuildRequest(request.jobs, request.build_dir,
+ request.uml_rootfs_path,
request.alltests,
request.make_options)
build_result = build_tests(linux, build_request)
@@ -143,6 +145,7 @@ def run_tests(linux: kunit_kernel.LinuxSourceTree,
return build_result
exec_request = KunitExecRequest(request.timeout, request.build_dir,
+ request.uml_rootfs_path,
request.alltests)
exec_result = exec_tests(linux, exec_request)
if exec_result.status != KunitStatus.SUCCESS:
@@ -168,6 +171,10 @@ def add_common_opts(parser):
help='As in the make command, it specifies the build '
'directory.',
type=str, default='.kunit', metavar='build_dir')
+ parser.add_argument('--uml_rootfs_dir',
+ help='To load modules, a root filesystem is '
+ 'required to install and load these modules.',
+ type=str, default=None, metavar='uml_rootfs_dir')
parser.add_argument('--make_options',
help='X=Y make option, can be repeated.',
action='append')
@@ -196,6 +203,7 @@ def add_parse_opts(parser):
def main(argv, linux=None):
+ uml_rootfs_path = None
parser = argparse.ArgumentParser(
description='Helps writing and running KUnit tests.')
subparser = parser.add_subparsers(dest='subcommand')
@@ -235,6 +243,16 @@ def main(argv, linux=None):
cli_args = parser.parse_args(argv)
+ if cli_args.uml_rootfs_dir \
+ and os.path.exists(cli_args.uml_rootfs_dir) \
+ and os.path.abspath(cli_args.uml_rootfs_dir) != \
+ os.path.abspath(os.getcwd()) \
+ and os.path.abspath(cli_args.uml_rootfs_dir) != '/':
+ uml_rootfs_path = os.path.abspath(cli_args.uml_rootfs_dir)
+ elif cli_args.uml_rootfs_dir != None:
+ print("Invalid uml_rootfs_dir: {}".format(cli_args.uml_rootfs_dir))
+ sys.exit(1)
+
if cli_args.subcommand == 'run':
if not os.path.exists(cli_args.build_dir):
os.mkdir(cli_args.build_dir)
@@ -246,6 +264,7 @@ def main(argv, linux=None):
cli_args.timeout,
cli_args.jobs,
cli_args.build_dir,
+ uml_rootfs_path,
cli_args.alltests,
cli_args.make_options)
result = run_tests(linux, request)
@@ -260,6 +279,7 @@ def main(argv, linux=None):
linux = kunit_kernel.LinuxSourceTree()
request = KunitConfigRequest(cli_args.build_dir,
+ uml_rootfs_path,
cli_args.make_options)
result = config_tests(linux, request)
kunit_parser.print_with_timestamp((
@@ -277,6 +297,7 @@ def main(argv, linux=None):
request = KunitBuildRequest(cli_args.jobs,
cli_args.build_dir,
+ uml_rootfs_path,
cli_args.alltests,
cli_args.make_options)
result = build_tests(linux, request)
@@ -295,6 +316,7 @@ def main(argv, linux=None):
exec_request = KunitExecRequest(cli_args.timeout,
cli_args.build_dir,
+ uml_rootfs_path,
cli_args.alltests)
exec_result = exec_tests(linux, exec_request)
parse_request = KunitParseRequest(cli_args.raw_output,
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index 63dbda2d029f..aeffd024816c 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -11,6 +11,7 @@ import logging
import subprocess
import os
import signal
+import time
from contextlib import ExitStack
@@ -19,8 +20,58 @@ import kunit_parser
KCONFIG_PATH = '.config'
kunitconfig_path = '.kunitconfig'
+X86_64_DEFCONFIG_PATH = 'arch/um/configs/x86_64_defconfig'
BROKEN_ALLCONFIG_PATH = 'tools/testing/kunit/configs/broken_on_uml.config'
+MAKE_CMD = {
+ 'make': {
+ 'command': ['make', 'ARCH=um'],
+ 'msg_error': 'Could not call execute make: ',
+ },
+ 'make_modules': {
+ 'command': ['make', 'modules', 'ARCH=um'],
+ 'msg_error': 'Could not call execute make modules: ',
+ },
+ 'make_modules_install': {
+ 'command': ['make', 'modules_install', 'ARCH=um'],
+ 'msg_error': 'Could not call execute make modules_install: ',
+ }
+}
+
+def halt_uml():
+ try:
+ subprocess.call(['uml_mconsole', 'kunitid', 'halt'])
+ except OSError as e:
+ raise ConfigError('Could not call uml_mconsole ' + e)
+ except subprocess.CalledProcessError as e:
+ raise ConfigError(e.output)
+
+def enable_uml_modules_on_boot(output_command, uml_rootfs_path):
+ uml_modules_path = None
+ found_kernel_version = False
+ modules = []
+ for i in output_command.decode('utf-8').split():
+ if found_kernel_version:
+ kernel_version = i
+ uml_modules_path = os.path.join(uml_rootfs_path,
+ 'lib/modules/', kernel_version, 'kernel/lib/')
+ break
+ if 'DEPMOD' in i:
+ found_kernel_version = True
+
+ try:
+ if os.path.exists(uml_modules_path):
+ modules = subprocess.check_output(['ls',
+ uml_modules_path]).decode('utf-8').split()
+ except OSError as e:
+ raise ConfigError('Could not list directory ' + e)
+ except subprocess.CalledProcessError as e:
+ raise ConfigError(e.output)
+
+ with open(os.path.join(uml_rootfs_path, 'etc/modules'), 'w') as f:
+ for i in modules:
+ f.write(i.replace('.ko', ''))
+
class ConfigError(Exception):
"""Represents an error trying to configure the Linux kernel."""
@@ -70,20 +121,28 @@ class LinuxSourceTreeOperations(object):
kunit_parser.print_with_timestamp(
'Starting Kernel with all configs takes a few minutes...')
- def make(self, jobs, build_dir, make_options):
- command = ['make', 'ARCH=um', '--jobs=' + str(jobs)]
+ def make(self, cmd, jobs, build_dir, uml_rootfs_path, make_options):
+ command = MAKE_CMD[cmd]['command'] + ['--jobs=' + str(jobs)]
+
if make_options:
command.extend(make_options)
if build_dir:
command += ['O=' + build_dir]
+
+ if cmd == 'make_modules_install':
+ command += ['INSTALL_MOD_PATH=' + uml_rootfs_path]
+
try:
- subprocess.check_output(command)
+ output = subprocess.check_output(command)
+ if cmd == 'make_modules_install':
+ enable_uml_modules_on_boot(output,
+ uml_rootfs_path)
except OSError as e:
- raise BuildError('Could not call execute make: ' + e)
+ raise BuildError(MAKE_CMD[cmd]['msg_error'] + e)
except subprocess.CalledProcessError as e:
raise BuildError(e.output)
- def linux_bin(self, params, timeout, build_dir, outfile):
+ def linux_bin(self, params, timeout, build_dir, uml_rootfs_path, outfile):
"""Runs the Linux UML binary. Must be named 'linux'."""
linux_bin = './linux'
if build_dir:
@@ -92,7 +151,11 @@ class LinuxSourceTreeOperations(object):
process = subprocess.Popen([linux_bin] + params,
stdout=output,
stderr=subprocess.STDOUT)
- process.wait(timeout)
+ if uml_rootfs_path:
+ time.sleep(timeout)
+ halt_uml()
+ else:
+ process.wait(timeout)
def get_kconfig_path(build_dir):
@@ -132,11 +195,16 @@ class LinuxSourceTree(object):
return False
return True
- def build_config(self, build_dir, make_options):
+ def build_config(self, build_dir, uml_rootfs_path, make_options):
kconfig_path = get_kconfig_path(build_dir)
if build_dir and not os.path.exists(build_dir):
os.mkdir(build_dir)
self._kconfig.write_to_file(kconfig_path)
+
+ if uml_rootfs_path:
+ with open(kconfig_path, 'a') as fw:
+ with open(X86_64_DEFCONFIG_PATH, 'r') as fr:
+ fw.write(fr.read())
try:
self._ops.make_olddefconfig(build_dir, make_options)
except ConfigError as e:
@@ -144,7 +212,7 @@ class LinuxSourceTree(object):
return False
return self.validate_config(build_dir)
- def build_reconfig(self, build_dir, make_options):
+ def build_reconfig(self, build_dir, uml_rootfs_path, make_options):
"""Creates a new .config if it is not a subset of the .kunitconfig."""
kconfig_path = get_kconfig_path(build_dir)
if os.path.exists(kconfig_path):
@@ -153,28 +221,38 @@ class LinuxSourceTree(object):
if not self._kconfig.is_subset_of(existing_kconfig):
print('Regenerating .config ...')
os.remove(kconfig_path)
- return self.build_config(build_dir, make_options)
+ return self.build_config(build_dir, uml_rootfs_path,
+ make_options)
else:
return True
else:
print('Generating .config ...')
- return self.build_config(build_dir, make_options)
+ return self.build_config(build_dir, uml_rootfs_path, make_options)
- def build_um_kernel(self, alltests, jobs, build_dir, make_options):
+ def build_um_kernel(self, alltests, jobs, build_dir,
+ uml_rootfs_path, make_options):
if alltests:
self._ops.make_allyesconfig()
try:
self._ops.make_olddefconfig(build_dir, make_options)
- self._ops.make(jobs, build_dir, make_options)
+ self._ops.make('make', jobs, build_dir, uml_rootfs_path, make_options)
+ if uml_rootfs_path:
+ self._ops.make('make_modules', jobs, build_dir,
+ uml_rootfs_path, make_options)
+ self._ops.make('make_modules_install', jobs,
+ build_dir, uml_rootfs_path, make_options)
except (ConfigError, BuildError) as e:
logging.error(e)
return False
return self.validate_config(build_dir)
- def run_kernel(self, args=[], build_dir='', timeout=None):
+ def run_kernel(self, args=[], build_dir='', uml_rootfs_path=None, timeout=None):
args.extend(['mem=1G'])
+ if uml_rootfs_path:
+ args.extend(['root=/dev/root', 'rootfstype=hostfs',
+ 'rootflags=' + uml_rootfs_path, 'umid=kunitid'])
outfile = 'test.log'
- self._ops.linux_bin(args, timeout, build_dir, outfile)
+ self._ops.linux_bin(args, timeout, build_dir, uml_rootfs_path, outfile)
subprocess.call(['stty', 'sane'])
with open(outfile, 'r') as file:
for line in file:
diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py
index ebedfc57a39b..2359c77c8efb 100755
--- a/tools/testing/kunit/kunit_tool_test.py
+++ b/tools/testing/kunit/kunit_tool_test.py
@@ -247,14 +247,14 @@ class KUnitMainTest(unittest.TestCase):
def test_build_passes_args_pass(self):
kunit.main(['build'], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 0
- self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, '.kunit', None)
+ self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, '.kunit', None, None)
assert self.linux_source_mock.run_kernel.call_count == 0
def test_exec_passes_args_pass(self):
kunit.main(['exec'], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 0
assert self.linux_source_mock.run_kernel.call_count == 1
- self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', timeout=300)
+ self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', uml_rootfs_path=None, timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_run_passes_args_pass(self):
@@ -262,7 +262,7 @@ class KUnitMainTest(unittest.TestCase):
assert self.linux_source_mock.build_reconfig.call_count == 1
assert self.linux_source_mock.run_kernel.call_count == 1
self.linux_source_mock.run_kernel.assert_called_once_with(
- build_dir='.kunit', timeout=300)
+ build_dir='.kunit', uml_rootfs_path=None, timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_exec_passes_args_fail(self):
@@ -302,7 +302,7 @@ class KUnitMainTest(unittest.TestCase):
def test_exec_timeout(self):
timeout = 3453
kunit.main(['exec', '--timeout', str(timeout)], self.linux_source_mock)
- self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', timeout=timeout)
+ self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', uml_rootfs_path=None, timeout=timeout)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_run_timeout(self):
@@ -310,7 +310,7 @@ class KUnitMainTest(unittest.TestCase):
kunit.main(['run', '--timeout', str(timeout)], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 1
self.linux_source_mock.run_kernel.assert_called_once_with(
- build_dir='.kunit', timeout=timeout)
+ build_dir='.kunit', uml_rootfs_path=None, timeout=timeout)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_run_builddir(self):
@@ -318,7 +318,7 @@ class KUnitMainTest(unittest.TestCase):
kunit.main(['run', '--build_dir=.kunit'], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 1
self.linux_source_mock.run_kernel.assert_called_once_with(
- build_dir=build_dir, timeout=300)
+ build_dir=build_dir, uml_rootfs_path=None, timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_config_builddir(self):
@@ -329,12 +329,12 @@ class KUnitMainTest(unittest.TestCase):
def test_build_builddir(self):
build_dir = '.kunit'
kunit.main(['build', '--build_dir', build_dir], self.linux_source_mock)
- self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, build_dir, None)
+ self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, build_dir, None, None)
def test_exec_builddir(self):
build_dir = '.kunit'
kunit.main(['exec', '--build_dir', build_dir], self.linux_source_mock)
- self.linux_source_mock.run_kernel.assert_called_once_with(build_dir=build_dir, timeout=300)
+ self.linux_source_mock.run_kernel.assert_called_once_with(build_dir=build_dir, uml_rootfs_path=None, timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
if __name__ == '__main__':
base-commit: 725aca9585956676687c4cb803e88f770b0df2b2
prerequisite-patch-id: 5e5f9a8a05c5680fda1b04c9ab1b95ce91dc88b2
prerequisite-patch-id: 4d997940f4a9f303424af9bac412de1af861f9d9
prerequisite-patch-id: 582b6d9d28ce4b71628890ec832df6522ca68de0
--
2.26.2
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
^ permalink raw reply related
* [RFC v2] kunit: tool: Allows to install and load modules in root filesystem
From: Vitor Massaru Iha @ 2020-07-18 0:49 UTC (permalink / raw)
To: kunit-dev
Cc: linux-kselftest, linux-kernel, brendanhiggins, keescook, davidgow,
skhan, linux-kernel-mentees
This makes possible to install and load KUnit tests
as modules in a root filesystem and boot UML with
this filesystem.
The filesystem was created using debootstrap:
sudo debootstrap buster .uml_rootfs
And change the owner of the root filesystem files
for your user:
sudo chown -R $USER:$USER .uml_rootfs
For the kunit-tool to correctly capture the test results,
uml_utilities must be installed on the host to halt uml.
Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
---
v2:
* splitted patch in 3:
- Allows to install and load modules in root filesystem;
- Provides an userspace memory context when tests are compiled
as module;
- Convert test_user_copy to KUnit test;
* added documentation;
* removed the use of global variable;
* capitalized make_cmd to look like a constant;
* adjusted unit tests to the new parameter (--uml_rootfs_dir);
---
Documentation/dev-tools/kunit/start.rst | 15 ++++
tools/testing/kunit/kunit.py | 40 +++++++--
tools/testing/kunit/kunit_kernel.py | 106 ++++++++++++++++++++----
tools/testing/kunit/kunit_tool_test.py | 16 ++--
4 files changed, 146 insertions(+), 31 deletions(-)
diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
index bb112cf70624..af2b6b9f870f 100644
--- a/Documentation/dev-tools/kunit/start.rst
+++ b/Documentation/dev-tools/kunit/start.rst
@@ -9,6 +9,21 @@ Installing dependencies
KUnit has the same dependencies as the Linux kernel. As long as you can build
the kernel, you can run KUnit.
+Unless you need to run the tests with a root filesystem, in this case you will
+need to install debootsrap and uml_tools (uml-tools in Debian flavor distro).
+
+To install the root filesystem:
+
+.. code-block:: bash
+
+ sudo debootstrap buster .uml_rootfs
+
+And change the owner of the root filesystem for your user:
+
+.. code-block:: bash
+
+ sudo chown -R $USER:$USER .uml_rootfs
+
Running tests with the KUnit Wrapper
====================================
Included with KUnit is a simple Python wrapper which runs tests under User Mode
diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index 2ece17e9eab5..8abe3a61f798 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -23,16 +23,16 @@ import kunit_parser
KunitResult = namedtuple('KunitResult', ['status','result','elapsed_time'])
KunitConfigRequest = namedtuple('KunitConfigRequest',
- ['build_dir', 'make_options'])
+ ['build_dir', 'uml_rootfs_path', 'make_options'])
KunitBuildRequest = namedtuple('KunitBuildRequest',
- ['jobs', 'build_dir', 'alltests',
+ ['jobs', 'build_dir', 'uml_rootfs_path', 'alltests',
'make_options'])
KunitExecRequest = namedtuple('KunitExecRequest',
- ['timeout', 'build_dir', 'alltests'])
+ ['timeout', 'build_dir', 'uml_rootfs_path', 'alltests'])
KunitParseRequest = namedtuple('KunitParseRequest',
['raw_output', 'input_data'])
KunitRequest = namedtuple('KunitRequest', ['raw_output','timeout', 'jobs',
- 'build_dir', 'alltests',
+ 'build_dir', 'uml_rootfs_path', 'alltests',
'make_options'])
KernelDirectoryPath = sys.argv[0].split('tools/testing/kunit/')[0]
@@ -47,7 +47,6 @@ def create_default_kunitconfig():
if not os.path.exists(kunit_kernel.kunitconfig_path):
shutil.copyfile('arch/um/configs/kunit_defconfig',
kunit_kernel.kunitconfig_path)
-
def get_kernel_root_path():
parts = sys.argv[0] if not __file__ else __file__
parts = os.path.realpath(parts).split('tools/testing/kunit')
@@ -61,7 +60,8 @@ def config_tests(linux: kunit_kernel.LinuxSourceTree,
config_start = time.time()
create_default_kunitconfig()
- success = linux.build_reconfig(request.build_dir, request.make_options)
+
+ success = linux.build_reconfig(request.build_dir, request.uml_rootfs_path, request.make_options)
config_end = time.time()
if not success:
return KunitResult(KunitStatus.CONFIG_FAILURE,
@@ -79,10 +79,9 @@ def build_tests(linux: kunit_kernel.LinuxSourceTree,
success = linux.build_um_kernel(request.alltests,
request.jobs,
request.build_dir,
+ request.uml_rootfs_path,
request.make_options)
build_end = time.time()
- if not success:
- return KunitResult(KunitStatus.BUILD_FAILURE, 'could not build kernel')
if not success:
return KunitResult(KunitStatus.BUILD_FAILURE,
'could not build kernel',
@@ -97,7 +96,8 @@ def exec_tests(linux: kunit_kernel.LinuxSourceTree,
test_start = time.time()
result = linux.run_kernel(
timeout=None if request.alltests else request.timeout,
- build_dir=request.build_dir)
+ build_dir=request.build_dir,
+ uml_rootfs_path=request.uml_rootfs_path)
test_end = time.time()
@@ -130,12 +130,14 @@ def run_tests(linux: kunit_kernel.LinuxSourceTree,
run_start = time.time()
config_request = KunitConfigRequest(request.build_dir,
+ request.uml_rootfs_path,
request.make_options)
config_result = config_tests(linux, config_request)
if config_result.status != KunitStatus.SUCCESS:
return config_result
build_request = KunitBuildRequest(request.jobs, request.build_dir,
+ request.uml_rootfs_path,
request.alltests,
request.make_options)
build_result = build_tests(linux, build_request)
@@ -143,6 +145,7 @@ def run_tests(linux: kunit_kernel.LinuxSourceTree,
return build_result
exec_request = KunitExecRequest(request.timeout, request.build_dir,
+ request.uml_rootfs_path,
request.alltests)
exec_result = exec_tests(linux, exec_request)
if exec_result.status != KunitStatus.SUCCESS:
@@ -168,6 +171,10 @@ def add_common_opts(parser):
help='As in the make command, it specifies the build '
'directory.',
type=str, default='.kunit', metavar='build_dir')
+ parser.add_argument('--uml_rootfs_dir',
+ help='To load modules, a root filesystem is '
+ 'required to install and load these modules.',
+ type=str, default=None, metavar='uml_rootfs_dir')
parser.add_argument('--make_options',
help='X=Y make option, can be repeated.',
action='append')
@@ -196,6 +203,7 @@ def add_parse_opts(parser):
def main(argv, linux=None):
+ uml_rootfs_path = None
parser = argparse.ArgumentParser(
description='Helps writing and running KUnit tests.')
subparser = parser.add_subparsers(dest='subcommand')
@@ -235,6 +243,16 @@ def main(argv, linux=None):
cli_args = parser.parse_args(argv)
+ if cli_args.uml_rootfs_dir \
+ and os.path.exists(cli_args.uml_rootfs_dir) \
+ and os.path.abspath(cli_args.uml_rootfs_dir) != \
+ os.path.abspath(os.getcwd()) \
+ and os.path.abspath(cli_args.uml_rootfs_dir) != '/':
+ uml_rootfs_path = os.path.abspath(cli_args.uml_rootfs_dir)
+ elif cli_args.uml_rootfs_dir != None:
+ print("Invalid uml_rootfs_dir: {}".format(cli_args.uml_rootfs_dir))
+ sys.exit(1)
+
if cli_args.subcommand == 'run':
if not os.path.exists(cli_args.build_dir):
os.mkdir(cli_args.build_dir)
@@ -246,6 +264,7 @@ def main(argv, linux=None):
cli_args.timeout,
cli_args.jobs,
cli_args.build_dir,
+ uml_rootfs_path,
cli_args.alltests,
cli_args.make_options)
result = run_tests(linux, request)
@@ -260,6 +279,7 @@ def main(argv, linux=None):
linux = kunit_kernel.LinuxSourceTree()
request = KunitConfigRequest(cli_args.build_dir,
+ uml_rootfs_path,
cli_args.make_options)
result = config_tests(linux, request)
kunit_parser.print_with_timestamp((
@@ -277,6 +297,7 @@ def main(argv, linux=None):
request = KunitBuildRequest(cli_args.jobs,
cli_args.build_dir,
+ uml_rootfs_path,
cli_args.alltests,
cli_args.make_options)
result = build_tests(linux, request)
@@ -295,6 +316,7 @@ def main(argv, linux=None):
exec_request = KunitExecRequest(cli_args.timeout,
cli_args.build_dir,
+ uml_rootfs_path,
cli_args.alltests)
exec_result = exec_tests(linux, exec_request)
parse_request = KunitParseRequest(cli_args.raw_output,
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index 63dbda2d029f..aeffd024816c 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -11,6 +11,7 @@ import logging
import subprocess
import os
import signal
+import time
from contextlib import ExitStack
@@ -19,8 +20,58 @@ import kunit_parser
KCONFIG_PATH = '.config'
kunitconfig_path = '.kunitconfig'
+X86_64_DEFCONFIG_PATH = 'arch/um/configs/x86_64_defconfig'
BROKEN_ALLCONFIG_PATH = 'tools/testing/kunit/configs/broken_on_uml.config'
+MAKE_CMD = {
+ 'make': {
+ 'command': ['make', 'ARCH=um'],
+ 'msg_error': 'Could not call execute make: ',
+ },
+ 'make_modules': {
+ 'command': ['make', 'modules', 'ARCH=um'],
+ 'msg_error': 'Could not call execute make modules: ',
+ },
+ 'make_modules_install': {
+ 'command': ['make', 'modules_install', 'ARCH=um'],
+ 'msg_error': 'Could not call execute make modules_install: ',
+ }
+}
+
+def halt_uml():
+ try:
+ subprocess.call(['uml_mconsole', 'kunitid', 'halt'])
+ except OSError as e:
+ raise ConfigError('Could not call uml_mconsole ' + e)
+ except subprocess.CalledProcessError as e:
+ raise ConfigError(e.output)
+
+def enable_uml_modules_on_boot(output_command, uml_rootfs_path):
+ uml_modules_path = None
+ found_kernel_version = False
+ modules = []
+ for i in output_command.decode('utf-8').split():
+ if found_kernel_version:
+ kernel_version = i
+ uml_modules_path = os.path.join(uml_rootfs_path,
+ 'lib/modules/', kernel_version, 'kernel/lib/')
+ break
+ if 'DEPMOD' in i:
+ found_kernel_version = True
+
+ try:
+ if os.path.exists(uml_modules_path):
+ modules = subprocess.check_output(['ls',
+ uml_modules_path]).decode('utf-8').split()
+ except OSError as e:
+ raise ConfigError('Could not list directory ' + e)
+ except subprocess.CalledProcessError as e:
+ raise ConfigError(e.output)
+
+ with open(os.path.join(uml_rootfs_path, 'etc/modules'), 'w') as f:
+ for i in modules:
+ f.write(i.replace('.ko', ''))
+
class ConfigError(Exception):
"""Represents an error trying to configure the Linux kernel."""
@@ -70,20 +121,28 @@ class LinuxSourceTreeOperations(object):
kunit_parser.print_with_timestamp(
'Starting Kernel with all configs takes a few minutes...')
- def make(self, jobs, build_dir, make_options):
- command = ['make', 'ARCH=um', '--jobs=' + str(jobs)]
+ def make(self, cmd, jobs, build_dir, uml_rootfs_path, make_options):
+ command = MAKE_CMD[cmd]['command'] + ['--jobs=' + str(jobs)]
+
if make_options:
command.extend(make_options)
if build_dir:
command += ['O=' + build_dir]
+
+ if cmd == 'make_modules_install':
+ command += ['INSTALL_MOD_PATH=' + uml_rootfs_path]
+
try:
- subprocess.check_output(command)
+ output = subprocess.check_output(command)
+ if cmd == 'make_modules_install':
+ enable_uml_modules_on_boot(output,
+ uml_rootfs_path)
except OSError as e:
- raise BuildError('Could not call execute make: ' + e)
+ raise BuildError(MAKE_CMD[cmd]['msg_error'] + e)
except subprocess.CalledProcessError as e:
raise BuildError(e.output)
- def linux_bin(self, params, timeout, build_dir, outfile):
+ def linux_bin(self, params, timeout, build_dir, uml_rootfs_path, outfile):
"""Runs the Linux UML binary. Must be named 'linux'."""
linux_bin = './linux'
if build_dir:
@@ -92,7 +151,11 @@ class LinuxSourceTreeOperations(object):
process = subprocess.Popen([linux_bin] + params,
stdout=output,
stderr=subprocess.STDOUT)
- process.wait(timeout)
+ if uml_rootfs_path:
+ time.sleep(timeout)
+ halt_uml()
+ else:
+ process.wait(timeout)
def get_kconfig_path(build_dir):
@@ -132,11 +195,16 @@ class LinuxSourceTree(object):
return False
return True
- def build_config(self, build_dir, make_options):
+ def build_config(self, build_dir, uml_rootfs_path, make_options):
kconfig_path = get_kconfig_path(build_dir)
if build_dir and not os.path.exists(build_dir):
os.mkdir(build_dir)
self._kconfig.write_to_file(kconfig_path)
+
+ if uml_rootfs_path:
+ with open(kconfig_path, 'a') as fw:
+ with open(X86_64_DEFCONFIG_PATH, 'r') as fr:
+ fw.write(fr.read())
try:
self._ops.make_olddefconfig(build_dir, make_options)
except ConfigError as e:
@@ -144,7 +212,7 @@ class LinuxSourceTree(object):
return False
return self.validate_config(build_dir)
- def build_reconfig(self, build_dir, make_options):
+ def build_reconfig(self, build_dir, uml_rootfs_path, make_options):
"""Creates a new .config if it is not a subset of the .kunitconfig."""
kconfig_path = get_kconfig_path(build_dir)
if os.path.exists(kconfig_path):
@@ -153,28 +221,38 @@ class LinuxSourceTree(object):
if not self._kconfig.is_subset_of(existing_kconfig):
print('Regenerating .config ...')
os.remove(kconfig_path)
- return self.build_config(build_dir, make_options)
+ return self.build_config(build_dir, uml_rootfs_path,
+ make_options)
else:
return True
else:
print('Generating .config ...')
- return self.build_config(build_dir, make_options)
+ return self.build_config(build_dir, uml_rootfs_path, make_options)
- def build_um_kernel(self, alltests, jobs, build_dir, make_options):
+ def build_um_kernel(self, alltests, jobs, build_dir,
+ uml_rootfs_path, make_options):
if alltests:
self._ops.make_allyesconfig()
try:
self._ops.make_olddefconfig(build_dir, make_options)
- self._ops.make(jobs, build_dir, make_options)
+ self._ops.make('make', jobs, build_dir, uml_rootfs_path, make_options)
+ if uml_rootfs_path:
+ self._ops.make('make_modules', jobs, build_dir,
+ uml_rootfs_path, make_options)
+ self._ops.make('make_modules_install', jobs,
+ build_dir, uml_rootfs_path, make_options)
except (ConfigError, BuildError) as e:
logging.error(e)
return False
return self.validate_config(build_dir)
- def run_kernel(self, args=[], build_dir='', timeout=None):
+ def run_kernel(self, args=[], build_dir='', uml_rootfs_path=None, timeout=None):
args.extend(['mem=1G'])
+ if uml_rootfs_path:
+ args.extend(['root=/dev/root', 'rootfstype=hostfs',
+ 'rootflags=' + uml_rootfs_path, 'umid=kunitid'])
outfile = 'test.log'
- self._ops.linux_bin(args, timeout, build_dir, outfile)
+ self._ops.linux_bin(args, timeout, build_dir, uml_rootfs_path, outfile)
subprocess.call(['stty', 'sane'])
with open(outfile, 'r') as file:
for line in file:
diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py
index ebedfc57a39b..2359c77c8efb 100755
--- a/tools/testing/kunit/kunit_tool_test.py
+++ b/tools/testing/kunit/kunit_tool_test.py
@@ -247,14 +247,14 @@ class KUnitMainTest(unittest.TestCase):
def test_build_passes_args_pass(self):
kunit.main(['build'], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 0
- self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, '.kunit', None)
+ self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, '.kunit', None, None)
assert self.linux_source_mock.run_kernel.call_count == 0
def test_exec_passes_args_pass(self):
kunit.main(['exec'], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 0
assert self.linux_source_mock.run_kernel.call_count == 1
- self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', timeout=300)
+ self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', uml_rootfs_path=None, timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_run_passes_args_pass(self):
@@ -262,7 +262,7 @@ class KUnitMainTest(unittest.TestCase):
assert self.linux_source_mock.build_reconfig.call_count == 1
assert self.linux_source_mock.run_kernel.call_count == 1
self.linux_source_mock.run_kernel.assert_called_once_with(
- build_dir='.kunit', timeout=300)
+ build_dir='.kunit', uml_rootfs_path=None, timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_exec_passes_args_fail(self):
@@ -302,7 +302,7 @@ class KUnitMainTest(unittest.TestCase):
def test_exec_timeout(self):
timeout = 3453
kunit.main(['exec', '--timeout', str(timeout)], self.linux_source_mock)
- self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', timeout=timeout)
+ self.linux_source_mock.run_kernel.assert_called_once_with(build_dir='.kunit', uml_rootfs_path=None, timeout=timeout)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_run_timeout(self):
@@ -310,7 +310,7 @@ class KUnitMainTest(unittest.TestCase):
kunit.main(['run', '--timeout', str(timeout)], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 1
self.linux_source_mock.run_kernel.assert_called_once_with(
- build_dir='.kunit', timeout=timeout)
+ build_dir='.kunit', uml_rootfs_path=None, timeout=timeout)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_run_builddir(self):
@@ -318,7 +318,7 @@ class KUnitMainTest(unittest.TestCase):
kunit.main(['run', '--build_dir=.kunit'], self.linux_source_mock)
assert self.linux_source_mock.build_reconfig.call_count == 1
self.linux_source_mock.run_kernel.assert_called_once_with(
- build_dir=build_dir, timeout=300)
+ build_dir=build_dir, uml_rootfs_path=None, timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
def test_config_builddir(self):
@@ -329,12 +329,12 @@ class KUnitMainTest(unittest.TestCase):
def test_build_builddir(self):
build_dir = '.kunit'
kunit.main(['build', '--build_dir', build_dir], self.linux_source_mock)
- self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, build_dir, None)
+ self.linux_source_mock.build_um_kernel.assert_called_once_with(False, 8, build_dir, None, None)
def test_exec_builddir(self):
build_dir = '.kunit'
kunit.main(['exec', '--build_dir', build_dir], self.linux_source_mock)
- self.linux_source_mock.run_kernel.assert_called_once_with(build_dir=build_dir, timeout=300)
+ self.linux_source_mock.run_kernel.assert_called_once_with(build_dir=build_dir, uml_rootfs_path=None, timeout=300)
self.print_mock.assert_any_call(StrContains('Testing complete.'))
if __name__ == '__main__':
base-commit: 725aca9585956676687c4cb803e88f770b0df2b2
prerequisite-patch-id: 5e5f9a8a05c5680fda1b04c9ab1b95ce91dc88b2
prerequisite-patch-id: 4d997940f4a9f303424af9bac412de1af861f9d9
prerequisite-patch-id: 582b6d9d28ce4b71628890ec832df6522ca68de0
--
2.26.2
^ permalink raw reply related
* Re: [PATCH bpf-next 2/2] bpf: compute bpf_skc_to_*() helper socket btf ids at build time
From: kernel test robot @ 2020-07-18 0:33 UTC (permalink / raw)
To: Yonghong Song, bpf, netdev
Cc: kbuild-all, Alexei Starovoitov, Daniel Borkmann, Jiri Olsa,
kernel-team
In-Reply-To: <20200717184707.3477423-1-yhs@fb.com>
[-- Attachment #1: Type: text/plain, Size: 3358 bytes --]
Hi Yonghong,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Yonghong-Song/compute-bpf_skc_to_-helper-socket-btf-ids-at-build-time/20200718-025117
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: x86_64-rhel-7.6-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
In file included from net/core/filter.c:78:
net/core/filter.c:3783:13: warning: array 'bpf_skb_output_btf_ids' assumed to have one element
3783 | BTF_ID_LIST(bpf_skb_output_btf_ids)
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/btf_ids.h:69:12: note: in definition of macro 'BTF_ID_LIST'
69 | static u32 name[];
| ^~~~
net/core/filter.c:4179:13: warning: array 'bpf_xdp_output_btf_ids' assumed to have one element
4179 | BTF_ID_LIST(bpf_xdp_output_btf_ids)
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/btf_ids.h:69:12: note: in definition of macro 'BTF_ID_LIST'
69 | static u32 name[];
| ^~~~
>> net/core/filter.c:9268:13: warning: array 'btf_sock_ids' assumed to have one element
9268 | BTF_ID_LIST(btf_sock_ids)
| ^~~~~~~~~~~~
include/linux/btf_ids.h:69:12: note: in definition of macro 'BTF_ID_LIST'
69 | static u32 name[];
| ^~~~
/tmp/ccDB7ajn.s: Assembler messages:
>> /tmp/ccDB7ajn.s:66247: Error: symbol `btf_sock_ids' is already defined
/tmp/ccDB7ajn.s:67196: Error: symbol `bpf_xdp_output_btf_ids' is already defined
/tmp/ccDB7ajn.s:67344: Error: symbol `bpf_skb_output_btf_ids' is already defined
--
In file included from net/core/filter.c:78:
net/core/filter.c:3783:13: warning: array 'bpf_skb_output_btf_ids' assumed to have one element
3783 | BTF_ID_LIST(bpf_skb_output_btf_ids)
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/btf_ids.h:69:12: note: in definition of macro 'BTF_ID_LIST'
69 | static u32 name[];
| ^~~~
net/core/filter.c:4179:13: warning: array 'bpf_xdp_output_btf_ids' assumed to have one element
4179 | BTF_ID_LIST(bpf_xdp_output_btf_ids)
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/btf_ids.h:69:12: note: in definition of macro 'BTF_ID_LIST'
69 | static u32 name[];
| ^~~~
>> net/core/filter.c:9268:13: warning: array 'btf_sock_ids' assumed to have one element
9268 | BTF_ID_LIST(btf_sock_ids)
| ^~~~~~~~~~~~
include/linux/btf_ids.h:69:12: note: in definition of macro 'BTF_ID_LIST'
69 | static u32 name[];
| ^~~~
/tmp/cc1GpKvw.s: Assembler messages:
/tmp/cc1GpKvw.s:66247: Error: symbol `btf_sock_ids' is already defined
/tmp/cc1GpKvw.s:67196: Error: symbol `bpf_xdp_output_btf_ids' is already defined
/tmp/cc1GpKvw.s:67344: Error: symbol `bpf_skb_output_btf_ids' is already defined
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50002 bytes --]
^ permalink raw reply
* Re: [PATCH] tools/memory-model: document the "one-time init" pattern
From: Darrick J. Wong @ 2020-07-18 0:44 UTC (permalink / raw)
To: Matthew Wilcox
Cc: Eric Biggers, linux-kernel, linux-arch, Paul E . McKenney,
linux-fsdevel, Akira Yokosawa, Alan Stern, Andrea Parri,
Boqun Feng, Daniel Lustig, Dave Chinner, David Howells,
Jade Alglave, Luc Maranget, Nicholas Piggin, Peter Zijlstra,
Will Deacon
In-Reply-To: <20200717174750.GQ12769@casper.infradead.org>
On Fri, Jul 17, 2020 at 06:47:50PM +0100, Matthew Wilcox wrote:
> On Thu, Jul 16, 2020 at 09:44:27PM -0700, Eric Biggers wrote:
> > +If that doesn't apply, you'll have to implement one-time init yourself.
> > +
> > +The simplest implementation just uses a mutex and an 'inited' flag.
> > +This implementation should be used where feasible:
>
> I think some syntactic sugar should make it feasible for normal people
> to implement the most efficient version of this just like they use locks.
>
> > +For the single-pointer case, a further optimized implementation
> > +eliminates the mutex and instead uses compare-and-exchange:
> > +
> > + static struct foo *foo;
> > +
> > + int init_foo_if_needed(void)
> > + {
> > + struct foo *p;
> > +
> > + /* pairs with successful cmpxchg_release() below */
> > + if (smp_load_acquire(&foo))
> > + return 0;
> > +
> > + p = alloc_foo();
> > + if (!p)
> > + return -ENOMEM;
> > +
> > + /* on success, pairs with smp_load_acquire() above and below */
> > + if (cmpxchg_release(&foo, NULL, p) != NULL) {
>
> Why do we have cmpxchg_release() anyway? Under what circumstances is
> cmpxchg() useful _without_ having release semantics?
>
> > + free_foo(p);
> > + /* pairs with successful cmpxchg_release() above */
> > + smp_load_acquire(&foo);
> > + }
> > + return 0;
> > + }
>
> How about something like this ...
>
> once.h:
>
> static struct init_once_pointer {
> void *p;
> };
>
> static inline void *once_get(struct init_once_pointer *oncep)
> { ... }
>
> static inline bool once_store(struct init_once_pointer *oncep, void *p)
> { ... }
>
> --- foo.c ---
>
> struct foo *get_foo(gfp_t gfp)
> {
> static struct init_once_pointer my_foo;
> struct foo *foop;
>
> foop = once_get(&my_foo);
> if (foop)
> return foop;
>
> foop = alloc_foo(gfp);
> if (!once_store(&my_foo, foop)) {
> free_foo(foop);
> foop = once_get(&my_foo);
> }
>
> return foop;
> }
>
> Any kernel programmer should be able to handle that pattern. And no mutex!
That would be even better.
--D
^ permalink raw reply
* Re: [PATCH] goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
From: Richard Henderson @ 2020-07-18 0:43 UTC (permalink / raw)
To: Jessica Clarke, qemu-riscv; +Cc: Anup Patel, Alistair Francis, qemu-devel
In-Reply-To: <20200718002027.82300-1-jrtc27@jrtc27.com>
On 7/17/20 5:20 PM, Jessica Clarke wrote:
> The specification says:
>
> 0x00 TIME_LOW R: Get current time, then return low-order 32-bits.
> 0x04 TIME_HIGH R: Return high 32-bits from previous TIME_LOW read.
>
> ...
>
> To read the value, the kernel must perform an IO_READ(TIME_LOW),
> which returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH),
> which returns a signed 32-bit value, corresponding to the higher half
> of the full value.
>
> However, we were just returning the current time for both. If the guest
> is unlucky enough to read TIME_LOW and TIME_HIGH either side of an
> overflow of the lower half, it will see time be in the future, before
> jumping backwards on the next read, and Linux currently relies on the
> atomicity guaranteed by the spec so is affected by this. Fix this
> violation of the spec by caching the correct value for TIME_HIGH
> whenever TIME_LOW is read, and returning that value for any TIME_HIGH
> read.
>
> Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
> ---
> hw/rtc/goldfish_rtc.c | 14 ++++++++++++--
> include/hw/rtc/goldfish_rtc.h | 1 +
> 2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/hw/rtc/goldfish_rtc.c b/hw/rtc/goldfish_rtc.c
> index 01e9d2b083..9b577bf159 100644
> --- a/hw/rtc/goldfish_rtc.c
> +++ b/hw/rtc/goldfish_rtc.c
> @@ -94,12 +94,22 @@ static uint64_t goldfish_rtc_read(void *opaque, hwaddr offset,
> GoldfishRTCState *s = opaque;
> uint64_t r = 0;
>
> + /*
> + * From the documentation linked at the top of the file:
> + *
> + * To read the value, the kernel must perform an IO_READ(TIME_LOW), which
> + * returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH), which
> + * returns a signed 32-bit value, corresponding to the higher half of the
> + * full value.
> + */
> switch (offset) {
> case RTC_TIME_LOW:
> - r = goldfish_rtc_get_count(s) & 0xffffffff;
> + r = goldfish_rtc_get_count(s);
> + s->time_high = r >> 32;
> + r &= 0xffffffff;
> break;
> case RTC_TIME_HIGH:
> - r = goldfish_rtc_get_count(s) >> 32;
> + r = s->time_high;
> break;
> case RTC_ALARM_LOW:
> r = s->alarm_next & 0xffffffff;
> diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h
> index 16f9f9e29d..9bd8924f5f 100644
> --- a/include/hw/rtc/goldfish_rtc.h
> +++ b/include/hw/rtc/goldfish_rtc.h
> @@ -41,6 +41,7 @@ typedef struct GoldfishRTCState {
> uint32_t alarm_running;
> uint32_t irq_pending;
> uint32_t irq_enabled;
> + uint32_t time_high;
> } GoldfishRTCState;
You need to add the new field to goldfish_rtc_vmstate, and increment the version.
r~
^ permalink raw reply
* Re: [PATCH ghak90 V9 08/13] audit: add containerid support for user records
From: Richard Guy Briggs @ 2020-07-18 0:43 UTC (permalink / raw)
To: Paul Moore
Cc: nhorman, linux-api, containers, LKML, dhowells,
Linux-Audit Mailing List, netfilter-devel, ebiederm, simo, netdev,
linux-fsdevel, Eric Paris, mpatel, Serge Hallyn
In-Reply-To: <CAHC9VhSwMEZrq0dnaXmPi=bu0NgUtWPuw-2UGDrQa6TwxWkZtw@mail.gmail.com>
On 2020-07-05 11:11, Paul Moore wrote:
> On Sat, Jun 27, 2020 at 9:23 AM Richard Guy Briggs <rgb@redhat.com> wrote:
> >
> > Add audit container identifier auxiliary record to user event standalone
> > records.
> >
> > Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> > Acked-by: Neil Horman <nhorman@tuxdriver.com>
> > Reviewed-by: Ondrej Mosnacek <omosnace@redhat.com>
> > ---
> > kernel/audit.c | 19 ++++++++++++-------
> > 1 file changed, 12 insertions(+), 7 deletions(-)
> >
> > diff --git a/kernel/audit.c b/kernel/audit.c
> > index 54dd2cb69402..997c34178ee8 100644
> > --- a/kernel/audit.c
> > +++ b/kernel/audit.c
> > @@ -1507,6 +1504,14 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
> > audit_log_n_untrustedstring(ab, str, data_len);
> > }
> > audit_log_end(ab);
> > + rcu_read_lock();
> > + cont = _audit_contobj_get(current);
> > + rcu_read_unlock();
> > + audit_log_container_id(context, cont);
> > + rcu_read_lock();
> > + _audit_contobj_put(cont);
> > + rcu_read_unlock();
> > + audit_free_context(context);
>
> I haven't searched the entire patchset, but it seems like the pattern
> above happens a couple of times in this patchset, yes? If so would it
> make sense to wrap the above get/log/put in a helper function?
I've redone the locking with an rcu lock around the get and a spinlock
around the put. It occurs to me that putting an rcu lock around the
whole thing and doing a get without the refcount increment would save
us the spinlock and put and be fine since we'd be fine with stale but
consistent information traversing the contobj list from this point to
report it. Problem with that is needing to use GFP_ATOMIC due to the
rcu lock. If I stick with the spinlock around the put then I can use
GFP_KERNEL and just grab the spinlock while traversing the contobj list.
> Not a big deal either way, I'm pretty neutral on it at this point in
> the patchset but thought it might be worth mentioning in case you
> noticed the same and were on the fence.
There is only one other place this is used, in audit_log_exit in
auditsc.c. I had noted the pattern but wasn't sure it was worth it.
Inline or not? Should we just let the compiler decide?
> paul moore
- RGB
--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635
--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit
^ permalink raw reply
* [PATCH v3] folds tests from test_current_pid_tgid_new_ns into test_progs.
From: Carlos Neira @ 2020-07-18 0:41 UTC (permalink / raw)
To: netdev; +Cc: yhs, ebiederm, brouer, bpf, cneirabustos
Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
---
tools/testing/selftests/bpf/.gitignore | 2 +-
tools/testing/selftests/bpf/Makefile | 3 +-
.../bpf/prog_tests/ns_current_pid_tgid.c | 85 -----------------
.../bpf/prog_tests/ns_current_pidtgid.c | 59 ++++++++++++
.../bpf/progs/test_ns_current_pid_tgid.c | 37 --------
.../bpf/progs/test_ns_current_pidtgid.c | 25 +++++
...new_ns.c => test_current_pidtgid_new_ns.c} | 0
.../bpf/test_ns_current_pidtgid_newns.c | 91 +++++++++++++++++++
8 files changed, 178 insertions(+), 124 deletions(-)
delete mode 100644 tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c
create mode 100644 tools/testing/selftests/bpf/prog_tests/ns_current_pidtgid.c
delete mode 100644 tools/testing/selftests/bpf/progs/test_ns_current_pid_tgid.c
create mode 100644 tools/testing/selftests/bpf/progs/test_ns_current_pidtgid.c
rename tools/testing/selftests/bpf/{test_current_pid_tgid_new_ns.c => test_current_pidtgid_new_ns.c} (100%)
create mode 100644 tools/testing/selftests/bpf/test_ns_current_pidtgid_newns.c
diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore
index 1bb204cee853..022055f23592 100644
--- a/tools/testing/selftests/bpf/.gitignore
+++ b/tools/testing/selftests/bpf/.gitignore
@@ -30,8 +30,8 @@ test_tcpnotify_user
test_libbpf
test_tcp_check_syncookie_user
test_sysctl
-test_current_pid_tgid_new_ns
xdping
+test_ns_current_pidtgid_newns
test_cpp
*.skel.h
/no_alu32
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index e7a8cf83ba48..c1ba9c947196 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -37,7 +37,7 @@ TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test
test_cgroup_storage \
test_netcnt test_tcpnotify_user test_sock_fields test_sysctl \
test_progs-no_alu32 \
- test_current_pid_tgid_new_ns
+ test_ns_current_pidtgid_newns
# Also test bpf-gcc, if present
ifneq ($(BPF_GCC),)
@@ -163,6 +163,7 @@ $(OUTPUT)/test_cgroup_storage: cgroup_helpers.c
$(OUTPUT)/test_netcnt: cgroup_helpers.c
$(OUTPUT)/test_sock_fields: cgroup_helpers.c
$(OUTPUT)/test_sysctl: cgroup_helpers.c
+$(OUTPUT)/test_ns_current_pidtgid_newns: test_ns_current_pidtgid_newns.c
DEFAULT_BPFTOOL := $(SCRATCH_DIR)/sbin/bpftool
BPFTOOL ?= $(DEFAULT_BPFTOOL)
diff --git a/tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c b/tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c
deleted file mode 100644
index e74dc501b27f..000000000000
--- a/tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c
+++ /dev/null
@@ -1,85 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/* Copyright (c) 2020 Carlos Neira cneirabustos@gmail.com */
-#include <test_progs.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/syscall.h>
-
-struct bss {
- __u64 dev;
- __u64 ino;
- __u64 pid_tgid;
- __u64 user_pid_tgid;
-};
-
-void test_ns_current_pid_tgid(void)
-{
- const char *probe_name = "raw_tracepoint/sys_enter";
- const char *file = "test_ns_current_pid_tgid.o";
- int err, key = 0, duration = 0;
- struct bpf_link *link = NULL;
- struct bpf_program *prog;
- struct bpf_map *bss_map;
- struct bpf_object *obj;
- struct bss bss;
- struct stat st;
- __u64 id;
-
- obj = bpf_object__open_file(file, NULL);
- if (CHECK(IS_ERR(obj), "obj_open", "err %ld\n", PTR_ERR(obj)))
- return;
-
- err = bpf_object__load(obj);
- if (CHECK(err, "obj_load", "err %d errno %d\n", err, errno))
- goto cleanup;
-
- bss_map = bpf_object__find_map_by_name(obj, "test_ns_.bss");
- if (CHECK(!bss_map, "find_bss_map", "failed\n"))
- goto cleanup;
-
- prog = bpf_object__find_program_by_title(obj, probe_name);
- if (CHECK(!prog, "find_prog", "prog '%s' not found\n",
- probe_name))
- goto cleanup;
-
- memset(&bss, 0, sizeof(bss));
- pid_t tid = syscall(SYS_gettid);
- pid_t pid = getpid();
-
- id = (__u64) tid << 32 | pid;
- bss.user_pid_tgid = id;
-
- if (CHECK_FAIL(stat("/proc/self/ns/pid", &st))) {
- perror("Failed to stat /proc/self/ns/pid");
- goto cleanup;
- }
-
- bss.dev = st.st_dev;
- bss.ino = st.st_ino;
-
- err = bpf_map_update_elem(bpf_map__fd(bss_map), &key, &bss, 0);
- if (CHECK(err, "setting_bss", "failed to set bss : %d\n", err))
- goto cleanup;
-
- link = bpf_program__attach_raw_tracepoint(prog, "sys_enter");
- if (CHECK(IS_ERR(link), "attach_raw_tp", "err %ld\n",
- PTR_ERR(link))) {
- link = NULL;
- goto cleanup;
- }
-
- /* trigger some syscalls */
- usleep(1);
-
- err = bpf_map_lookup_elem(bpf_map__fd(bss_map), &key, &bss);
- if (CHECK(err, "set_bss", "failed to get bss : %d\n", err))
- goto cleanup;
-
- if (CHECK(id != bss.pid_tgid, "Compare user pid/tgid vs. bpf pid/tgid",
- "User pid/tgid %llu BPF pid/tgid %llu\n", id, bss.pid_tgid))
- goto cleanup;
-cleanup:
- bpf_link__destroy(link);
- bpf_object__close(obj);
-}
diff --git a/tools/testing/selftests/bpf/prog_tests/ns_current_pidtgid.c b/tools/testing/selftests/bpf/prog_tests/ns_current_pidtgid.c
new file mode 100644
index 000000000000..49578c0afbe0
--- /dev/null
+++ b/tools/testing/selftests/bpf/prog_tests/ns_current_pidtgid.c
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2020 Carlos Neira cneirabustos@gmail.com */
+
+#define _GNU_SOURCE
+#include <test_progs.h>
+#include "test_ns_current_pidtgid.skel.h"
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <sched.h>
+#include <sys/wait.h>
+#include <sys/mount.h>
+#include <sys/fcntl.h>
+
+void test_ns_current_pidtgid(void)
+{
+ int err, duration = 0;
+ struct test_ns_current_pidtgid *skel;
+ struct test_ns_current_pidtgid__bss *bss;
+ struct stat st;
+ __u64 id;
+
+ skel = test_ns_current_pidtgid__open();
+ if (CHECK(!skel, "skel_open", "failed to open skeleton\n"))
+ return;
+
+ err = test_ns_current_pidtgid__load(skel);
+ if (CHECK(err, "skel_load", "failed to load skeleton: %d\n", err))
+ goto cleanup;
+
+ pid_t tid = syscall(SYS_gettid);
+ pid_t pid = getpid();
+
+ id = (__u64) tid << 32 | pid;
+
+ if (CHECK_FAIL(stat("/proc/self/ns/pid", &st))) {
+ perror("Failed to stat /proc/self/ns/pid");
+ goto cleanup;
+ }
+
+ bss = skel->bss;
+ bss->dev = st.st_dev;
+ bss->ino = st.st_ino;
+ bss->user_pid_tgid = 0;
+
+ err = test_ns_current_pidtgid__attach(skel);
+ if (CHECK(err, "skel_attach", "skeleton attach failed: %d\n", err))
+ goto cleanup;
+
+ /* trigger tracepoint */
+ usleep(1);
+
+ CHECK(bss->user_pid_tgid != id, "pid/tgid", "got %llu != exp %llu\n",
+ bss->user_pid_tgid, id);
+cleanup:
+ test_ns_current_pidtgid__destroy(skel);
+
+}
diff --git a/tools/testing/selftests/bpf/progs/test_ns_current_pid_tgid.c b/tools/testing/selftests/bpf/progs/test_ns_current_pid_tgid.c
deleted file mode 100644
index 1dca70a6de2f..000000000000
--- a/tools/testing/selftests/bpf/progs/test_ns_current_pid_tgid.c
+++ /dev/null
@@ -1,37 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/* Copyright (c) 2019 Carlos Neira cneirabustos@gmail.com */
-
-#include <linux/bpf.h>
-#include <stdint.h>
-#include <bpf/bpf_helpers.h>
-
-static volatile struct {
- __u64 dev;
- __u64 ino;
- __u64 pid_tgid;
- __u64 user_pid_tgid;
-} res;
-
-SEC("raw_tracepoint/sys_enter")
-int trace(void *ctx)
-{
- __u64 ns_pid_tgid, expected_pid;
- struct bpf_pidns_info nsdata;
- __u32 key = 0;
-
- if (bpf_get_ns_current_pid_tgid(res.dev, res.ino, &nsdata,
- sizeof(struct bpf_pidns_info)))
- return 0;
-
- ns_pid_tgid = (__u64)nsdata.tgid << 32 | nsdata.pid;
- expected_pid = res.user_pid_tgid;
-
- if (expected_pid != ns_pid_tgid)
- return 0;
-
- res.pid_tgid = ns_pid_tgid;
-
- return 0;
-}
-
-char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/progs/test_ns_current_pidtgid.c b/tools/testing/selftests/bpf/progs/test_ns_current_pidtgid.c
new file mode 100644
index 000000000000..9818a56510d9
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/test_ns_current_pidtgid.c
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2019 Carlos Neira cneirabustos@gmail.com */
+
+#include <linux/bpf.h>
+#include <stdint.h>
+#include <bpf/bpf_helpers.h>
+
+__u64 user_pid_tgid = 0;
+__u64 dev = 0;
+__u64 ino = 0;
+
+SEC("raw_tracepoint/sys_enter")
+int handler(const void *ctx)
+{
+ struct bpf_pidns_info nsdata;
+
+ if (bpf_get_ns_current_pid_tgid(dev, ino, &nsdata,
+ sizeof(struct bpf_pidns_info)))
+ return 0;
+ user_pid_tgid = (__u64)nsdata.tgid << 32 | nsdata.pid;
+
+ return 0;
+}
+
+char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/test_current_pid_tgid_new_ns.c b/tools/testing/selftests/bpf/test_current_pidtgid_new_ns.c
similarity index 100%
rename from tools/testing/selftests/bpf/test_current_pid_tgid_new_ns.c
rename to tools/testing/selftests/bpf/test_current_pidtgid_new_ns.c
diff --git a/tools/testing/selftests/bpf/test_ns_current_pidtgid_newns.c b/tools/testing/selftests/bpf/test_ns_current_pidtgid_newns.c
new file mode 100644
index 000000000000..3bca38941c99
--- /dev/null
+++ b/tools/testing/selftests/bpf/test_ns_current_pidtgid_newns.c
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2020 Carlos Neira cneirabustos@gmail.com */
+
+#define _GNU_SOURCE
+#include <test_progs.h>
+#include "test_ns_current_pidtgid.skel.h"
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <sched.h>
+#include <sys/wait.h>
+#include <sys/mount.h>
+#include <sys/fcntl.h>
+
+#define STACK_SIZE (1024 * 1024)
+static char child_stack[STACK_SIZE];
+
+static int newns_pidtgid(void *arg)
+{
+ struct test_ns_current_pidtgid__bss *bss;
+ struct test_ns_current_pidtgid *skel;
+ int pidns_fd = 0, err = 0;
+ pid_t pid, tid;
+ struct stat st;
+ __u64 id;
+
+ skel = test_ns_current_pidtgid__open();
+ err = test_ns_current_pidtgid__load(skel);
+ if (err) {
+ perror("Failed to load skeleton");
+ goto cleanup;
+ }
+
+ tid = syscall(SYS_gettid);
+ pid = getpid();
+ id = (__u64) tid << 32 | pid;
+
+ if (stat("/proc/self/ns/pid", &st)) {
+ printf("Failed to stat /proc/self/ns/pid: %s\n",
+ strerror(errno));
+ goto cleanup;
+ }
+
+ bss = skel->bss;
+ bss->dev = st.st_dev;
+ bss->ino = st.st_ino;
+ bss->user_pid_tgid = 0;
+
+ err = test_ns_current_pidtgid__attach(skel);
+ if (err) {
+ printf("Failed to attach: %s err: %d\n", strerror(errno), err);
+ goto cleanup;
+ }
+ /* trigger tracepoint */
+ usleep(1);
+
+ if (bss->user_pid_tgid != id) {
+ printf("test_ns_current_pidtgid_newns:FAIL\n");
+ err = EXIT_FAILURE;
+ } else {
+ printf("test_ns_current_pidtgid_newns:PASS\n");
+ err = EXIT_SUCCESS;
+ }
+
+cleanup:
+ setns(pidns_fd, CLONE_NEWPID);
+ test_ns_current_pidtgid__destroy(skel);
+
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ pid_t cpid;
+ int wstatus;
+
+ cpid = clone(newns_pidtgid,
+ child_stack + STACK_SIZE,
+ CLONE_NEWPID | SIGCHLD, NULL);
+ if (cpid == -1) {
+ printf("test_ns_current_pidtgid_newns:Failed on CLONE: %s\n",
+ strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ if (waitpid(cpid, &wstatus, 0) == -1) {
+ printf("test_ns_current_pidtgid_newns:Failed on waitpid: %s\n",
+ strerror(errno));
+ }
+ return (WEXITSTATUS(wstatus));
+}
--
2.20.1
^ permalink raw reply related
* Re: [PATCH bpf-next 1/2] bpf: change var type of BTF_ID_LIST to static
From: kernel test robot @ 2020-07-18 0:10 UTC (permalink / raw)
To: Yonghong Song, bpf, netdev
Cc: kbuild-all, Alexei Starovoitov, Daniel Borkmann, Jiri Olsa,
kernel-team
In-Reply-To: <20200717184706.3477154-1-yhs@fb.com>
[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]
Hi Yonghong,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url: https://github.com/0day-ci/linux/commits/Yonghong-Song/compute-bpf_skc_to_-helper-socket-btf-ids-at-build-time/20200718-025117
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: x86_64-rhel-7.6-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from kernel/bpf/btf.c:21:
kernel/bpf/btf.c:3625:13: warning: array 'bpf_ctx_convert_btf_id' assumed to have one element
3625 | BTF_ID_LIST(bpf_ctx_convert_btf_id)
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/btf_ids.h:69:12: note: in definition of macro 'BTF_ID_LIST'
69 | static u32 name[];
| ^~~~
/tmp/ccXM0qVD.s: Assembler messages:
>> /tmp/ccXM0qVD.s:23808: Error: symbol `bpf_ctx_convert_btf_id' is already defined
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 49999 bytes --]
^ permalink raw reply
* Re: [PATCH] goldfish_rtc: Fix non-atomic read behaviour of TIME_LOW/TIME_HIGH
From: Richard Henderson @ 2020-07-18 0:43 UTC (permalink / raw)
To: Jessica Clarke, qemu-riscv; +Cc: Alistair Francis, Anup Patel, qemu-devel
In-Reply-To: <20200718002027.82300-1-jrtc27@jrtc27.com>
On 7/17/20 5:20 PM, Jessica Clarke wrote:
> The specification says:
>
> 0x00 TIME_LOW R: Get current time, then return low-order 32-bits.
> 0x04 TIME_HIGH R: Return high 32-bits from previous TIME_LOW read.
>
> ...
>
> To read the value, the kernel must perform an IO_READ(TIME_LOW),
> which returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH),
> which returns a signed 32-bit value, corresponding to the higher half
> of the full value.
>
> However, we were just returning the current time for both. If the guest
> is unlucky enough to read TIME_LOW and TIME_HIGH either side of an
> overflow of the lower half, it will see time be in the future, before
> jumping backwards on the next read, and Linux currently relies on the
> atomicity guaranteed by the spec so is affected by this. Fix this
> violation of the spec by caching the correct value for TIME_HIGH
> whenever TIME_LOW is read, and returning that value for any TIME_HIGH
> read.
>
> Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
> ---
> hw/rtc/goldfish_rtc.c | 14 ++++++++++++--
> include/hw/rtc/goldfish_rtc.h | 1 +
> 2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/hw/rtc/goldfish_rtc.c b/hw/rtc/goldfish_rtc.c
> index 01e9d2b083..9b577bf159 100644
> --- a/hw/rtc/goldfish_rtc.c
> +++ b/hw/rtc/goldfish_rtc.c
> @@ -94,12 +94,22 @@ static uint64_t goldfish_rtc_read(void *opaque, hwaddr offset,
> GoldfishRTCState *s = opaque;
> uint64_t r = 0;
>
> + /*
> + * From the documentation linked at the top of the file:
> + *
> + * To read the value, the kernel must perform an IO_READ(TIME_LOW), which
> + * returns an unsigned 32-bit value, before an IO_READ(TIME_HIGH), which
> + * returns a signed 32-bit value, corresponding to the higher half of the
> + * full value.
> + */
> switch (offset) {
> case RTC_TIME_LOW:
> - r = goldfish_rtc_get_count(s) & 0xffffffff;
> + r = goldfish_rtc_get_count(s);
> + s->time_high = r >> 32;
> + r &= 0xffffffff;
> break;
> case RTC_TIME_HIGH:
> - r = goldfish_rtc_get_count(s) >> 32;
> + r = s->time_high;
> break;
> case RTC_ALARM_LOW:
> r = s->alarm_next & 0xffffffff;
> diff --git a/include/hw/rtc/goldfish_rtc.h b/include/hw/rtc/goldfish_rtc.h
> index 16f9f9e29d..9bd8924f5f 100644
> --- a/include/hw/rtc/goldfish_rtc.h
> +++ b/include/hw/rtc/goldfish_rtc.h
> @@ -41,6 +41,7 @@ typedef struct GoldfishRTCState {
> uint32_t alarm_running;
> uint32_t irq_pending;
> uint32_t irq_enabled;
> + uint32_t time_high;
> } GoldfishRTCState;
You need to add the new field to goldfish_rtc_vmstate, and increment the version.
r~
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.