Re: Using binary attributes for configuration sysfs entries

2019-03-13 Thread valdis . kletnieks
On Wed, 13 Mar 2019 12:02:02 +0530, Jay Aurabind said: > For the corresponding sysfs interface, since there are a lot of > parameters, would it be justified to use the same binary format though > sysfs_create_binary_file() ? The rationale is that it would be easier > to simply pack all the config

Re: [PATCH 1/1] staging: erofs: Add function comment for erofs/super.c

2019-03-13 Thread valdis . kletnieks
On Wed, 13 Mar 2019 08:48:26 +0800, Gao Xiang said: (Reversing order of comments) > "Release slab Memory" is not a very useful description for this function. Agreed. > i_callback is used to free inode structure and other memory related to this > inode However, that's not a bad description at

Re: [PATCH 1/1] staging: erofs: Add function comment for erofs/super.c

2019-03-12 Thread valdis . kletnieks
On Tue, 12 Mar 2019 23:33:47 +0530, arshad hussain said: > Re-sending. Previous patch I put in very old kernel-newbies address. > > Subject: [PATCH 1/1] staging: erofs: Add function comment for > erofs/super.c > > This patch adds functions comment for file erofs/super.c in > sphinx format. > >

Re: Finding all modules which consume kernel lib?

2019-03-09 Thread valdis . kletnieks
On Sat, 09 Mar 2019 13:04:44 +0300, Lev Olshvang said: > There is also modulus.dep file which depmod builds. You can just grep to find > which modulus depends. Note that the modules.dep file only tells modprobe "If you're loading module A, you need to load B first to get some symbols

Re: exit-code of 251

2019-03-07 Thread valdis . kletnieks
On Wed, 06 Mar 2019 17:20:07 +0530, prashantkumar dhotre said: > Could you please let me know if any system call can exit with 251 ? > I am trying to find out who exited with 251 ? strace is your friend. ___ Kernelnewbies mailing list

Re: undefined reference to `ioctl_tty'

2019-03-07 Thread valdis . kletnieks
On Wed, 06 Mar 2019 03:50:10 -0500, Jeffrey Walton said: > Yeah, the race seems to be the downside to ioctl and TIOEXCL. > > It is too bad Linux does not honor O_EXCL for the device, or provide a > similar open flag like SOCK_NONBLOCK was added to avoid the race in > sockets. It would avoid a lot

Re: undefined reference to `ioctl_tty'

2019-03-06 Thread valdis . kletnieks
On Wed, 06 Mar 2019 01:58:41 -0500, Jeffrey Walton said: >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

Re: Unimplemented system call

2019-03-05 Thread valdis . kletnieks
On Tue, 05 Mar 2019 19:52:13 -0500, Umair Khan said: > I was just wondering why are these system calls not implemented? Ah. So now we get to the question you *should* have asked. :) Depends on the system call and the hardware and the kernel config. Often, on embedded systems, you know from the

Re: Unimplemented system call

2019-03-05 Thread valdis . kletnieks
On Tue, 05 Mar 2019 19:08:20 -0500, Umair Khan said: > I was just roaming around the linux source code when I stumbled upon > this line - > https://github.com/torvalds/linux/blob/master/include/linux/syscalls.h#L1200 > > May I know what is the use of this system call? /* * Not a real system

Re: How to make /dev/ttyACM0 (and friends) exclusive?

2019-03-04 Thread valdis . kletnieks
On Mon, 04 Mar 2019 16:38:44 +0100, Yann Droneaud said: > O_EXCL is intended to be used to prevent opening an existing file. Said > differently, it's used to ensure a new file is created, useful to > prevent race condition, where multiple processes compete to create a > file. For example think of

Re: How to make /dev/ttyACM0 (and friends) exclusive?

2019-03-02 Thread valdis . kletnieks
On Sat, 02 Mar 2019 14:36:12 -0500, Jeffrey Walton said: > I feel like I am missing something... Does Linux consider the modem a > shared resource instead of an exclusive resource? What use cases > support two different programs sending commands to the modem at the > same time? The Linux kernel

Re: How to make /dev/ttyACM0 (and friends) exclusive?

2019-03-02 Thread valdis . kletnieks
On Fri, 01 Mar 2019 23:29:53 -0500, Jeffrey Walton said: > I cannot seem to open the device in exclusive mode. The current open > is (I also tried with O_EXCL): > > int modem = open(device_path, O_RDWR | O_NOCTTY | O_SYNC); So what happens? Does the open fail? If so, what does perror() say

Re: SELinux, LSM and ima_policy rules

2019-02-04 Thread valdis . kletnieks
On Mon, 04 Feb 2019 11:38:19 +0300, Lev Olshvang said: > I learned recently that IMA kernel security subsystem can be integrated with > LSMs, such as SELinux, Smack, ... > https://sourceforge.net/p/linux-ima/wiki/Home/ > > https://www.kernel.org/doc/Documentation/ABI/testing/ima_policy > > It

