gpio-it87: gpiod_get*() always return -ENOENT
Hello, I posted this message to linix-gpio group about a week ago, but it didn't get any reply so far; thus trying here. I am developing a driver for PCIe-based device that needs to receive external signals through on-board GPIOs. The target platform is Intel-based board running Fedora 34 kernel 5.11.12-300.fc34.x86_64 and has GPIO controller driven by gpio-it87. # gpiodetect gpiochip0 [INT34BB:00] (312 lines) gpiochip1 [gpio_it87] (64 lines) 8 of available 64 lines are connected to a header on the board: # gpioinfo 1 ... line 49: "it87_gp71" unused input active-high line 50: "it87_gp72" unused input active-high line 51: "it87_gp73" unused input active-high line 52: "it87_gp74" unused input active-high line 53: "it87_gp75" unused input active-high line 54: "it87_gp76" unused input active-high line 55: "it87_gp77" unused input active-high ... These lines were verified with logic analyzer and `gpioset 1 nn=0|1` The PCIe device driver defines these lines as: static struct gpiod_lookup_table gpio_it87_gpios = { .dev_id = "gpio_it87", .table = { GPIO_LOOKUP("gpio-it87", 48, "it87_gp70", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 49, "it87_gp71", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 50, "it87_gp72", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 51, "it87_gp73", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 52, "it87_gp74", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 53, "it87_gp75", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 54, "it87_gp76", GPIO_ACTIVE_HIGH), GPIO_LOOKUP("gpio-it87", 55, "it87_gp77", GPIO_ACTIVE_HIGH), {}, }, }; and then adds them to lookup table, eg.: gpiod_add_lookup_table(&gpio_it87_gpios); However, none of those lines seem available struct desc *gpio = gpiod_get(dev, "it87_gp70", GPIOD_IN); Above returns -ENOENT for any of those lines. I believe it is due to incorrct lookup definions in gpio_it87_gpios above, however, I cannot figure out what is wrong there. What am I missing? Thanks, --Alex ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Earlier Linux Code...
On Fri, May 26, 2023 at 9:42 AM Deepak Goel wrote: > > > > On Fri, May 26, 2023 at 12:04 PM Prathu Baronia > wrote: >> >> On Fri, May 26, 2023 at 11:58:49AM +0530, Deepak Goel wrote: >> > Hello >> > >> > I am a newbie. >> > >> > Is it possible to find the linux code of earlier versions like >> > 0.1,0.2,...1.0, 1.1...? >> > >> Here you go https://elixir.bootlin.com/linux/0.01/source > > > Is there a way to download them onto my computer? Or I will have to download > each file separately? > >> >> >> >> Prathu > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies https://mirrors.edge.kernel.org/pub/linux/kernel/Historic/ ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: BUG: kernel NULL pointer dereference while copying sk_buff struct
On Tue, May 2, 2023 at 6:35 PM Abdul Matin wrote: > > I'm initializing the memory for skbPrev at module init function: > > static int __init nf_conntrack_my_mod_init(void) > { > saddr_m = (union nf_inet_addr* ) kmalloc(sizeof(union nf_inet_addr), > GFP_KERNEL); > skbPrev = (struct sk_buff*) kmalloc(sizeof(struct sk_buff), GFP_KERNEL); > if (saddr_m == NULL) { > printk(KERN_INFO "Can not allocate space for saddr\n"); > return -ENOMEM; > } > if(skbPrev == NULL) { > printk(KERN_INFO "Can not allocate space for skbPrev\n"); > return -ENOMEM; > } > > On Tue, May 2, 2023 at 8:23 PM Alexander Kapshuk > wrote: >> >> On Tue, May 2, 2023 at 3:26 PM Abdul Matin >> wrote: >> > >> > Hi. >> > I'm writing a netfilter module where I need to copy a sk_buff in a global >> > variable that I use in another subsequent call. But I crashed the whole >> > kernel. I've tried to add a code snippet to share with you how I'm doing >> > it. >> > >> > here case1 is always true before case2 (i.e. 1st call of help -> case1 is >> > true, 2nd call of help -> case2 true). >> > So, in the 2nd call, case2 is true where we're using exp, ctinfoPrev, >> > saddr_m which have been initialized before in case1. >> > >> > union nf_inet_addr *saddr_m; >> > struct sk_buff* skbPrev; >> >> This declares a pointer to struct sk_buff which is uninitialised and >> most probably set to NULL by the compiler. >> Where do you allocate memory for skbPrev? >> >> > enum ip_conntrack_info ctinfoPrev; >> > struct nf_conntrack_expect *exp; >> > >> > static int help(struct sk_buff *skb, >> > unsigned int protoff, >> > struct nf_conn *ct, >> > enum ip_conntrack_info ctinfo) >> > { >> > switch (msgType) { >> > case case1: >> > >> > ctinfoPrev = ctinfo; >> > memcpy((void *)skbPrev, (const void *)skb, sizeof(skb)); >> >> The NULL pointer dereference probably happens here, as memcpy attempts >> to copy data from skb to skbPrev, which is likely to be NULL. >> >> > skbPrev->next = (struct sk_buff*) kmalloc(sizeof(struct sk_buff), >> > GFP_KERNEL); >> > skbPrev->prev = (struct sk_buff*) kmalloc(sizeof(struct sk_buff), >> > GFP_KERNEL); >> > skbPrev->sk = (struct sock*) kmalloc(sizeof(struct sock), GFP_KERNEL); >> > memcpy((void *)(skbPrev->next), (const void *)skb->next, >> > sizeof(skb->next)); >> > memcpy((void *)(skbPrev->prev), (const void *)skb->prev, >> > sizeof(skb->prev)); >> >memcpy((void *)(skbPrev->sk), (const void *)skb->sk, sizeof(skb->sk)); >> > >> > unsigned int type = (dptr[0] << 8) | dptr[1]; // little endian >> > unsigned int length = (dptr[2] << 8) | dptr[3]; >> > printk(KERN_INFO "type: %hu length: %hu", type, length); >> > >> > unsigned int ip; >> > memcpy(&ip, dptr, 4); >> > ip = ntohl(ip) ^ MAGIC_COOKIE_VALUE_HOST; >> > exp = nf_ct_expect_alloc(ct); >> > if (exp == NULL) { >> > printk( KERN_INFO "cannot alloc expectation"); >> > return NF_DROP; >> > } >> > tuple = &ct->tuplehash[IP_CT_DIR_REPLY].tuple; >> > nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, >> > nf_ct_l3num(ct), >> > saddr_m, &tuple->dst.u3, >> > IPPROTO_UDP, NULL, &tuple->dst.u.udp.port); >> > >> > pr_debug("expect: "); >> > nf_ct_dump_tuple(&exp->tuple); >> > >> > >> > break; >> >case case2: >> > printk(KERN_INFO "createpermission response\n"); >> > nf_nat_tftp = rcu_dereference(nf_nat_tftp_hook); >> > if (nf_nat_tftp && ct->status & IPS_NAT_MASK) >> > ret= nf_nat_tftp(skbPrev, ctinfoPrev, exp); >> > else if (nf_ct_expect_related(exp, 0) != 0) { >> > printk( KERN_INFO "cannot add expectation"); >> > nf_ct_helper_log(skb, ct, "cannot add expectation"); >> > ret = NF_DROP; >> > } >> >nf_ct_expect_put(exp); >> >break; >> >} >> >return ret; >> > } >> > I got this log before crash: 1,589,5743337757,-;BUG: kernel NULL pointer >> > dereference, address: >> > 1,590,5743337860,-;#PF: supervisor read access in kernel mode >> > 1,591,5743337880,-;#PF: error_code(0x) - not-present page >> > 6,592,5743337900,-;PGD 0 P4D 0 >> > 4,593,5743337974,-;Oops: [#1] SMP PTI >> > >> > Is there anything wrong I am doing in copying and initializing? >> > >> > ___ >> > Kernelnewbies mailing list >> > Kernelnewbies@kernelnewbies.org >> > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies I see. Without seeing the code in its entirety it's hard to tell which pointer is being null-dereferenced. Examine the OOPS output. The answer may very well be there. Otherwise, you want to add some pr_info() or printk() calls around the pointers being dereferenced in your code and see if any of those are set to NULL. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: BUG: kernel NULL pointer dereference while copying sk_buff struct
On Tue, May 2, 2023 at 3:26 PM Abdul Matin wrote: > > Hi. > I'm writing a netfilter module where I need to copy a sk_buff in a global > variable that I use in another subsequent call. But I crashed the whole > kernel. I've tried to add a code snippet to share with you how I'm doing it. > > here case1 is always true before case2 (i.e. 1st call of help -> case1 is > true, 2nd call of help -> case2 true). > So, in the 2nd call, case2 is true where we're using exp, ctinfoPrev, saddr_m > which have been initialized before in case1. > > union nf_inet_addr *saddr_m; > struct sk_buff* skbPrev; This declares a pointer to struct sk_buff which is uninitialised and most probably set to NULL by the compiler. Where do you allocate memory for skbPrev? > enum ip_conntrack_info ctinfoPrev; > struct nf_conntrack_expect *exp; > > static int help(struct sk_buff *skb, > unsigned int protoff, > struct nf_conn *ct, > enum ip_conntrack_info ctinfo) > { > switch (msgType) { > case case1: > > ctinfoPrev = ctinfo; > memcpy((void *)skbPrev, (const void *)skb, sizeof(skb)); The NULL pointer dereference probably happens here, as memcpy attempts to copy data from skb to skbPrev, which is likely to be NULL. > skbPrev->next = (struct sk_buff*) kmalloc(sizeof(struct sk_buff), > GFP_KERNEL); > skbPrev->prev = (struct sk_buff*) kmalloc(sizeof(struct sk_buff), > GFP_KERNEL); > skbPrev->sk = (struct sock*) kmalloc(sizeof(struct sock), GFP_KERNEL); > memcpy((void *)(skbPrev->next), (const void *)skb->next, > sizeof(skb->next)); > memcpy((void *)(skbPrev->prev), (const void *)skb->prev, > sizeof(skb->prev)); >memcpy((void *)(skbPrev->sk), (const void *)skb->sk, sizeof(skb->sk)); > > unsigned int type = (dptr[0] << 8) | dptr[1]; // little endian > unsigned int length = (dptr[2] << 8) | dptr[3]; > printk(KERN_INFO "type: %hu length: %hu", type, length); > > unsigned int ip; > memcpy(&ip, dptr, 4); > ip = ntohl(ip) ^ MAGIC_COOKIE_VALUE_HOST; > exp = nf_ct_expect_alloc(ct); > if (exp == NULL) { > printk( KERN_INFO "cannot alloc expectation"); > return NF_DROP; > } > tuple = &ct->tuplehash[IP_CT_DIR_REPLY].tuple; > nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, > nf_ct_l3num(ct), > saddr_m, &tuple->dst.u3, > IPPROTO_UDP, NULL, &tuple->dst.u.udp.port); > > pr_debug("expect: "); > nf_ct_dump_tuple(&exp->tuple); > > > break; >case case2: > printk(KERN_INFO "createpermission response\n"); > nf_nat_tftp = rcu_dereference(nf_nat_tftp_hook); > if (nf_nat_tftp && ct->status & IPS_NAT_MASK) > ret= nf_nat_tftp(skbPrev, ctinfoPrev, exp); > else if (nf_ct_expect_related(exp, 0) != 0) { > printk( KERN_INFO "cannot add expectation"); > nf_ct_helper_log(skb, ct, "cannot add expectation"); > ret = NF_DROP; > } >nf_ct_expect_put(exp); >break; >} >return ret; > } > I got this log before crash: 1,589,5743337757,-;BUG: kernel NULL pointer > dereference, address: > 1,590,5743337860,-;#PF: supervisor read access in kernel mode > 1,591,5743337880,-;#PF: error_code(0x) - not-present page > 6,592,5743337900,-;PGD 0 P4D 0 > 4,593,5743337974,-;Oops: [#1] SMP PTI > > Is there anything wrong I am doing in copying and initializing? > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: POSIX.1b book/documentation
On Fri, Jan 20, 2023 at 9:20 AM Axel M. wrote: > > Hi all, > > I'm looking for a book that explains the content of POSIX.1 standard > (especially POSIX.1b). > Do you know anything about this ? > Thanks for the help. > > -- > Thanks, > Axel M. > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Is this, https://pubs.opengroup.org/onlinepubs/9699919799/, what you're looking for? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: kernel compile message
On Tue, Oct 25, 2022 at 12:29 PM Anatoly Pugachev wrote: > > Hello! > > Doing kernel testing, occasionally I started to get messages: > > mator@ttip:~/linux-2.6$ make -j olddefconfig; nice make -j20 && nice > make -j20 modules > # > # configuration written to .config > # > SYNCinclude/config/auto.conf.cmd > make[1]: /bin/sh: Bad address > UPD include/generated/compile.h > UPD include/config/kernel.release > UPD include/generated/utsrelease.h > > > It is not always "bad address" is shown, next time i run "make > olddefconfig" it does not shows, but sometimes it shows... How do i > debug this ? > > Thanks > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies You may want to raise the level of 'chattiness' by using W=1 with make to identify the command being executed by the shell which emits the error message in question. Higher levels of chattiness may be used if required. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: kernel build error during ubuntu linux kernel build
On Thu, Jul 1, 2021 at 4:03 AM wrote: > > > Hello Alexander Kapshuk, > > Thanks for the reply. Following your advice, I installed `sudo apt install > zfs-dkms` ( it gave me this scary-looking warning below I just installed > it, because I’ll not distribute anything) > > It installs sources for zfs-dkms and I understand it contains bash script > to automatically compile it when the kernel changes. > > I later found I had to do these commands. > > > > export $(dpkg-architecture -aarm64); export > CROSS_COMPILE=arm-linux-gnueabihf- > > LANG=C fakeroot debian/rules ARCH=arm64 > CROSS_COMPILE=aarch64-none-linux-gnu- clean > > LANG=C fakeroot debian/rules ARCH=arm64 > CROSS_COMPILE=aarch64-none-linux-gnu- binary-headers binary-generic > binary-perarch > > > > Before this, I had to download > gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu > from > https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads > because I saw some compiler error related to STACKPROTECTOR compile option > when I used gcc tool from linaro which was based on gcc 7.5 (I remember, > the new toolchain is gcc 10.2 based). > > With these, I could finally compile ubuntu 20.04! > Great to hear. Thanks for letting us know. > (For those interested, please see > https://unix.stackexchange.com/questions/656263/how-to-build-ubuntu-for-arm64-how-to-give-arch-and-cross-compile-variable-to > ) > > > > Thank you! > > Chan Kim > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: kernel build error during ubuntu linux kernel build
On Tue, Jun 29, 2021 at 7:07 AM wrote: > I found from https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel, the > correct method to build ubuntu is (for ARCH=arm64 case) > > > >- LANG=C fakeroot debian/rules ARCH=arm64 clean >- # quicker build: >- LANG=C fakeroot debian/rules ARCH=arm64 binary-headers >binary-generic binary-perarch >- # if you need linux-tools or lowlatency kernel, run instead: >- LANG=C fakeroot debian/rules ARCH=arm64 binary > > > > But when I tried it, it went far longer but eventually it failed with > error. > > > > …. > > Creating symlink > /home/ckim/prj1/QEMU/qemu_test/test_ubuntu-20.04-build/focal/ubuntu-focal/debian/build/builddkms/build/zfs/0.8.3/source > -> > > > /home/ckim/prj1/QEMU/qemu_test/test_ubuntu-20.04-build/focal/ubuntu-focal/debian/build/builddkms/source/zfs-0.8.3 > > > > DKMS: add completed. > > > > Running the pre_build script: > > checking for gawk... gawk > > checking metadata... META file > > checking build system type... x86_64-pc-linux-gnu > > checking host system type... x86_64-pc-linux-gnu > > checking target system type... x86_64-pc-linux-gnu > > checking whether to enable maintainer-specific portions of Makefiles... no > > checking whether make supports nested variables... yes > > checking for a BSD-compatible install... /bin/install -c > > checking whether build environment is sane... yes > > checking for a thread-safe mkdir -p... /bin/mkdir -p > > ….. > > checking kernel source version... 5.4.0-42-generic > > checking kernel file name for module symbols... Module.symvers > > checking whether modules can be built... no > > configure: error: > >*** Unable to build an empty module. > > > > > > Building module: > > cleaning build area...(bad exit status: 2) > > make -j28 KERNELRELEASE=5.4.0-42-generic...(bad exit status: 2) > > ERROR (dkms apport): binary package for zfs: 0.8.3 not found > Based on the error message above you may not have the zfs-dkms package installed. > Error! Bad return status for module build on kernel: 5.4.0-42-generic > (x86_64) > > Consult > /home/ckim/prj1/QEMU/qemu_test/test_ubuntu-20.04-build/focal/ubuntu-focal/debian/build/builddkms/build/zfs/0.8.3/build/make.log > for more information. > > DKMS make.log for zfs-0.8.3 for kernel 5.4.0-42-generic (x86_64) > > Tue Jun 29 11:43:02 KST 2021 > > make[1]: Entering directory '<>/build/zfs/0.8.3/build' > > make[1]: *** No targets specified and no makefile found. Stop. > > make[1]: Leaving directory '<>/build/zfs/0.8.3/build' > > make: *** [debian/rules.d/2-binary-arch.mk:223: install-generic] Error 1 > > > > And according to the guide, I’m supposed to see in ../ directory two > linux headers .deb files and a linux-image .deb file but I see only > linux-headers-5.4.0-42_5.4.0-42.46_all.deb > > Can anyone give me an advice? Any suggestion will be appreciated. > > Thank you! > > Chan Kim > > > > *From:* c...@etri.re.kr > *Sent:* Tuesday, June 29, 2021 10:04 AM > *To:* kernelnewbies@kernelnewbies.org > *Subject:* kernel build error during ubuntu linux kernel build > > > > Hello, all > > > > I have a strange problem in building the linux kernel from ubuntu. (I want > to replace the kernel in ubuntu to debug install failure on qemu virtual > machine) > > I downloaded ubuntu source by “git clone git:// > kernel.ubuntu.com/ubuntu/ubuntu-focal.git”. and because I wanted to use a > specific version, I did “git checkout Ubuntu-5.4.0-42.46” (this version > is the one used in a ubuntu installation .iso. > > And you can see related askubuntu question here : > https://askubuntu.com/questions/1347390/what-ubuntu-source-version-should-i-use-to-add-some-debug-prints-for-ubuntu-bo > ) > > > > After git-checkout, the `git log` shows this result : > > > > commit 98c4545e2d65ed35c31056f72c4da20f6b5ea0d0 (HEAD, tag: > Ubuntu-5.4.0-42.46) > > Author: Khalid Elmously > > Date: Thu Jul 9 19:50:26 2020 -0400 > > > > UBUNTU: Ubuntu-5.4.0-42.46 > > > > Signed-off-by: Khalid Elmously > > > > To build the kernel, I did `ARCH=arm64 CROSS_COMPILE=aarch64-none-elf- > make defconfig` and `ARCH=arm64 CROSS_COMPILE=aarch64-none-elf- make -j24 > Image`. But this gives me a compile error below. What can be wrong? > > > > . > > . > > CC mm/interval_tree.o > > CC drivers/base/regmap/regcache.o > > CC kernel/time/posix-cpu-timers.o > > CC mm/list_lru.o > > CC block/blk-mq.o > > AS arch/arm64/lib/memchr.o > > CC fs/ext4/migrate.o > > security/security.c: In function 'security_add_hooks': > > security/security.c:477:25: error: 'struct security_hook_heads' has no > member named 'socket_getpeersec_stream' > > 477 | &security_hook_heads.socket_getpeersec_stream) > > | ^ > > CC kernel/time/posix-clock.o > > AS arch/arm64/lib/memcmp.o > > security/security.c: In function 'security_setprocattr': > >
Re:
On Thu, Jan 14, 2021 at 11:54 AM bigbird2...@163.com wrote: > > On Thu, Jan 14, 2021 at 8:01 AM Alexander Kapshuk > wrote: > > > > On Thu, Jan 14, 2021 at 8:14 AM bigbird2...@163.com > > wrote: > > > > > > > > > I've just added a newbies mailing list, How to join other mailing lists, > > > and I'd like to see what other people are communicating with. > > > > > > ___ > > > Kernelnewbies mailing list > > > Kernelnewbies@kernelnewbies.org > > > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > > > Not sure what other lists you were referring to, but you may want to > > check out these mailing lists, http://vger.kernel.org/vger-lists.html, > > and see if that's what you were after. > > >If you just would like to read the mails on >the different mailing > >list, you do not need to subscribe. > > >You can find all emails at >https://lore.kernel.org/lists.html, just > >look into the various mailing lists and see >what is of interest to > >you. > > >Lukas > > > Thank you, how do I subscribe to other mailing lists? > > Liang Peng > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies By clicking on the link for the mailing list of interest, e.g. linux-next, http://vger.kernel.org/vger-lists.html#linux-next, followed by clicking on the subscribe link, which would launch your email client, if available, with majord...@vger.kernel.org as the recipient and the following email body: subscribe name-of-mailing-list Alternatively, you could simply send the subscription request above using an email client of your preference. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: How to join other mailing lists
On Thu, Jan 14, 2021 at 8:14 AM bigbird2...@163.com wrote: > > > I've just added a newbies mailing list, How to join other mailing lists, and > I'd like to see what other people are communicating with. > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Not sure what other lists you were referring to, but you may want to check out these mailing lists, http://vger.kernel.org/vger-lists.html, and see if that's what you were after. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: How to install kernel modules after a successful compiling
On Thu, Dec 10, 2020 at 4:19 PM FuLong Wang wrote: > > > have checked the config file and the script, not found the exact match. > > > > > > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ pwd > /home/zbrand/rpmbuild/BUILD/kernel-3.10.0-957.el7/linux-3.10.0-957.el7.s390x > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ cat .config | grep > CONFIG_LOCALVERSION > CONFIG_LOCALVERSION="" > # CONFIG_LOCALVERSION_AUTO is not set > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ grep -r CONFIG_LOCALVERSION > ./* > > . > > ./arch/um/defconfig:CONFIG_LOCALVERSION="" > ./arch/um/defconfig:CONFIG_LOCALVERSION_AUTO=y > ./arch/unicore32/configs/unicore32_defconfig:CONFIG_LOCALVERSION="-unicore32" > ./arch/x86/configs/i386_defconfig:# CONFIG_LOCALVERSION_AUTO is not set > ./arch/x86/configs/x86_64_defconfig:# CONFIG_LOCALVERSION_AUTO is not set > ./arch/xtensa/configs/common_defconfig:CONFIG_LOCALVERSION="" > ./arch/xtensa/configs/iss_defconfig:CONFIG_LOCALVERSION="" > ./arch/xtensa/configs/iss_defconfig:CONFIG_LOCALVERSION_AUTO=y > ./arch/xtensa/configs/s6105_defconfig:CONFIG_LOCALVERSION="" > ./arch/xtensa/configs/s6105_defconfig:CONFIG_LOCALVERSION_AUTO=y > ./configs/kernel-3.10.0-s390x-debug.config:CONFIG_LOCALVERSION="" > ./configs/kernel-3.10.0-s390x-debug.config:# CONFIG_LOCALVERSION_AUTO is > not set > ./configs/kernel-3.10.0-s390x-kdump.config:CONFIG_LOCALVERSION="" > ./configs/kernel-3.10.0-s390x-kdump.config:CONFIG_LOCALVERSION_AUTO=y > ./configs/kernel-3.10.0-s390x.config:CONFIG_LOCALVERSION="" > ./configs/kernel-3.10.0-s390x.config:# CONFIG_LOCALVERSION_AUTO is not set > ./include/config/auto.conf:CONFIG_LOCALVERSION="" > ./include/generated/autoconf.h:#define CONFIG_LOCALVERSION "" > ./init/Kconfig: set in CONFIG_LOCALVERSION. > ./scripts/setlocalversion:# CONFIG_LOCALVERSION and LOCALVERSION (if set) > ./scripts/setlocalversion:res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}" > ./scripts/setlocalversion:if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > > > > > -- > Regards > FuLong Wang > ___ > > On 12/10/20 16:28, Alexander Kapshuk wrote: > > On Thu, Dec 10, 2020 at 9:51 AM FuLong Wang > > wrote: > >> > >> > >> > >> When I try to install the new built kernel and modules, i found the > >> install script will assign the kernel version as "3.10.0". > > > > The kernel version is set via these config options via > > scripts/setlocalversion: > > CONFIG_LOCALVERSION > > CONFIG_LOCALVERSION_AUTO > > > > In your setup, CONFIG_LOCALVERSION is probably set to 3.10.0. > > If that is the case, try setting CONFIG_LOCALVERSION="" via 'make > > menuconfig', and ensure that CONFIG_LOCALVERSION_AUTO is set to 'y'. > > > >> > >> Where is this defined? > >> Can we keep it as the current kernel version or change it as we want? > >> > >> ~ > >> > >> > >> [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ sudo make install > >> CHK include/generated/uapi/linux/version.h > >> CHK include/generated/utsrelease.h > >> CHK include/generated/qrwlock.h > >> CHK include/generated/qrwlock_api_smp.h > >> CHK include/generated/qrwlock_types.h > >> CHK kernel/qrwlock_gen.c > >> CHK lib/qrwlock_debug.c > >> CALLscripts/checksyscalls.sh > >> CC scripts/mod/devicetable-offsets.s > >> GEN scripts/mod/devicetable-offsets.h > >> HOSTCC scripts/mod/file2alias.o > >> HOSTLD scripts/mod/modpost > >> CHK include/generated/compile.h > >> SKIPPED include/generated/compile.h > >> CHK include/generated/uapi/linux/version.h > >> sh -x ./arch/s390/boot/install.sh 3.10.0 arch/s390/boot/bzImage \ > >> System.map "/boot" > >> + '[' -x /root/bin/installkernel ']' > >> + '[' -x /sbin/installkernel ']' > >> + exec /sbin/inst
Re: How to install kernel modules after a successful compiling
On Thu, Dec 10, 2020 at 9:51 AM FuLong Wang wrote: > > > > When I try to install the new built kernel and modules, i found the > install script will assign the kernel version as "3.10.0". The kernel version is set via these config options via scripts/setlocalversion: CONFIG_LOCALVERSION CONFIG_LOCALVERSION_AUTO In your setup, CONFIG_LOCALVERSION is probably set to 3.10.0. If that is the case, try setting CONFIG_LOCALVERSION="" via 'make menuconfig', and ensure that CONFIG_LOCALVERSION_AUTO is set to 'y'. > > Where is this defined? > Can we keep it as the current kernel version or change it as we want? > > ~ > > > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ sudo make install >CHK include/generated/uapi/linux/version.h >CHK include/generated/utsrelease.h >CHK include/generated/qrwlock.h >CHK include/generated/qrwlock_api_smp.h >CHK include/generated/qrwlock_types.h >CHK kernel/qrwlock_gen.c >CHK lib/qrwlock_debug.c >CALLscripts/checksyscalls.sh >CC scripts/mod/devicetable-offsets.s >GEN scripts/mod/devicetable-offsets.h >HOSTCC scripts/mod/file2alias.o >HOSTLD scripts/mod/modpost >CHK include/generated/compile.h >SKIPPED include/generated/compile.h >CHK include/generated/uapi/linux/version.h > sh -x ./arch/s390/boot/install.sh 3.10.0 arch/s390/boot/bzImage \ >System.map "/boot" > + '[' -x /root/bin/installkernel ']' > + '[' -x /sbin/installkernel ']' > + exec /sbin/installkernel 3.10.0 arch/s390/boot/bzImage System.map /boot > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ pwd > /home/zbrand/rpmbuild/BUILD/kernel-3.10.0-957.el7/linux-3.10.0-957.el7.s390x > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > > > > > -- > Regards > FuLong Wang > ___ > > On 12/10/20 12:25, FuLong Wang wrote: > > > > Alexander, > > > > > > Thanks for the reminder! > > > > > > I realized that the new build module is with version "3.10.0" and so not > > match with my running kernel version "3.10.0-957.el7.s390x". > > > > I do confirm that i was using the right kernel source rpm. > > > > So, the question turns to why the "make modules" command changed the > > kernel version of built modules to "3.10.0" instead of > > "3.10.0-957.el7.s390x". > > > > > > Is there any special steps i need to follow to keep the original kernel > > naming convention? > > > > btw: I'm following below article to compile the kernel modules. > > > > https://wiki.centos.org/HowTos/BuildingKernelModules > > > > > > Thanks! > > > > ~ > > > > > > [root@bz094f ~]# modinfo ib_ipoib > > filename: > > /lib/modules/3.10.0-957.el7.s390x/kernel/drivers/infiniband/ulp/ipoib/ib_ipoib.ko > > > > license:Dual BSD/GPL > > description:IP-over-InfiniBand net driver > > author: Roland Dreier > > alias: rtnl-link-ipoib > > rhelversion:7.6 > > srcversion: 917AA4365B3509F0B347217 > > depends:ib_core,ib_cm > > intree: Y > > vermagic: 3.10.0 SMP mod_unload modversions > > parm: max_nonsrq_conn_qp:Max number of connected-mode QPs per > > interface (applied only if shared receive queue is not available) (int) > > parm: cm_data_debug_level:Enable data path debug tracing for > > connected mode if > 0 (int) > > parm: mcast_debug_level:Enable multicast debug tracing if > 0 > > (int) > > parm: data_debug_level:Enable data path debug tracing if > 0 > > (int) > > parm: send_queue_size:Number of descriptors in send queue (int) > > parm: recv_queue_size:Number of descriptors in receive queue > > (int) > > parm: ipoib_enhanced:Enable IPoIB enhanced for capable devices > > (default = 1) (0-1) (int) > > parm: debug_level:Enable debug tracing if > 0 (int) > > [root@bz094f ~]# > > > > > > [root@bz094f ~]# uname -ar > > Linux bz094f 3.10.0-957.el7.s390x #1 SMP Thu Oct 4 16:53:20 EDT 2018 > > s390x s390x s390x GNU/Linux > > > > > > [root
Re: How to install kernel modules after a successful compiling
On Wed, Dec 9, 2020 at 11:31 AM FuLong Wang wrote: > > > Hello Experts, > > > I'm trying to enable some infiniband related kernel modules (ib_ipoib, > iser, isert, etc) on my RHEL 7.6 instance running on IBM linuxONE > machine. (I have found the code in the kernel source tree.) > > After installing the kernel source rpm in a normal user and make module > selection using the "make menuconfig" command, i can successfully > re-built all the selected modules (include the new selection) with the > "make modules" command. > > I copied the desired module files to the > "/lib/modules/3.10.0-957.el7.s390x/kernel/drivers/infiniband/ulp" dir > and the depmod -a command also was executed with no errors. > > [root@bz094f ulp]# pwd > /lib/modules/3.10.0-957.el7.s390x/kernel/drivers/infiniband/ulp > [root@bz094f ulp]# > [root@bz094f ulp]# ls -l ipoib > total 5704 > -rw-r--r--. 1 root root 5837016 Dec 9 15:50 ib_ipoib.ko > [root@bz094f ulp]# ls -l iser > total 2880 > -rw-r--r--. 1 root root 2946496 Dec 9 15:50 ib_iser.ko > [root@bz094f ulp]# ls -l isert > total 1384 > -rw-r--r--. 1 root root 1414304 Dec 9 15:50 ib_isert.ko > [root@bz094f ulp]# > > > But after reboot the OS, i found the new copied modules can't be loaded > by the kernel. > > errors reported in the /var/log/message: > > Dec 9 15:49:05 bz094f systemd-modules-load: Failed to insert > 'ib_ipoib': Exec format error > Dec 9 15:49:05 bz094f systemd-modules-load: Failed to find module 'ib_umad' > Dec 9 15:49:05 bz094f systemd: rdma-load-modules@infiniband.service: > main process exited, code=exited, status=1/FAILURE > Dec 9 15:49:05 bz094f systemd: Failed to start Load RDMA modules from > /etc/rdma/modules/infiniband.conf. > Dec 9 15:49:05 bz094f systemd: Unit > rdma-load-modules@infiniband.service entered failed state. > Dec 9 15:49:05 bz094f systemd: rdma-load-modules@infiniband.service failed. > Dec 9 15:49:05 bz094f kernel: ib_ipoib: no symbol version for module_layout > Dec 9 15:49:05 bz094f systemd-modules-load: Failed to insert 'ib_iser': > Exec format error > Dec 9 15:49:05 bz094f kernel: ib_iser: no symbol version for module_layout > > > > > when load the module manually, it will produce the same error: > > > [root@bz094f ~]# modprobe ib_ipoib > modprobe: ERROR: could not insert 'ib_ipoib': Exec format error The error message above usually indicates that the version of the currently running kernel is different from the version of the kernel the given driver was compiled for. Compare the output of 'uname -r' of the running kernel with the output of modinfo /path/to/module.ko | grep vermagic. If they happen to differ, rebuild the given modules against the sources of the running kernel. > > error reported in the dmesg: > > [9.589647] ib_ipoib: no symbol version for module_layout > [9.597600] ib_srp: no symbol version for module_layout > > > [root@bz094f ~]# modinfo ib_ipoib > filename: > /lib/modules/3.10.0-957.el7.s390x/kernel/drivers/infiniband/ulp/ipoib/ib_ipoib.ko > license:Dual BSD/GPL > description:IP-over-InfiniBand net driver > author: Roland Dreier > alias: rtnl-link-ipoib > rhelversion:7.6 > srcversion: 917AA4365B3509F0B347217 > depends:ib_core,ib_cm > intree: Y > vermagic: 3.10.0 SMP mod_unload modversions > parm: max_nonsrq_conn_qp:Max number of connected-mode QPs per > interface (applied only if shared receive queue is not available) (int) > parm: cm_data_debug_level:Enable data path debug tracing for > connected mode if > 0 (int) > parm: mcast_debug_level:Enable multicast debug tracing if > 0 > (int) > parm: data_debug_level:Enable data path debug tracing if > 0 (int) > parm: send_queue_size:Number of descriptors in send queue (int) > parm: recv_queue_size:Number of descriptors in receive queue (int) > parm: ipoib_enhanced:Enable IPoIB enhanced for capable devices > (default = 1) (0-1) (int) > parm: debug_level:Enable debug tracing if > 0 (int) > [root@bz094f ~]# > > > I had also tried the "make modules_install" command, but get the error > below. > > [root@bz094f ~]# su - zbrand > Last login: Wed Dec 9 16:38:08 CST 2020 on pts/1 > [zbrand@bz094f ~]$ cd > /home/zbrand/rpmbuild/BUILD/kernel-3.10.0-957.el7/linux-3.10.0-957.el7.s390x > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ sudo make modules_install >INSTALL arch/s390/appldata/appldata_mem.ko > Can't read private key > make[1]: *** [arch/s390/appldata/appldata_mem.ko] Error 2 > make: *** [_modinst_] Error 2 > [zbrand@bz094f linux-3.10.0-957.el7.s390x]$ > > > So, did anybody have idea on this? > > > Many Thanks! > > -- > Regards > FuLong Wang > ___ > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies __
Re: Oops stack trace missing function addresses
On Fri, Oct 16, 2020 at 2:49 PM Adrian Larumbe wrote: > > > OK, I'll bite. You *are* getting the function name and offset, what > > additional > > knowledge do you get from knowing the VA? > > I was hoping to use the VA to calculate the C source line where the > fault happens, by substracting the function's VA from the module load > address as revealed by cat /proc/modules, adding the offset within the > function and then passing the offset to addr2line. > > I've just realised I might as well load the module object file into gdb > and do 'info line *(func+offset)'. > > But how would I do this just with addr2line ? scripts/faddr2line path/to/module.ko symbol+0xsym_offset/0xsym_size would give you the C source line referenced by the offset. > > > What architecture is this on? Stack unwinding is architecture-dependent, so > > it may just be the unwinder for that arch doesn't output the virtual > > address. > > It's a QEMU VM, 'uname -m' claims it's i686. > > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Kernel TLS
Hello, I think reason is here: https://github.com/torvalds/linux/blob/386403a115f95997c2715691226e11a7b5cffcfd/net/tls/tls_main.c#L725 You need to setsockopt() ULP ktls on CONNECTION socket. Regards, Alex On Sat, Nov 30, 2019 at 7:39 AM Jeffrey Walton wrote: > > On Fri, Nov 29, 2019 at 3:04 PM Jeffrey Walton wrote: > > ... > > So now I am at: > > > > $ gcc -Wall -g2 -O1 ktls.c -o ktls > > $ ./ktls > > setsockopt failed, 524, Unknown error 524 > > Now open in the Fedora bug tracker: > https://bugzilla.redhat.com/show_bug.cgi?id=1778348 > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Kernel TLS
Hello, I think you need to load "tls" kernel module first. Regards, Alex On Fri, Nov 29, 2019 at 11:37 AM Jeffrey Walton wrote: > > Hi Everyone, > > I'm trying to run through the example at > https://www.kernel.org/doc/html/latest/networking/tls.html#kernel-tls > . > > I'm working on Fedora 31 x86_64 (fully patched). Running my program results > in: > > $ ./ktls > setsockopt failed, 2, No such file or directory > > I observed: > > $ cat /proc/sys/net/ipv4/tcp_available_ulp > $ > > Is there a way to enable ULP at boot? Or is this a kernel config > option? Or maybe I am doing something else wrong? > > Below is the sample code. > > Jeff > > == > > #include > #include > #include > #include > > #include > #include > > #include > #include > #include > > int main() > { > int sock = socket(AF_INET, SOCK_STREAM, 0); > if (sock == -1) > { > printf("socket failed, %d, %s\n", errno, strerror(errno)); > return 1; > } > > if (setsockopt(sock, SOL_TCP, TCP_ULP, "tls", sizeof("tls")) == -1 ) > { > printf("setsockopt failed, %d, %s\n", errno, strerror(errno)); > return 1; > } > > close (sock); > return 0; > } > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Thu, 29 Aug 2019 00:47 -07:00, Valentin Vidić wrote: > On Wed, Aug 28, 2019 at 02:04:44PM -0700, Alexander Ivanov wrote: > > It took me (or rather the vendor) to update the firmware and enable INT344B > > controller. After update, the system enumerates gpio controller > > How did you get them to update the firmware? I have a similar problem > with iTCO_wdt on Intel NUC not being enabled. > We have quite big account with them and paid support service, otherwise it would be virtually impossible :/ ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Tue, 25 Jun 2019 04:08 -07:00, Andy Shevchenko wrote: > > There is no issue with kernel. ACPI tables provided by firmware, so, > vendor of your firmware decided to turn off this device. > It took me (or rather the vendor) to update the firmware and enable INT344B controller. After update, the system enumerates gpio controller [4.236944] sunrisepoint-pinctrl INT344B:00: intel_gpio_probe init done All is good! Thank you for helping! ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Fri, 21 Jun 2019 10:39 -07:00, Alexander Ivanov wrote: > > On Fri, 21 Jun 2019 03:12 -07:00, Andy Shevchenko > wrote: > > > > Usually to check this is better to run > > grep -H 15 /sys/bus/acpi/devices/*/status > > which return you the list of *present and available* ACPI devices. > > > It looks like INT344B device is neither present nor available. This > device isn't in the list returned by above grep. > Its status actually returns 0. What could be reasons for that? > Any idea why would otherwise 'visible' [1] device appear unavailable and not present [2]? I cannot see anything obviously wrong in kernel traces either. [1] # tree /sys/bus/acpi/devices/INT344B\:00/ /sys/bus/acpi/devices/INT344B:00/ ├── hid ├── modalias ├── path ├── power │ ├── autosuspend_delay_ms │ ├── control │ ├── runtime_active_time │ ├── runtime_status │ └── runtime_suspended_time ├── status ├── subsystem -> ../../../../../bus/acpi └── uevent [2] # cat /sys/bus/acpi/devices/INT344B\:00/status 0 ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Fri, 21 Jun 2019 03:12 -07:00, Andy Shevchenko wrote: > > Usually to check this is better to run > grep -H 15 /sys/bus/acpi/devices/*/status > which return you the list of *present and available* ACPI devices. It looks like INT344B device is neither present nor available. This device isn't in the list returned by above grep. Its status actually returns 0. What could be reasons for that? > > to use character device; libgpiod tools will help you with that It's good to know there is C library for handling gpio. But this is user-land thing. I'm interested in kernel's means to handle gpios. And for experiments I'd rather use tools/gpio/. Anyway, I can figure out how to use kernel API. At the moment though I need to understand what's wrong with my platform and how can I fix/make it work. Thx! ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Tue, 18 Jun 2019 01:41 -07:00, Andy Shevchenko wrote: > > > > Obviously, I am wrong here. However, the question stands, is there linux > > kernel support for Intel PCH GPIO? > > Yes. Most of the SoCs from Intel use GPIO IP based on Chassis specification, > the drivers for which are available under drivers/pinctrl/intel. What you are > looking for is located under PINCTRL_SUNRISEPOINT configuration option. > My box is updated with current Fedora distro and now running 5.0.9-301.fc30.x86_64. It's also said that the box has Sunrisepoint chipset. For this chipset, 5.0.9 kernel support following devices: static const struct acpi_device_id spt_pinctrl_acpi_match[] = { { "INT344B", (kernel_ulong_t)&sptlp_soc_data }, { "INT345D", (kernel_ulong_t)&spth_soc_data }, { } }; [ https://elixir.bootlin.com/linux/v5.0.9/source/drivers/pinctrl/intel/pinctrl-sunrisepoint.c#L587 ] I believe the box has INT344B device attached to acpi bus proper: $ sudo ls -la /sys/bus/acpi/devices/INT344* ... lrwxrwxrwx. 1 root root 0 Jun 20 11:47 /sys/bus/acpi/devices/INT344B:00 -> ../../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT344B:00 Drivers seem loaded: $ lsmod | grep pin pinctrl_sunrisepoint28672 0 pinctrl_intel 28672 1 pinctrl_sunrisepoint However, I don't see any gpio devices. $ ls /dev/gpio* ls: cannot access '/dev/gpio*': No such file or directory $ ls /sys/bus/gpio/devices/ $ What am I still missing? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Tue, 18 Jun 2019 08:58 -07:00, Andy Shevchenko wrote: > On Tue, Jun 18, 2019 at 10:48:45AM -0400, Valdis Klētnieks wrote: > > On Tue, 18 Jun 2019 11:40:34 +0300, Andy Shevchenko said: > > > > > Yes. Most of the SoCs from Intel use GPIO IP based on Chassis > > > specification, > > > the drivers for which are available under drivers/pinctrl/intel. What you > > > are > > > looking for is located under PINCTRL_SUNRISEPOINT configuration option. > > > > Thanks for the info, it's often unclear where to look - when the hardware > > has > > a PCH and documentation that says it has GPIO, and there's an in-tree driver > > called gpio_pch, it's easy to fail to look in the right place :) > Thank you for the info, indeed. I'm going to give it a try. > Citing in-kernel documentation: > > --- 8< --- 8< 8< --- > > Electrical properties of the pin such as biasing and drive strength > may be placed at some pin-specific register in all cases or as part > of the GPIO register in case (B) especially. This doesn't mean that such > properties necessarily pertain to what the Linux kernel calls "GPIO". > Given the amount of related (and not so much) documentation, it's hard to miss. That's what this newsgroup for :) Thank you for helping! ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Mon, 17 Jun 2019 09:39 -07:00, Andy Shevchenko wrote: > > How come that this device is GPIO? > I mean what makes you, guys, to come to this conclusion? > Intel document 332996-002EN [1] chapter 28 says GPP_* groups are accessible through the PCH Sideband Interface, while 332690-004EN [2] defines P2SB at d31.f1 Obviously, I am wrong here. However, the question stands, is there linux kernel support for Intel PCH GPIO? [1] http://www.intel.cn/content/dam/www/public/us/en/documents/datasheets/6th-gen-core-pch-u-y-io-datasheet-vol-2.pdf [2] https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/100-series-chipset-datasheet-vol-1.pdf ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Sat, 15 Jun 2019 18:50 -07:00, Valdis Klētnieks wrote: > On Sat, 15 Jun 2019 12:38:34 -0700, "Alexander Ivanov" said: > > > This is fedora 25 running 4.8.6 kernel. > > It probably won't fix the problem, but you should upgrade if at all possible. > You're not getting any security patches for 25. 30 is the current release, > with 31 due out fairly soon. > I know. However, it isn't up to me. We have hundreds such units and I heard about plans to upgrade to 30 'soon'. I'm going to give it a try with 30 on my development board, just out of curiosity. For the problem at hand though, I'd likely have to find an external GPIO board that can generate an interrupt on GPIO pin toggle. Anyway, thanks for trying to help. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Sat, 15 Jun 2019 12:31 -07:00, Valdis Klētnieks wrote: > On Fri, 14 Jun 2019 15:40:59 -0700, "Alexander Ivanov" said: > > (Adding likely knowledgeable people to the recipients) > > Jean, Andy, Linus: The situation thus far: Alexander has a system with this > GPIO on it: > > > lspci -vvvnns 1f.1 > > 00:1f.1 Memory controller [0580]: Intel Corporation Device [8086:9d20] (rev > > 21) > > Subsystem: Gigabyte Technology Co., Ltd Device [1458:1000] > > Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- > > Stepping- SERR- FastB2B- DisINTx- > > Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- > SERR- > Latency: 0 > > Region 0: Memory at 7d00 (64-bit, non-prefetchable) [size=16M] > > The obvious first thing to try was: > > diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c > index 1d99293096f2..19884b5b2a74 100644 > --- a/drivers/gpio/gpio-pch.c > +++ b/drivers/gpio/gpio-pch.c > @@ -439,6 +439,7 @@ static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, > pch_gpio_suspend, pch_gpio_resume); > > static const struct pci_device_id pch_gpio_pcidev_id[] = { > { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) }, > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9d20) }, > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) }, > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) }, > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) }, > > and that died thusly when attempted to load: > > [ 105.965846] pci :00:1f.1: [8086:9d20] type 00 class 0x058000 > [ 105.965928] pci :00:1f.1: reg 0x10: [mem 0xfd00-0xfdff 64bit] > [ 105.967084] pci :00:1f.1: BAR 0: assigned [mem 0x7d00-0x7dff > 64bit] > [ 105.978037] pch_gpio :00:1f.1: pch_gpio_probe : pci_iomap FAILED > [ 105.978194] pch_gpio :00:1f.1: pch_gpio_probe Failed returns -12 > [ 105.978317] pch_gpio: probe of :00:1f.1 failed with error -12 > > So obviously an older kernel. Not sure what release Alexander is on, but > a 'git log' against this week's linux-next tree didn't show anything that was > an obvious fix for a similar problem. This is fedora 25 running 4.8.6 kernel. > > Any ideas? > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Fri, 14 Jun 2019 13:25 -07:00, Alexander Ivanov wrote: > > > On Fri, 14 Jun 2019 12:09 -07:00, Valdis Klētnieks > wrote: >> On Fri, 14 Jun 2019 12:01:28 -0700, you said: >> >> > > static const struct pci_device_id pch_gpio_pcidev_id[] = { >> > > { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) }, >> > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) }, >> > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) }, >> > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) }, >> > > { 0, } >> > > }; >> > > MODULE_DEVICE_TABLE(pci, pch_gpio_pcidev_id); >> >> > It is a PCI device with 8086/9d20 IDs. >> >> Give this patch a try, if it works I'll push it upstream for you... >> >> diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c >> index 1d99293096f2..19884b5b2a74 100644 >> --- a/drivers/gpio/gpio-pch.c >> +++ b/drivers/gpio/gpio-pch.c >> @@ -439,6 +439,7 @@ static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, >> pch_gpio_suspend, pch_gpio_resume); >> >> static const struct pci_device_id pch_gpio_pcidev_id[] = { >> { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) }, >> + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9d20) }, >> { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) }, >> { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) }, >> { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) }, >> > > > I did try this. It did not enumerate. > There is one little detail. This device is hidden by default in motherboard > FW. However, I manually un-hide it before trying to enumerate the device. > > gpio-pch driver's patched as you described, built out-of-tree and loaded. > Then, I un-hide the device and rescan the bus: > > # echo 1 > /sys/bus/pcie/rescan > > > > > On Fri, 14 Jun 2019 12:13 -07:00, Bjørn Mork wrote: > > "Valdis Klētnieks" writes: > > > > > Though I'm having a hard time aligning that with "D31:F2". Are you > > > confusing > > > a PCI address with a PCI ID, or is this on a non-PCI bus? > > > > "D31:F2" is device 31, function 2. We're used to see this as "1f.2". > > > > The question is really: Is there such a device in the system? And if so: > > What's the ID? That's easy to find out: > > > > lspci -vvvnns 0:1f.2 > > > > Device is indeed there: > lspci -vvvnns 1f.1 > 00:1f.1 Memory controller [0580]: Intel Corporation Device [8086:9d20] (rev > 21) > Subsystem: Gigabyte Technology Co., Ltd Device [1458:1000] > Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- > Stepping- SERR- FastB2B- DisINTx- > Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Latency: 0 > Region 0: Memory at 7d00 (64-bit, non-prefetchable) [size=16M] > > > ps. I misstyped device address in my original post, it is supposed to be > function 1 not 2: d31:f1. gpio-pch depends on X86_32 || MIPS || COMPILE_TEST config GPIO_PCH tristate "Intel EG20T PCH/LAPIS Semiconductor IOH(ML7223/ML7831) GPIO" depends on X86_32 || MIPS || COMPILE_TEST select GENERIC_IRQ_CHIP the platform at hand, is not X86_32 nor MIPS. It means gpi-pch requires CONFIG_COMPILE_TEST (to compile drivers which wont load). Sure enough, even when driver enumerates, it fails to map BAR: [ 105.965846] pci :00:1f.1: [8086:9d20] type 00 class 0x058000 [ 105.965928] pci :00:1f.1: reg 0x10: [mem 0xfd00-0xfdff 64bit] [ 105.967084] pci :00:1f.1: BAR 0: assigned [mem 0x7d00-0x7dff 64bit] [ 105.978037] pch_gpio :00:1f.1: pch_gpio_probe : pci_iomap FAILED [ 105.978194] pch_gpio :00:1f.1: pch_gpio_probe Failed returns -12 [ 105.978317] pch_gpio: probe of :00:1f.1 failed with error -12 Any suggestions on what driver (if any available) should be used instead? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
On Fri, 14 Jun 2019 12:09 -07:00, Valdis Klētnieks wrote: > On Fri, 14 Jun 2019 12:01:28 -0700, you said: > > > > static const struct pci_device_id pch_gpio_pcidev_id[] = { > > > { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) }, > > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) }, > > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) }, > > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) }, > > > { 0, } > > > }; > > > MODULE_DEVICE_TABLE(pci, pch_gpio_pcidev_id); > > > It is a PCI device with 8086/9d20 IDs. > > Give this patch a try, if it works I'll push it upstream for you... > > diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c > index 1d99293096f2..19884b5b2a74 100644 > --- a/drivers/gpio/gpio-pch.c > +++ b/drivers/gpio/gpio-pch.c > @@ -439,6 +439,7 @@ static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, > pch_gpio_suspend, pch_gpio_resume); > > static const struct pci_device_id pch_gpio_pcidev_id[] = { > { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) }, > + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9d20) }, > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) }, > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) }, > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) }, > I did try this. It did not enumerate. There is one little detail. This device is hidden by default in motherboard FW. However, I manually un-hide it before trying to enumerate the device. gpio-pch driver's patched as you described, built out-of-tree and loaded. Then, I un-hide the device and rescan the bus: # echo 1 > /sys/bus/pcie/rescan On Fri, 14 Jun 2019 12:13 -07:00, Bjørn Mork wrote: > "Valdis Klētnieks" writes: > > > Though I'm having a hard time aligning that with "D31:F2". Are you confusing > > a PCI address with a PCI ID, or is this on a non-PCI bus? > > "D31:F2" is device 31, function 2. We're used to see this as "1f.2". > > The question is really: Is there such a device in the system? And if so: > What's the ID? That's easy to find out: > > lspci -vvvnns 0:1f.2 > Device is indeed there: lspci -vvvnns 1f.1 00:1f.1 Memory controller [0580]: Intel Corporation Device [8086:9d20] (rev 21) Subsystem: Gigabyte Technology Co., Ltd Device [1458:1000] Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: GPIO Driver for Skylake-Y PCH
Valdis, Thanks for quick response! On Fri, 14 Jun 2019 11:46 -07:00, Valdis Klētnieks wrote: > On Fri, 14 Jun 2019 10:58:53 -0700, "Alexander Ivanov" said: > > > I have a hardware platform with Skylake i7-6500 CPU and Skylake-Y PCH > > southbridge, running 4.8.5 kernel fc25. The platform has 12 GPIO pins, > > however, > > none are available. gpio-pch driver does not support D31:F2 device that > > manages > > GPIO. > > > Am I missing something here? > > Well.. my copy of drivers/gpio/gpio-pch.c has this near line 440: > > static const struct pci_device_id pch_gpio_pcidev_id[] = { > { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) }, > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) }, > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) }, > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) }, > { 0, } > }; > MODULE_DEVICE_TABLE(pci, pch_gpio_pcidev_id); > > Though I'm having a hard time aligning that with "D31:F2". Are you confusing > a PCI address with a PCI ID, or is this on a non-PCI bus? No, I believe I am not. This borrowed from Intel doc (https://lab.whitequark.org/files/gpioke/Intel-332690-004EN.pdf, see Ch 2) It is a PCI device with 8086/9d20 IDs. --Alex ps. I apologize, I mistyped "D31:F2" it's supposed to be D31:F1. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
GPIO Driver for Skylake-Y PCH
Hi, I have a hardware platform with Skylake i7-6500 CPU and Skylake-Y PCH southbridge, running 4.8.5 kernel fc25. The platform has 12 GPIO pins, however, none are available. gpio-pch driver does not support D31:F2 device that manages GPIO. Am I missing something here? Cheers, --Alex ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Fwd: undefined reference to `ioctl_tty'
-- Forwarded message - From: Alexander Kapshuk Date: Wed, Mar 6, 2019 at 9:30 AM Subject: Re: undefined reference to `ioctl_tty' To: On Wed, Mar 6, 2019 at 9:00 AM Jeffrey Walton wrote: > > Hi Everyone, > > I'm working from http://man7.org/linux/man-pages/man4/tty_ioctl.4.html > . According to the man page: > >TIOCEXCL void > Put the terminal into exclusive mode. No further open(2) > operations on the terminal are permitted. (They fail with > EBUSY, except for a process with the CAP_SYS_ADMIN > capability.) > > The page goes on to say in the colophon it is part of the 4.16 kernel. > I am running on the 4.20 kernel: > > $ uname -a > Linux silo 4.20.13-200.fc29.x86_64 #1 ... GNU/Linux > > However: > > gcc -D_GNU_SOURCE -g2 -std=gnu99 test.c -o -lrt > test.c: In function ‘main’: > test.c:11:7: warning: implicit declaration of function ‘ioctl_tty’; > did you mean ‘ioctl’? [-Wimplicit-function-declaration] >if (ioctl_tty(1 /*STDOUT_FILENO*/, TIOCEXCL, NULL) == -1) { >^ >ioctl > /usr/bin/ld: /tmp/ccCNNyG3.o: in function `main': > /home/test/test.c:11: undefined reference to `ioctl_tty' > collect2: error: ld returned 1 exit status > > Search is producing a lot of non-relevant hits. > > Any ideas why I can't find ioctl_tty during link when using a 4.20 kernel? > > Thanks in advance. > > -- > > $ cat test.c > #include > #include > #include > #include > #include > #include > > int main(int argc, char* argv[]) > { > if (ioctl_tty(1 /*STDOUT_FILENO*/, TIOCEXCL, NULL) == -1) { > fprintf(stderr, "%s\n", strerror(errno)); > return 1; > } > return 0; > } > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies While the man page does refer to this function as ioctl_tty, the actual signature, as shown in the man page, is: int ioctl(int fd, int cmd, ...); Not ioctl_tty. The example section of the man pages gives this usage example: fd = open("/dev/ttyS0", O_RDONLY); ioctl(fd, TIOCMGET, &serial); Hope this helps. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Linux kernel mailing list filtering issues
On Fri, Jul 20, 2018 at 3:43 PM wrote: > > On 2018-07-19 23:55, Alexander Kapshuk wrote: > > On Thu, Jul 19, 2018 at 10:25 PM wrote: > >> > >> Hi all, I've been trying to post a bug report to the linux-usb mailing > >> list but keep getting trapped in the filters despite ensuring I'm > >> using > >> plaintext. > >> Heres what I get in the bounce back: > >> > >> The mail system > >> > >> : host vger.kernel.org[209.132.180.67] > >> said: > >> 550 > >> 5.7.1 Content-Policy accept-into-freezer-1 msg: Bayes Statistical > >> Bogofilter considers this message SPAM. BF: In case you > >> disagree, > >> send the ENTIRE message plus this error message to > >> ; > >> > >> I've sent the message to the postmaster but haven't heard anything. My > >> message got through to the maintainer, who has requested I fix my > >> message and get it on the mailing list proper but nothing I've tried > >> is > >> working. > >> > >> Heres part of the header from the source of my most recent message: > >> > >> MIME-Version: 1.0 > >> Content-Type: text/plain; charset=UTF-8; > >> format=flowed > >> Content-Transfer-Encoding: 8bit > >> > >> Any suggestions? Thanks > >> > >> ___ > >> Kernelnewbies mailing list > >> Kernelnewbies@kernelnewbies.org > >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > > > What email client did you use to send in your patch? > > I used thuderbird to post to the list. My issue seemed to be not having > the usb: dwc2: tags in the subject line, and my subject being too long. > Both apparently heavily weight the filter towards treating the message > as spam. I also removed anything in the debug information that resembled > a url or email address, which didn't help immediately but might have > helped weight it towards not spam after I did the above things. It > might be a good idea to have a list of suggestions like these on the > wiki. You will find kernel documentation [1] on preferred email clients and formats of interest. Among other things, the advise on the format of email messages is: Don't send patches with ``format=flowed``. This can cause unexpected and unwanted line breaks. My personal preference is the use of 'git send-email'. I've also found mutt to be compliant with the guidelines laid out in the reference doc. Hope this helps. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/Documentation/process/email-clients.rst?h=v4.17.8 ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Linux kernel mailing list filtering issues
On Thu, Jul 19, 2018 at 10:25 PM wrote: > > Hi all, I've been trying to post a bug report to the linux-usb mailing > list but keep getting trapped in the filters despite ensuring I'm using > plaintext. > Heres what I get in the bounce back: > > The mail system > > : host vger.kernel.org[209.132.180.67] said: > 550 > 5.7.1 Content-Policy accept-into-freezer-1 msg: Bayes Statistical > Bogofilter considers this message SPAM. BF: In case you > disagree, > send the ENTIRE message plus this error message to > ; > > I've sent the message to the postmaster but haven't heard anything. My > message got through to the maintainer, who has requested I fix my > message and get it on the mailing list proper but nothing I've tried is > working. > > Heres part of the header from the source of my most recent message: > > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8; > format=flowed > Content-Transfer-Encoding: 8bit > > Any suggestions? Thanks > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies What email client did you use to send in your patch? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Is there mailist about LSM
Thibaut, On Thu, 31 May 2018 23:11 +0200, Thibaut Sautereau wrote: > Hi Alexander, > > On Wed, May 30, 2018 at 03:10:37PM -0700, Alexander Ivanov wrote: > > I do no need blobs, as I said, it's stateless. > > The question was how to register a subset of hooks that may overlap > > with another module(s). > > I wrote two articles on my blog last year to sum up what I had learned > when digging into the LSM world in order to create one, as I had trouble > finding recent enough documentation. They might answer some of your > questions. > > Here's the link to the second one (which also points to the first): > https://thibaut.sautereau.fr/2017/06/02/linux-security-modules-part-2/ > > Of course, any questions or feedback are welcome ;) > Thanks, it's very helpful! > > Thibaut -- Alexander Ivanov amiva...@fastmail.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Is there mailist about LSM
On Thu, 31 May 2018 08:22 +0300, Ozgur Kara wrote: > > Hi all, > > @Valdis and @Ivanov you can see the new LSM list archive, Paul Moore helped. > Thanks Dear Paul. > > http://kernsec.org/pipermail/linux-security-module-archive/ > Thanks a lot, Ozgur and Paul! > Regards > > Ozgur > > 31.05.2018, 01:12, "Alexander Ivanov" : > > On Wed, 30 May 2018 14:26 -0400, valdis.kletni...@vt.edu wrote: > >> On Wed, 30 May 2018 11:13:31 -0700, Alexander Ivanov said: > >> > >> > > There's some support for one "large" LSM and a "trivial" one like > >> yama. > >> > > >> > What this some support would be then? > >> > >> Basically, there's a pointer for an LSM-private blob, and no support > >> for a chain of blobs. > > > > I do no need blobs, as I said, it's stateless. > > The question was how to register a subset of hooks that may overlap with > > another module(s). > > > >> > Suppose I have stateless LSM, don't really interested in using any > >> objects' blobs. > >> > >> Congrats. You just re-invented YAMA. :) > > > > Exactly! Isn't learn and re-use a good linux approach ;) > > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies -- Alexander Ivanov amiva...@fastmail.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Is there mailist about LSM
On Wed, 30 May 2018 14:26 -0400, valdis.kletni...@vt.edu wrote: > On Wed, 30 May 2018 11:13:31 -0700, Alexander Ivanov said: > > > > There's some support for one "large" LSM and a "trivial" one like yama. > > > > What this some support would be then? > > Basically, there's a pointer for an LSM-private blob, and no support > for a chain of blobs. > I do no need blobs, as I said, it's stateless. The question was how to register a subset of hooks that may overlap with another module(s). > > Suppose I have stateless LSM, don't really interested in using any objects' > > blobs. > > Congrats. You just re-invented YAMA. :) Exactly! Isn't learn and re-use a good linux approach ;) ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Is there mailist about LSM
On Wed, 30 May 2018 20:12 +0200, Greg KH wrote: > On Wed, May 30, 2018 at 10:37:25AM -0700, Alexander Ivanov wrote: > > On Wed, 30 May 2018 13:25 -0400, valdis.kletni...@vt.edu wrote: > > > What question do you have about it? > > > > There are a couple, actually :) > > First, theoretical, I suppose: what were the reasons to effectively > > disable dynamic loading of LSM ? > > This was discussed loads when LSM was first created. I'll leave this as > an exercise for the reader, how would you properly unload a LSM? Think > about what a LSM does to lots and lots of different objects in the > kernel... > > > Second, is there a way for two or more LSMs to co-exist? After > > inspecting security_module_enable() and register_security(), it > > doesn't seem possible, however yama does attempt to load itself? Am I > > missing something? > > Again, this is discussed all the time. Search for "stackable LSM" and > you should find lots of threads about the problems involved, how people > are considering solving them, and what workarounds are currently in > place to allow some LSM to do this today. > > I think google is your friend here, read the mailing list archives, it > has all of this information there already. > Thanks, Greg. That what my original question was about, proper mailing list. It is indeed very useful to learn an evolution of the framework, there some constraints that make some of the knowledge irrelevant. Say, I have to develop 'minor' LSM for certain kernel version. thx! ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Is there mailist about LSM
On Wed, 30 May 2018 14:05 -0400, valdis.kletni...@vt.edu wrote: > On Wed, 30 May 2018 10:37:25 -0700, you said: > > > First, theoretical, I suppose: what were the reasons to effectively disable > > dynamic loading of LSM ? > > Because that implies the system was up without the LSM loaded - at which > point > somebody can have tampered with whatever labelling the LSM uses. So we > insist that the LSM be brought online very early during the boot > process, to make > sure that the LSM has a chance to stop any unauthorized relabeling. > Understood. It thus implies, custom kernel build, right? > > Second, is there a way for two or more LSMs to co-exist? After inspecting > > security_module_enable() and register_security(), it doesn't seem possible, > > however yama does attempt to load itself? Am I missing something? > > There's some support for one "large" LSM and a "trivial" one like yama. What this some support would be then? Suppose I have stateless LSM, don't really interested in using any objects' blobs. What would be a proper way to register a hook or two then? > There's very real and nasty interactions if you try to run (for instance) > SELinux and AppArmor at the same time. The composition of multiple > MAC systems is fraught with danger (go back and look at how long it took > us to get file capabilities to work right...) thx! ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Is there mailist about LSM
On Wed, 30 May 2018 20:54 +0300, Ozgur Kara wrote: > 30.05.2018, 20:16, "Alexander Ivanov" : > > Hi All, > > Hello > > > What would be right place to ask questions about LSM? > > I think can ask your questions to LSM kernel e-mail list: > > http://vger.kernel.org/vger-lists.html#linux-security-module > Isn't this list specific to fedora? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Is there mailist about LSM
On Wed, 30 May 2018 13:25 -0400, valdis.kletni...@vt.edu wrote: > On Wed, 30 May 2018 10:16:13 -0700, Alexander Ivanov said: > > Hi All, > > What would be right place to ask questions about LSM? > > linux-security-module > > is where that development was done, but that list was last active in > May 2016 or so. > > linux-ker...@vger.kernel.org would be another place to try. Will try these, thanks! > > What question do you have about it? There are a couple, actually :) First, theoretical, I suppose: what were the reasons to effectively disable dynamic loading of LSM ? Second, is there a way for two or more LSMs to co-exist? After inspecting security_module_enable() and register_security(), it doesn't seem possible, however yama does attempt to load itself? Am I missing something? thx! > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > Email had 1 attachment: > + Attachment1.2 > 1k (application/pgp-signature) -- Alexander Ivanov amiva...@fastmail.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Is there mailist about LSM
Hi All, What would be right place to ask questions about LSM? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: when to use make olddefconfig
On Sun, Apr 22, 2018 at 9:19 PM, Sumit Kumar wrote: > Hi, > > I was going through this link : > https://kernelnewbies.org/OutreachyfirstpatchSetup , and came across the > make olddefconfig cmd. The explanation on the web page is very confusing. > Can anyone please explain in simpler way when "make olddefconfig" cmd is > intended to be used ? The webpage says this : If you need to make any > changes to your configuration, run this command to silently update any new > configuration values to their default. > > > -- > > Thanks and Regards, > > Sumit > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies make help | sed '/olddefconfig/!d;N' olddefconfig- Same as oldconfig but sets new symbols to their default value without prompting ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Eudyptual Challenge website and email service down?
On Thu, Mar 15, 2018 at 10:41 AM, Alexander Kapshuk wrote: > On Thu, Mar 15, 2018 at 10:34 AM, Himanshu Chauhan > wrote: >> >> >> On 15-Mar-2018 1:48 PM, "Alexander Kapshuk" >> wrote: >> >> Both the Eudyptula Challenge website[1] and the email service[2] seem >> to be down. >> [1] http://eudyptula-challenge.org/ >> [2] lit...@eudyptula-challenge.org >> >> The delayed email delivery report I got from Gmail says: >> Final-Recipient: rfc822; lit...@eudyptula-challenge.org >> Action: delayed >> Status: 4.4.1 >> Diagnostic-Code: smtp; The recipient server did not accept our >> requests to connect. Learn more at >> https://support.google.com/mail/answer/7720 >> [mail.eudyptula-challenge.org. 2600:3c01::f03c:91ff:fe6e:f4bf: timed out] >> [mail.eudyptula-challenge.org. 23.239.3.192: timed out] >> Last-Attempt-Date: Wed, 14 Mar 2018 15:24:21 -0700 (PDT) >> Will-Retry-Until: Fri, 16 Mar 2018 13:18:11 -0700 (PDT) >> >> >> Not sure where else to lodge this report. >> >> If the people behind the challenge are subscribed to this mailing >> list, their response would be much appreciated. >> >> Alexander Kapshuk >> >> ___ >> Kernelnewbies mailing list >> Kernelnewbies@kernelnewbies.org >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> >> >> Eudyptula is permanently down. > > Yes, the actual challenge has been put on hold and not taking in new > participants, but they have been still responding to the current > participants' emails. > This looks like their server could be down for maintenance, or something. Both the website as well as the email service seem to be up and running now. Thanks for fixing it. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Eudyptual Challenge website and email service down?
On Thu, Mar 15, 2018 at 10:34 AM, Himanshu Chauhan wrote: > > > On 15-Mar-2018 1:48 PM, "Alexander Kapshuk" > wrote: > > Both the Eudyptula Challenge website[1] and the email service[2] seem > to be down. > [1] http://eudyptula-challenge.org/ > [2] lit...@eudyptula-challenge.org > > The delayed email delivery report I got from Gmail says: > Final-Recipient: rfc822; lit...@eudyptula-challenge.org > Action: delayed > Status: 4.4.1 > Diagnostic-Code: smtp; The recipient server did not accept our > requests to connect. Learn more at > https://support.google.com/mail/answer/7720 > [mail.eudyptula-challenge.org. 2600:3c01::f03c:91ff:fe6e:f4bf: timed out] > [mail.eudyptula-challenge.org. 23.239.3.192: timed out] > Last-Attempt-Date: Wed, 14 Mar 2018 15:24:21 -0700 (PDT) > Will-Retry-Until: Fri, 16 Mar 2018 13:18:11 -0700 (PDT) > > > Not sure where else to lodge this report. > > If the people behind the challenge are subscribed to this mailing > list, their response would be much appreciated. > > Alexander Kapshuk > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > > Eudyptula is permanently down. Yes, the actual challenge has been put on hold and not taking in new participants, but they have been still responding to the current participants' emails. This looks like their server could be down for maintenance, or something. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Eudyptual Challenge website and email service down?
Both the Eudyptula Challenge website[1] and the email service[2] seem to be down. [1] http://eudyptula-challenge.org/ [2] lit...@eudyptula-challenge.org The delayed email delivery report I got from Gmail says: Final-Recipient: rfc822; lit...@eudyptula-challenge.org Action: delayed Status: 4.4.1 Diagnostic-Code: smtp; The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720 [mail.eudyptula-challenge.org. 2600:3c01::f03c:91ff:fe6e:f4bf: timed out] [mail.eudyptula-challenge.org. 23.239.3.192: timed out] Last-Attempt-Date: Wed, 14 Mar 2018 15:24:21 -0700 (PDT) Will-Retry-Until: Fri, 16 Mar 2018 13:18:11 -0700 (PDT) Not sure where else to lodge this report. If the people behind the challenge are subscribed to this mailing list, their response would be much appreciated. Alexander Kapshuk ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: udev rule, when RUN script is invoked?
On Thu, 22 Feb 2018 18:05 +0100, Greg KH wrote: > On Thu, Feb 22, 2018 at 08:44:20AM -0800, Alexander Ivanov wrote: > > Greg, > > > > On Thu, 22 Feb 2018 08:56 +0100, Greg KH wrote: > > > On Wed, Feb 21, 2018 at 03:36:44PM -0800, Alexander Ivanov wrote: > > > > Hi All, > > > > > > > > I have udev rule defined on a > > > > > > > > DEVPATH="/dev/mydev0",..., ACTION="remove", ..., RUN+="/path/to/script" > > > > > > > > When does /path/to/script is executed in respect to module's remove() > > > > and exit() ? > > > > > > A module's lifecycle is different from a device's lifecycle, right? > > > > > Sure. However, in this particular case, only one device for the module > > can exist and user-land calls insmod/rmmod, Thus, on rmmod both > > device's remove() and module's exit() are getting called. > > What type of crazy "device" is this? Have a pointer to the source code > anywhere? > Why crazy? :) This is char device that is created by pcie driver. PCIe device has a channel to dump some debug information over to the host. This char device is an interface to that debug data. It's just a little addition to main pcie driver to help hw/fw development > > > There is no remove() call for a module, only for a driver subsystem, so > > > be careful as to what exactly you are referring to here. > > > > > > Hopefully, all devices "owned" by the module should be removed from the > > > kernel before the module is unloaded, so that should help you out here. > > > > > > Also note that modules are never automatically unloaded, so that is > > > never a normal operation in the system. > > > > > > what exactly are you trying to do here with your udev script? > > > > On action=="remove", I'd like to call device's close(), it was open()ed by > > action=="add" > > It looks like device is removed before RUN gets a chance to execute.. > > Of course it is, because when the module is removed, you already removed > the device, right? > > > Basically, I need to start reading from device as soon as it appears > > in the system, and stop it right before it get removed. > > "right before" is hard if you don't tell your userspace program you are > going to remove the module :) > > Your program should be able to handle the device node being removed > underneath it anyway, there's no need to have to "stop" the program, it > can easily detect if the device goes away. > Sure custom code can do it, no problem. I though I could just use simple cat /dev/dbg0 > file, and then kill it . anyway, thank you for explanation. --Alex > So there's no real need for the udev rule here. > > hope this helps, > > greg k-h > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies -- Alexander Ivanov amiva...@fastmail.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: udev rule, when RUN script is invoked?
Greg, On Thu, 22 Feb 2018 08:56 +0100, Greg KH wrote: > On Wed, Feb 21, 2018 at 03:36:44PM -0800, Alexander Ivanov wrote: > > Hi All, > > > > I have udev rule defined on a > > > > DEVPATH="/dev/mydev0",..., ACTION="remove", ..., RUN+="/path/to/script" > > > > When does /path/to/script is executed in respect to module's remove() and > > exit() ? > > A module's lifecycle is different from a device's lifecycle, right? > Sure. However, in this particular case, only one device for the module can exist and user-land calls insmod/rmmod, Thus, on rmmod both device's remove() and module's exit() are getting called. > There is no remove() call for a module, only for a driver subsystem, so > be careful as to what exactly you are referring to here. > > Hopefully, all devices "owned" by the module should be removed from the > kernel before the module is unloaded, so that should help you out here. > > Also note that modules are never automatically unloaded, so that is > never a normal operation in the system. > > what exactly are you trying to do here with your udev script? On action=="remove", I'd like to call device's close(), it was open()ed by action=="add" It looks like device is removed before RUN gets a chance to execute.. Basically, I need to start reading from device as soon as it appears in the system, and stop it right before it get removed. thanks, --Alex > > thanks, > > greg k-h > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies -- Alexander Ivanov amiva...@fastmail.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
udev rule, when RUN script is invoked?
Hi All, I have udev rule defined on a DEVPATH="/dev/mydev0",..., ACTION="remove", ..., RUN+="/path/to/script" When does /path/to/script is executed in respect to module's remove() and exit() ? Thx, -- Alex Ivanov amiva...@fastmail.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: sched_child_runs_first doesn't work
If my understanding of what Linus says in the post referenced below is correct, there's never a guarantee which process would run first, parent or child. http://yarchive.net/comp/linux/child-runs-first.html vfork(), on the other hand, is said in the post to always run the child process first. See below for an example. #include #include #include #include int main(void) { struct timeval tv; switch(vfork()) { case -1: perror("vfork failed\n"); exit(-1); case 0: if (gettimeofday(&tv, NULL) == 0) printf("child time sec %ld, usec %ld\n", tv.tv_sec, tv.tv_usec); exit(0); default: if (gettimeofday(&tv, NULL) == 0) printf("parent time sec %ld, usec %ld\n", tv.tv_sec, tv.tv_usec); } return 0; } Sample run: ./gettimeofday child time sec 1512719270, usec 716672 parent time sec 1512719270, usec 716748 ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Kernel Compiling Issue
On Tue, Aug 29, 2017 at 6:52 AM, Herb Garcia wrote: > I recently learned how to compile the kernel on my Debian PC. What I'm > running into is the default kernel runs well with no issues. With that said, > when I will run menu oldconfig. To keep the current settings. When Alall said > and done. When I reboot my PC. I get this error: failed to. Start load/save > screen backlight brightness > > Any suggestions appreciated > > ~H.P. Garcia > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Linux Kernel in a Nutshell [1] is a good reference on how to configure and build custom kernels. The Debian Administrator's Handbook offers instructions on how to build a custom kernel the Debian way [2]. [1] http://www.kroah.com/lkn/ [2] https://debian-handbook.info/browse/stable/sect.kernel-compilation.html ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Eudyptula Challenge scripts not responding?
On Thu, Jul 6, 2017 at 4:04 PM, Laurence Rochfort wrote: > Hi all, > > The Eudyptula Challenge scripts seem to not be responding these past few > days. > > if anybody here is involved behind the scenes, would you please take a look? > > Cheers, > Laurence. > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > The response times vary between hearing from them the same day to up to a few weeks. They will get back to you eventually. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Qemu+busybox for kernel development
On Wed, Jun 28, 2017 at 10:48 PM, Shahbaz khan wrote: > Hi Alexander, > > On Wed, Jun 28, 2017 at 1:46 PM, Alexander Kapshuk > wrote: >> >> I am trying to setup a build environment where I can run the kernel and >> see how the changes I have made to the kernel source work. >> My understanding, based on googling, is that it is common practice in the >> kernel community to use a virtualised environment for that purpose. >> What I have done so far is create a ramfs that is built into the kernel, >> as described here [1] and here [2]. >> >> [1] https://landley.net/writing/rootfs-howto.html >> [2] >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/early-userspace/README?h=v4.12-rc7 >> >> a). I have generated a minimal initramfs_list file: >> scripts/gen_initramfs_list.sh -d >usr/initramfs_list >> Which looks like this: >> # This is a very simple, default initramfs >> >> dir /dev 0755 0 0 >> nod /dev/console 0600 0 0 c 5 1 >> dir /root 0700 0 0 >> # file /kinit usr/kinit/kinit 0755 0 0 >> # slink /init kinit 0755 0 0 >> slink /bin/sh busybox 777 0 0 >> file /init /bin/busybox 755 0 0 >> >> b). Set CONFIG_INITRAMFS_SOURCE: >> CONFIG_INITRAMFS_SOURCE="/home/sasha/linux/usr/initramfs_list" >> >> c). And had the kernel generate the initramfs image: >> make >> ... >> GEN usr/initramfs_data.cpio.gz >> CHK include/generated/compile.h >> AS usr/initramfs_data.o >> LD usr/built-in.o >> ... >> >> When I run the kernel in qemu I get an error message which complains about >> /etc/init.d/rcS missing. > > > Did you check initramfs for rc.S script? > > The kernel configuration, busybox configuration and the layout of initramfs > (which should be /home/sasha/linux/usr/initramfs_list) should be consistent. > If the kernel is asking for it then it is not consistent. > >> >> The posts online seem to suggest that this has got to do with the busybox >> configuration. >> So far, I have not been able to get my head around this problem. >> Any points or suggestions would be much appreciated. >> >> Alexander Kapshuk. >> >> >> ___ >> Kernelnewbies mailing list >> Kernelnewbies@kernelnewbies.org >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> > > > Thank you. > Shahbaz Khan Apologies for the delay in replying. Thanks very much for all of your responses. I'll give them all a try. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Qemu+busybox for kernel development
I am trying to setup a build environment where I can run the kernel and see how the changes I have made to the kernel source work. My understanding, based on googling, is that it is common practice in the kernel community to use a virtualised environment for that purpose. What I have done so far is create a ramfs that is built into the kernel, as described here [1] and here [2]. [1] https://landley.net/writing/rootfs-howto.html [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/early-userspace/README?h=v4.12-rc7 a). I have generated a minimal initramfs_list file: scripts/gen_initramfs_list.sh -d >usr/initramfs_list Which looks like this: # This is a very simple, default initramfs dir /dev 0755 0 0 nod /dev/console 0600 0 0 c 5 1 dir /root 0700 0 0 # file /kinit usr/kinit/kinit 0755 0 0 # slink /init kinit 0755 0 0 slink /bin/sh busybox 777 0 0 file /init /bin/busybox 755 0 0 b). Set CONFIG_INITRAMFS_SOURCE: CONFIG_INITRAMFS_SOURCE="/home/sasha/linux/usr/initramfs_list" c). And had the kernel generate the initramfs image: make ... GEN usr/initramfs_data.cpio.gz CHK include/generated/compile.h AS usr/initramfs_data.o LD usr/built-in.o ... When I run the kernel in qemu I get an error message which complains about /etc/init.d/rcS missing. The posts online seem to suggest that this has got to do with the busybox configuration. So far, I have not been able to get my head around this problem. Any points or suggestions would be much appreciated. Alexander Kapshuk. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Fwd: Importance of kobject
-- Forwarded message -- From: Alexander Kapshuk Date: Wed, May 17, 2017 at 10:20 AM Subject: Re: Importance of kobject To: Madhu K On Wed, May 17, 2017 at 10:08 AM, Madhu K wrote: > Hi All, > > I am kernel newbie, I want to know the importance of kobject, can anybody > explain the importance of kobject with an example. > > Thanks in advance. > Madhu > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > Kobjects play an essential role in the Device Model. The documentation below may be a good starting point in learning about kobjects: https://lwn.net/images/pdf/LDD3/ch14.pdf https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/kobject.txt?h=v4.12-rc1 ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: What is the fastest way to build and boot a kernel
On Thu, Apr 20, 2017 at 7:20 PM, Code Soldier1 wrote: > On Thu, Apr 20, 2017 at 1:21 AM, Sébastien Masson > wrote: >> >> On 2017-04-19 20:26, Code Soldier1 wrote: >>> >>> On Wed, Apr 19, 2017 at 3:32 AM, Tobin C. Harding wrote: On Tue, Apr 18, 2017 at 08:59:36AM -0700, Code Soldier1 wrote: [snip] Why the moniker? >>> >>> >>> Why not ? unlike most people today I value my privacy. >> >> >> Hi! >> >> In my opinion, the point is not really about privacy. Although, I >> understand you concern. >> >> As a kernel developer, the source code you will write will be subject to >> copyright matters and, if you want to contribute, you will have to give your >> agreement to this. >> This is only possible using your real name. >> >> I am inviting you to read: Documentation/process/submitting-patches.rst in >> this regard. >> >> Of course, as long as you do not submit source code, it does not really >> matter. It may be more a question of "consistency". >> >> BR, >> Sebastien. > > I completely agree with you. If I decide to submit code and there is a > requirement, I will have to make a choice. BTW how would anyone verify > if I am really Joe Smith and I have not just created an email account > ? > > I just looked at the kernel that I am working with and it does not > have the file you pointed out to me. I read the first file and it does > not say anything about username neither did anyone objected when I > posted on netdev. > > ubuntu-server:~/linux/linux-stable-v4.9.9/Documentation$ find . -name > \*patches\* -print > ./hwmon/submitting-patches > ./applying-patches.txt > ./devicetree/bindings/submitting-patches.txt > > > > > -- > CS1 > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/plain/Documentation/SubmittingPatches?id=refs/tags/v4.9.23 11) Sign your work -- To improve tracking of who did what, especially with patches that can percolate to their final resting place in the kernel through several layers of maintainers, we've introduced a "sign-off" procedure on patches that are being emailed around. The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below: Developer's Certificate of Origin 1.1 ^ By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. then you just add a line saying:: Signed-off-by: Random J Developer using your real name (sorry, no pseudonyms or anonymous contributions.) ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Error while sending a mail from mutt
On Wed, Mar 29, 2017 at 10:32 PM, AYAN KUMAR HALDER wrote: > Hi, > > I am trying to send a mail using mutt. I am getting the error as follows :- > > SMTP session failed: 501 5.5.4 > > I understand the error meant that a valid mail transaction protocol > was used with invalid arguments. Please let me know how do I debug > this issue further. > > Regards, > Ayan Kumar Halder > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies I've set up mutt to use Gmail using the instructions given here: https://dev.mutt.org/trac/wiki/UseCases/Gmail https://wiki.archlinux.org/index.php/mutt#Summary Hope this helps. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: How do I know if my patch was accepted?
On Tue, Mar 21, 2017 at 5:26 PM, Prasant J wrote: > Hi, > > I was able to send a tiny coding style error correction patch to the > kernel mailing list. > > How do I find out whether my patch was accepted or not? > > How do I find out subsystem maintainers git tree for my patch (patch > related to drivers/staging/vt6656/ )? > > > Regards, Pj > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies If your patch gets accepted, you will be notified via email. You will also be told in the email which tree your patch got accepted into. Be patient. Maintainers are busy. Give it a week or two, and if you don't hear from them by then, send them a friendly reminder. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in First-Patch-Tutorial
On Sun, Mar 19, 2017 at 10:53 AM, SIMRAN SINGHAL wrote: > # modinfo iio_dummy_evgen.ko > filename: > /home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko > license:GPL v2 > description:IIO dummy driver > author: Jonathan Cameron > srcversion: A8AC238EC07833E018CAF7B > depends:industrialio > intree: Y > vermagic: 4.11.0-rc1+ SMP mod_unload modversions > > > $ uname -r > 4.10.0-rc3+ > > So, this shows that I need to compile module iio_dummy_evgen.ko for > kernel version 4.11.0-rc1, so for this I need to build system and > source tree for this version. > > So, I am trying this:- > make -C /lib/modules/4.11.0-rc1+/build M=drivers/iio/dummy/ > iio_dummy_evgen.ko > > But I don't know why I am getting this error:- > make: Entering directory '/home/simran/git/kernels/staging' > make[1]: *** No rule to make target 'iio_dummy_evgen.o'. Stop. > Makefile:1664: recipe for target 'iio_dummy_evgen.ko' failed > make: *** [iio_dummy_evgen.ko] Error 2 > make: Leaving directory '/home/simran/git/kernels/staging' > > > On Tue, Mar 14, 2017 at 12:19 AM, wrote: >> On Mon, 13 Mar 2017 15:38:07 +0530, SIMRAN SINGHAL said: >> >>> >> # modinfo iio_dummy_evgen.ko >>> >> filename: >> >>> >> vermagic: 4.11.0-rc1+ SMP mod_unload modversions >>> >> >>> >> >>> >> $ uname -r >>> >> 4.10.0-rc3+ >> >>> Greg, I got that I have to build the module against the kernel I am using. >>> But, How can I do this? >> >> You can do this in two different ways: >> >> 1) You're running a 4.10.0-rc3+ kernel. Get the matching 4.10.0-rc3+ source >> tree and build the module against that. >> >> 2) You built the module from a 4.11.0-rc1+ tree. Build a kernel from that >> tree, >> boot that, and then try to load the module. >> >> You're running 4.10.0-rc3+. Your module is 4.11.0-rc1+. The command line you supplied shows you attempting to recompile your module for 4.11.0-rc1+. Your module is already 4.11.0-rc1+. As has been pointed out before, you need to either: (a). recompile your module for 4.10.0-rc3+. (b). or, install and boot into kernel 4.11.0-rc1+, and then try loading your module. As a side note, what kernel tree are you developing your driver against? The location of your staging drivers directory seems different from Linus' tree: ls -ld torvalds/drivers/staging/iio/ drwxr-xr-x 14 sasha sasha 4096 Feb 13 21:24 torvalds/drivers/staging/iio/ Finally, please do not top-post. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: pr_debug
On Wed, Mar 15, 2017 at 11:15 PM, Tobin C. Harding wrote: > On Wed, Mar 15, 2017 at 12:12:48PM +0100, Bjørn Mork wrote: >> Alexander Kapshuk writes: >> >> >>> On Wed, Mar 15, 2017 at 10:31 AM, Tobin C. Harding wrote: >> >>> > why does calling pr_debug() with more than one argument cause a sparse >> >>> > warning? >> >>> > >> >>> > drivers/mmc/core/sdio_io.c:70:9: error: unknown field name in >> >>> > initializer >> >>> > >> >>> > sdio_io.c:70: >> >>> > pr_debug("SDIO: Enabling device %s...\n", sdio_func_id(func)); >> .. >> > 'sdio_func_id()' is a macro defined here: >> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/linux/mmc/sdio_func.h?id=refs/tags/v4.11-rc2 >> > #define sdio_func_id(f) (dev_name(&(f)->dev)) >> >> >> So the "func" in that debug call contains a 'struct device'. Any >> reason why the pr_debug() shouldn't be converted to something like >> >> dev_dbg(&func->dev, "SDIO: Enabling device...\n"); > > Good point Bjørn, thanks. And thank you Alexander for your input. I > fear I may have sent you both on a wild goose chase with the example > that I chose. pr_debug() causes a sparse warning in many instances > when the format string includes format specifiers. > > /* this is fine */ > pr_debug("some info string"); > > /* this often causes Sparse warning */ > pr_debug("string with specifier: %d", foo); > > A simple example can be seen by adding this function > > void foo(const char *baz) > { > pr_debug("cause Sparse warning - %s\n", baz); > } > > To a random driver, and running `make C=2 M=drivers/staging/ks7010` > > drivers/staging/ks7010/ks_hostif.c:2702:9: error: unknown field name in > initializer > > For more examples from the kernel tree, running: > $ make -j9 C=2 M=drivers/staging 2>sparse.out > > gives many such cases, for example: > > drivers/staging/fbtft/fbtft-core.c:472:17: error: unknown field name in > initialize > drivers/staging/media/bcm2048/radio-bcm2048.c:2596:17: error: unknown field > name in initializer > drivers/staging/dgnc/dgnc_tty.c:1274:17: error: unknown field name in > initializer > > Also dev_debug causes the same sparse warning at times, for example: > > drivers/staging/comedi/comedi_fops.c:352:17: error: unknown field name in > initialize > > if (s->busy) { > dev_dbg(dev->class_dev, > "subdevice is busy, cannot resize buffer\n"); > return -EBUSY; > } > > And 2 more example instances of dev_debug: > drivers/staging/comedi/drivers/das16.c:578:25: error: unknown field name in > initialize > drivers/staging/dgnc/dgnc_tty.c:1274:17: error: unknown field name in > initializer > > thanks, > Tobin. The pr_debug() manpage, https://www.kernel.org/doc/local/pr_debug.txt, states that: Some files call pr_debug(), which is ordinarily an empty macro that discards its arguments at compile time. To enable debugging output, build the appropriate file with -DDEBUG by adding CFLAGS_[filename].o := -DDEBUG to the makefile. You did not mention whether you have compiling those modules with the DEBUG flag enabled, so, perhaps if you didn't, that could be the reason why you've been getting those errors. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: pr_debug
On Wed, Mar 15, 2017 at 12:40 PM, Tobin C. Harding wrote: > On Wed, Mar 15, 2017 at 12:01:39PM +0200, Alexander Kapshuk wrote: >> On Wed, Mar 15, 2017 at 10:31 AM, Tobin C. Harding wrote: >> > why does calling pr_debug() with more than one argument cause a sparse >> > warning? >> > >> > drivers/mmc/core/sdio_io.c:70:9: error: unknown field name in initializer >> > >> > sdio_io.c:70: >> > pr_debug("SDIO: Enabling device %s...\n", sdio_func_id(func)); >> > >> > What can we do about this? >> > >> > thanks, >> > Tobin. >> > >> > ___ >> > Kernelnewbies mailing list >> > Kernelnewbies@kernelnewbies.org >> > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> >> What is the version of the sources you are using? > > I'm usually working of gregKH's staging tree using branch staging-next > and/or staging-testing > > thanks, > Tobin. 'sdio_func_id()' is a macro defined here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/linux/mmc/sdio_func.h?id=refs/tags/v4.11-rc2 #define sdio_func_id(f) (dev_name(&(f)->dev)) The 'func' parameter passed into 'sdio_func_id()' is a pointer to 'struct device dev', which is a member of 'struct sdio_func' defined here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/linux/mmc/sdio_func.h?id=refs/tags/v4.11-rc2 Based on my understanding of the error message you got, the error must lie in code that initialises 'func' to a field name of a struct that isn't known at compile time. At this stage, I'm not sure how to identify the code where the faulty initialisation takes place. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: pr_debug
On Wed, Mar 15, 2017 at 10:31 AM, Tobin C. Harding wrote: > why does calling pr_debug() with more than one argument cause a sparse > warning? > > drivers/mmc/core/sdio_io.c:70:9: error: unknown field name in initializer > > sdio_io.c:70: > pr_debug("SDIO: Enabling device %s...\n", sdio_func_id(func)); > > What can we do about this? > > thanks, > Tobin. > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies What is the version of the sources you are using? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in First-Patch-Tutorial
On Mon, Mar 13, 2017 at 12:08 PM, SIMRAN SINGHAL wrote: > On Mon, Mar 13, 2017 at 1:05 PM, Greg KH wrote: >> On Mon, Mar 13, 2017 at 11:39:36AM +0530, SIMRAN SINGHAL wrote: >>> On Mon, Mar 13, 2017 at 10:42 AM, Alexander Kapshuk >>> wrote: >>> > On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL >>> > wrote: >>> >> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk >>> >> wrote: >>> >>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL >>> >>> wrote: >>> >>>> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk >>> >>>> wrote: >>> >>>>> On Sun, Mar 12, 2017 at 5:34 PM, wrote: >>> >>>>>> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said: >>> >>>>>> >>> >>>>>>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko, >>> >>>>>>> something of your own making, as I'm not seeing them in the kernel >>> >>>>>>> source tree? >>> >>>>>>> >>> >>>>>>> The 'modules_install' make target installs drivers that have been >>> >>>>>>> compiled as modules as opposed to those compiled into the kernel, >>> >>>>>>> into >>> >>>>>>> /lib/modules/`uname -r`. For your own modules added to the kernel >>> >>>>>>> source tree, or built out-of-tree, that would involve putting >>> >>>>>>> appropriate entries into Kconfig and/or Makefiles. >>> >>>>>>> >>> >>>>>>> Modeprobe expects your module to be found in /lib/modules/`uname >>> >>>>>>> -r`. >>> >>>>>>> Otherwise, your module won't get loaded. >>> >>>>>> >>> >>>>>> One other thing to remember is that although 'make modules_install' >>> >>>>>> will >>> >>>>>> take all the .ko files from in-tree modules and put them in their >>> >>>>>> proper >>> >>>>>> place in /lib/modules/`uname-r` and then run 'depmod', many >>> >>>>>> out-of-tree >>> >>>>>> Makefiles manage to forget to do that last step. >>> >>>>>> >>> >>>>>> modprobe is a wrapper around insmod - and the file produced by >>> >>>>>> 'depmod' >>> >>>>>> are what the wrapper uses to find the module. >>> >>>>> >>> >>>>> Thanks for elaborating on that. >>> >>>> >>> >>>> Still not working >>> >>>> >>> >>>> First I executed following commands:- >>> >>>> >>> >>>> $ make drivers/iio/dummy/iio_dummy_evgen.ko >>> >>>> $ make drivers/iio/dummy/iio_dummy.ko >>> >>>> >>> >>>> Above commands executed successfully >>> >>>> >>> >>>> Then I run following command: >>> >>>> $ insmod iio_dummy_evgen.ko >>> >>>> >>> >>>> Getting following error: >>> >>>> insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file >>> >>>> or directory >>> >>>> >>> >>>> And, then I try executing them from driver/staging/dummy and then I >>> >>>> got this error: >>> >>>> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation >>> >>>> not permitted >>> >>> >>> >>> You have to run insmod as user root. Either specify the full path to >>> >>> your module, or cd into the directory where the module is and run >>> >>> insmod from there. >>> >> >>> >> I tried this before also but as you said I tried it again: >>> >> # insmod iio_dummy_evgen.ko >>> >> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid >>> >> module format >>> >> >>> >> Now, I am getting this error. >>> > >>> > Sounds like your kernel module has been compiled for kernel sources >>> > whose version is different to the version of the kernel you are trying >>> > to load your module into. >>> > >>> > See http://www.tldp.org/LDP/lkmpg/2.6/html/x380.html for details. >>> > >>> > In other words, the version output by 'uname -r' must match the >>> > version output by 'modinfo iio_dummy_evgen.ko | grep vermagic'. >>> >>> Hi, >>> >>> The problem is same you got, I have different versions of uname-r and the >>> version output I got through vermagic. >>> >>> # modinfo iio_dummy_evgen.ko >>> filename: >>> /home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko >>> license:GPL v2 >>> description:IIO dummy driver >>> author: Jonathan Cameron >>> srcversion: A8AC238EC07833E018CAF7B >>> depends:industrialio >>> intree: Y >>> vermagic: 4.11.0-rc1+ SMP mod_unload modversions >>> >>> >>> $ uname -r >>> 4.10.0-rc3+ >>> >>> How to deal with this? >> >> You did look in the kernel log when modprobe or insmod failed, right? >> It should tell you what went wrong. >> >> As others pointed out, you need to build your module against the kernel >> you are running. >> > Greg, I got that I have to build the module against the kernel I am using. > But, How can I do this? > >> good luck! >> >> greg k-h Googling for how to configure and build a custom kernel, should return ample results. One such resource is the Linux Kernel in a Nutshell available here: http://www.kroah.com/lkn/ ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in First-Patch-Tutorial
On Mon, Mar 13, 2017 at 8:09 AM, SIMRAN SINGHAL wrote: > On Mon, Mar 13, 2017 at 10:42 AM, Alexander Kapshuk > wrote: >> On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL >> wrote: >>> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk >>> wrote: >>>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL >>>> wrote: >>>>> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk >>>>> wrote: >>>>>> On Sun, Mar 12, 2017 at 5:34 PM, wrote: >>>>>>> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said: >>>>>>> >>>>>>>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko, >>>>>>>> something of your own making, as I'm not seeing them in the kernel >>>>>>>> source tree? >>>>>>>> >>>>>>>> The 'modules_install' make target installs drivers that have been >>>>>>>> compiled as modules as opposed to those compiled into the kernel, into >>>>>>>> /lib/modules/`uname -r`. For your own modules added to the kernel >>>>>>>> source tree, or built out-of-tree, that would involve putting >>>>>>>> appropriate entries into Kconfig and/or Makefiles. >>>>>>>> >>>>>>>> Modeprobe expects your module to be found in /lib/modules/`uname -r`. >>>>>>>> Otherwise, your module won't get loaded. >>>>>>> >>>>>>> One other thing to remember is that although 'make modules_install' will >>>>>>> take all the .ko files from in-tree modules and put them in their proper >>>>>>> place in /lib/modules/`uname-r` and then run 'depmod', many out-of-tree >>>>>>> Makefiles manage to forget to do that last step. >>>>>>> >>>>>>> modprobe is a wrapper around insmod - and the file produced by 'depmod' >>>>>>> are what the wrapper uses to find the module. >>>>>> >>>>>> Thanks for elaborating on that. >>>>> >>>>> Still not working >>>>> >>>>> First I executed following commands:- >>>>> >>>>> $ make drivers/iio/dummy/iio_dummy_evgen.ko >>>>> $ make drivers/iio/dummy/iio_dummy.ko >>>>> >>>>> Above commands executed successfully >>>>> >>>>> Then I run following command: >>>>> $ insmod iio_dummy_evgen.ko >>>>> >>>>> Getting following error: >>>>> insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file >>>>> or directory >>>>> >>>>> And, then I try executing them from driver/staging/dummy and then I >>>>> got this error: >>>>> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation >>>>> not permitted >>>> >>>> You have to run insmod as user root. Either specify the full path to >>>> your module, or cd into the directory where the module is and run >>>> insmod from there. >>> >>> I tried this before also but as you said I tried it again: >>> # insmod iio_dummy_evgen.ko >>> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid module >>> format >>> >>> Now, I am getting this error. >> >> Sounds like your kernel module has been compiled for kernel sources >> whose version is different to the version of the kernel you are trying >> to load your module into. >> >> See http://www.tldp.org/LDP/lkmpg/2.6/html/x380.html for details. >> >> In other words, the version output by 'uname -r' must match the >> version output by 'modinfo iio_dummy_evgen.ko | grep vermagic'. > > Hi, > > The problem is same you got, I have different versions of uname-r and the > version output I got through vermagic. > > # modinfo iio_dummy_evgen.ko > filename: > /home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko > license:GPL v2 > description:IIO dummy driver > author: Jonathan Cameron > srcversion: A8AC238EC07833E018CAF7B > depends:industrialio > intree: Y > vermagic: 4.11.0-rc1+ SMP mod_unload modversions > > > $ uname -r > 4.10.0-rc3+ > > How to deal with this? Your kernel version is 4.10.0-rc3, while your module was built for kernel version 4.11.0-rc1, which is why it wouldn't load. You have to either download the sources for kernel version 4.10.0-rc3, and build your module against that, or build a new kernel using the sources for version 4.11.0-rc1, build your module against that, reboot into 4.11.0-rc1, and then load your module. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in First-Patch-Tutorial
On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL wrote: > On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk > wrote: >> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL >> wrote: >>> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk >>> wrote: >>>> On Sun, Mar 12, 2017 at 5:34 PM, wrote: >>>>> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said: >>>>> >>>>>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko, >>>>>> something of your own making, as I'm not seeing them in the kernel >>>>>> source tree? >>>>>> >>>>>> The 'modules_install' make target installs drivers that have been >>>>>> compiled as modules as opposed to those compiled into the kernel, into >>>>>> /lib/modules/`uname -r`. For your own modules added to the kernel >>>>>> source tree, or built out-of-tree, that would involve putting >>>>>> appropriate entries into Kconfig and/or Makefiles. >>>>>> >>>>>> Modeprobe expects your module to be found in /lib/modules/`uname -r`. >>>>>> Otherwise, your module won't get loaded. >>>>> >>>>> One other thing to remember is that although 'make modules_install' will >>>>> take all the .ko files from in-tree modules and put them in their proper >>>>> place in /lib/modules/`uname-r` and then run 'depmod', many out-of-tree >>>>> Makefiles manage to forget to do that last step. >>>>> >>>>> modprobe is a wrapper around insmod - and the file produced by 'depmod' >>>>> are what the wrapper uses to find the module. >>>> >>>> Thanks for elaborating on that. >>> >>> Still not working >>> >>> First I executed following commands:- >>> >>> $ make drivers/iio/dummy/iio_dummy_evgen.ko >>> $ make drivers/iio/dummy/iio_dummy.ko >>> >>> Above commands executed successfully >>> >>> Then I run following command: >>> $ insmod iio_dummy_evgen.ko >>> >>> Getting following error: >>> insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file >>> or directory >>> >>> And, then I try executing them from driver/staging/dummy and then I >>> got this error: >>> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation >>> not permitted >> >> You have to run insmod as user root. Either specify the full path to >> your module, or cd into the directory where the module is and run >> insmod from there. > > I tried this before also but as you said I tried it again: > # insmod iio_dummy_evgen.ko > insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid module > format > > Now, I am getting this error. Sounds like your kernel module has been compiled for kernel sources whose version is different to the version of the kernel you are trying to load your module into. See http://www.tldp.org/LDP/lkmpg/2.6/html/x380.html for details. In other words, the version output by 'uname -r' must match the version output by 'modinfo iio_dummy_evgen.ko | grep vermagic'. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in First-Patch-Tutorial
On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL wrote: > On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk > wrote: >> On Sun, Mar 12, 2017 at 5:34 PM, wrote: >>> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said: >>> >>>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko, >>>> something of your own making, as I'm not seeing them in the kernel >>>> source tree? >>>> >>>> The 'modules_install' make target installs drivers that have been >>>> compiled as modules as opposed to those compiled into the kernel, into >>>> /lib/modules/`uname -r`. For your own modules added to the kernel >>>> source tree, or built out-of-tree, that would involve putting >>>> appropriate entries into Kconfig and/or Makefiles. >>>> >>>> Modeprobe expects your module to be found in /lib/modules/`uname -r`. >>>> Otherwise, your module won't get loaded. >>> >>> One other thing to remember is that although 'make modules_install' will >>> take all the .ko files from in-tree modules and put them in their proper >>> place in /lib/modules/`uname-r` and then run 'depmod', many out-of-tree >>> Makefiles manage to forget to do that last step. >>> >>> modprobe is a wrapper around insmod - and the file produced by 'depmod' >>> are what the wrapper uses to find the module. >> >> Thanks for elaborating on that. > > Still not working > > First I executed following commands:- > > $ make drivers/iio/dummy/iio_dummy_evgen.ko > $ make drivers/iio/dummy/iio_dummy.ko > > Above commands executed successfully > > Then I run following command: > $ insmod iio_dummy_evgen.ko > > Getting following error: > insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file > or directory > > And, then I try executing them from driver/staging/dummy and then I > got this error: > insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation > not permitted You have to run insmod as user root. Either specify the full path to your module, or cd into the directory where the module is and run insmod from there. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in First-Patch-Tutorial
On Sun, Mar 12, 2017 at 5:34 PM, wrote: > On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said: > >> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko, >> something of your own making, as I'm not seeing them in the kernel >> source tree? >> >> The 'modules_install' make target installs drivers that have been >> compiled as modules as opposed to those compiled into the kernel, into >> /lib/modules/`uname -r`. For your own modules added to the kernel >> source tree, or built out-of-tree, that would involve putting >> appropriate entries into Kconfig and/or Makefiles. >> >> Modeprobe expects your module to be found in /lib/modules/`uname -r`. >> Otherwise, your module won't get loaded. > > One other thing to remember is that although 'make modules_install' will > take all the .ko files from in-tree modules and put them in their proper > place in /lib/modules/`uname-r` and then run 'depmod', many out-of-tree > Makefiles manage to forget to do that last step. > > modprobe is a wrapper around insmod - and the file produced by 'depmod' > are what the wrapper uses to find the module. Thanks for elaborating on that. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Problem in First-Patch-Tutorial
On Sun, Mar 12, 2017 at 12:00 PM, SIMRAN SINGHAL wrote: > Reloading Modules > > make -j2 && sudo make modules_install > sudo modprobe -r > sudo modprobe > > In Reloading Modules I tried the first command it works fine for me. > > git/kernels/staging$ ls drivers/iio/dummy/*.ko > drivers/iio/dummy/iio_dummy_evgen.ko drivers/iio/dummy/iio_dummy.ko > > Then I tried to run second-command > > git/kernels/staging$ sudo modprobe -r iio_dummy_evgen > > I got the following error:- > modprobe: FATAL: Module iio_dummy_evgen not found. > > I am not getting what is wrong with this. > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko, something of your own making, as I'm not seeing them in the kernel source tree? The 'modules_install' make target installs drivers that have been compiled as modules as opposed to those compiled into the kernel, into /lib/modules/`uname -r`. For your own modules added to the kernel source tree, or built out-of-tree, that would involve putting appropriate entries into Kconfig and/or Makefiles. Modeprobe expects your module to be found in /lib/modules/`uname -r`. Otherwise, your module won't get loaded. To load a module from a directory other than /lib/modules/`uname -r`, you want to use insmod and to remove it, rmmod. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: want to be a kernel developer
On Fri, Feb 24, 2017 at 01:59:08PM +0530, sourav mondal wrote: > hi, > I want to be a kernel developer.I don't really know much about linux > kernel. can anyone suggests me some good books that can help to learn more > about the kernel development? > > thanks, > Not sure if it the whole book is good, but I liked the 100+ pages I read in Linux-Treiber entwickeln[0]. If you can't read German might be a challenge but found it to be newer than LDD3. Have you considered finding a subsystem you like and try reading all the emails the maintainer replies to? I have tried that several times now and some of the cover letters / commits feels like reading a chapter in a book. [0]: https://www.dpunkt.de/buecher/12176/Linux-Treiber%20entwickeln.html -- Mit freundlichen Grüßen Alexander Alemayhu ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Code Compilation
On Sun, Feb 12, 2017 at 10:49 AM, Wasim Akram wrote: > I want to organize my code C code , such as all header file in include > folder , all library file in lib folder , main file in src and compile > output should be generated in /bin . I am facing problem in code > compilation. > > On Sun, Feb 12, 2017 at 2:09 PM, Alexander Kapshuk > wrote: >> On Sun, Feb 12, 2017 at 10:00 AM, Wasim Akram >> wrote: >>> How to compile the code and get binary in bin folder , if hearder >>> files , library files and source file is present in include,lib,src >>> folders respectively ? >>> >>> -- >> >> Can you please give us more detail? >> >> What binary do you want compiled and put in what bin folder? Are you >> talking about the kernel binary? If so, 'make install' places it in >> /boot. >> Or are you asking about how to compile an out-of-tree kernel module? > > > > -- Please, do not top post. You have not answered the questions I asked in my previous email. What code are you trying to compile? Are you working on an out-of-tree kernel driver? Or are working on some kernel subsystem? Or are working on something else you want to be a part of the kernel code base? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Code Compilation
On Sun, Feb 12, 2017 at 10:00 AM, Wasim Akram wrote: > How to compile the code and get binary in bin folder , if hearder > files , library files and source file is present in include,lib,src > folders respectively ? > > -- Can you please give us more detail? What binary do you want compiled and put in what bin folder? Are you talking about the kernel binary? If so, 'make install' places it in /boot. Or are you asking about how to compile an out-of-tree kernel module? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: insmod error
On Sat, Feb 11, 2017 at 6:32 PM, Madhu K wrote: > Hi Alexander, > > Thank you so much for your valuable reply. > > yes, you are correct I have kernel-source in home directory and I did not > install modules. > > To fix "out-of-tree" one, if I do make modules and modules_install will it > go off? > > Thanks, > Madhu > > On Sat, Feb 11, 2017 at 7:27 PM, Alexander Kapshuk > wrote: >> >> On Sat, Feb 11, 2017 at 3:28 PM, Madhu K wrote: >> > Hi All, >> > >> > I have built a kernel module against a 4.9.2 for arm board. while >> > inserting >> > this kernel module I am getting below message which is high lighted in >> > red >> > color what exactly mean loading out-of-tree module. what could be the >> > possible reason to get this message? >> > >> > Please help me out to understand below message mean. >> > >> > ubuntu@ubuntu-armhf:/home/Madhu/i2c$ dmesg >> > [ 704.283100] i2c_client: loading out-of-tree module taints kernel. >> > [ 704.285359] driver initialization >> > [ 704.285693] inside probe function >> > >> > >> > Regards, >> > Madhu >> > >> > ___ >> > Kernelnewbies mailing list >> > Kernelnewbies@kernelnewbies.org >> > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> > >> >> An 'out-of-tree' message does not indicate an error. It is informing >> you that the module being loaded is not a part of the kernel source >> tree, but an 'out-of-tree' one, i.e. your custom module whose source >> code resides say in your home directory. >> >> To verify your module has been loaded successfully, run 'lsmod | grep >> your_module_name' after loading it with 'insmod'. >> >> Hope this helps. > > You're welcome. Please do not top-post. As I already mentioned, the purpose of the 'loading out-of-tree module taints kernel' message is to inform the users of the i2c_client driver that it is not a part of the kernel source tree. It does not indicate a problem. So, to the best of my knowledge, the message won't go away. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: insmod error
On Sat, Feb 11, 2017 at 3:28 PM, Madhu K wrote: > Hi All, > > I have built a kernel module against a 4.9.2 for arm board. while inserting > this kernel module I am getting below message which is high lighted in red > color what exactly mean loading out-of-tree module. what could be the > possible reason to get this message? > > Please help me out to understand below message mean. > > ubuntu@ubuntu-armhf:/home/Madhu/i2c$ dmesg > [ 704.283100] i2c_client: loading out-of-tree module taints kernel. > [ 704.285359] driver initialization > [ 704.285693] inside probe function > > > Regards, > Madhu > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > An 'out-of-tree' message does not indicate an error. It is informing you that the module being loaded is not a part of the kernel source tree, but an 'out-of-tree' one, i.e. your custom module whose source code resides say in your home directory. To verify your module has been loaded successfully, run 'lsmod | grep your_module_name' after loading it with 'insmod'. Hope this helps. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: How to propose a patch to the kernel mainline
On Thu, Jan 26, 2017 at 8:33 AM, Alexander Kapshuk wrote: > On Thu, Jan 26, 2017 at 3:32 AM, Abel wrote: >> Hi! >> >> First, I apologize as I guess this topic has been treated many times here. >> >> I'm already coding for a patch intended to be merged with the kernel >> mainline. It adds a small new feature, so it's not a little bug fix, but >> still not so big deal. >> I'll get it compiling and working before I submit the patch to the mailing >> list, that's clear to me; but I'm sure there will be mistakes, stuff I >> didn't think/know about, some styling issues and, maybe, a technical >> discussion of how it should be done. >> >> What I want to ask it's what are the best steps I should walk through in >> order to get this patch merged. >> >> I've already done some modifications of the Linux kernel for university >> works, I've also contributed to other open source projects. But I've never >> tried to contribute to code to the upstream kernel code before. >> >> Greetings, >> >>Akronix. >> >> ___ >> Kernelnewbies mailing list >> Kernelnewbies@kernelnewbies.org >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> > > Please see in-tree documentation for development process found here, > https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/development-process?id=refs/tags/v4.9.5. > It addresses all of your queries. Here are a few more resources to consider: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/Documentation/SubmittingPatches?id=refs/tags/v4.9.5 https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/Documentation/SubmittingDrivers?id=refs/tags/v4.9.5 https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/Documentation/CodingStyle?id=refs/tags/v4.9.5 ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: How to propose a patch to the kernel mainline
On Thu, Jan 26, 2017 at 3:32 AM, Abel wrote: > Hi! > > First, I apologize as I guess this topic has been treated many times here. > > I'm already coding for a patch intended to be merged with the kernel > mainline. It adds a small new feature, so it's not a little bug fix, but > still not so big deal. > I'll get it compiling and working before I submit the patch to the mailing > list, that's clear to me; but I'm sure there will be mistakes, stuff I > didn't think/know about, some styling issues and, maybe, a technical > discussion of how it should be done. > > What I want to ask it's what are the best steps I should walk through in > order to get this patch merged. > > I've already done some modifications of the Linux kernel for university > works, I've also contributed to other open source projects. But I've never > tried to contribute to code to the upstream kernel code before. > > Greetings, > >Akronix. > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > Please see in-tree documentation for development process found here, https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/development-process?id=refs/tags/v4.9.5. It addresses all of your queries. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: How to build an external module in a specified directory?
On Tue, Jan 3, 2017 at 4:11 PM, Alexander Kapshuk wrote: > On Tue, Jan 3, 2017 at 9:32 AM, Shiyao Ma wrote: >> Hi Alexander, >> >> >> Looking at that Makefile: >> >> # Use make M=dir to specify directory of external module to build >> # Old syntax make ... SUBDIRS=$PWD is still supported >> # Setting the environment variable KBUILD_EXTMOD take precedence >> ifdef SUBDIRS >> KBUILD_EXTMOD ?= $(SUBDIRS) >> endif >> >> ifeq ("$(origin M)", "command line") >> KBUILD_EXTMOD := $(M) >> endif >> >> >> So specifying KBUILD_EXTMOD or M is the same thing, which tells KBUILD the >> directory that the Makefile for the module is in. >> And by default, KBUILD will build the module in KBUILD_EXTMOD. >> >> What I want is tell KBUILD to build the modules in a specified directory. >> >> >> >> Regards. >> >> >> >> >> >> On Jan 2, 2017, 20:30 +0800, Alexander Kapshuk >> , wrote: >> >> On Mon, Jan 2, 2017 at 1:39 PM, Shiyao Ma wrote: >> >> Hi, >> >> When building an external module, for example, given this command, >> all: >> $(MAKE) -C $(KDIR) M=$$PWD >> >> It will build the ko file in the $PWD. >> >> How to specify a location for the .ko files? >> >> >> Regards. >> >> ___ >> Kernelnewbies mailing list >> Kernelnewbies@kernelnewbies.org >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> >> >> Perhaps KBUILD_EXTMOD is what you're looking for. >> >> /path/to/kernel/sources/Makefile:183,185 >> # Use make M=dir to specify directory of external module to build >> # Old syntax make ... SUBDIRS=$PWD is still supported >> # Setting the environment variable KBUILD_EXTMOD take precedence > > I haven't verified this, but perhaps KBUILD_OUTPUT would better server > your purposes. > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/kbuild/kbuild.txt?id=refs/tags/v4.10-rc2 > KBUILD_OUTPUT > -- > Specify the output directory when building the kernel. > The output directory can also be specified using "O=...". > Setting "O=..." takes precedence over KBUILD_OUTPUT. Tain't it either. Just verified it on my system. Don't have an answer for you at the moment. Sorry. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: How to build an external module in a specified directory?
On Tue, Jan 3, 2017 at 9:32 AM, Shiyao Ma wrote: > Hi Alexander, > > > Looking at that Makefile: > > # Use make M=dir to specify directory of external module to build > # Old syntax make ... SUBDIRS=$PWD is still supported > # Setting the environment variable KBUILD_EXTMOD take precedence > ifdef SUBDIRS > KBUILD_EXTMOD ?= $(SUBDIRS) > endif > > ifeq ("$(origin M)", "command line") > KBUILD_EXTMOD := $(M) > endif > > > So specifying KBUILD_EXTMOD or M is the same thing, which tells KBUILD the > directory that the Makefile for the module is in. > And by default, KBUILD will build the module in KBUILD_EXTMOD. > > What I want is tell KBUILD to build the modules in a specified directory. > > > > Regards. > > > > > > On Jan 2, 2017, 20:30 +0800, Alexander Kapshuk > , wrote: > > On Mon, Jan 2, 2017 at 1:39 PM, Shiyao Ma wrote: > > Hi, > > When building an external module, for example, given this command, > all: > $(MAKE) -C $(KDIR) M=$$PWD > > It will build the ko file in the $PWD. > > How to specify a location for the .ko files? > > > Regards. > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > > Perhaps KBUILD_EXTMOD is what you're looking for. > > /path/to/kernel/sources/Makefile:183,185 > # Use make M=dir to specify directory of external module to build > # Old syntax make ... SUBDIRS=$PWD is still supported > # Setting the environment variable KBUILD_EXTMOD take precedence I haven't verified this, but perhaps KBUILD_OUTPUT would better server your purposes. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/kbuild/kbuild.txt?id=refs/tags/v4.10-rc2 KBUILD_OUTPUT -- Specify the output directory when building the kernel. The output directory can also be specified using "O=...". Setting "O=..." takes precedence over KBUILD_OUTPUT. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: How to build an external module in a specified directory?
On Mon, Jan 2, 2017 at 1:39 PM, Shiyao Ma wrote: > Hi, > > When building an external module, for example, given this command, > all: > $(MAKE) -C $(KDIR) M=$$PWD > > It will build the ko file in the $PWD. > > How to specify a location for the .ko files? > > > Regards. > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > Perhaps KBUILD_EXTMOD is what you're looking for. /path/to/kernel/sources/Makefile:183,185 # Use make M=dir to specify directory of external module to build # Old syntax make ... SUBDIRS=$PWD is still supported # Setting the environment variable KBUILD_EXTMOD take precedence ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: What's the purpose of subsys_interface in linux/device.h?
On Fri, Dec 16, 2016 at 8:57 AM, Perr Zhang wrote: > On Fri, 16 Dec 2016 00:26:24 +0800 Alexander Kapshuk > wrote > > > > Having looked at the pieces of source code below, it appears that > > subsys_interface is the means to expose specific functionality of a > > subsystem/class of devices, as the commentary below states. > > include/linux/device.h:331,350 > > /** > > * struct subsys_interface - interfaces to device functions > > * @name: name of the device function > > * @subsys: subsytem of the devices to attach to > > * @node: the list of functions registered at the subsystem > > * @add_dev:device hookup to device function handler > > * @remove_dev: device hookup to device function handler > > * > > * Simple interfaces attached to a subsystem. Multiple interfaces can > > * attach to a subsystem and its devices. Unlike drivers, they do not > > * exclusively claim or control devices. Interfaces usually represent > > * a specific functionality of a subsystem/class of devices. > > */ > > struct subsys_interface { > > const char *name; > > struct bus_type *subsys; > > struct list_head node; > > int (*add_dev)(struct device *dev, struct subsys_interface *sif); > > void (*remove_dev)(struct device *dev, struct subsys_interface *sif); > > }; > > > > Here's sample usage: > > arch/tile/kernel/sysfs.c:211,216 > > static struct subsys_interface hv_stats_interface = { > > .name = "hv_stats", > > .subsys = &cpu_subsys, > > .add_dev = hv_stats_device_add, > > .remove_dev = hv_stats_device_remove, > > }; > > > > And the add_dev method, whose main purpose seems to be creating a > > sysfs file for a particular device: > > arch/tile/kernel/sysfs.c:189,199 > > static int hv_stats_device_add(struct device *dev, struct subsys_interface > *sif) > > { > > int err, cpu = dev->id; > > > > if (!cpu_online(cpu)) > > return 0; > > > > err = sysfs_create_file(&dev->kobj, &dev_attr_hv_stats.attr); > > > > return err; > > } > > > > Here's an example of the hv_stats_interface being registered with the > subsystem: > > arch/tile/kernel/sysfs.c:261 > > err = subsys_interface_register(&hv_stats_interface); > > > > Hopefully, other members of this list will offer a better informed > > explanation than that given here. > > Sorry for sending email repeatedly. > I have also read the code: > device_add() -> bus_add_device() -> device_add_attrs(bus, dev) -> > device_create_file(dev, &bus->dev_attrs[i]) > Since the attribute file/functionality could be added through bus->dev_attrs, > why not to do it in this way? > My understanding is that an interface is like a protocol that has been put in place to enable a particular set of functions within a given subsystem or device model. I am sending a copy of this email to the list as well, so you can hopefully get a better informed reply to your query. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: building last kernel version
On Fri, Dec 2, 2016 at 6:02 AM, Ahmed Adel wrote: > your solution is correct. Thanks you so much You're welcome. Good to hear it worked out for you. Thanks for letting us know. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Non-zero preemption count on voluntary preemptive kernel
Hi folks! I'm sorry to bother you, guys, but neither the mailing list 'kpreempt-t...@lists.sourceforge.net' nor Robert's address 'r...@tech9.net' exist anymore. If I have to address someone else, pls let me know. We're currently investigating the locking of data structures in the Linux Kernel -- namely 3.16. Doing so, we've been logging every call to *lock() or *unlock(). For further analysis, we log the preempt count as well. Although we use a voluntary preemptive kernel (defined(CONFIG_PREEMPT_VOLUNTARY) && !defined(CONFIG_PREEMPT) && !defined(CONFIG_PREEMPT_COUNT), the actual preemption count, the first eight bits, aren't zero all time. I'd expect the kernel to not touch those bits, because the preempt_{enable,disable} functions do nearly nothing in my case. They actually insert a memory barrier, but nothing more. As you can see in the file (query.txt) attached to this mail, there are several occasions where the preemption count is above zero. I'm a bit puzzled why this happens... The format is as follows: The first three columns donate the position within the source code where a lock has been acquired. The fourth column is the preemption count, as returned by preemption_count(), after acquiring the lock. The last column tells how often this happens. I attached my kernel config as well. Can you please tell why this happens? Have I missed something? Might this be a bug? Thanks! Regards, Alex -- Technische Universität Dortmund Alexander LochmannPGP key: 0xBC3EF6FD Otto-Hahn-Str. 16 phone: +49.231.7556141 D-44227 Dortmund fax:+49.231.7556116 http://ess.cs.tu-dortmund.de/Staff/al # # Automatically generated file; DO NOT EDIT. # Linux/x86 3.16.0 Kernel Configuration # # CONFIG_64BIT is not set CONFIG_X86_32=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_MMU=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y # CONFIG_ZONE_DMA32 is not set # CONFIG_AUDIT_ARCH is not set CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_X86_32_SMP=y CONFIG_X86_HT=y CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx" CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="-al" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y # CONFIG_KERNEL_GZIP is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set CONFIG_KERNEL_XZ=y # CONFIG_KERNEL_LZO is not set # CONFIG_KERNEL_LZ4 is not set CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_FHANDLE=y CONFIG_USELIB=y CONFIG_AUDIT=y CONFIG_HAVE_ARCH_AUDITSYSCALL=y CONFIG_AUDITSYSCALL=y CONFIG_AUDIT_WATCH=y CONFIG_AUDIT_TREE=y # # IRQ subsystem # CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_IRQ_LEGACY_ALLOC_HWIRQ=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_GENERIC_IRQ_CHIP=y CONFIG_IRQ_DOMAIN=y # CONFIG_IRQ_DOMAIN_DEBUG is not set CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_KTIME_SCALAR=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BUILD=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y CONFIG_GENERIC_CMOS_UPDATE=y # # Timers subsystem # CONFIG_TICK_ONESHOT=y CONFIG_NO_HZ_COMMON=y # CONFIG_HZ_PERIODIC is not set CONFIG_NO_HZ_IDLE=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y # # CPU/Task time and stats accounting # CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y CONFIG_TASK_XACCT=y CONFIG_TASK_IO_ACCOUNTING=y # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_PREEMPT_RCU is not set CONFIG_RCU_STALL_COMMON=y C
Re: Append Localversion to Kernel String
On Thu, Oct 6, 2016 at 12:26 PM, Marco Gross wrote: > > Hello folks, > > > > I’m trying to automatically append version information to my kernel’s version > string. > > Therefore, I have in my .config following option: > > > > CONFIG_LOCALVERSION_AUTO=y > > > > Additionally, following is set: > > > > CONFIG_LOCALVERSION=”++” > > > > The output that is expected is said to be the first eight characters of the > output of ‘git rev-parse --verify HEAD’. > > The output in my kernel directory is: > > > > $ git rev-parse --verify HEAD > > c8d2bc9bc39ebea8437fd974fdbc21847bb897a3 > > > > After installing the kernel the name of the kernel is as follows: > > > > vmlinuz-4.8.0++ > > > > I expected: > > > > vmlinuz-4.8.0++-gc8d2bc9b > > > > My question: Where is the version string that I expected? > > > > Marco > > > > Mit freundlichen Grüßen / Best regards > > Marco Gross > > Diplomand > > > > > > Fritz Stephan GmbH > > - Medizintechnik - > > Kirchstraße 19, D-56412 Gackenbach > > > > Tel.: +49 6439 9125-249 > > Fax: +49 6439 9125-111 > > E-Mail: mgr...@stephan-gmbh.com > > Web: www.stephan-gmbh.com > > > > Handelsregister Amtsgericht Montabaur HR-Nr. 4241 > > Geschäftsführer: Tanja Stephan, Georg Mainusch > > > > > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > The '+' character is appended when the contents of your git repository have been modified, but not committed. You want to either commit the changes you have made, and rebuild the kernel, or undo the changes to restore the original state of the tree. Hope this helps. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: insmod failing to insert a simple module
On Thu, Sep 29, 2016 at 3:24 PM, Madhu K wrote: > Hi, > > uname -a output : > > Linux BLR-PCUB-01141 4.5.0-rc7 #2 SMP Wed Mar 23 15:51:13 IST 2016 x86_64 > x86_64 x86_64 GNU/Linux > > And my modinfo of my module is : > > icense:Dual BSD/GPL > srcversion: 1D16256F51E63BC3632B65B > depends: > vermagic: 4.5.0-rc7+ SMP mod_unload modversions 686 > > > So both are machining, what could be the problem? > > Regards, > Madhu > > On Thu, Sep 29, 2016 at 5:40 PM, Johannes Thoma > wrote: >> >> Type >> >> uname -a >> >> on the box where you try the insmod. If it says anything else than >> 4.0.5-rc7+ for the kernel version then this is the reason why insmod fails. >> >> Best >> >> Johannes > > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > They do not match. 'uname -a': says 4.5.0-rc7. Whereas your original post said: 4.0.5_rc7+. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Virtual Address Space
On Wed, Sep 28, 2016 at 8:06 AM, Madhu K wrote: > Hi All, > > This is to understand the Virtual address space.Basically who generates the > virtual addresses CPU or GNU compiler? > > Thanks > Madhu > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > In no way does this response claim to be based on personal expert knowledge, but if my understanding of Chapter 2 (Page tables) of https://pdos.csail.mit.edu/6.828/2016/xv6/book-rev9.pdf is correct, it is the hardware that performs the mapping of physical memory, RAM, to virtual addresses on x86: Quote: As a reminder, x86 instructions (both user and kernel) manipulate virtual addresses. The machine’s RAM, or physical memory, is indexed with physical addresses. The x86 page table hardware connects these two kinds of addresses, by mapping each virtual address to a physical address. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Please, add me to EditorsGroup
On Tue, Aug 16, 2016 at 03:51:59PM +0530, Chinmay V S wrote: [snip] > > Would it be better to keep the current oftc.net hyperlink as is, > and add a hyperlink to "irc network" that points to > https://webchat.oftc.net/ ? > [snip] Added the web version to the list of clients. It does make it better for people not familiar with IRC or who just prefer to use their browser. -- Mit freundlichen Grüßen Alexander Alemayhu ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
pushing other commits upstream
Hi, I would like to push patches from somebody else upstream. I'm talking of commits of the TI's beagleboard repo [1]. What do I need to take care of? Best, lynxis [1] https://github.com/beagleboard/linux -- Alexander Couzens mail: lyn...@fe80.eu jabber: lyn...@fe80.eu mobile: +4915123277221 gpg: 390D CF78 8BF9 AA50 4F8F F1E2 C29E 9DA6 A0DF 8604 pgpxYn4BbOWnF.pgp Description: OpenPGP digital signature ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: eudyptula challenge, stuck at task 06 - no reply for four weeks
asking anything here about eudyptula challange is a violation of the rules. i've been booted out of the challenge next day I asked same question :( I should've asked Little istead On Thu, Dec 31, 2015 at 9:41 AM, chuckleberryfinn wrote: > I had some replies in November. He's still alive for sure. :) > Patience is the biggest requirement for the challenge! ;) > > >> From: "Geyslan G. Bem" >> Subject: Re: eudyptula challenge, stuck at task 06 - no reply for four >> weeks >> To: Abner Silva >> Cc: kernelnewbies >> Message-ID: >> >> Content-Type: text/plain; charset=UTF-8 >> >> 2015-12-31 12:27 GMT-03:00 Abner Silva : >>> Anyone heard from Little recently? Got nothing since beginning of Oct. >> Mine is stucked in task 6 too. No reply until now. >> >>> >>> On 11/21/2015 12:57 AM, Karthik Nayak wrote: >>>> Thanks, I'll check them out. >>>> >>>> >>>> On Sat, Nov 21, 2015, 1:34 AM Drew Fustini >>> <mailto:pdp7p...@gmail.com>> wrote: >>>> >>>> yup, that advice has served me well during the challenge. >>>> >>>> I highly recommend Free Electrons's Embedded Linux kernel and driver >>>> development training: >>>> >>>> slides: >>>> >>>> http://free-electrons.com/doc/training/linux-kernel/linux-kernel-slides.pdf >>>> labs: >>>> >>>> http://free-electrons.com/doc/training/linux-kernel/linux-kernel-labs.pdf >>>> code: >>>> >>>> http://free-electrons.com/doc/training/linux-kernel/linux-kernel-labs.tar.xz >>>> >>>> cheers, >>>> drew >>>> >>>> On Fri, Nov 20, 2015 at 7:57 AM, Karthik Nayak >>>> mailto:karthik@gmail.com>> wrote: >>>> > Just wait you'll get it, in the meantime continue reading about >>>> Linux =) >>>> > >>>> > >>>> > On Fri, Nov 20, 2015, 6:38 PM Lucas Tanure >>> <mailto:tan...@linux.com>> wrote: >>>> >> >>>> >> Hi, >>>> >> >>>> >> I'm waiting for task 8 since September 05: >>>> >> " Just to provide some information, you are currently number 9 in >>>> >> line, and the response that is next is from "05 Sep 2015 >>>> 00:53:31 -0400" >>>> >> so be aware of the potential wait time. " >>>> >> >>>> >> Thanks >>>> >> >>>> >> -- >>>> >> Lucas Tanure >>>> >> +55 (19) 988176559 >>>> >> >>>> >> On Thu, Nov 19, 2015 at 11:36 PM, Alexander Ivanov >>>> mailto:amiva...@gmail.com>> >>>> >> wrote: >>>> >>> >>>> >>> Hi there, >>>> >>> >>>> >>> Is there anybody stuck at task 06 too? >>>> >>> >>>> >>> --ami >>>> >>> >>>> >>> ___ >>>> >>> Kernelnewbies mailing list >>>> >>> Kernelnewbies@kernelnewbies.org >>>> <mailto:Kernelnewbies@kernelnewbies.org> >>>> >>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >>>> >> >>>> >> >>>> >> ___ >>>> >> Kernelnewbies mailing list >>>> >> Kernelnewbies@kernelnewbies.org >>>> <mailto:Kernelnewbies@kernelnewbies.org> >>>> >> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >>>> > >>>> > -- >>>> > >>>> > Regards, >>>> > Karthik >>>> > >>>> > >>>> > ___ >>>> > Kernelnewbies mailing list >>>> > Kernelnewbies@kernelnewbies.org >>>> <mailto:Kernelnewbies@kernelnewbies.org> >>>> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >>>> > >>>> >>>> -- >>>> >>>> Regards, >>>> Karthik >>>> >>>> >>>> >>>> ___ >>>> Kernelnewbies mailing list >>>> Kernelnewbies@kernelnewbies.org >>>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >>>> >>> >>> ___ >>> Kernelnewbies mailing list >>> Kernelnewbies@kernelnewbies.org >>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies >> >> >> > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
eudyptula challenge, stuck at task 06 - no reply for four weeks
Hi there, Is there anybody stuck at task 06 too? --ami ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Delegating printk work to UART interrupt
Hi Arun KS, Actually, i already saw this one and something similar were tested. I just trying to figure out the reasons why generic kernel layer (console_unlock) implemented in such way: i.e. why it accounts on immediate busyloop printing? Is it reliable to defer such printing to UART interrupts? Thank you. On Mon, 20 Jul 2015 09:34:16 +0530 Arun KS wrote: > Hello Alexander, > > On Sat, Jul 18, 2015 at 11:23 AM, Alexander wrote: > > > > > Hi! > > When i checked how kernel printing works, i mentioned that it takes > > messages > > from log_buffer in console_unlock and gives it to call_console_drivers -> > > ... > > -> some uart bsp function. Basically, as i see this BSP realization tries > > to flush all message chars in busyloop ... so it waits until FIFO_NOT_FULL > > bit will > > be dropped by UART and it will be able to push the next byte. > > Basically, as i see userspace printing do something different. It puts > > N_FIFO_BYTES > > and exits, next, when FIFO will be freed - interrupt will be generated, and > > other characters will be put into UART FIFO. > > Can we do something similar for kernel printing? i.e. do not busyloop > > sending char > > after char, but put N_FIFO chars and flush other in interrupt. When panic > > will occur > > we can do busyloop printing again. Is it reliable? Suppose we have several > > cores. > > Thank you. > > > What about trying this patch, > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/kernel/printk/printk.c?id=5874af2003b1053128d655710140e3187226 > > Its not changing console printing through UART to interrupt mode. But > minimizes the time interrupts being disabled on printk(). > > Thanks, > Arun > > > > > > > -- > > Alexander > > > > ___ > > Kernelnewbies mailing list > > Kernelnewbies@kernelnewbies.org > > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > -- Alexander ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Delegating printk work to UART interrupt
Hi! When i checked how kernel printing works, i mentioned that it takes messages from log_buffer in console_unlock and gives it to call_console_drivers -> ... -> some uart bsp function. Basically, as i see this BSP realization tries to flush all message chars in busyloop ... so it waits until FIFO_NOT_FULL bit will be dropped by UART and it will be able to push the next byte. Basically, as i see userspace printing do something different. It puts N_FIFO_BYTES and exits, next, when FIFO will be freed - interrupt will be generated, and other characters will be put into UART FIFO. Can we do something similar for kernel printing? i.e. do not busyloop sending char after char, but put N_FIFO chars and flush other in interrupt. When panic will occur we can do busyloop printing again. Is it reliable? Suppose we have several cores. Thank you. -- Alexander ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Correctness of compaction_suitable condition
Hello. Actually this question is about kernel 3.10, but as i can see the situation didn't change in future versions. I would like to mention 2 places in the code: 1.) First one is an internals of buddy allocator subsystem function __rmqueue As i can see, kernel tries to allocate smallest suitable free block for given order and migratetype here __rmqueue_smallest. If it fails, then it could try other migration types here __rmqueue_fallback. The suitable migration types are in fallback list. For example, if we have MIGRATE_UNMOVABLE allocation, we can try: [MIGRATE_UNMOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE, MIGRATE_RESERVE} but as i can see we can't try MIGRATE_CMA free blocks. 2.) Now let's consider compaction_suitable function. This one is used in compact_zone, to check if the compaction is suitable. This function uses fill_contig_page_info, where number of suitable blocks for current order allocation is calculated like: 570 /* Count number of free blocks */ 571 blocks = zone->free_area[order].nr_free; 572 info->free_blocks_total += blocks; 573 574 /* Count free base pages */ 575 info->free_pages += blocks << order; 576 577 /* Count the suitable free blocks */ 578 if (order >= suitable_order) 579 info->free_blocks_suitable += blocks << 580 (order - suitable_order); So as i can see, zone->free_area[order].nr_free includes all MIGRATE_TYPES for given order. But if we allocate unmovable blocks, in fact we can't use free blocks with MIGRATE_CMA. As i think this could lead to the fact, that on slowpath __alloc_pages_direct_compact wouldn't invoke compaction, because it will think that we have suitable blocks for current order allocation, but in fact we haven't. Please, could you explain is this a problem, or i just don't understand some logic behind this? Thank you. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Interrupts handling
Ah, I understood, $-1 is just -1 here. But why we push it - 0x? 2015-06-17 17:22 GMT+06:00 Alexander Kuleshov : > Hello, > > I have a question about interrupt handling in Linux kernel for x86_64. > As we can read in the > 64-ia-32-architectures-software-developer-vol-3a-part-1-manual, when > an interurpt/exception occurs, the handler's stack contains SS, RSP, > RFLAGS, CS, RIP and error code. My question is: does processor push > this register on the stack when an interrupt occurs or kernel must > push it? > > In the arch/x86/kernel/entry_64.S we can see following code in the > idtentry macro: > > .ifeq \has_error_code > pushq_cfi $-1 > .endif > > where pushq_cfi is: > > .macro pushq_cfi reg > pushq \reg > CFI_ADJUST_CFA_OFFSET 8 > .endm > > First of all what does it mean $-1 here? I have write simple assembly > program and I see: > > push 0x > > in the gdb. The second question, if processor pushes error code and > other during interrupt why we push it here? > > Thank you. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Interrupts handling
Hello, I have a question about interrupt handling in Linux kernel for x86_64. As we can read in the 64-ia-32-architectures-software-developer-vol-3a-part-1-manual, when an interurpt/exception occurs, the handler's stack contains SS, RSP, RFLAGS, CS, RIP and error code. My question is: does processor push this register on the stack when an interrupt occurs or kernel must push it? In the arch/x86/kernel/entry_64.S we can see following code in the idtentry macro: .ifeq \has_error_code pushq_cfi $-1 .endif where pushq_cfi is: .macro pushq_cfi reg pushq \reg CFI_ADJUST_CFA_OFFSET 8 .endm First of all what does it mean $-1 here? I have write simple assembly program and I see: push 0x in the gdb. The second question, if processor pushes error code and other during interrupt why we push it here? Thank you. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Question about assembly in set bit function for x86 architecture
2015-04-20 5:11 GMT+06:00 Anuz Pratap Singh Tomar : > > > On Mon, Apr 20, 2015 at 12:08 AM, Nicholas Krause > wrote: >> >> >> >> On April 19, 2015 5:13:20 PM EDT, Anuz Pratap Singh Tomar >> wrote: >> >On Sun, Apr 19, 2015 at 9:51 PM, nick wrote: >> > >> >> Greetings All, >> >> I am wondering what the below code in the asm modifier does: >> >> static inline void set_bit(int nr, void *addr) >> >> { >> >> asm("btsl %1,%0" : "+m" (*(u32 *)addr) : "Ir" (nr)); >> >> } >> >> This would be very helpful as I am new to x86 assembly and don't >> >> even known what register(s)/instruction(s) this touches and therefore >> >this >> >> is impossible for me to look up in the Intel Manuals. If someone >> >either >> >> tells me the registers/instructions this uses or explains the code >> >that >> >> would be very helpful. >> >> Nick What's the problem to read it in the intel manual or just to use google [https://www.google.com/search?channel=fs&q=btsl+instruction&ie=utf-8&oe=utf-8] which will give you answer with first link instead of spend time of community for such questions? >> 95 percent of the kernel is written in C This is true. But kernel is big, and are you really sure that somebody will want to expain you rest of 5% of the kernel? I am not sure about it. Yes kernel is big and complex. It contains many tricks which even hard to find explanation in the interntet. But, if you want to read/develop kernel, you need learning to learn, but not just ask. It's important. Heed the advice of Anuz, he gave the perfect advice. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Question about fixmap
Hello All, I'm reading x86_64 source code and trying to understand where are fixmaps space in the virtual memory space. If I understand correctly (but i'm really not sure about it), fixmap space is after vsyscall space. As Documentation/x86/x86_64/mm.txt says vsyscall virtual space is: ff60 - ffdf (=8 MB) vsyscalls Also I see that FIXADDR_START and FIXADDR_TOP and are: FIXADDR_START - 0xff779000L FIXADDR_TOP - 0xff7ff000L on my machine. With these addressess FIXADDR_START/FIXADDR_TOP overlap vsyscalls area. Is it correct case that fixmaps are in vsyscal virtual memory space or I'm wrong somewhere? Thank you. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: I am new here
Hello, There are many ways how to start with the kernel. Try to search kernelnewbies archive, there are many questions like your. The good way to start is a join to the Eudyptula Challenge - http://eudyptula-challenge.org/. From myself i can recommed, try to select what you are interested in the kernel. Kernel is huge. Maybe you're interesting in filesystems or vfs, network or in any architecture. Select this part and try to research it. 2015-03-12 22:27 GMT+06:00 Leonardo Ariel Carreras Rodríguez : > Hello! > I am new here, and I want to know how to get started, maybe with the > simplest way available. > Regards, > Leonardo > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > -- _ 0xAX ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
x86 boot gdt
Hello all, Have a little question about gdt initialization. We can see the following: [GDT_ENTRY_BOOT_CS] = GDT_ENTRY(0xc09b, 0, 0xf), in the arch/x86/boot/pm.c. Why accessed bit is set here (9b)? I see that it was not set (9a) in the earliest versions. What's reason was to change it? -- _ 0xAX ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: realmode _WAKEUP
8 янв. 2015 г. 0:57 пользователь "Paul Bolle" написал: > > On Wed, 2015-01-07 at 23:59 +0600, Alexander Kuleshov wrote: > > Yes i saw video-*.c files, but i can't understand how compilation of > > these video-*.c files depends on _WAKEUP macro... > > > > For example if'd remove -D_WAKEUP, i get errors during realmode.elf linking: > > > > arch/x86/realmode/rm/video-vga.o: In function `vga_probe': > > /home/alex/dev/linux/arch/x86/realmode/rm/../../boot/video-vga.c:259: > > undefined reference to `boot_params' > > > > As you wrote there are many #ifndef/#endif directives, but why there > > _WAKEUP is undefined everytime, but we pass it from command line with > > -D_WAKEUP? > > Because these file also get compiled via arch/x86/boot/Makefile? Ie, I > _guess_ _WAKEUP is needed to ensure the compile started from > arch/x86/realmode/rm/Makefile differs from the compile started from > arch/x86/boot/Makefile. But [...]/boot/Makefile is sufficiently > complicated for me to stop me from looking at it too long! > > You do realize that the Linux kernel is a treasure trove for people > wanting to know just how far make, gcc, etc can be pushed, don't you? > > > Paul Bolle > That's true ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: realmode _WAKEUP
Seems that finally i got point of this. Thank you Paul for the help. 8 янв. 2015 г. 1:10 пользователь kuleshovm...@gmail.com написал: 8 янв. 2015 г. 0:57 пользователь "Paul Bolle" написал: > > On Wed, 2015-01-07 at 23:59 +0600, Alexander Kuleshov wrote: > > Yes i saw video-*.c files, but i can't understand how compilation of > > these video-*.c files depends on _WAKEUP macro... > > > > For example if'd remove -D_WAKEUP, i get errors during realmode.elf linking: > > > > arch/x86/realmode/rm/video-vga.o: In function `vga_probe': > > /home/alex/dev/linux/arch/x86/realmode/rm/../../boot/video-vga.c:259: > > undefined reference to `boot_params' > > > > As you wrote there are many #ifndef/#endif directives, but why there > > _WAKEUP is undefined everytime, but we pass it from command line with > > -D_WAKEUP? > > Because these file also get compiled via arch/x86/boot/Makefile? Ie, I > _guess_ _WAKEUP is needed to ensure the compile started from > arch/x86/realmode/rm/Makefile differs from the compile started from > arch/x86/boot/Makefile. But [...]/boot/Makefile is sufficiently > complicated for me to stop me from looking at it too long! > > You do realize that the Linux kernel is a treasure trove for people > wanting to know just how far make, gcc, etc can be pushed, don't you? > > > Paul Bolle > That's true ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: realmode _WAKEUP
As i understood correctly we compile wakeup-objs only if CONFIG_ACPI_SLEEP is 'y', but than why we pass -D_WAKEUP everytime, even CONFIG_ACPI_SLEEP is not y? 2015-01-07 23:59 GMT+06:00 Alexander Kuleshov : > Hello Paul, thank you for answer. > > Yes i saw video-*.c files, but i can't understand how compilation of > these video-*.c files depends on _WAKEUP macro... > > For example if'd remove -D_WAKEUP, i get errors during realmode.elf linking: > > arch/x86/realmode/rm/video-vga.o: In function `vga_probe': > /home/alex/dev/linux/arch/x86/realmode/rm/../../boot/video-vga.c:259: > undefined reference to `boot_params' > > As you wrote there are many #ifndef/#endif directives, but why there > _WAKEUP is undefined everytime, but we pass it from command line with > -D_WAKEUP? > > Thank you. > > 2015-01-07 22:54 GMT+06:00 Paul Bolle : >> On Wed, 2015-01-07 at 20:12 +0600, Alexander Kuleshov wrote: >>> There is following definition at arch/x86/realmode/rm/Makefile: >>> >>> KBUILD_CFLAGS:= $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \ >>>-I$(srctree)/arch/x86/boot >>> >>> Is it used now? I'm asking because _WAKEUP definition everywhere >>> undefined in the code. >> >> git grep tells me: >> $ git grep -n "_WAKEUP\b" arch/x86 >> arch/x86/boot/video-bios.c:51:#ifndef _WAKEUP >> arch/x86/boot/video-bios.c:66:#ifdef _WAKEUP >> arch/x86/boot/video-mode.c:169:#ifndef _WAKEUP >> arch/x86/boot/video-vesa.c:27:#ifndef _WAKEUP >> arch/x86/boot/video-vesa.c:29:#else /* _WAKEUP */ >> arch/x86/boot/video-vesa.c:31:#endif /* _WAKEUP */ >> arch/x86/boot/video-vesa.c:160:#ifndef _WAKEUP >> arch/x86/boot/video-vesa.c:272:#endif /* not _WAKEUP */ >> arch/x86/boot/video-vga.c:257:#ifndef _WAKEUP >> arch/x86/boot/video-vga.c:269:#ifndef _WAKEUP >> >> And in that Makefile we also see, a few lines up: >> wakeup-objs := [...] video-mode.o >> [...] >> wakeup-objs += video-vga.o >> wakeup-objs += video-vesa.o >> wakeup-objs += video-bios.o >> >> So this Makefile line defines a _WAKEUP macro that is, it seems, used >> for the build of those four object files. (It's bit more complicated >> than that. But I think KBUILD_CFLAGS is explained in Documentation/, >> isn't it?) >> >> Hope this helps, >> >> >> Paul Bolle >> > > > > -- > _ > 0xAX -- _ 0xAX ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: realmode _WAKEUP
Hello Paul, thank you for answer. Yes i saw video-*.c files, but i can't understand how compilation of these video-*.c files depends on _WAKEUP macro... For example if'd remove -D_WAKEUP, i get errors during realmode.elf linking: arch/x86/realmode/rm/video-vga.o: In function `vga_probe': /home/alex/dev/linux/arch/x86/realmode/rm/../../boot/video-vga.c:259: undefined reference to `boot_params' As you wrote there are many #ifndef/#endif directives, but why there _WAKEUP is undefined everytime, but we pass it from command line with -D_WAKEUP? Thank you. 2015-01-07 22:54 GMT+06:00 Paul Bolle : > On Wed, 2015-01-07 at 20:12 +0600, Alexander Kuleshov wrote: >> There is following definition at arch/x86/realmode/rm/Makefile: >> >> KBUILD_CFLAGS:= $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \ >>-I$(srctree)/arch/x86/boot >> >> Is it used now? I'm asking because _WAKEUP definition everywhere >> undefined in the code. > > git grep tells me: > $ git grep -n "_WAKEUP\b" arch/x86 > arch/x86/boot/video-bios.c:51:#ifndef _WAKEUP > arch/x86/boot/video-bios.c:66:#ifdef _WAKEUP > arch/x86/boot/video-mode.c:169:#ifndef _WAKEUP > arch/x86/boot/video-vesa.c:27:#ifndef _WAKEUP > arch/x86/boot/video-vesa.c:29:#else /* _WAKEUP */ > arch/x86/boot/video-vesa.c:31:#endif /* _WAKEUP */ > arch/x86/boot/video-vesa.c:160:#ifndef _WAKEUP > arch/x86/boot/video-vesa.c:272:#endif /* not _WAKEUP */ > arch/x86/boot/video-vga.c:257:#ifndef _WAKEUP > arch/x86/boot/video-vga.c:269:#ifndef _WAKEUP > > And in that Makefile we also see, a few lines up: > wakeup-objs := [...] video-mode.o > [...] > wakeup-objs += video-vga.o > wakeup-objs += video-vesa.o > wakeup-objs += video-bios.o > > So this Makefile line defines a _WAKEUP macro that is, it seems, used > for the build of those four object files. (It's bit more complicated > than that. But I think KBUILD_CFLAGS is explained in Documentation/, > isn't it?) > > Hope this helps, > > > Paul Bolle > -- _ 0xAX ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
realmode _WAKEUP
Hello all, There is following definition at arch/x86/realmode/rm/Makefile: KBUILD_CFLAGS:= $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \ -I$(srctree)/arch/x86/boot Is it used now? I'm asking because _WAKEUP definition everywhere undefined in the code. Thank you. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies