Re: Earlier Linux Code...

2023-05-26 Thread Alexander Kapshuk
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

2023-05-02 Thread Alexander Kapshuk
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(, 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 = >tuplehash[IP_CT_DIR_REPLY].tuple;
>> > nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT,
>> > nf_ct_l3num(ct),
>> > saddr_m, >dst.u3,
>> > IPPROTO_UDP, NULL, >dst.u.udp.port);
>> >
>> > pr_debug("expect: ");
>> > nf_ct_dump_tuple(>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

2023-05-02 Thread Alexander Kapshuk
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(, 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 = >tuplehash[IP_CT_DIR_REPLY].tuple;
> nf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT,
> nf_ct_l3num(ct),
> saddr_m, >dst.u3,
> IPPROTO_UDP, NULL, >dst.u.udp.port);
>
> pr_debug("expect: ");
> nf_ct_dump_tuple(>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

2023-01-20 Thread Alexander Kapshuk
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

2022-10-25 Thread Alexander Kapshuk
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

2021-07-01 Thread Alexander Kapshuk
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

2021-06-29 Thread Alexander Kapshuk
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 | _hook_heads.socket_getpeersec_stream)
>
>   | ^
>
>   CC  kernel/time/posix-clock.o
>
>   AS  arch/arm64/lib/memcmp.o
>
> security/security.c: In function 'security_setprocattr':
>
>   CC   

Re:

2021-01-14 Thread Alexander Kapshuk
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

2021-01-13 Thread Alexander Kapshuk
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

2020-12-10 Thread Alexander Kapshuk
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/installkernel 3.10.0 arch/s390/boot/bzImage System.map /boot
>

Re: How to install kernel modules after a successful compiling

2020-12-10 Thread Alexander Kapshuk
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@bz094f ~]# ls -l /home/zbrand/sourcerpm/
> > total 102468
> > -rw-r--r--. 1 zbrand zbrand257644 Dec  8 13:44
> > asciidoc-8.6.8-5.el7.noarch.rpm
> > -rw-r--r--. 1 zbrand zbrand   1551156 Dec  8 13:45
> > glibc-static-2.17-260.el7.s390x.rpm
> > -rw-r--r--. 1 zbrand zbrand   1307048 Dec  8 14:01
> > graphviz-2.30.1-21.el7.s390x.rpm
> > -rw-r--r--. 1 zbrand zbrand 101028281 Dec  8 13:15
> > kernel-3.10.0-957.el7.src.rpm
> > -rw-r--r--. 1 zbrand zbrand 52620 Dec  8 13:44
> > newt-devel-0.52.15-4.el7.s390x.rpm
> > -rw-r--r--. 1 zbrand zbrand 93176 Dec  8 14:07
> > slang-devel-2.2.4-11.el7.s390x.rpm
> > -rw-r--r--. 1 zbrand zbrand625688 Dec  8 14:02
> > 

Re: How to install kernel modules after a successful compiling

2020-12-09 Thread Alexander Kapshuk
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

2020-10-16 Thread Alexander Kapshuk
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