Re: Userspace configurable GPIO pinout

2019-01-28 Thread valdis . kletnieks
On Mon, 28 Jan 2019 13:26:55 +, Laurence Rochfort said: > I'm writing a driver for an ePaper display, that will attach via GPIO. > > I've read the docs in Documentation/GPIO, and > Documentation/devicetree/bindings/gpio. > > The ePaper itself just has a 34pin flat-flex cable, so people will

Re: drivers: iio: Adding channels to the simple_dummy module

2019-01-26 Thread valdis . kletnieks
On Sat, 26 Jan 2019 12:12:07 +0530, Bharath Vedartham said: > On Fri, Jan 25, 2019 at 11:24:33AM -0500, valdis.kletni...@vt.edu wrote: > > On Fri, 25 Jan 2019 17:11:25 +0530, Bharath Vedartham said: > > > VM has low RAM. Need to adjust :) > > > > Upgrade the hypervisor system so the VM can be

Re: drivers: iio: Adding channels to the simple_dummy module

2019-01-25 Thread valdis . kletnieks
On Fri, 25 Jan 2019 17:11:25 +0530, Bharath Vedartham said: > On Thu, Jan 24, 2019 at 04:21:32PM +0530, Himanshu Jha wrote: > > Well, you can try other email clients such as Evolution, Claws ... > > > > There is no rule saying to use Mutt exclusively. > VM has low RAM. Need to adjust :) Upgrade

Re: drivers: iio: dummy: Unable to add channels to simple_dummy_channel

2019-01-23 Thread valdis . kletnieks
On Wed, 23 Jan 2019 23:25:59 +0530, Bharath Vedartham said: > I am trying to add the 3-axis compass data channels to the > simple_dummy_channel. I have mounted configfs and am able to load the > modules correctly. Is this the right approach? printk is not printing > anything to syslogs. Do you

Re: Security-What can be done in kernel to disable forever executable memory modificaton

2019-01-12 Thread valdis . kletnieks
On Sat, 12 Jan 2019 16:19:00 +0300, Lev Olshvang said: > The fact that the text segment could be modified is bad news from the > security standpoint. We've known that for at least a decade now. Maybe longer. And we already had this discussion once, about a week ago. > I am not sure whether it

Re: mount /proc at boot as read-only

2019-01-06 Thread valdis . kletnieks
On Sun, 06 Jan 2019 21:13:26 +0300, Lev Olshvang said: > I am trying to harden the embedded system. > I have embedded system with systemd . OK, you've already got a problem right there. It's an embedded system. Therefor, you know everything that should be running, and what order it should

Re: How to forbid user space and kernel executable pages from becoming writable?

2019-01-05 Thread valdis . kletnieks
On Sat, 05 Jan 2019 18:30:01 +0300, Lev Olshvang said: > Some articles, ex > https://shanetully.com/2013/12/writing-a-self-mutating-x86_64-c-program/ > state that mprotect() can change protection of executable section. Note that appears to be a 5 year old article, and one that tries to be

Re: why are some stat.h "S_*" perm macros not exported via uapi?

2018-12-31 Thread valdis . kletnieks
On Mon, 31 Dec 2018 14:53:30 -0500, "Robert P. J. Day" said: > #define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO) > #define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO) > #define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) > #define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) >

Re: In a process context kernel_read returns -EINTR, how to proceed?

2018-12-23 Thread valdis . kletnieks
On Sun, 23 Dec 2018 11:41:30 +0300, Lev Olshvang said: > I use security_mmap_file hook. And what are you trying to accomplish in there? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org

Re: In a process context kernel_read returns -EINTR, how to proceed?

2018-12-21 Thread valdis . kletnieks
On Fri, 21 Dec 2018 16:51:29 +0300, Lev Olshvang said: > I need to read file inside LSM hook and I can not do it in user space Why? And which LSM hook are you trying to do this? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org

Re: In a process context kernel_read returns -EINTR, how to proceed?

2018-12-20 Thread valdis . kletnieks
On Thu, 20 Dec 2018 13:33:09 +0300, Lev Olshvang said: > I use kernel_read to read file in chunks of 4K size in a process context > On several files, like libc, libm, I got -EINTR error. What are you trying to accomplish? This is not a recommended way to do things. > I do not understand who

Re: Why existing filesystem encryption tools do not limit run-time file access while user/session might be used?

2018-12-07 Thread valdis . kletnieks
On Fri, 07 Dec 2018 23:13:45 +0300, Lev Olshvang said: > Existing file encryption tools, like dm-crypt, fscrypt and eCryptfs provide > only encryption of files only until file system is mounted.  (data at rest) > The moment it became mounted, every user of computer can try to access the > data.

