Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all 12196 articles
Browse latest View live

Cloning the testing branch on git

$
0
0

I have been told that development takes place in the "testing" branch of some XYZ git tree:

https://git.develop.org/def/pqr/abc/xyz.git/

The above link is an imaginary/hypothetical git link related to Linux kernel.

So how do I clone the testing branch on my local laptop? Will the following command suffice?:

git clone https://git.develop.org/def/pqr/abc/xyz.git/

What if it clones another branch ? for example master. Do i need to change to testing branch explicitly using git checkout ...

OR is there any other command to clone the testing branch directly ?


Is it possible to get kernel version from EFL image file without disassemble or using grep or strings?

$
0
0

I have a vmlinuz EFL image file. I need to get the kernel version from the image file without disassembling it. Is it possible to get kerenel version from offsets of that compressed image file? The file is ELF 64-bit MSB executable, statically linked, not stripped.

unrecognized command line option ‘-fstack-protector-strong’ with arm-linux-gnueabihf-gcc

$
0
0

I have cloned the Raspberry Pi toolchain using the following command and added the tools path to bashrc

git clone https://github.com/raspberrypi/tools.git --depth=1
echo PATH=$PATH:~raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin >> ~/.bashrc
source ~/.bashrc

Cloned the raspberry pi kernel sources

git clone --depth=1 https://github.com/raspberrypi/linux

Simple hello world module

#include <linux/kernel.h>
#include <linux/module.h>

MODULE_LICENSE("GPL");
static int test_hello_init(void)
{
    printk(KERN_INFO"%s: In init\n", __func__);
    return 0;
}

static void test_hello_exit(void)
{
    printk(KERN_INFO"%s: In exit\n", __func__);
}

module_init(test_hello_init);
module_exit(test_hello_exit);

Makefile

obj-m := hello.o

all:
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/jamal/raspberrypi/linux M=$(PWD) modules
clean:
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /home/jamal/raspberrypi/linux M=$(PWD) clean

It's failing with the following error:

arm-linux-gnueabihf-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
scripts/Makefile.build:309: recipe for target '/home/jamal/Linux_Device_Drivers/hello.o' failed

Previously, this used to work, not sure what has changed and now i am getting this error

Why is Linux Kernel copy implementation uses AC flag?

$
0
0

The implementation copy_user_enhanced_fast_string of Linux Kernel copy routine uses stac/clac in the epilog and prolog. perf annotate shows the following code:

stac 
cmp  $0x40,%edx
jb   0xffffffff91281f5c
mov  %edx,%ecx
rep  movsb %ds:(%rsi),%es:(%rdi)
xor  %eax,%eax
clac
retq              

AC is Alignment check (or access control) flag

What is the reason stac/clac are used in the routine? What would be the consequences if we simply remove them?

How to measure elapsed time between sending a message on a socket and sending it on the physical medium?

$
0
0

I need to accurately measure the time elapsed between calling sendto() in application layer and sending the last bit of the message on the wire in PHY layer. How can I measure this time in my C program? Thanks in advance.

Increasing time slices for a particular process via implementing a system call in xv6

$
0
0

I am trying to implement a system call in xv6 OS Increase_time( int n) which when executed will increase the timeslice of a program that calls it by n times. The default xv6 scheduler uses a simple FCFS and RR policies with each process having the same time slice. My implementation of Increase_time() will allow different processes to have different amount of time slices.

Can you please tell me a way how I can work around this? I know how to add a system call in xv6. I just need an idea as to how I can code my system call and what files to change in xv6.

Compile a 4.16.3 kernel on 5.3.0-40 Ubuntu VM [closed]

$
0
0
  1. I have a Ubuntu VM with Kernel 5.3.0-40-generic in VMWare workstation.
  2. I compile a Kernel 4.16.3. It looks like successful as it creates /boot/vmlinuz-4.16.3, /boot/initrd.img-4.16.3, and it updates /boot/grub/grub.cfg.
  3. As I reboot, it doens't boot with 4.16.3, but still boot to 5.3.0-40-generic. I don't see boot options of 4.16.3 or 5.3.0-40 or others.
  4. I edit /boot/grub/grub.cfg and delete all menuentries

    submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-******' { menuentry 'Ubuntu, with Linux 5.3.0-40-generic.......}