Fwd: undefined reference to `ioctl_tty'

2019-03-05 Thread Alexander Kapshuk
-- 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, );

Hope this helps.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Linux kernel mailing list filtering issues

2018-07-20 Thread Alexander Kapshuk
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

2018-07-19 Thread Alexander Kapshuk
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: when to use make olddefconfig

2018-04-22 Thread Alexander Kapshuk
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?

2018-03-15 Thread Alexander Kapshuk
On Thu, Mar 15, 2018 at 10:41 AM, Alexander Kapshuk
<alexander.kaps...@gmail.com> wrote:
> On Thu, Mar 15, 2018 at 10:34 AM, Himanshu Chauhan <hs.chau...@gmail.com> 
> wrote:
>>
>>
>> On 15-Mar-2018 1:48 PM, "Alexander Kapshuk" <alexander.kaps...@gmail.com>
>> 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?

2018-03-15 Thread Alexander Kapshuk
On Thu, Mar 15, 2018 at 10:34 AM, Himanshu Chauhan <hs.chau...@gmail.com> wrote:
>
>
> On 15-Mar-2018 1:48 PM, "Alexander Kapshuk" <alexander.kaps...@gmail.com>
> 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?

2018-03-15 Thread Alexander Kapshuk
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: sched_child_runs_first doesn't work

2017-12-07 Thread Alexander Kapshuk
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(, NULL) == 0)
printf("child time sec %ld, usec %ld\n",
tv.tv_sec, tv.tv_usec);
exit(0);
default:
if (gettimeofday(, 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: Eudyptula Challenge scripts not responding?

2017-07-06 Thread Alexander Kapshuk
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

2017-07-02 Thread Alexander Kapshuk
On Wed, Jun 28, 2017 at 10:48 PM, Shahbaz khan <shazal...@gmail.com> wrote:
> Hi Alexander,
>
> On Wed, Jun 28, 2017 at 1:46 PM, Alexander Kapshuk
> <alexander.kaps...@gmail.com> 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

2017-06-28 Thread Alexander Kapshuk
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

2017-05-17 Thread Alexander Kapshuk
-- Forwarded message --
From: Alexander Kapshuk <alexander.kaps...@gmail.com>
Date: Wed, May 17, 2017 at 10:20 AM
Subject: Re: Importance of kobject
To: Madhu K <madhu.s...@gmail.com>


On Wed, May 17, 2017 at 10:08 AM, Madhu K <madhu.s...@gmail.com> 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

2017-04-20 Thread Alexander Kapshuk
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

2017-03-30 Thread Alexander Kapshuk
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?

2017-03-21 Thread Alexander Kapshuk
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

2017-03-19 Thread Alexander Kapshuk
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

2017-03-16 Thread Alexander Kapshuk
On Wed, Mar 15, 2017 at 11:15 PM, Tobin C. Harding <m...@tobin.cc> wrote:
> On Wed, Mar 15, 2017 at 12:12:48PM +0100, Bjørn Mork wrote:
>> Alexander Kapshuk <alexander.kaps...@gmail.com> writes:
>>
>> >>> On Wed, Mar 15, 2017 at 10:31 AM, Tobin C. Harding <m...@tobin.cc> 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(>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

2017-03-15 Thread Alexander Kapshuk
On Wed, Mar 15, 2017 at 12:40 PM, Tobin C. Harding <m...@tobin.cc> 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 <m...@tobin.cc> 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

2017-03-15 Thread Alexander Kapshuk
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

2017-03-13 Thread Alexander Kapshuk
On Mon, Mar 13, 2017 at 12:08 PM, SIMRAN SINGHAL
<singhalsimr...@gmail.com> wrote:
> On Mon, Mar 13, 2017 at 1:05 PM, Greg KH <g...@kroah.com> 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
>>> <alexander.kaps...@gmail.com> wrote:
>>> > On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL
>>> > <singhalsimr...@gmail.com> wrote:
>>> >> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
>>> >> <alexander.kaps...@gmail.com> wrote:
>>> >>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
>>> >>> <singhalsimr...@gmail.com> wrote:
>>> >>>> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>>> >>>> <alexander.kaps...@gmail.com> wrote:
>>> >>>>> On Sun, Mar 12, 2017 at 5:34 PM,  <valdis.kletni...@vt.edu> 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
>>> >>
>>> >> No

Re: Problem in First-Patch-Tutorial

2017-03-13 Thread Alexander Kapshuk
On Mon, Mar 13, 2017 at 8:09 AM, SIMRAN SINGHAL
<singhalsimr...@gmail.com> wrote:
> On Mon, Mar 13, 2017 at 10:42 AM, Alexander Kapshuk
> <alexander.kaps...@gmail.com> wrote:
>> On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL
>> <singhalsimr...@gmail.com> wrote:
>>> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
>>> <alexander.kaps...@gmail.com> wrote:
>>>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
>>>> <singhalsimr...@gmail.com> wrote:
>>>>> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>>>>> <alexander.kaps...@gmail.com> wrote:
>>>>>> On Sun, Mar 12, 2017 at 5:34 PM,  <valdis.kletni...@vt.edu> 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 <ji...@kernel.org>
> 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

2017-03-12 Thread Alexander Kapshuk
On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL
<singhalsimr...@gmail.com> wrote:
> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
> <alexander.kaps...@gmail.com> wrote:
>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
>> <singhalsimr...@gmail.com> wrote:
>>> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>>> <alexander.kaps...@gmail.com> wrote:
>>>> On Sun, Mar 12, 2017 at 5:34 PM,  <valdis.kletni...@vt.edu> 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

2017-03-12 Thread Alexander Kapshuk
On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
<singhalsimr...@gmail.com> wrote:
> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
> <alexander.kaps...@gmail.com> wrote:
>> On Sun, Mar 12, 2017 at 5:34 PM,  <valdis.kletni...@vt.edu> 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

2017-03-12 Thread Alexander Kapshuk
On Sun, Mar 12, 2017 at 5:34 PM,  <valdis.kletni...@vt.edu> 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

2017-03-12 Thread Alexander Kapshuk
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: Code Compilation

2017-02-12 Thread Alexander Kapshuk
On Sun, Feb 12, 2017 at 10:49 AM, Wasim Akram <wasim7702843...@gmail.com> 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
> <alexander.kaps...@gmail.com> wrote:
>> On Sun, Feb 12, 2017 at 10:00 AM, Wasim Akram <wasim7702843...@gmail.com> 
>> 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

2017-02-12 Thread Alexander Kapshuk
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

2017-02-11 Thread Alexander Kapshuk
On Sat, Feb 11, 2017 at 6:32 PM, Madhu K <madhu.s...@gmail.com> 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
> <alexander.kaps...@gmail.com> wrote:
>>
>> On Sat, Feb 11, 2017 at 3:28 PM, Madhu K <madhu.s...@gmail.com> 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

2017-02-11 Thread Alexander Kapshuk
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

2017-01-25 Thread Alexander Kapshuk
On Thu, Jan 26, 2017 at 8:33 AM, Alexander Kapshuk
<alexander.kaps...@gmail.com> wrote:
> On Thu, Jan 26, 2017 at 3:32 AM, Abel <akron...@gmail.com> 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

2017-01-25 Thread Alexander Kapshuk
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?

2017-01-03 Thread Alexander Kapshuk
On Tue, Jan 3, 2017 at 4:11 PM, Alexander Kapshuk
<alexander.kaps...@gmail.com> wrote:
> On Tue, Jan 3, 2017 at 9:32 AM, Shiyao Ma <i...@introo.me> 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
>> <alexander.kaps...@gmail.com>, wrote:
>>
>> On Mon, Jan 2, 2017 at 1:39 PM, Shiyao Ma <i...@introo.me> 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?

2017-01-03 Thread Alexander Kapshuk
On Tue, Jan 3, 2017 at 9:32 AM, Shiyao Ma <i...@introo.me> 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
> <alexander.kaps...@gmail.com>, wrote:
>
> On Mon, Jan 2, 2017 at 1:39 PM, Shiyao Ma <i...@introo.me> 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?

2017-01-02 Thread Alexander Kapshuk
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?

2016-12-16 Thread Alexander Kapshuk
On Fri, Dec 16, 2016 at 8:57 AM, Perr Zhang <strongb...@zoho.com> wrote:
>   On Fri, 16 Dec 2016 00:26:24 +0800 Alexander Kapshuk 
> <alexander.kaps...@gmail.com> 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 = _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(>kobj, _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(_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, >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

2016-12-02 Thread Alexander Kapshuk
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


Re: Append Localversion to Kernel String

2016-10-06 Thread Alexander Kapshuk
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

2016-09-29 Thread Alexander Kapshuk
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

2016-09-28 Thread Alexander Kapshuk
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