Re: When kernel deletes unused kernel module from RAM?

2018-11-30 Thread valdis . kletnieks
On Fri, 30 Nov 2018 20:35:54 +0300, Lev Olshvang said: > I saw many times that kernel keeps kernel module with reference count of 0 in > a > running system until explicit rmmod command is entered/ > Is there any way to require that unused module will be removed from kernel by > the kernel

Re: Kernel default security configuration - how it affects LSM policy?

2018-11-25 Thread valdis . kletnieks
On Wed, 21 Nov 2018 17:20:50 +0300, Lev Olshvang said: > So the questioned config option seems obsolete ? > Wheher LSM always consulted last ? If an LSM is configured/loaded, it is always consulted *after* applying standard DAC file permission bits checks. (Discretionary Access Control- the

Re: [ARM64] Printing IRQ stack usage information

2018-11-20 Thread valdis . kletnieks
On Tue, 20 Nov 2018 18:21:33 +0530, Pintu Agarwal said: > + sp = current_stack_pointer; > + if (on_irq_stack(sp, cpu)) { > + stack_start = (unsigned long)per_cpu(irq_stack, cpu); > + last_usage = per_cpu(irq_stack_usage, cpu); > + curr_usage = sp - stack_start; > +

Re: deferred pages

2018-11-20 Thread valdis . kletnieks
On Tue, 20 Nov 2018 10:16:41 -0500, Cindy-Sue Causey said: > First reference is near the top under "AIX 4.3.2+ Deferred Paging > #2) AIX 5L Differences Guide Version 5.3 Edition I feel sorry for anybody still running either of these AIX versions (4.3.2 is late 1998, 5.3 is from 2005). Word of

Re: Why eeprom driver is read-only ?

2018-11-19 Thread valdis . kletnieks
On Tue, 20 Nov 2018 00:04:03 +0200, Ranran said: > That's interesting... > I think the name is confusing, because this chips are also writable. > > Not only this, but in arm the eeprom (at24) is writable! > But in the x86 I am using, it is readonly in kernel code: >

Re: [ARM64] Printing IRQ stack usage information

2018-11-16 Thread valdis . kletnieks
On Fri, 16 Nov 2018 23:13:48 +0530, Pintu Agarwal said: > On Fri, Nov 16, 2018 at 10:16 PM wrote: > > Congrats. You just re-invented DEBUG_STACK_USAGE, which just keeps a > > high-water mark > > for stack usage. > > So, you mean to say, my implementation is good enough to get the > irq_stack

Re: [ARM64] Printing IRQ stack usage information

2018-11-16 Thread valdis . kletnieks
On Fri, 16 Nov 2018 20:10:28 +0530, Pintu Agarwal said: > > Look at the code controlled by '#ifdef CONFIG_DEBUG_STACK_USAGE' > For example: is it possible to keep storing the irq_stack_usage (for > each cpu in a variable) information from boot time, and then use this > variable to dump the

Re: [ARM64] Printing IRQ stack usage information

2018-11-16 Thread valdis . kletnieks
On Fri, 16 Nov 2018 11:44:36 +0530, Pintu Agarwal said: > > If your question is "Did one > > of the CPUs blow out its IRQ stack (or come close to doing so)?" there's > > better > > approaches. > > > Yes, exactly, this is what the main intention. > If you have any better idea about this approach,

Re: a question on mapping from PTE to swap entry

2018-11-15 Thread valdis . kletnieks
On Thu, 15 Nov 2018 23:53:56 +0800, "Larry" said: > I'm curious when multiple process has the same PTE which points to the > samepage, > how can kernel differenciate which page from swap space should be swappedin? The PTE tells where in /dev/swap to find the page. If it's a shared page, the

Re: [ARM64] Printing IRQ stack usage information

2018-11-15 Thread valdis . kletnieks
On Thu, 15 Nov 2018 18:52:39 +0530, Pintu Agarwal said: > Currently, when I tested this (as a proc interface), I got the below output: > CPUUNUSED-STACKACTUAL-STACK > 0 16368 16384 > 3) How should I test it to get the different usage values for unused stack ?

Re: function stack frames in the kernel

2018-11-11 Thread valdis . kletnieks
On Mon, 12 Nov 2018 02:00:02 +0800, Carter Cheng said: > Thanks for the reply but the link doesn't quite answer the question. I am > wondering how the pointer is handled so that there is one per thread by the > compiler. I perhaps was under the perhaps mistaken impression that the > stack pointer

Re: Creating compressed backing_store as swapfile

2018-11-05 Thread valdis . kletnieks
On Mon, 05 Nov 2018 11:28:49 -0500, "Austin S. Hemmelgarn" said: > Also, it's probably worth noting that BTRFS doesn't need to decompress > the entire file to read or write blocks in the middle, it splits the > file into 128k blocks and compresses each of those independent of the > others, so it

Re: Creating compressed backing_store as swapfile

2018-11-05 Thread valdis . kletnieks
On Mon, 05 Nov 2018 11:07:12 -0500, "Austin S. Hemmelgarn" said: > Performance isn't _too_ bad for the BTRFS case though (I've actually > tested this before), just make sure you disable direct I/O mode on the > loop device, otherwise you run the risk of data corruption. Did you test that for