I only keep as below:

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-43d7897d-7ed8-490c-ab63-960db141cff8' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  43d7897d-7ed8-490c-ab63-960db141cff8
        else
          search --no-floppy --fs-uuid --set=root 43d7897d-7ed8-490c-ab63-960db141cff8
        fi
        linux   /boot/vmlinuz-5.3.0-40-generic root=UUID=43d7897d-7ed8-490c-ab63-960db141cff8 ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet
        initrd  /boot/initrd.img-5.3.0-40-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-43d7897d-7ed8-490c-ab63-960db141cff8' {
        menuentry 'Ubuntu, with Linux 4.16.3'  ......}

I guess if I still need to modify /boot/grub/grub.cfg but I am not sure how to do it and what will be the consequence.

If I remember well, I had compiled a newer kernel than 5.3.0-40 on a 5.3.0-40 VM, and it succeeded to boot with that newer kernel. This VM has been deleted so I have no evidence but I am pretty sure I remember it was true.

Could you give advice?

Thanks, Jie

Perf event for sending reschedule interrupt?

$
0
0

When a process wakes another process on the same core, a sched:sched_wakeup event is generated with both PIDs. This is great for finding relationships between processes.

When a process wakes another process on a different core, the second core generates an irq_vectors:reschedule_entry event on whichever process is unlucky enough to catch the IPI, followed by a sched:sched_wakeup event from that victim process.

What I can't find is the original process on the first core that does the waking. The one that sends the reschedule IPI.

Is there any event associated with sending a reschedule interrupt, or with anything else in the process?

(In case it isn't apparent, I'm using "perf record", not "perf stat")


Single makefile that compiles kernel driver and .c file

$
0
0

I have a hello.c file that prints Hello World, and I also have another hello_driver.c file that prints Hello World to the kernellog.

I can compile hello_driver.c file and it prints out Hello World to the kernel log but I can't compile those 2 .c files in same Makefile program.

I've tried this Makefile but it is not working:

obj-o += hello.o hello_driver.o

KVERSION = $(shell uname -r)
all:
     make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules

clean:
     make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean

The futex facility returned an unexpected error code?

$
0
0

Two threads in same process using rwlock object stored in shared memory encounter crash during pthreads stress test. I spent a while trying to find memory corruption or deadlock but nothing so far. is this just an less than optimal way of informing me I have created a deadlock? Any pointers on tools/methods for debugging this?

Thread 5 "tms_test" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff28a7700 (LWP 3777)]
0x00007ffff761e428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff761e428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff762002a in __GI_abort () at abort.c:89
#2  0x00007ffff76607ea in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff77776cc "%s") at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff766080e in __GI___libc_fatal (message=message@entry=0x7ffff79c4ae0 "The futex facility returned an unexpected error code.") at ../sysdeps/posix/libc_fatal.c:185
#4  0x00007ffff79be7e5 in futex_fatal_error () at ../sysdeps/nptl/futex-internal.h:200
#5  futex_wait (private=, expected=, futex_word=0x7ffff7f670d9) at ../sysdeps/unix/sysv/linux/futex-internal.h:77
#6  futex_wait_simple (private=, expected=, futex_word=0x7ffff7f670d9) at ../sysdeps/nptl/futex-internal.h:135
#7  __pthread_rwlock_wrlock_slow (rwlock=0x7ffff7f670cd) at pthread_rwlock_wrlock.c:67
#8  0x00000000004046e3 in _memstat (offset=0x7fffdc0b11a5, func=0x0, lineno=0, size=134, flag=1 '\001') at tms_mem.c:107
#9  0x000000000040703b in TmsMemReallocExec (in=0x7fffdc0abb81, size=211, func=0x43f858  "_malloc_thread", lineno=478) at tms_mem.c:390
#10 0x000000000042a008 in _malloc_thread (arg=0x644c11) at tms_test.c:478
#11 0x000000000041a1d6 in _threadStarter (arg=0x644c51) at tms_mem.c:2384
#12 0x00007ffff79b96ba in start_thread (arg=0x7ffff28a7700) at pthread_create.c:333
#13 0x00007ffff76ef82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) 

PROBLEM for EMULATE RASPBIAN WITH THE OFFICIAL SUPPORT OF QEMU [closed]

$
0
0

Good morning all,

