Re: Overwriting copy functionality in filesystem

2019-03-24 Thread Valdis Klētnieks
On Sun, 24 Mar 2019 18:48:08 +0530, Bharath Vedartham said: > I was interested in implementing copy-on-write for my filesystem(for fun > :P). When I do a "cp" operation, I do not want to create a seperate > inode for the new file. I only want to create a inode when I make a > change to the file.

Re: What will happen if 2 processes map same physical page

2019-03-22 Thread Valdis Klētnieks
On Fri, 22 Mar 2019 12:15:49 +0300, Lev Olshvang said: > But the question might be rephrased : IMHO Kernel should mandate same PTE > flags no matter how many virtual mapping were made to the same physical page. And exactly *why* should it be "mandated"? Certainly, for many classes of objects,

Re: How to calculate page address to PFN in user space.

2019-04-05 Thread Valdis Klētnieks
On Fri, 05 Apr 2019 10:54:47 -, Pankaj Suryawanshi said: > I have PFN of all processes in user space, how to calculate page address to > PFN. *All* user processes? That's going to be a lot of PFN's. What problem are you trying to solve here? (Hint - under what cases does the kernel care

Re: Unexpected scheduling with mutexes

2019-03-29 Thread Valdis Klētnieks
On Fri, 29 Mar 2019 21:01:58 +0100, Greg KH said: > But if you are trying to somehow create a real api that you have to > enforce the passing off of writing data from two different character > devices in an interleaved format, you are doing this totally wrong, as > this is not going to work with

Re: Overwriting copy functionality in filesystem

2019-03-28 Thread Valdis Klētnieks
On Fri, 29 Mar 2019 00:00:17 +0530, Bharath Vedartham said: > I was thinking of a use case where we are copying a huge file (say 100 > GB), if we do copy-on-write we can speed up /bin/cp for such files i > feel. Any comments on this? Hmm.. wait a minute. What definition of "copy on write" are

Re: maintainer for this update?

2019-03-28 Thread Valdis Klētnieks
On Thu, 28 Mar 2019 14:53:28 -0700, Dave Stevens said: > In the article below about kernel updates is a reference to a driver for > a Plantower PMS7003 particulate matter sensor. I'm using this series in > air pollution monitoring and its usual interface to the computer > is over a serial line. I

Re: Where is PageHead defined in v5.0?

2019-03-27 Thread Valdis Klētnieks
On Wed, 27 Mar 2019 17:23:05 -0700, Igor Pylypiv said: > and TESTPAGEFLAG defines PageHead: > #define TESTPAGEFLAG(uname, lname, policy) \ > static __always_inline int Page##uname(struct page *page) > >

Re: Questions about my idea (for gsoc)

2019-04-01 Thread Valdis Klētnieks
On Mon, 01 Apr 2019 18:19:12 +0200, Andrea Laisa said: > My idea is to write a Linux driver for a proprietary network protocol > used by the outdoor Gemtek antennas(which are essentially a LTE modem) This may be a legal mine field. To create a *usable* Linux driver, you'll need to have one

Re: Overwriting copy functionality in filesystem

2019-03-23 Thread Valdis Klētnieks
On Sat, 23 Mar 2019 22:29:45 +0530, Bharath Vedartham said: > I was wondering how we can overwrite the copy functionality while > writing our own filesystem in linux. > VFS does not offer any sort of API for copy. I think it calls create and > write when we execute the copy the file/dir. Which

Re: What will happen if 2 processes map same physical page

2019-03-20 Thread Valdis Klētnieks
On Wed, 20 Mar 2019 16:42:39 +0300, Lev Olshvang said: > The question is it ipossiblle in Linux/MMU/TLB that 2 processes map to > the same physical address? Totally possible. That's how mmap shared memory works, and why shared libraries are possible. > Will CPU or TLB discover that second

Re: fsync slowness + XFS -- Regd.

2019-03-19 Thread Valdis Klētnieks
On Tue, 19 Mar 2019 07:40:29 +0530, Jeno P said: > One of my module *(C/C++)* is writing to log files and periodically flushes > it using *fsync()*. Even for small amount of data, *fsync* is taking more > time *(>15 seconds)* than expected. Is it possible that some other process is applying a

Re: development in python

2019-05-12 Thread Valdis Klētnieks
On Sun, 12 May 2019 19:05:29 +0200, Tom�š Roj said: > I know that everything in the kernel is written in C but are there also > some fields where can I code in Python? I mean some websites etc. Not a whole lot of Python being used for building websites. Now if you meant websites that have

Re: how to collect information regarding function calls in run time?

2019-05-17 Thread Valdis Klētnieks
On Tue, 14 May 2019 16:11:51 -0300, Pedro Terra Delboni said: > I agree that the question alone seems like a weird one, I just assumed > when I wrote my first email that the explaining the motivation would > only consume time of the reader. Asking "what problem are you trying to solve" is a

Re: GPIO Driver for Skylake-Y PCH

2019-06-14 Thread Valdis Klētnieks
On Fri, 14 Jun 2019 12:01:28 -0700, you said: > > static const struct pci_device_id pch_gpio_pcidev_id[] = { > > { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) }, > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) }, > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8043) }, > > { PCI_DEVICE(PCI_VENDOR_ID_ROHM,

Re: GPIO Driver for Skylake-Y PCH

2019-06-14 Thread Valdis Klētnieks
On Fri, 14 Jun 2019 10:58:53 -0700, "Alexander Ivanov" said: > I have a hardware platform with Skylake i7-6500 CPU and Skylake-Y PCH > southbridge, running 4.8.5 kernel fc25. The platform has 12 GPIO pins, > however, > none are available. gpio-pch driver does not support D31:F2 device that >

Re: GPIO Driver for Skylake-Y PCH

2019-06-15 Thread Valdis Klētnieks
On Fri, 14 Jun 2019 15:40:59 -0700, "Alexander Ivanov" said: (Adding likely knowledgeable people to the recipients) Jean, Andy, Linus: The situation thus far: Alexander has a system with this GPIO on it: > lspci -vvvnns 1f.1 > 00:1f.1 Memory controller [0580]: Intel Corporation Device

Re: GPIO Driver for Skylake-Y PCH

2019-06-18 Thread Valdis Klētnieks
On Tue, 18 Jun 2019 11:40:34 +0300, Andy Shevchenko said: > Yes. Most of the SoCs from Intel use GPIO IP based on Chassis specification, > the drivers for which are available under drivers/pinctrl/intel. What you are > looking for is located under PINCTRL_SUNRISEPOINT configuration option.

Re: [IMX] [DRM]: suspend/resume support

2019-06-19 Thread Valdis Klētnieks
On Wed, 19 Jun 2019 20:47:34 +0530, Pintu Agarwal said: > No I mean to say, there are lots of features and customization already > done on this version and stabilized. > Upgrading again may require months of effort. This is what happens when you don't upstream your local changes. And no, saying

Re: GPIO Driver for Skylake-Y PCH

2019-06-15 Thread Valdis Klētnieks
On Sat, 15 Jun 2019 12:38:34 -0700, "Alexander Ivanov" said: > This is fedora 25 running 4.8.6 kernel. It probably won't fix the problem, but you should upgrade if at all possible. You're not getting any security patches for 25. 30 is the current release, with 31 due out fairly soon.

Re: how to determine whether the source code is same between two kernels

2019-05-11 Thread Valdis Klētnieks
On Sat, 11 May 2019 09:20:22 -0400, Aruna Hewapathirane said: > Seriously ? Since when are you working for turing-police ? I'm semi-retired. :) And there's two other systems in the room called wintermute and neuromancer. Hopefully you can figure it out from there. :) pgpCqPU2a9tRj.pgp

Re: how to determine whether the source code is same between two kernels

2019-05-10 Thread Valdis Klētnieks
On Fri, 10 May 2019 22:11:31 -0400, Aruna Hewapathirane said: > > Suppose I have two kernels, one is A.B.C build by people Tom. And > > the other is A.B.C build by Jerry. The source code have been deleted > Run diff vmlinuz-Tom vmlinuz-Jerry and see if they differ. Then just to Don't even

[PATCH] scripts/spdxcheck.py - fix list of directories to check

2019-05-12 Thread Valdis Klētnieks
After this commit: commit 62be257e986dab439537b3e1c19ef746a13e1860 Author: Christoph Hellwig Date: Tue Apr 30 06:51:30 2019 -0400 LICENSES: Rename other to deprecated checkpatch throws an error: [/usr/src/linux-next]2 scripts/checkpatch.pl -f drivers/staging/rtl8712/rtl871x_rf.h FAIL:

Re: Checkpatch.pl FAIL: "Blob or Tree named 'other' not found"

2019-05-12 Thread Valdis Klētnieks
On Sun, 12 May 2019 11:45:24 +0530, Deepak Mishra said: > When I run checkpatch.pl, for every file I get the follwong or similar > error. Could you please help if this is my environment issue or actually > error in code which I need to fix ? > > I executed the following in command prompt. > perl

Re: how to collect information regarding function calls in run time?

2019-05-14 Thread Valdis Klētnieks
On Tue, 14 May 2019 10:55:40 -0300, Pedro Terra Delboni said: > Regarding bpftrace: This seemed like the best option since I could use it > to count frames of the stack with depth 2, allowing me to know precisely > the amount of times each specific call has been made. However, I could not > use

Re: Page Allocation Failure and Page allocation stalls

2019-05-01 Thread Valdis Klētnieks
On Thu, 02 May 2019 04:56:05 +0530, Pankaj Suryawanshi said: > Please help me to decode the error messages and reason for this errors. > [ 3205.818891] HwBinder:1894_6: page allocation failure: order:7, > mode:0x14040c0(GFP_KERNEL|__GFP_COMP), nodemask=(null) Order 7 - so it wants 2**7

Re: radix_tree_next_chunk: redundant search for next slot in hole

2019-05-03 Thread Valdis Klētnieks
On Fri, 03 May 2019 16:03:46 -0500, Probir Roy said: > While searching for next slot in a hole, it walks through the same > slots over n over. How did you determine this? > while (++offset < RADIX_TREE_MAP_SIZE) { > void *slot = rcu_dereference_raw( /* redundant

Re: radix_tree_next_chunk: redundant search for next slot in hole

2019-05-03 Thread Valdis Klētnieks
On Fri, 03 May 2019 19:00:26 -0500, Probir Roy said: > > > While searching for next slot in a hole, it walks through the same > > > slots over n over. > > > > How did you determine this? > > I am working on a tool that identifies repeated load of an address. > Often these repeated loads are

Re: ULIMIT: limiting user virtual address space (stack inluded)

2019-05-02 Thread Valdis Klētnieks
On Thu, 02 May 2019 09:06:09 -0400, Karaoui mohamed lamine said: > According to the man page of "ulimit", it is possible to limit the virtual > address space of a user process: https://ss64.com/bash/ulimit.html > To limit the virtual address space to 2 GB: > $ ulimit -SH -v 1048576 It's

Re: Best practice to upgrade kernel

2019-04-26 Thread Valdis Klētnieks
On Fri, 26 Apr 2019 11:17:24 -0700, Xiaolong Wang said: > I have a newbie question. I’m using a 3.18.66 kernel branch from Qualcomm. > Over the year I’ve applied some of patched here and there manually. > But It seems Qualcomm does not patch lot of newly released vulnerabilities. I > would

Re: how to determine whether the source code is same between two kernels

2019-05-08 Thread Valdis Klētnieks
On Wed, 08 May 2019 16:52:46 +0800, wuzhouhui said: > Suppose I have two kernels, one is A.B.C build by people Tom. And > the other is A.B.C build by Jerry. The source code have been deleted > after kernel is build and installed. Now I want to know whether the > source code of these two kernel is

Re: __clksrc_of_table and "clocksource_probe: no matching clocksources found"

2019-04-23 Thread Valdis Klētnieks
On Tue, 23 Apr 2019 17:07:14 -0300, Guilherme Costa said: > From the code, we can see that the message was printed because > clocksources == 0. This implies that there were no matching nodes on > the device tree, Right. > and that acpi_probe_device_table returned 0 (which is correct, seeing >

Re: Partition linux page cache for each VM

2019-04-25 Thread Valdis Klētnieks
On Fri, 26 Apr 2019 03:01:52 +0530, Chirag Chauhan said: > I have selected this as a course project for a course on virtualization. > Doing this will reduce the performance interference between virtual > machines. Actually, it can make it worse. Consider the behavior of 4 VMs sharing 16G of

Driver for t2uh mt7610e/mt7610e (was Re: Frank

2019-08-03 Thread Valdis Klētnieks
On Sat, 03 Aug 2019 10:57:15 -0400, Pastor Frank Ernesto Ram�rez Torres said: > Hi, I downloaded the Linux 5.2.5 kernel from your website. I have a tplink > t2uh that I would like to operate on the Debian 9.0 system that I have > installed. Note that there is an option in the configuration to

Re: How to handle page allocation when memory exceeds a local node

2019-08-22 Thread Valdis Klētnieks
On Thu, 22 Aug 2019 17:41:22 +0900, Won-Kyo Choe said: > In my perspective, if the kernel starts to allocate in the remote node, > I think the scheduler should move the process to the remote node and it > will allocate a page in the remote node at first in the loop (in the > process view, the

Re: Staging/netlogic coding style issues with struct

2019-09-03 Thread Valdis Klētnieks
On Tue, 03 Sep 2019 01:26:17 -0300, Pablo Pellecchia said: > *WARNING: struct should normally be const#9: FILE: > platform_net.h:9:+struct xlr_net_data {* > > A similar issue is reported when we declare a variable of type struct > , but in this case warning is reported on the struct definition >

Re: [OSSNA] Intro to kernel hacking tutorial

2019-09-02 Thread Valdis Klētnieks
On Mon, 02 Sep 2019 15:42:19 +0300, Anatoly Pugachev said: > is it intentionally that you use > > yes "" | make oldconfig > > instead of > > make olddefconfig They do something different. 'olddefconfig' just takes the platform or architecture defconfig and updates it for any new CONFIG_*

Re: checkpatch.pl CHECK alignment

2019-09-02 Thread Valdis Klētnieks
On Mon, 02 Sep 2019 16:17:00 -, "XenoN. w0w" said: > Hello all, I am running checkpath.pl against one driver and I’m getting > CHECK: Alignment should match open parenthesis > Are these lines worth of changing, what are the odds of that patch being > accepted. I’m new and I want to

Re: is there a macro symbol for strlen($LINUX_SOURCE_PATH)

2019-09-05 Thread Valdis Klētnieks
On Thu, 05 Sep 2019 08:31:55 -0600, jim.cro...@gmail.com said: > So I feel compelled to offer a fix for dynamic_debug, attached. > hopefully it explains adequately, I have some doubts.. > > maybe this should go to LKML now, > but I guess Id prefer to make my obvious thinkos less publicly. > Im

Re: perf_event wakeup_events = 0

2019-09-07 Thread Valdis Klētnieks
On Sat, 07 Sep 2019 09:14:49 -0700, Theodore Dubois said: > If I’m reading this right, this is a sampling event which overflows 4000 > times a second. But perf then does a poll call which wakes up on this FD with > POLLIN after 1.637 seconds, instead of 0.00025 seconds. No, it *takes a sample*

Re: perf_event wakeup_events = 0

2019-09-07 Thread Valdis Klētnieks
On Sat, 07 Sep 2019 09:14:49 -0700, Theodore Dubois said: Reading what it actually says rather than what I thought it said.. :) Events come in two flavors: counting and sampled. A counting event is one that is used for counting the aggregate number of events that

Re: perf_event wakeup_events = 0

2019-09-07 Thread Valdis Klētnieks
On Fri, 06 Sep 2019 16:28:24 -0700, Theodore Dubois said: > The man page for perf_event_open(2) says that recent kernels treat a 0 > value for wakeup_events the same as 1, which I believe means it will > notify after a single sample. However, strace on perf(1) shows that it > uses wakeup_events=0,

Re: newbie-level question about cgroups

2019-07-28 Thread Valdis Klētnieks
On Sun, 28 Jul 2019 15:39:26 -0400, "Robert P. J. Day" said: > no point bugging the actual cgroup people about this since it should > be simple ... if i need *only* cgroup v2, can i dispense entirely with > everything under /sys/fs/cgroup/ other than /sys/fs/cgroup/unified? There's a whole

Re: wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up()

2019-07-29 Thread Valdis Klētnieks
On Mon, 29 Jul 2019 22:48:57 +0530, Muni Sekhar said: > Let us assume that multiple processes are waiting on wait_event()\ > wait_event_interruptible()\ wait_event_interruptible_timeout(), which > process gets woken up on calling wake_up()?? > > I presume wake_up() picks one process, but is there

Re: wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up()

2019-07-29 Thread Valdis Klētnieks
On Mon, 29 Jul 2019 23:37:34 +0530, Muni Sekhar said: > On Mon, Jul 29, 2019 at 11:31 PM Bharath Vedartham > wrote: > > Sorry to spoil the fun here. But check out what the queue data structure > > is all about. 'wait_queue' :) > A wait queue is a doubly linked list of wait_queue_t structures

Re: wait_event()\ wait_event_interruptible()\ wait_event_interruptible_timeout() and wake_up()

2019-08-06 Thread Valdis Klētnieks
On Tue, 06 Aug 2019 14:15:53 +0530, Muni Sekhar said: > If they do different things, does the waiting threads wakeup order is > the same in which they were enqueued (FIFO order)? You missed the point - if you have (for example) something that's waiting for mouse I/O and something that's waiting

Re: Query TCP states/connection tracking table in Linux Kernel Module

2019-09-19 Thread Valdis Klētnieks
On Thu, 19 Sep 2019 06:12:46 -, Yadunandan Pillai said: > I'm developing a proxy system for TCP handshakes. The programmer's version of "I'm writing the Great American Novel". :) > However, I'm unable to find a way to verify an incoming ACK packet. That will depend on exactly what you mean

Re: Hello, does anyone know any university that has lines of research on the linux kernel

2019-09-28 Thread Valdis Klētnieks
On Sat, 28 Sep 2019 12:45:11 -0600, Manuel Quintero Fonseca said: > Hello, does anyone know any university that has lines of research on > the linux kernel Well.. most of the actual code development is being done out in industry and by individuals. The stuff that happens in universities is

Re: Generating Log of Guest Physical Addresses from a Kernel Function and Perform Analysis at Runtime

2019-09-26 Thread Valdis Klētnieks
On Thu, 26 Sep 2019 20:05:57 +1000, Brock said: > On Thu, 2019-09-26 at 15:45 +0900, Sahibzada Irfanullah wrote: > > Thank you very for your help. I have checked the ftrace, and perf. I > > think it won't work for me.I am not analyzing/tracing the the kernel. > > I want to develop my own dynamic

Re: Fwd: Need Help regarding Reading and Writting to a file from kernel function file

2019-09-24 Thread Valdis Klētnieks
On Tue, 24 Sep 2019 16:10:07 +0900, Sahibzada Irfanullah said: > subject line. The problem is: I am trying to write/read page faulted > physical addresses to a file in a kernel (v5.3-1) function, i.e., > handle_ept_violation() which is present in vmx.c. I have followed this >

Re: Generating Log of Guest Physical Addresses from a Kernel Function and Perform Analysis at Runtime

2019-09-24 Thread Valdis Klētnieks
On Tue, 24 Sep 2019 19:10:59 +0900, Sahibzada Irfanullah said: > My actual goal is to generate log of physical addresses for different > applications by writing them into the file, and then perform some analysis What makes you think that the log of physical addresses will tell you anything

Re: Do I need strong mathematical bases to work in the memory subsystem?

2019-09-29 Thread Valdis Klētnieks
On Sun, 29 Sep 2019 17:48:43 -0500, CRISTIAN ANDRES VARGAS GONZALEZ said: > Hello good morning, to be developed from the kernel do I need to have good > math bases? I want to help in the ram memory subsystem and I have that > doubt thank you. Depends what you mean by "strong math basics".

Re: Generating Log of Guest Physical Addresses from a Kernel Function and Perform Analysis at Runtime

2019-09-24 Thread Valdis Klētnieks
On Tue, 24 Sep 2019 20:26:36 +0900, Sahibzada Irfanullah said: > After having a reasonable amount of log data, If you're trying to figure out how the kernel memory manager is working, you're probably better off using 'perf' or one of the other tracing tools already in the kernel to track the

Re: Linux stable: 4.19 vs 4.14

2019-11-02 Thread Valdis Klētnieks
On Fri, 01 Nov 2019 14:24:26 -0700, Avinash Patil said: > Hi Greg, I'm not Greg, but... :) > I am curious as to why Linux4.19 which was released later has earlier > EOL than 4.14? Not all stable releases are kept going for the same amount of time. Most go EOL as soon as a few newer releases

Re: [PATCH 1/1] syscalls: Fix references to filenames containing syscall defs

2019-11-04 Thread Valdis Klētnieks
On Mon, 04 Nov 2019 18:00:05 -0500, Mohammad Nasirifar said: > Fix stale references to files containing syscall definitions in > 'include/linux/syscalls.h' and 'include/uapi/asm-generic/unistd.h', > pointing to 'kernel/itimer.c', 'kernel/hrtimer.c', and 'kernel/time.c'. > They are now under

Re: [PATCH] hwmon: (dell-smm-hwmon) Disable BIOS fan control upon loading

2019-11-12 Thread Valdis Klētnieks
On Tue, 12 Nov 2019 22:41:28 +0100, Giovanni Mascellani said: > Disable BIOS fan control on such laptops at module loading, and > re-enable it at module unloading, so that a userspace controller like > i8kmon can take control of the fan. The code as written appears to make the disabling

Re: Netlink socket returns NULL in vmx.c kernel file

2019-11-05 Thread Valdis Klētnieks
On Tue, 05 Nov 2019 17:59:43 +0900, Irfan Ullah said: > Thank you for the response. > Attached are the files for kernel-user spaces communication. > //when I remove this wait the code does not work > msleep(3000); If your code doesn't work, but sticking in random

Re: How to get the preprocessor output as part of the compilation process?

2019-12-08 Thread Valdis Klētnieks
On Sun, 08 Dec 2019 14:05:06 -0500, "Frank A. Cancio Bello" said: > I know that with gcc -E you can get the output of the preprocessor, but what > I have to do to get that output for every source code file in the Linux Lernel > as part of the compilation process? What problem are you trying to

Re: Free RAM in Linux .

2019-12-16 Thread Valdis Klētnieks
On Tue, 17 Dec 2019 10:39:08 +0530, Neel chakraborty said: > Does Linux use all of the physical memory (RAM) I have ? In both the > outputs of /proc/meminfo and free -h , shows that 1.4 gigs is used and 1.6 > gigs is cached , and the rest is "free" out of 32 Gigs . The available ram > is the

Re: Missing FDT description in DTB

2019-12-06 Thread Valdis Klētnieks
On Fri, 06 Dec 2019 10:03:34 +0100, Tomek Domek said: > And this uboot and spl is somekind of experimental software which is in > the middle of creation. Could anyone try to guide what might be possible > the reason of the issue as I am a bit new in u-boot development? Is there a reason why

Re: How to get the preprocessor output as part of the compilation process?

2019-12-09 Thread Valdis Klētnieks
On Mon, 09 Dec 2019 13:10:11 +0300, Konstantin Andreev said: > The universal approach that always works in this and many similar cases is > just > to replace the instrumented binary by your interception shell script. > E.g. rename gcc to gcc.hide (generally, moving into another location may not

Re: Can't seem to find a maintainer for init/* files

2019-10-21 Thread Valdis Klētnieks
On Tue, 22 Oct 2019 01:37:33 +1300, Paulo Miguel Almeida said: > In a second approach: > I tried making "git log" to list all the commits this particular file was > involved in > (so I could use --follow) but I ended up with loads of commits that change > other sections > of the file (not the

Re: Kernel Panic

2019-10-15 Thread Valdis Klētnieks
On Tue, 15 Oct 2019 07:21:18 -, Christophe DUMONT said: > We're facing Kernel Panic on CentOS 7 since upgrading from 3.10.0-957 to > 3.10.0-1062. I'm thinking about a java memory leak, but not sure. > Do you know what's going on here ? Well, what made you think "Java memory leak"? Java is

Re: Kernel Panic

2019-10-16 Thread Valdis Klētnieks
On Wed, 16 Oct 2019 07:34:01 -, Christophe DUMONT said: > What made me think about a memory leak is the message : Java Not Tainted > 3.10.0-1062.1.1.el7.x86_64.=20 That just tells you that the currently executing process was java. It says nothing at all about a memory leak, and as I

Re: Getting netlink socket creation returns NULL in the kernel

2019-10-16 Thread Valdis Klētnieks
On Wed, 16 Oct 2019 13:54:08 +0900, Irfan Ullah said: > developed kernel space, and user space programs. Kernel and user space > programs working perfectly when I load and run these modules from the > terminal using “sudo insmod kernelmodule.ko”, and “./userspaceApp” > respectively.

Re: Setting up to debug kernel

2019-10-16 Thread Valdis Klētnieks
On Wed, 16 Oct 2019 18:14:10 -0700, Jerry DeLisle said: > My first thought is to try to connect via a serial port or similarly a USB > based > port and get some sort of continuous stream of log data that I can capture on > another machine. If you have a network, netconsole may be an option. If

Re: Try/catch for modules?

2019-10-18 Thread Valdis Klētnieks
On Fri, 18 Oct 2019 13:11:54 -0300, Martin Galvan said: > I don't think I was clear. My intent is that if a pointer bug isn't > fixed, my module will fail gracefully and go through the catch block > instead of panicking the whole system. Well..here's the thing. Unless you have "panic_on_oops"

Re: Try/catch for modules?

2019-10-18 Thread Valdis Klētnieks
On Fri, 18 Oct 2019 12:43:58 -0300, Martin Galvan said: > goto statements are harmful. For starters, note that the original paper was written in 1968. Yes, it's over a half century old now. Have you actually *read* the paper? https://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.pdf You

Re: Can't seem to find a maintainer for init/* files

2019-10-18 Thread Valdis Klētnieks
On Sat, 19 Oct 2019 10:33:00 +1300, Paulo Almeida said: > 1 - This specific code block has been around for quite some time and many > additions using the correct printk(KERN_* were made after it was written. > Does that mean that this code block is an exception and should be left > as-is for some

Re: Try/catch for modules?

2019-10-17 Thread Valdis Klētnieks
On Thu, 17 Oct 2019 10:37:09 -0300, Martin Galvan said: > module does e.g. a NULL dereference. The (horribly hackish) way I'm > doing this right now is registering a die_notifier which will set the > 'panic_on_oops' variable to 0 if we detect that the current PID > corresponds to my module.

Re: Netlink socket returns NULL in vmx.c kernel file

2019-10-22 Thread Valdis Klētnieks
On Wed, 23 Oct 2019 11:43:22 +0900, Irfan Ullah said: > Can you please what's the problem? To be brutally honest, your code is too unreadable to figure out what the problem is. First off, fix your code formatting to match Linux kernel indenting. Second, there's a lot of code in your .h file

Re: Just started w/Linux Kernel (Beginner)

2019-11-24 Thread Valdis Klētnieks
On Sun, 24 Nov 2019 11:58:24 +, Benjamin Selormey said: > Hello, > > I’m a newbie with Linux kernel and I l want to contribute in security > research of the Linux Kernel. A newbie? Go and read https://lists.kernelnewbies.org/pipermail/kernelnewbies/2017-April/017765.html and

Re: How to printk synchronously

2019-11-27 Thread Valdis Klētnieks
On Tue, 26 Nov 2019 22:31:08 +, Lucas Tanure said: > Hi, > > What about ftrace ? Documentation/trace/ftrace.txt That won't help - his ^@^@^@ is a result of the system stopping and no longer writing to disk, so his logfile has blocks allocated to it but not yet written to. Using ftrace will

Re: Kernel TLS

2019-11-29 Thread Valdis Klētnieks
On Fri, 29 Nov 2019 23:37:35 -0500, Jeffrey Walton said: repl: bad addresses: Valentin VidiD -- no mailbox in address, only a phrase (Valentin VidiD) > On Fri, Nov 29, 2019 at 3:04 PM Jeffrey Walton wrote: > > ... > > So now I am at: > > > > $ gcc -Wall -g2 -O1 ktls.c -o ktls > >

Re: Kernel TLS

2019-11-30 Thread Valdis Klētnieks
On Sat, 30 Nov 2019 09:13:35 +0100, Bj�rn Mork said: > include/linux/errno.h is kernel internal only. The UAPI header is > uapi/linux/errno.h, which is an alias for uapi/asm/errno.h. There is no > 524 in include/uapi/asm-generic/errno.h or > include/uapi/asm-generic/errno-base.h > > The codes

Re: Kernel TLS

2019-11-30 Thread Valdis Klētnieks
On Sat, 30 Nov 2019 11:10:50 +0100, Bj�rn Mork said: > My version of setsockopt(2) says (...) > ERRORS >EBADF The argument sockfd is not a valid file descrip‐ > tor. > Note that there is no general *guarantee* that a syscall cannot return any values other than the

Re: Just joined

2019-11-19 Thread Valdis Klētnieks
On Tue, 19 Nov 2019 17:03:37 +0530, Akash Sarda said: > Hi, > > My name is Akash, and I want to start with OS development.. > I am interested in memory management, and would like to know if anyone > has a newbie project in their mind.. Unfortunately, there's probably not much good newbie work in

Re: Generating Log of Guest Physical Addresses from a Kernel Function and Perform Analysis at Runtime

2019-09-25 Thread Valdis Klētnieks
On Wed, 25 Sep 2019 11:38:24 +0200, Greg KH said: > Try using ftrace and tracing in general first, before messing around > with netlink. ftrace does not require any kernel changes at all, why > would you _not_ want to try that? :) Beginning programmers write complicated messy code. Good

Re: Software Prefetching using Machine learning

2019-10-09 Thread Valdis Klētnieks
On Thu, 10 Oct 2019 11:48:11 +0900, Irfan Ullah said: > it can it be possible to share any type of data structure (e.g., structure, > array, etc.) between kernel space C program and user space Python program > in two way communication. Python's split() is probably the wrong tool here. You

Kernel development tools (was Re: Software Prefetching using Machine learning)

2019-10-09 Thread Valdis Klētnieks
On Thu, 10 Oct 2019 11:48:11 +0900, Irfan Ullah said: > @All,* There is one thing I want to share, although it is not too relevant > but worth to share,* that very limited number of *easy-to-use-&-understand* > tools and libraries available to welcome and facilitate the > newbies/freshmen in the

Re: Software Prefetching using Machine learning

2019-10-09 Thread Valdis Klētnieks
On Wed, 09 Oct 2019 12:37:51 +0900, Irfan Ullah said: > Thanks in advance. I am a PhD candidate, and currently I have started > working on kernel development. My professor told me to implement this paper > . In this paper authors have used machine > learning to

Re: Predicting Process crash / Memory utlization using machine learning

2019-10-09 Thread Valdis Klētnieks
On Wed, 09 Oct 2019 01:23:28 -0700, prathamesh naik said: > I want to work on project which can predict kernel process > crash or even user space process crash (or memory usage spikes) using > machine learning algorithms. This sounds like it's isomorphic to the Turing Halting

Re: Hello, does anyone know any university that has lines of research on the linux kernel

2019-10-03 Thread Valdis Klētnieks
On Thu, 03 Oct 2019 16:09:28 -0600, Manuel Quintero Fonseca said: > Thank you all for answering, my question is, if I want to do a phD > that has to do with the Linux kernel, it will be more difficult to be > accepted at a university, where they do not have lines of research on > Linux, those

Re: Test the kernel code

2019-10-04 Thread Valdis Klētnieks
On Fri, 04 Oct 2019 22:07:21 -0500, CRISTIAN ANDRES VARGAS GONZALEZ said: > I am starting to develop the kernel and I have been compiling the kernel, > now it has been compiling for some time now. When a patch is added, should > everything be compiled again? Or is there a different way to test

Re: Remote I/O bus

2019-10-05 Thread Valdis Klētnieks
On Sun, 06 Oct 2019 00:29:18 +0200, Luca Ceresoli said: > BTW I guess having an FPGA external to the SoC connected via SPI or I2C > is not uncommon. Am I wrong? Look at it this way - as a practical matter, if you have an FPGA, it's probably going to be hanging off an SPI, I2C, or PCI. And if

Re: Do I need strong mathematical bases to work in the memory subsystem?

2019-10-02 Thread Valdis Klētnieks
On Wed, 02 Oct 2019 21:47:42 -0400, Ruben Safir said: > I've heard this for years and when I went back for my PhD and Masters > degree in comp sci, I found out, low and behold, this is just not true. The question was specific to *kernel* development. Look around. Does Linus have a PhD? How

Re: Do I need strong mathematical bases to work in the memory subsystem?

2019-10-03 Thread Valdis Klētnieks
On Thu, 03 Oct 2019 06:55:50 -0400, Ruben Safir said: > I wouldn't call that C code basic. Regardless, showing an example of a > driver that doesn't need math, and it might if you understood the high > level math, and your not aware of it, but predictive branching would > need it. See the

Re: Remote I/O bus

2019-10-04 Thread Valdis Klētnieks
On Fri, 04 Oct 2019 17:08:30 +0200, Luca Ceresoli said: > Yes, the read/write helpers are nicely isolated. However this sits in a > vendor kernel that tends to change a lot from one release to another, so I admit having a hard time wrapping my head around "vendor kernel that changes a lot from

Re: Need help to get started

2020-02-24 Thread Valdis Klētnieks
On Tue, 25 Feb 2020 12:08:53 +0530, m vivek said: > I just joined the mailing list. Excited to contribute to linux kernel but > finding it difficult to figure out where to start. > > Any help would be appreciated. Pretty much anything under drivers/staging is fair game - it's *all* code that

Re: Ordering guarantee inside a single bio?

2020-01-27 Thread Valdis Klētnieks
On Sun, 26 Jan 2020 13:07:38 +0100, Lukas Straub said: > I am planing to write a new device-mapper target and I'm wondering if there > is a ordering guarantee for the operation inside a single bio? For example if > I > issue a write bio to sector 0 of length 4, is it guaranteed that sector 0 is

Re: Ordering guarantee inside a single bio?

2020-01-29 Thread Valdis Klētnieks
On Tue, 28 Jan 2020 13:50:56 +0900, 오준택 said: (Lukas - there's stuff for you further down...) > If you write checksum for some data, ordering between checksum and data is > not needed. Actually, it is. > When the crash occurs, we just recalculate checksum with data and compare > the

Re: Understanding the working of Optimistic DAD Feature.

2020-02-06 Thread Valdis Klētnieks
On Thu, 06 Feb 2020 12:19:26 +, Chinmay Agarwal said: > To check the same there is a condition in kernel code wherein we check if > ipv6.devconf_all is set. > Now, my query is that we are checking if forwarding is enabled on all > interfaces, then we consider the system to be a router. >

Re: Ordering guarantee inside a single bio?

2020-01-30 Thread Valdis Klētnieks
On Thu, 30 Jan 2020 15:16:17 +0100, Lukas Straub said: > No, csum_next (and csum_prev) is a whole sector (i.e. physical block) > containing all the checksums for the following chunk of data (which > spans multiple sectors) Oh, OK. That works too.. :) > Regarding the ordering guarantee, I have

Re: Kernel drivers and IOCTLs

2020-01-23 Thread Valdis Klētnieks
On Tue, 21 Jan 2020 22:27:01 -0600, WyoFlippa said: > I'm working on a driver that would verify a Linux or U-Boot image is > secure and I need to pass parameters such as the public key, starting > address, etc. This is actually a lot harder to do properly than it looks, especially if you're

Re: Kernel drivers and IOCTLs

2020-02-04 Thread Valdis Klētnieks
On Tue, 04 Feb 2020 20:57:24 -0600, WyoFlippa said: > I'm actually happy with the existing boot schemes. In this case, the > driver is going to validate a signed image (U-Boot or Linux) before it > is programmed into the flash memory. Although the image is validated > when booting, it is one

Re: New text

2020-02-20 Thread Valdis Klētnieks
On Wed, 19 Feb 2020 18:17:36 -0500, Ruben Safir said: > > 1) Start wading through the git log until you find the commit that > > changed the API. In either that commit, or a commit in the same series, > > whoever changed the API > > I don't think that will be a useful way to learn to code the

Re: uxfs review

2020-02-20 Thread Valdis Klētnieks
On Thu, 20 Feb 2020 18:39:21 +0100, Valentin Vidic said: > Now that you mention 2.6 :), I've been trying to update this uxfs > filesystem from an old book[1] for modern kernels: > > https://github.com/vvidic/uxfs/ > > It currently builds and seems to work but it could probably use a > review if

Re: New text

2020-02-19 Thread Valdis Klētnieks
On Wed, 19 Feb 2020 10:54:10 -0500, Ruben Safir said: > is there currently a rfecommended text to learn kernel development from? The first thing to remember is that the kernel has no obligation to be easy for new programmers. It's more like a Formula 1 race car than a Ford Escort - there's an

Re: .config

2020-02-21 Thread Valdis Klētnieks
On Fri, 21 Feb 2020 23:41:10 +, Enzo Desiage said: > modules I actually need (thanks find_all_modules.sh). I'm trying to devise > a strategy to take the output of that script and make a brand new minimal > .config file. However, the only solution I've found is doing it manually > via make

Re: Kernel debugging

2020-02-21 Thread Valdis Klētnieks
On Wed, 19 Feb 2020 06:19:10 +, "Pankaj Vinadrao Joshi" said: > I am using linux 5.4.3 with our custom Yocto distro on RISC v machine i want > to get kernel crash log(hard panic) since RISC v does mot have support for the > kxec how i can collect the crash logs? Is netconsole an option, if

Re: .config

2020-02-22 Thread Valdis Klētnieks
On Sat, 22 Feb 2020 17:39:03 +, Enzo Desiage said: > I had a look back at the book and couldn't find the command > 'make localmodconfig' in "The Linux Kernel in a Nutshell" book, > why is that? Was it introduced in recent years? Depends what you call "recent". Looks like v2.6.30-ish.

  1   2   3   >