Re: Creating compressed backing_store as swapfile

2018-11-05 Thread valdis . kletnieks
On Mon, 05 Nov 2018 20:31:46 +0530, Pintu Agarwal said: > I wanted to have a swapfile (64MB to 256MB) on my system. > But I wanted the data to be compressed and stored on the disk in my swapfile. > [Similar to zram, but compressed data should be moved to disk, instead of > RAM]. What platform

Re: Backporting stacked security patch

2018-10-30 Thread valdis . kletnieks
On Tue, 30 Oct 2018 21:19:08 +0300, Lev Olshvang said: > As I stated, I have no option to come to customer and ask to upgrade his > kernel, but I will try to put his attention to mentioned by you cease of > security updates. If you can't get him to upgrade the installed kernel, it's not worth

Re: MMU related code

2018-10-28 Thread valdis . kletnieks
On Mon, 29 Oct 2018 00:08:12 +0800, Carter Cheng said: > Where do I find the code in the kernel related to the MMU and resolving > memory addresses? I am trying to understand what the implications are if > code like this has bugs and the impact on the various functions that return > chunks of

Re: Boot all yes config kernel with QEMU

2018-10-22 Thread valdis . kletnieks
On Tue, 23 Oct 2018 13:56:42 +1100, "Tobin C. Harding" said: > I'd like to build and boot an allyesconfig kernel with QEMU. Building > is no problem but when I try to boot it I get problems because the host > system does not support features requested by the VM. > > How does one go about testing

Re: Modify a file content from block layer

2018-10-22 Thread valdis . kletnieks
On Mon, 22 Oct 2018 22:32:14 +0530, jitendra kumar khasdev said: > Working on a custom driver that tracks I/Os on block level. For some use > case, I need to write metadata of tracked I/Os from driver in shutdown > sequence (more likely in reboot handler). In reboot handler, performing I/O > on

Re: changing parameters in build

2018-10-17 Thread valdis . kletnieks
On Wed, 17 Oct 2018 20:02:46 +0800, Carter Cheng said: > The problem is I have to do something special with the clang options. I > have to add an interprocedural link time optimization pass spitting out > bitcode files and tying them together using llvm-link. As I said back on Friday, this is

Re: Testing the performance impact of kernel modifications

2018-10-15 Thread valdis . kletnieks
On Tue, 16 Oct 2018 01:23:45 +0800, Carter Cheng said: > I am actually looking at some changes that litter the kernel with short > code snippets and thus according to papers i have read can result in CPU > hits of around 48% when applied is userspace. You're going to need to be more specific.

Re: Testing the performance impact of kernel modifications

2018-10-15 Thread valdis . kletnieks
On Mon, 15 Oct 2018 23:42:03 +0800, Carter Cheng said: > I was wondering what are some good ways to assess the performance impact of > kernel modifications. Are there some papers in the literature where this is > done? Does one need to differentiate between CPU bound and different types > of I/O

Re: link time analysis for the kernel.

2018-10-11 Thread valdis . kletnieks
On Thu, 11 Oct 2018 21:45:16 +0800, Carter Cheng said: > There are some detaills about the current procedures for linking the kernel > that I am unfamiliar with. My understanding is that GCC and Clang both have > the ability to do link time analysis and transforms on code but is it > possible to

Re: Learning Linux Kernel Development

2018-10-11 Thread valdis . kletnieks
On Thu, 11 Oct 2018 14:42:56 +0400, o...@goosey.org said: > 10.10.2018, 19:36, "Carter Cheng" : > >2. Is there some good way to figure out how to update knowledge gained > > from > >this book to what is in the 4.x series of kernels? > I think all C code-based drivers will work on all

Re: Fwd: Learning Linux Kernel Development

2018-10-10 Thread valdis . kletnieks
On Wed, 10 Oct 2018 23:35:20 +0800, Carter Cheng said: > 1. After finishing the book and perhaps Understanding the Linux Kernel and > Linux Device Drivers. What is the best way to dig deeper. There's multiple answers to that question, as it depends on the questioner's preferred learning style

Re: What is "#define alloc_ieee80211 alloc_ieee80211_rsl"?

2018-10-09 Thread valdis . kletnieks
On Tue, 09 Oct 2018 20:07:08 +0100, John Whitmore said: > #define alloc_ieee80211 alloc_ieee80211_rsl > > So what am I missing or why are a number of functions being redefined > as another name, which doesn't exist? There's areas in the kernel which use the preprocessor ##