I am writing this message because I followed the steps indicated on a french page page of the course in order to emulate a Raspberry Pi with QEmu in order to launch a Linux Embedded (Raspbian distribution).

I have checked another stack overflow page example but we don't have the same error. It is also important to remember that since my original operating system is: Windows 10, I installed Virtual Box 6.1, then on virtual box, I installed Debian 10 in order to be in the conditions of this which is requested by the writer.

However in the first case, I get an error message which shows that there is another problem because the "raspberries" of which in mention do not even appear.

Even in the second case of which he says that he fixes the situation, I still have an error message which is the following:

FIRST CASE : enter image description here

Here is what I get in the SECOND case supposed to resolve the situation:

enter image description here

Could you help me to fix this "bug" because I think that for my part, there is yet another problem different from that which he indicates in his course, in view of the error messages that I receive and which differ from his?

thanks in advance

Why does the Linux Kernel copy implementation use the AC flag?

$
0
0

The implementation of copy_user_enhanced_fast_string in the Linux Kernel copy routine uses stac/clac in the epilog and prolog. perf annotate shows the following code:

stac 
cmp  $0x40,%edx
jb   0xffffffff91281f5c
mov  %edx,%ecx
rep  movsb %ds:(%rsi),%es:(%rdi)
xor  %eax,%eax
clac
retq              

AC is "Alignment check (or access control) flag".

What is the reason stac/clac are used in the routine? What would be the consequences if we simply remove them?

linux kernel: how to remove a file in kernel space

$
0
0

I know this is strongly not recommended. But does is possible to do this in kernel space.

Given the file path, can we remove the corresponding file in kernel space?

Unexpected System failure of CentOS7 due to LVM partition not mounted

$
0
0

I have a problem with my CentOS7 system installed in Intel NUC(Intel® Core™ i7-7567U CPU @ 3.50GHz × 4 ). Last time i was not able to login to the system by any user or root password. Then I tried to rescue the password by reset root password. But it was not successful after many attempts. During rescue mode, I found that the LVM partition 'home' was not activated in SSD (Crucial MX500 1TB: CT1000MX500SSD1) and log file has following error given below.

What is cause of these error including LVM volume not mounted in CentOS7 (kernel 3.10.0-1062.12.1.el7.x86_64) while trying to login after many days? How to manage it so that it will not happen again?

Please help.

Output of lvdisplay is given below:-

      --- Logical volume ---
  LV Path                /dev/centos/home
  LV Name                home
  VG Name                centos
  LV UUID                ZhVKZ0-Oqwx-U3Jl-ukke-8cY6-dKQt-QX3W5g
  LV Write Access        read/write
  LV Creation host, time ubuntu, 2020-01-05 20:05:17 +0530
  LV Status              available
  # open                 0
  LV Size                522.31 GiB
  Current LE             133712
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

[root@localhost log]# lsblk 
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0 931.5G  0 disk 
├─sda1            8:1    0   200M  0 part /boot/efi
├─sda2            8:2    0     1G  0 part /boot
└─sda3            8:3    0 930.1G  0 part 
  ├─centos-root 253:0    0   400G  0 lvm  /
  ├─centos-swap 253:1    0   7.8G  0 lvm  [SWAP]
  └─centos-home 253:2    0 522.3G  0 lvm  /home

Failed message in log file is given below:-

messages-20200202:Jan 29 15:13:28 localhost journal: g_array_unref: assertion 'array' failed
messages-20200202:Jan 29 15:13:28 localhost journal: g_array_unref: assertion 'array' failed
messages-20200216:Feb 11 11:58:45 localhost journal: g_array_unref: assertion 'array' failed
messages-20200216:Feb 11 11:58:45 localhost journal: g_array_unref: assertion 'array' failed

messages-20200216:Feb 11 12:07:17 localhost journal: g_array_unref: assertion 'array' failed messages-20200216:Feb 11 12:07:17 localhost journal: g_array_unref: assertion 'array' failed

and

[root@localhost log]# grep failed messages| cut -f3- -d ':'|cut -f2- -d''|sort -u