Re: How to make linux stop all processes/activities except the one I am benchmarking?

2018-10-08 Thread valdis . kletnieks
On Mon, 08 Oct 2018 23:05:56 +0300, Lev Olshvang said: > Of cause the simplest way which comes to my mind  is to send SIGPAUSE to all > processes,  except mine. Actually, the *simplest* way is to just boot the machine into single-user mode and run your test there. pgp1ddCl5hh2I.pgp

Re: Diploma project with the Linux kernel

2018-10-04 Thread valdis . kletnieks
On Fri, 05 Oct 2018 02:58:23 +0100, Mike Krinkin said: > This might be of interest to you: https://www.criu.org That's got two problems - first, it's userspace. And second, it's fairly mature software, which means it's not suitable for a student project by itself, and all the low-hanging fruit

Re: Diploma project with the Linux kernel

2018-10-04 Thread valdis . kletnieks
On Thu, 04 Oct 2018 21:44:14 +0300, Boian Karatotev said: > I am a Computer Science student and for my last year I need to make and > present a 'diploma project' at the end of June. So far I want to make a > kernel module, whose description is in the following paragraph. I feel > comfortable with

Re: How to enable max98357a in sound/soc/codecs

2018-10-04 Thread valdis . kletnieks
On Thu, 04 Oct 2018 12:44:00 +0100, Paul Nader said: > I'm trying to enable the max98357a codec in sound/soc/codecs. > In the Kconfig file it is listed with an empty tristate so it doesn't show > up when I do a make menu config. That's usually a result of the variable being enabled by a

Re: Checkpatch.pl warning

2018-09-30 Thread valdis . kletnieks
On Sun, 30 Sep 2018 16:04:13 +0300, Shubham Singh said: > Regarding the warning of checkpatch.pl, > " 'str' object has no attribute 'decode' " > This warning is related to spdxcheck.py which is because of version of python > In python3 str has no attribute decode(), while it works fine in

Re: Problem with netconsole and eth0 timing

2018-09-27 Thread valdis . kletnieks
On Wed, 26 Sep 2018 21:38:27 -0700, don fisher said: > Thanks. I tried building with the driver embedded in the kernel, but the > compile failed with a halt. No crash is apparent, just a halt. It turned > out that this was repeated until I removed the netconsole command during > boot. System

Re: Problem with netconsole and eth0 timing

2018-09-26 Thread valdis . kletnieks
On Wed, 26 Sep 2018 13:25:35 -0700, don fisher said: > Would you tell me how to tell the driver that it is to be eth0, ip > address etc. Maybe on linux command line, but I do not know the format. To quote some guy named Don Fisher: > my kernel and including the proper command (as shown below) in

Re: staging:rtl8192u: Possible memory leak?

2018-09-26 Thread valdis . kletnieks
On Wed, 26 Sep 2018 16:52:03 +0100, John Whitmore said: > This might all be a mute point as I seem to remember someone saying > that memory allocation never fails in Linux and this can only happen > if the first two allocations work and the third fails. If memory allocation never fails, it would

[PATCH] fix error handling in drivers/staging/rtl8192u/ieee80211/ieee80211_module.c

2018-09-26 Thread valdis . kletnieks
John notes that if the kzalloc of ieee->pHTInfo fails, we fail to call ieee80211_networks_free(). In addition, that function has an un-needed check before kfree(). Reported-by: John Whitmore Signed-off-by: Valdis Kletnieks --- diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_modul

Re: Problem with netconsole and eth0 timing

2018-09-25 Thread valdis . kletnieks
On Tue, 25 Sep 2018 18:26:06 -0700, don fisher said: > The wicked message eth0: up comes at Sep 24 22:02:01.173616. The > difference is maybe 36 seconds? There is an eth0: avail message at Sep > 24 22:01:34.112744, don't know if that would suffice for netconsole Both > are after netconsole has

Re: 4.19-rc3 incompatible with nvidia driver

2018-09-20 Thread valdis . kletnieks
On Sun, 16 Sep 2018 20:47:41 +0200, Daan Wendelen said: > The latest nvidia driver is incompatible with 4.19-rc3 because > "drm_mode_connector_update_edid_property" got renamed to > "drm_connector_update_edid_property" and > "drm_mode_connector_attach_encoder" to "drm_connector_attach_encoder" in

Re: dev process - reduce mistakes

2018-09-18 Thread valdis . kletnieks
On Wed, 19 Sep 2018 09:35:36 +1000, "Tobin C. Harding" said: > Hi, > > I'm after some advice from those more experienced with [kernel] > development please. > > What systems do you have in place to help catch mistakes? In other > words; what processes do you use when coding and submitting patches

Re: regarding const variables/structures

2018-09-17 Thread valdis . kletnieks
On Sat, 15 Sep 2018 01:19:24 +0530, inventsekar said: > I didnt get you... I thanked Valdis for his detailed mail.. A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in

Re: Linux FS design and implementation book

2018-09-15 Thread valdis . kletnieks
On Sat, 15 Sep 2018 07:33:51 +0530, inventsekar said: > Around last year I was searching for Linux Kernel FS design and > implementation, and I found out a book by someone,.. a full length book, > particularly, at the end of the book he/she included source code as well... That sounds like the

Re: regarding const variables/structures

2018-09-12 Thread valdis . kletnieks
On Wed, 12 Sep 2018 22:40:50 +0530, inventsekar said: > So, please suggest some subsystems or some small puedes of code, where i > can "dwell" sometimes and submit my first patch. 0) subsystems? Anything under drivers/staging is fair game and certain to provide hours of amusement... 1) Install

Re: interruptible sleep tasks

2018-09-11 Thread valdis . kletnieks
On Tue, 11 Sep 2018 16:26:40 +0530, Muni Sekhar said: > During kernel drivers testing I see lot of user mode applications > blocks forever in interruptible sleep mode. Is there any way to get > the corresponding kernel functions stack trace ? cat /proc/NNN/stack should do the trick. >

Re: Implementing tight time constraints for read/write with USB serial (ftdi_sio)

2018-09-03 Thread valdis . kletnieks
On Mon, 03 Sep 2018 21:12:35 +0200, Thomas Bracht Laumann Jespersen said: > The challenge is that my application needs to act within 100 tbits, ie in > around > ~.066ms. That is the window in which I need to begin transmitting a reply. Is > there a way to achieve this with the ftdi_sio driver or

Re: Queries on bottom halves

2018-09-02 Thread valdis . kletnieks
On Sun, 02 Sep 2018 20:58:14 +0530, Abhinav Misra said: > But if in new kernel this implementation is changed then why we need so > many options to defer the work as all of them are basically getting > executed in almost the same way.* In that case code running softirq, > tasklet, workqueue and

Re: Question about DMA mapping.

2018-08-31 Thread valdis . kletnieks
On Fri, 31 Aug 2018 08:53:29 +0800, "phind@gmail.com" said: > Thank for your time, I'm new to linux kernel. I am reading LDD3 chapter > 15, Dirrect Memory Access section. I see that when I call function > /dma_map_single/ and /dma_unmap_single/, I need to pass a direction as a > parameter.

Re: suggestions for good in-kernel examples of simple ethernet/PHY drivers?

2018-08-30 Thread valdis . kletnieks
On Thu, 30 Aug 2018 13:27:13 -0400, "Robert P. J. Day" said: > i'm already looking at that, but what i wanted was an example of an > existing, physical driver that shows how simple the design can be (if > such a thing exists). For some reason, engineers building network devices almost never

Re: System call vs POSIX call

2018-08-16 Thread valdis . kletnieks
On Thu, 16 Aug 2018 16:29:29 -, Nicholas Mc Guire said: > Note that you can do system calls directly with system() but that is > generaly not how you do it - you to through the glibc calls > which do some checks before invoking the actual system call. system() does a fork/exec of a process.

Re: A question on the function clean_bdev_bh_alias

2018-08-10 Thread valdis . kletnieks
On Fri, 10 Aug 2018 22:48:43 +0800, "Larry" said: > Does it intend to remove existent pages in block device's page cache > if some new page cache of a vfs file was created whose block number > range has overlaps with its block device page cache? That's a situation you *really* hope doesn't

Re: Problem of compiling linux2.6.11.12 kernel

2018-08-05 Thread valdis . kletnieks
On Mon, 06 Aug 2018 01:10:40 +0800, "He Huanyu" said: > linux 4.16.9-1-ARCH > gcc (GCC) 8.1.1 20180531 > GNU ld (GNU Binutils) 2.30 > And I get a problem like this, don't know if it is because of the version of > gcc or ld: The problem is the version of Linux. 2.6.11 probably won't build with

Re: How to unwind stack to seek for specific caller?

2018-08-03 Thread valdis . kletnieks
On Fri, 03 Aug 2018 15:14:45 +0300, Lev Olshvang said: > But I need to find out whether my function y() was called from linux kernel > function x().\ What problem are you trying to solve? If it's your function, don't you already *know* which functions call it? And if being called from code A

Re: First patch

2018-08-03 Thread valdis . kletnieks
On Thu, 02 Aug 2018 23:49:03 +0200, Arkadiusz Lis said: > From 231fa77d595536cdaacf364b02dd64fd45a6adc4 Mon Sep 17 00:00:00 2001 > From: Arkadiusz Lis > Date: Thu, 2 Aug 2018 23:38:17 +0200 > Subject: [PATCH] Staging: One Laptop Per Child: fix coding style and license > issues One thing per