localhost dracut:    microcode_ctl: kernel version "3.10.0-1062.12.1.el7.x86_64" failed early             load check for "intel-06-4f-01", skipping
localhost gdm: GLib: g_hash_table_find: assertion 'version == hash_table->version' failed
localhost gnome-keyring-daemon[2729]: failed to unlock login keyring on startup
localhost gnome-keyring-daemon[5458]: failed to unlock login keyring on startup
localhost journal: disabling plugin because: failed to coldplug amt: ME refused connection
localhost journal: disabling plugin because: failed to coldplug synapticsmst: MST firmware updating not supported by OEM
localhost journal: disabling plugin because: failed to startup dell: Firmware updating not supported
localhost journal: failed to call gs_plugin_refresh on odrs: [*/*/*/source/odrs/*] failed to download https://odrs.gnome.org/1.0/reviews/api/ratings: Connection terminated unexpectedly
localhost journal: failed to call gs_plugin_refresh on shell-extensions: [*/*/*/source/shell-extensions/*] failed to download https://extensions.gnome.org//static/extensions.json: Connection terminated unexpectedly
localhost journal: failed to connect to device: Failed to connect to missing device /org/freedesktop/ColorManager/devices/xrandr_Dell_Inc__DELL_E2418HN_5RFY876Q0JKB_gdm_42
localhost journal: failed to get native mode status: Error reading from file: Input/output error
localhost journal: failed to set screen _ICC_PROFILE: Failed to open file “/var/lib/gdm/.local/share/icc/edid-7699f71e10e1e1f6308292efbe777a00.icc”: Permission denied
localhost journal: g_array_unref: assertion 'array' failed
localhost journal: g_dbus_proxy_call_finish_internal: assertion 'G_IS_DBUS_PROXY (proxy)' failed
localhost journal: g_variant_get_va: assertion 'value != NULL' failed
localhost journal: g_variant_unref: assertion 'value != NULL' failed
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff88073a265118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff8c00ba26b118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff90203a265118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff9082ba265118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff92ec3a262118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff9443ba261118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff95a0fa26c118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff96f1ba265118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff98997a267118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff9b41fa265118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff9db0fa265118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP04.PXSX] (Node ffff9e9fba261118), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff88073a266488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff8c00ba26c488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff90203a266488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff9082ba266488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff92ec3a263488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff9443ba262488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff95a0fa26d488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff96f1ba266488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff98997a268488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff9b41fa266488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff9db0fa266488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: ACPI Error: Method parse/execution failed [\_SB_.PCI0.RP08.PXSX] (Node ffff9e9fba262488), AE_NOT_FOUND (20130517/psparse-536)
localhost kernel: [drm] failed to retrieve link info, disabling eDP
localhost kernel: hid-generic 0003:413C:2113.0001: usb_submit_urb(ctrl) failed: -19
localhost kernel: pci 0000:01:00.0: BAR 13: failed to assign [io  size 0x2000]
localhost kernel: pci 0000:02:01.0: BAR 13: failed to assign [io  size 0x1000]
localhost kernel: pci 0000:02:02.0: BAR 13: failed to assign [io  size 0x1000]
localhost kernel: pci 0000:02:02.0: BAR 15: failed to assign [mem size 0x00200000 64bit pref]
localhost kernel: pcieport 0000:01:00.0: BAR 13: failed to assign [io  size 0x2000]
localhost kernel: pcieport 0000:02:01.0: BAR 13: failed to assign [io  size 0x1000]
localhost kernel: pcieport 0000:02:02.0: BAR 13: failed to assign [io  size 0x1000]
localhost kernel: pcieport 0000:02:02.0: BAR 15: failed to assign [mem size 0x00200000 64bit pref]
localhost kernel: thermal thermal_zone1: failed to read out thermal zone 1
localhost kernel: wlp58s0: failed to remove key (1, ff:ff:ff:ff:ff:ff) from hardware (-22)
localhost kernel: xhci_hcd 0000:39:00.0: Host halt failed, -19
localhost kernel: xhci_hcd 0000:39:00.0: Host not accessible, reset failed.
localhost lldpad: config file failed to load,
localhost NetworkManager[1425]: <warn>  [1582646846.5334] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1425]: <warn>  [1582646846.5338] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[1429]: <warn>  [1582632750.1176] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1429]: <warn>  [1582632750.1181] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[1430]: <warn>  [1582625137.7477] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1430]: <warn>  [1582625137.7477] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[1431]: <warn>  [1582647800.3975] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1431]: <warn>  [1582647800.4014] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[1432]: <warn>  [1582625829.1927] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1432]: <warn>  [1582625829.1943] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[1432]: <warn>  [1582647271.2795] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1432]: <warn>  [1582647271.2798] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[1433]: <warn>  [1582625731.2519] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1433]: <warn>  [1582625731.2520] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[1434]: <warn>  [1582624667.2971] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1434]: <warn>  [1582624667.2971] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[1434]: <warn>  [1582632328.6818] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1434]: <warn>  [1582632328.6819] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[1437]: <warn>  [1582631756.9007] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[1437]: <warn>  [1582631756.9008] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[3190]: <warn>  [1582624727.5623] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[3190]: <warn>  [1582624727.5623] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost NetworkManager[3242]: <warn>  [1582631895.7613] sup-iface: failed to cancel p2p connect: P2P cancel failed
localhost NetworkManager[3242]: <warn>  [1582631895.7616] supplicant: failed to set WFD IEs on wpa_supplicant: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property
localhost org.gnome.Shell.CalendarServer: gnome-shell-calendar-server[3983]: Lost (or failed to acquire) the name org.gnome.Shell.CalendarServer - exiting
localhost org.gnome.Shell.CalendarServer: gnome-shell-calendar-server[5779]: Lost (or failed to acquire) the name org.gnome.Shell.CalendarServer - exiting

splice(2) returns "Invalid argument" when reading from ftrace raw files

$
0
0

I wanted to try splice syscall, which trace-cmd uses to zero copy raw files of off ftrace.

Here is the partial list of ftrace raw files splice fails to read:

/sys/kernel/debug/tracing/per_cpu/cpo0/trace_pipe_raw

/sys/kernel/debug/tracing/per_cpu/cpo0/snapshot_raw

/sys/kernel/debug/tracing/per_cpu/cpo1/trace_pipe_raw

/sys/kernel/debug/tracing/per_cpu/cpo1/snapshot_raw

And here are some other files (that splice handles just fine):

/sys/kernel/debug/tracing/per_cpu/cpo0/trace_pipe

/sys/kernel/debug/tracing/per_cpu/cpo0/snapshot

/sys/kernel/debug/tracing/per_cpu/cpo1/trace_pipe

/sys/kernel/debug/tracing/per_cpu/cpo1/snapshot

What works:

  • using the read() system call works great to read from raw ftrace files.
  • using the cat() system call will display raw ftrace files.
  • using the trace-cmd tool which is a CLI front end for ftrace.

This is my code:

static void unit_test_x(void)
{  
    int buffer_pipe[2];
    pipe(buffer_pipe);

    std::string source_path = "/sys/kernel/debug/tracing/per_cpu/cpu1/trace_pipe_raw";
    int trace_fd = open(source_path.c_str(), O_RDONLY);

    std::string destination_path = "foo";
    int dest_fd = open (destination_path.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0644);

    int actually_read = splice(trace_fd,
                               NULL,
                               buffer_pipe[1],
                               NULL,
                               1000,
                               SPLICE_F_MORE | SPLICE_F_MOVE );

    if (0 > actually_read )
    {   
        printf("Oh dear, something went wrong %s\n", s  trerror(errno));
        throw std::runtime_error("writing from source to pipe failed");
    }

    actually_read = splice(buffer_pipe[0],
                           NULL,
                           dest_fd,
                           NULL,
                           actually_read,
                           SPLICE_F_MORE | SPLICE_F_MOVE);

}

note:

All accsess to /sys/kernel/debug/tracing is done with sudo


Guest Kernel Crashes with Supervisor Mode Protection fault when monitored using Intel PEBS

$
0
0

I am monitoring my test program's memory access using Intel PEBS (Precise Event-Based Sampling). I don't want to use PEBS using the existing PERF infrastructure (for various reasons). So, I have written my own Kernel Module to for Intel PEBS and I handle all the NMI events inside my Kernel Module. I am able to successfully log memory access when the test program natively runs on the host system. Everything works fine.

But when I try to run the test program inside a VM (running over QEMU/KVM), my Guest Kernel crash with error following error. Only the Guest kernel crashes. Host Kernel is stable:

#PF: supervisor read access in user mode.

I have tried playing around disabling/enabling SMEP, SMAP, LAPIC and other options in both Guest and Host kernel. Still crash happens.

I am using Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHZ, Host Kernel Linux Version 5.4.0 (same as the Guest Kernel Version).

Logs from Guest Kernel:

BUG: unable to handle page fault for address: ffff9c122e8a1038
[   76.011730] #PF: supervisor read access in user mode
[   76.012190] #PF: error_code(0x0000) - not-present page
[   76.012603] IDT: 0xfffffe0000000000 (limit=0xfff) GDT: 0xfffffe0000034000 (limit=0x7f)
[   76.013206] LDTR: NULL
[   76.013398] TR: 0x40 -- base=0xfffffe0000036000 limit=0x206f
[   76.013852] PGD 0 P4D 0
[   76.014041] Oops: 0000 [#1] SMP
[   76.014274] CPU: 1 PID: 953 Comm: one_page Not tainted 5.4.0-rc7 #4
[   76.014738] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
[   76.015394] RIP: 0033:0x55bd4855cd56
[   76.015661] Code: 85 5c ff ff ff 00 00 00 00 eb 26 48 8b 05 e2 12 20 00 8b 95 5c ff ff ff 48 63 d2 48 c1 e2 02 48 01 d0 8b 00 88
 85 5b ff ff ff <83> 85 5c ff ff ff 01 81 bd 5c ff ff ff ff 0f 00 00 7e ce 8b 05 a1
[   76.017081] RSP: 002b:00007fff48cf8810 EFLAGS: 00010202
[   76.017477] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[   76.018038] RDX: 0000000000000b60 RSI: 00007fff48cf86d0 RDI: 0000000000000002
[   76.018556] RBP: 00007fff48cf88d0 R08: 0000000000000000 R09: 0000000000000000
[   76.019077] R10: 0000000000000008 R11: 0000000000000246 R12: 000055bd4855c8c0
[   76.019599] R13: 00007fff48cf89b0 R14: 0000000000000000 R15: 0000000000000000
[   76.020116] FS:  00007f2b93ce34c0 GS:  0000000000000000
[   76.020533] Modules linked in: nfsv3 nfs_acl rpcsec_gss_krb5 auth_rpcgss nfsv4 nfs lockd grace fscache intel_rapl_msr intel_rapl
_common crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd dax_pmem_compat device_dax nd_pmem glue_he
lper dax_pmem_core nd_btt ppdev joydev parport_pc input_leds nfit intel_rapl_perf mac_hid qemu_fw_cfg serio_raw sch_fq_codel sunrpc
 lp parport ip_tables x_tables psmouse virtio_blk virtio_net net_failover failover i2c_piix4 pata_acpi floppy
[   76.023751] CR2: ffff9c122e8a1038
[   76.023997] ---[ end trace 10450321a820a090 ]---

ERROR: modinfo: could not find module

$
0
0

I am installing new kernel 3.12.x on redhat 6 machine. Below is my steps which I followed to install the new kernel.

  1. extract kernel in /usr/src/ directory
  2. Switch to cd /usr/src/linux-3.12.x
  3. make menuconfig
  4. saved defaults to config file
  5. make
  6. make modules_install
  7. make install

In this process I am getting the following error:

ERROR: modinfo: could not find module fuse
ERROR: modinfo: could not find module autofs4
ERROR: modinfo: could not find module target_core_iblock
ERROR: modinfo: could not find module target_core_file
ERROR: modinfo: could not find module target_core_pscsi
ERROR: modinfo: could not find module target_core_mod
ERROR: modinfo: could not find module configfs
ERROR: modinfo: could not find module 8021q
ERROR: modinfo: could not find module bnx2fc
ERROR: modinfo: could not find module fcoe
ERROR: modinfo: could not find module libfcoe
ERROR: modinfo: could not find module libfc
ERROR: modinfo: could not find module scsi_transport_fc
ERROR: modinfo: could not find module scsi_tgt
ERROR: modinfo: could not find module garp
ERROR: modinfo: could not find module stp
ERROR: modinfo: could not find module llc
ERROR: modinfo: could not find module sunrpc
ERROR: modinfo: could not find module be2iscsi
ERROR: modinfo: could not find module iscsi_boot_sysfs
ERROR: modinfo: could not find module bnx2i
ERROR: modinfo: could not find module cnic
ERROR: modinfo: could not find module uio
ERROR: modinfo: could not find module ib_iser
ERROR: modinfo: could not find module rdma_cm
ERROR: modinfo: could not find module ib_cm
ERROR: modinfo: could not find module iw_cm
ERROR: modinfo: could not find module ib_sa
ERROR: modinfo: could not find module ib_mad
ERROR: modinfo: could not find module ib_core
ERROR: modinfo: could not find module ib_addr
ERROR: modinfo: could not find module iscsi_tcp
ERROR: modinfo: could not find module libiscsi_tcp
ERROR: modinfo: could not find module libiscsi
ERROR: modinfo: could not find module scsi_transport_iscsi
ERROR: modinfo: could not find module cachefiles
ERROR: modinfo: could not find module fscache
ERROR: modinfo: could not find module ipv6
ERROR: modinfo: could not find module dm_mirror
ERROR: modinfo: could not find module dm_region_hash
ERROR: modinfo: could not find module dm_log
ERROR: modinfo: could not find module uinput
ERROR: modinfo: could not find module iTCO_wdt
ERROR: modinfo: could not find module iTCO_vendor_support
ERROR: modinfo: could not find module sg
ERROR: modinfo: could not find module coretemp
ERROR: modinfo: could not find module kvm_intel
ERROR: modinfo: could not find module kvm
ERROR: modinfo: could not find module microcode
ERROR: modinfo: could not find module serio_raw
ERROR: modinfo: could not find module pcspkr
ERROR: modinfo: could not find module i2c_i801
ERROR: modinfo: could not find module i2c_core
ERROR: modinfo: could not find module lpc_ich
ERROR: modinfo: could not find module mfd_core
ERROR: modinfo: could not find module shpchp
ERROR: modinfo: could not find module dm_mod
ERROR: modinfo: could not find module e1000e
ERROR: modinfo: could not find module i5400_edac
ERROR: modinfo: could not find module edac_core
ERROR: modinfo: could not find module i5k_amb
ERROR: modinfo: could not find module ioatdma
ERROR: modinfo: could not find module dca
ERROR: modinfo: could not find module floppy
ERROR: modinfo: could not find module ext4
ERROR: modinfo: could not find module mbcache

Can you guys please help me to resolve this issue?

AF_UNIX in windows

$
0
0

I have an application that I wish to use over windows. I am using AF_UNIX family un windows. I wish to know that AF_UNIX family is available in windows. If not then is there any alternate to AF_UNIX ?

Thanks Arpit

systemd: Freezing execution in Yocto [closed]

$
0
0

We have a legacy device with following configurations:

  • Chipset Architecture : Intel NM10 express
  • OS : Yocto warrior
  • CPU : Atom D2250 Dual Core
  • Volatile Memory : 2GB DDR3
  • CPU core : 4

I have generated 64-bit core-image-sato and run on my device but systemd freezes execution with SIGILL (as shown below). Please note that with 32-bit image the issue is not observed.

systemd[1]: Set hostname to <panther1>.
traps: systemd[1] trap invalid opcode ip:7f257b9b8bd7 sp:7ffe7bc63090 error:0 in libsystemd-shared-241.so[7f257b8b4000+12f000]
systemd[1]: Caught <ILL>, core dump failed (child 77, code=killed, status=4/ILL).
systemd[1]: Freezing execution.

I further debugged and found that it happens whensystemd tries to setup machineid. I went through code and functions flow is =>machine_id_setup -> generate_machine_id -> sd_id128_randomize

sd_id128_randomize function consists following lines,

/* Set UUID version to 4 --- truly random generation */
id[6] = (id[6] & 0x0F) | 0x40;
/* Set the UUID variant to DCE */
id[8] = (id[8] & 0x3F) | 0x80;

id[6] = (id[6] & 0x0F) | 0x40; This is the place where execution gets freezes as far as my findings are concerned.

Any help is really appreciated on why it is happening and how to fix it?

Note : lubuntu is running fine on this device which has systemd in it.

can't remove kernel driver after enabling tracepoint

$
0
0

I added a new trace point to a kernel module that I built. A few seconds after insmod, my driver refcnt stays on 1 and from this point I can't unload my module.

I've followed the instructions on https://lwn.net/Articles/383362/

Running on Ubuntu 18.04.4 - kernel 4.15.0-rc4.

I enabled traces to check what is using my module and it looks like the trace point code (perf_trace_init) is "holding" my module.

Any idea what I'm doing wrong?

Viewing all 12196 articles
Browse latest View live