Re: Sharing memory between two kernel module - Better approach

2018-08-02 Thread valdis . kletnieks
On Thu, 02 Aug 2018 23:12:23 +0530, Abhinav Misra said: > I want to know is there any alternative for sharing the memory between two > modules. Why are two modules trying to share memory? In general, each module should be managing its own data objects. If two modules need to share, maybe it

Re: virtual address space allocation

2018-08-01 Thread valdis . kletnieks
On Tue, 31 Jul 2018 15:41:28 +0200, Babis Chalios said: > I am working on the runtime system of a distributed memory programming > language. For some reason we need to create a big hole on the address space of > the application. We are trying to do so by using an mmap during the > initialization

Re: Need Suggestions

2018-07-25 Thread valdis . kletnieks
On Thu, 26 Jul 2018 03:07:27 +0530, Himanshu Jha said: > Now, this part of section is really important and somehow if you think > you really learnt C well in the course offered at University. Then > please take a look at implicit conversions: > https://en.cppreference.com/w/c/language/conversion

Re: link_path_walk/dentry_path_raw TOCTTOU race question

2018-07-24 Thread valdis . kletnieks
On Tue, 24 Jul 2018 16:59:27 -0400, riya khanna said: > I'm trying to understand what prevents TOCTTOU race conditions in > dentry_path_raw > and link_path_walk? What happens when somebody points a symlink path > component from a dir that has the attacker is allowed to read to a dir that > they

Re: Synaptics Driver Problem

2018-07-23 Thread valdis . kletnieks
On Mon, 23 Jul 2018 19:29:17 +0400, o...@goosey.org said: > So synaptics is not working, I want to write a driver for synaptics. > Can I modify a generic synaptics driver? Step 0 should be to figure out *why* the generic driver isn't working, because you'll need that information to fix the

Re: undefined reference to `__divdi3'

2018-07-23 Thread valdis . kletnieks
On Sun, 22 Jul 2018 17:48:21 +0530, Himanshu Jha said: > I am currently working on my GSoC project and while testing through > 0-day test service, I hit the following error: >424 static u32 bme680_compensate_gas(struct bme680_data *data, u16 > gas_res_adc, >425

Re: Need Suggestions

2018-07-18 Thread valdis . kletnieks
On Wed, 18 Jul 2018 22:16:07 -0300, "Daniel." said: > Sorry. Do I did something bad? I wasn't intended to.. I didn't think that > trimming was a bad idea, I just want to reinforce the book suggestion ... > Sorry It's OK.. just remember to trim out the non-important stuff next time. :)

Re: Need Suggestions

2018-07-18 Thread valdis . kletnieks
On Wed, 18 Jul 2018 14:29:41 -0700, Dave Stevens said: > On Wed, 18 Jul 2018 18:19:05 -0300 "Daniel." wrote: > > > > Hi Athul... > > > This is my collegemate's writing, ... This will solve all your > > > confusions > > > > > is it the policy on this list to trim? Only the irrelevant parts,

Re: Need Suggestions

2018-07-17 Thread valdis . kletnieks
On Tue, 17 Jul 2018 21:10:05 -0700, Dave Stevens said: > $ make help > make: *** No rule to make target 'help'. Stop. Were you cd'ed into the directory that had the base of the kernel source tree? Hint: the directory should look something like this: [/usr/src/linux-next] ls COPYING

Re: Netpoll APIs

2018-07-17 Thread valdis . kletnieks
On Tue, 17 Jul 2018 18:35:15 +0530, jitendra kumar khasdev said: > Can netpoll apis send data over the internet. It worked for me in local > network but when I try to send data over server which is in cloud not able > to send it. > > Can anybody help me out ? If it works over the local net, time

Re: newly add MAP_SYNC flag to mmap

2018-07-16 Thread valdis . kletnieks
On Tue, 17 Jul 2018 02:15:17 -, David Frank said: > inking. I'm checking out if the flag does what is is said to do-- I don't > have > to call msync function, which would boost performance. Note that this can actually *kill* performance, because this means that the kernel has to flush to

Re: newly add MAP_SYNC flag to mmap

2018-07-16 Thread valdis . kletnieks
On Tue, 17 Jul 2018 00:57:31 -, David Frank said: > I installed LTS 18.04 with headers.  I'm trying to use the new flag MAP_SYNC > with mmap call, but it complained MAP_SYNC undefined.What #define do I need to > enable this? You need more than a #define. You need a 4.15 kernel and matching

Re: Need Suggestions

2018-07-15 Thread valdis . kletnieks
On Sat, 14 Jul 2018 22:07:12 +0400, oz...@goosey.org said: > LFS is a good places to prepare a new linux distribution and have fun as you > talk about :) Note that *building* a LFS system is a bit of work. Properly *maintaining* an LFS system is an ongoing *ton* of work. Basically, you end up

Re: Question about memcpy

2018-07-13 Thread valdis . kletnieks
On Fri, 13 Jul 2018 11:02:13 +0800, bing zhu said: > I‘m trying to write a simple fs in user space,if memcpy is slower than > kernel , i think it's unfair,as for only cpu for my task, > it's a bit of arbitrary ,i just want my task not interrupted during a > specific time is that possible ?

Re: mmap huge page and MAP_SYNC flag support

2018-07-12 Thread valdis . kletnieks
On Thu, 12 Jul 2018 20:33:32 -, David Frank said: > I got it from hereHow To Install Kernel 4.15 RC7 on Ubuntu, Linux Mint, > Elementary OS And Other Ubuntu Derivatives | LinuxG.net Looks like you got the linux-image-... .deb but didn't do the linux-headers-... .deb(s). (And I have no

Re: mmap huge page and MAP_SYNC flag support

2018-07-12 Thread valdis . kletnieks
On Thu, 12 Jul 2018 20:10:36 -, David Frank said: > Thanks Valdis.Looks like the failure is that I can not write to a 2GB buffer > (char bf[2GB size]).Where do I get the distro include file? >From the same exact place you got the distro kernel from. (I'm guessing it's a distro kernel from

Re: mmap huge page and MAP_SYNC flag support

2018-07-12 Thread valdis . kletnieks
On Thu, 12 Jul 2018 18:44:43 -, David Frank said: > Hi,How do I enable the MAP_SYNC flag in mmap for linux 4.15, my code does not > compile with that flag on linux 4.15.0-041500rc7-generic #201801072330 Get your distro to ship an update to /usr/include/linux (kernel-headers) that contains

Re: Question about memcpy

2018-07-12 Thread valdis . kletnieks
On Thu, 12 Jul 2018 22:27:37 +0800, bing zhu said: > as for memcpy ,kernel is faster than user ,might because schedule ,can i > try to make user as fast as kernel ? Do you have an actual issue where the difference in speed of these two things makes a difference? Or is this primarily a mental

Re: Question about memcpy

2018-07-10 Thread valdis . kletnieks
On Tue, 10 Jul 2018 22:51:34 +0800, bing zhu said: > Thank you ,I use this func for both kernel and user ,result are same. > void *memcpy(void *dest, const void *src, size_t n) > { Might want to use 'void *my_memcpy(..)' instead, just in case the build environment plays #define games with you

Re: [linux-3.12.19] - kernel panic observed

2018-07-10 Thread valdis . kletnieks
On Tue, 10 Jul 2018 12:08:25 +0530, Sriram said: > I m working on linux-3.12.19 kernel. You have our condolences. Note that the fix for your problem has probably already been found, somewhere in the millions of lines of changes since then. [/usr/src/linux-next] git diff --shortstat v3.12

Re: [PATCH] vsprintf: fix build warning

2018-07-09 Thread valdis . kletnieks
On Tue, 10 Jul 2018 09:42:03 +1000, "Tobin C. Harding" said: > I was under the impression that each maintainer constantly rebased their > next branches and that was why one has to checkout the tagged linux-next > each day instead of just pulling. Close, but no cigar. The maintainers don't

Re: Question about watchdog

2018-07-09 Thread valdis . kletnieks
On Mon, 09 Jul 2018 09:30:51 -0400, Ruben Safir said: > On 07/08/2018 04:44 PM, valdis.kletni...@vt.edu wrote: > > Error while parsing statement., What is a "filesystem bus" and when does it > > issue a HW interrupt? > You have a hard drive on the system bus and it sends interupts... That's

Re: Question about memcpy

2018-07-09 Thread valdis . kletnieks
On Mon, 09 Jul 2018 19:34:44 +0530, Himanshu Jha said: > I think for these benchmarking stuff, to evaluate the cycles and time > correctly you should use the __rdtscp(more info at "AMD64 Architecture > Programmer’s Manual Volume 3: General-Purpose and System Instructions" > Pg 401) Just beware

Re: Question about watchdog

2018-07-08 Thread valdis . kletnieks
On Sun, 08 Jul 2018 15:46:32 -0400, Ruben Safir said: > What are you saying? That is the filesystem bus sends a HW interupt on Error while parsing statement., What is a "filesystem bus" and when does it issue a HW interrupt? pgpAXjJvARBym.pgp Description: PGP signature

Re: Regarding Signing Linux kernel with Microsoft secure boot keys for UEFI

2018-07-08 Thread valdis . kletnieks
On Sun, 08 Jul 2018 11:21:08 +0530, inventsekar said: > I read this page few times but I am unable to understand what's Linus's > idea..Why he disagree ... > whether the Linux kernel should include code that makes it easier to boot > Linux on Windows PCs. The issue is "trusted boot", and it

  1   2   3   4   5   6   7   8   9   10   >