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: Leaving I/O pressure with memory!? How to do it?

2018-07-05 Thread valdis . kletnieks
On Thu, 05 Jul 2018 19:30:22 -0300, "Daniel." said: > Sometime we have a machine that we work on and that is really really slow > when doing I/O. I know that kernel will use memory to avoid doing I/O, and > that it would be a kind of conservative in avoiding keep to much data on > volatile memory

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: [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 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: How to change page permission from inside the kernel?

2018-07-06 Thread valdis . kletnieks
On Fri, 06 Jul 2018 20:06:29 +0200, Ahmed Soliman said: > I have a memory page allocated with mmap() from user space, This > address is passed to some kernel module (kvm_intel to be specific) and > i want to know how can I change the page permission from inside there > My goal is to achieve

Re: Leaving I/O pressure with memory!? How to do it?

2018-07-06 Thread valdis . kletnieks
On Fri, 06 Jul 2018 08:26:52 -0300, "Daniel." said: > I'll try using a disk on memory (residing on a tmpfs mount) for improving > this. Good idea! Of course, actually getting the data *onto* the tmpfs will involve a lot of I/O, and it doesn't really fix the problem (just moves it around) unless

Re: Fwd: How to change page permission from inside the kernel?

2018-07-06 Thread valdis . kletnieks
On Fri, 06 Jul 2018 23:59:30 +0200, Ahmed Soliman said: > ROE can be enabled by the guest kernel and once enabled the hypervisor > will make sure it never gets disabled again, so if even if the kernel > decided to modify a paged that has ROE, it can't without a reboot. So in essence, you're

Re: Fwd: How to change page permission from inside the kernel?

2018-07-06 Thread valdis . kletnieks
On Sat, 07 Jul 2018 01:31:45 +0200, Ahmed Soliman said: > > You missed the point - your protection can be bypassed without manipulating > > a ROE page. > Changing the virtual memory pointer table is ok but again these memory > mappings will never > make it to the TLB and will be caught during by

Re: How to change page permission from inside the kernel?

2018-07-06 Thread valdis . kletnieks
On Fri, 06 Jul 2018 21:29:40 +0200, you said: > Implementing some kernel protection against subset of rootkits that > manipulates kernel static data (memory pages as well as their > mappings) by having them enforced by hypervisor which is KVM in our Can you give an actual example of a case where

Re: Question about memcpy

2018-07-07 Thread valdis . kletnieks
On Sat, 07 Jul 2018 19:36:47 +0800, bing zhu said: > and in user space i do the same thing,I noticed that kernel is faster than > user , How did you measure the times? Doing this right is actually harder than it looks... pgpT3oFpml7qt.pgp Description: PGP signature

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: 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 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: 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: 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: 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

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-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 watchdog

2018-07-03 Thread valdis . kletnieks
On Tue, 03 Jul 2018 10:28:48 +0800, you said: > yes ! but there are days when people have to do a real-time work with no > delay in kernel space ,i think i can feed the dog > a percpu variable "nmi_touch" looks suspicious,thanks! 1) The Linux kernel community convention is t use 'reply all'

Re: Jbd2 async problem

2018-01-22 Thread valdis . kletnieks
On Mon, 22 Jan 2018 20:18:47 +0800, Rock Lee said: > I think in order to keep the consistency, the whole transaction should > be discarded, as long as not all the metadata blocks have the right > crc value in the transaction. But why jbd2 still copies the metadata > block(with the right crc) to

Re: [tools/perf] perf test LLVM failure on 4.9

2018-01-23 Thread valdis . kletnieks
On Tue, 23 Jan 2018 18:07:25 +0530, Pintu Kumar said: > My uname says: > 4.9--amd-x86-64 Literally 4.9-? No 3rd number? And why ''? (Hint - obfuscating doesn't help here, it's hard to debug when we don't see the *actual* string.) Some unames from my various machines:

Re: Guidelines for Submitting an RFC PATCH

2018-03-12 Thread valdis . kletnieks
On Mon, 12 Mar 2018 12:26:38 -0700, Joe Smith said: > I understand the guidelines for submitting a PATCH and they are quite > rigorous. What about submitting an RFC, since RFC is just to get early > comments do I have to make sure that each patch in the RFC compiles or > is it OK if all patches

Re: Guidelines for Submitting an RFC PATCH

2018-03-13 Thread valdis . kletnieks
On Tue, 13 Mar 2018 08:52:01 -0700, Joe Smith said: > By conformant I mean for example that it has to compile or if the > patch consists of a series of patches each patch applied individually > should compile. That is a lot of work for something that is just being > presented to ask for an

Re: During shutdown/reboot Network Subsystem v/s Storage Subsystem

2018-03-14 Thread valdis . kletnieks
On Wed, 14 Mar 2018 11:53:33 +0530, jitendra kumar khasdev said: > eg. when we do shutdown, which (network or storage)stack goes down first? Hint: What order do these *have* to happen in? What happens if you shut down the network before unmounting an NFS share, or if you pixie-booted onto an

Re: What will happen if I kill a process which is waiting for the retuan ioctl() syscall?

2018-03-14 Thread valdis . kletnieks
On Wed, 14 Mar 2018 17:46:16 +0100, Greg KH said: > On Wed, Mar 14, 2018 at 12:32:21PM -0400, valdis.kletni...@vt.edu wrote: > > That's *totally* device dependent. The things a driver needs to do to > > ensure > > consistency for a 40Gbit ethernet adapter are *totally* different from that > >

Re: What will happen if I kill a process which is waiting for the retuan ioctl() syscall?

2018-03-14 Thread valdis . kletnieks
On Wed, 14 Mar 2018 11:27:41 +0800, Larry Chen said: > > 3. If ioctl() still running even after we terminate this process, where doe s the return value ioctl() will return to? > That sounds insane. That's because it *is* insane. The ioctl() *can't* "still be running" after the kill -9, because

Re: Building separate files for a kernel module

2018-04-04 Thread valdis . kletnieks
On Wed, 04 Apr 2018 18:29:21 -0300, Martin Galvan said: > PS: Yes, I'm aware I could just add $(bar-objs) to mydriver-y and > avoid building bar.a, but I really need to have those files as a > separate library. What's driving the requirement for a separate library?

Re: specifying in the kernel command line

2018-04-04 Thread valdis . kletnieks
On Wed, 04 Apr 2018 11:46:01 +0300, Kevin Wilson said: > Hello, > I have an x86_64 host with 4GB of Physical RAM running Fedora 25. > > I have a question about hugepages allocation on this host. > In: > https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt > > I see that you can use

Re: Block device handling from other module

2018-04-06 Thread valdis . kletnieks
On Fri, 06 Apr 2018 12:12:31 +0530, Rupesh Kumar said: > My question is : Can STANDBY IMMEDIATE command be issued directly to > SSD device ? How can I achieve it in most efficient way ? In the source tree, see tools/laptop/freefall/freefall.c for how to do the daemon. The sample code does a

Re: How can I disable compile optimization in kernel for friendly debugging, Thanks

2018-04-20 Thread valdis . kletnieks
On Fri, 20 Apr 2018 23:39:10 +0800, Yubin Ruan said: > On 2018-04-19 13:28, valdis.kletni...@vt.edu wrote: > > On Thu, 19 Apr 2018 16:58:40 +0800, sizel said: > > > How can I disable compile optimization in kernel for friendly > > > debugging, Thanks > > > > First off, there are parts of the

Re: How can I disable compile optimization in kernel for friendly debugging, Thanks

2018-04-21 Thread valdis . kletnieks
On Sat, 21 Apr 2018 21:15:10 +0800, Yubin Ruan said: > From this, I have a related question, can I treat __builtin_return_address() > as a "builtin" stack unwinder (but only check for return addresses, or, where > a function is called). It would seem possible, but it doesn't actually work that

Re: Softlockup and Hardlockup sample test module

2018-04-15 Thread valdis . kletnieks
On Sun, 15 Apr 2018 13:17:27 +0530, Ivid Suvarna said: > I had tried with the module where I put a busy loop inside spinlock > but was not able to cause any lockups. Maybe this is because of SMP > which schedule the job to other CPU. "How do I make a task to run on > single CPU only?" So you get

Re: How can I disable compile optimization in kernel for friendly debugging, Thanks

2018-04-19 Thread valdis . kletnieks
On Thu, 19 Apr 2018 16:58:40 +0800, sizel said: > How can I disable compile optimization in kernel for friendly debugging, > Thanks First off, there are parts of the kernel that *WILL* explode if you try to build with -O0 - in particular, any code that expects static inlines to be treated as

Re: V4l2 Sensor driver and V4l2 ctrls

2018-03-30 Thread valdis . kletnieks
On Fri, 30 Mar 2018 11:38:07 +0530, MUHAMMED ASAD P T said: > In reference sensor drivers, they used the V4L2_CID_DV_RX_POWER_PRESENT v4l2 > ctrl. > It is a standard ctrl and created using v4l2_ctrl_new_std(). > 1. Whether in our sensor driver, we need to create this Control Id or not. > How to

Re: Why are the PAGE_SIZE and the physical page frame size different in x86_64 kernel?

2018-03-29 Thread valdis . kletnieks
On Thu, 29 Mar 2018 22:48:24 +0800, Hao Lee said: > I'm confused about the meaning of the PAGE_SIZE macro in x86_64 > kernel. Its value is 4KB and I once thought it was the size of a > physical page frame, but now I think I'm wrong. I find that most of > the physical address space is mapped by PMD

Re: Hang in FUTEX_WAKE_PRIVATE after clock_gettime

2018-03-24 Thread valdis . kletnieks
On Sat, 24 Mar 2018 04:43:42 -0400, Jeffrey Walton said: > My question is, is a futex with a 2147483647 or -1 expected? Where > should I be looking to begin to narrow the problem down? 'man 7 futex' says: Semantics Any futex operation starts in user space, but it may be necessary

Re: Difference between atomic context and interrupt context.

2018-04-02 Thread valdis . kletnieks
On Mon, 02 Apr 2018 13:00:32 +0530, Madhu K said: > what is the difference between atomic context and interrupt context. > are they both same? Interrupt context means we're dealing with an interrupt. Atomic context means we're doing something that *itself* should not be interrupted.

Re: A question about function split_mem_range

2018-03-25 Thread valdis . kletnieks
On Sun, 25 Mar 2018 22:32:42 +0800, Hao Lee said: > In arch/x86/mm/init.c, there is a function called split_mem_range[0]. > Its logic is very complicated and I can't figure out what it does. I > have added some debug statements in this function to print all > variable, but I still can't

Re: LKCAMP - Linux Kernel study group - volunteers

2018-03-20 Thread valdis . kletnieks
On Tue, 20 Mar 2018 09:14:30 -, Lucas Tanure said: > > We are starting meetings every Tuesday night (starting on 20th March > > at 3pm PST) and we will probably have lots of questions in the > > #kernelnewbies IRC channel coming from the students during the > > workshops. Umm.. What GMT

Re: Why do some config options return limited info from a search?

2018-03-18 Thread valdis . kletnieks
On Mon, 19 Mar 2018 00:08:10 -, John Whitmore said: > Sometimes however you get a module which don't give this information. Is this > intentional, signify something, or just an oversight for that config option? > For example SND_HDA_CORE: > Symbol: SND_HDA_CORE [=m] > Type : tristate >

Re: sysfs unbind, miscdev

2018-03-21 Thread valdis . kletnieks
On Wed, 21 Mar 2018 17:26:57 +0100, Martin Kaiser said: > I have a driver that is an spi device on one side and a miscdevice on > the other. This way usually leads to either madness or heavy drinking. > Surprisingly to me, I can unbind the driver from the spi device on the > bus while there's a

Re: Year 2038 time set problem

2018-03-04 Thread valdis . kletnieks
On Sun, 04 Mar 2018 06:59:46 +, tali.pe...@nuvoton.com said: > It is not secure because it is not fixed for these issues: > https://meltdownattack.com/ Note that saying "The CPU isn't vulnerable to Meltdown/Spectre, therefor the 4.1 kernel is OK" is *incredibly* wrong. For the record, since

Re: Year 2038 time set problem

2018-03-04 Thread valdis . kletnieks
On Sun, 04 Mar 2018 20:47:15 +, Alex Arvelaez said: > You can kexec into the newer kernel to avoid rebooting if you absolutely must > but yeah the best practice is to keep your system up to date and that requires > some disruption of service. If you can't afford the disruption of service a

Re: Year 2038 time set problem

2018-03-04 Thread valdis . kletnieks
On Sun, 04 Mar 2018 21:54:03 +0100, Greg KH said: > To be fair, the next 4.1.y release to come out in a few days should have > almost all of these issues resolved. So as long as you are keeping your > systems up to date, all should be fine. So the next one will be the "So long, and thanks for

Re: Year 2038 time set problem

2018-03-04 Thread valdis . kletnieks
On Sun, 04 Mar 2018 21:21:13 -0500, Ruben Safir said: > I am not setting up a high availability cluster in my house, thank you. > And fwiw, I've run systems for 6-8 years without rebooting on pc > hardware. My little fanless fit/pc service running an intel atom had at > one time run 5 years

Re: Year 2038 time set problem

2018-03-05 Thread valdis . kletnieks
On Sun, 04 Mar 2018 23:50:32 -0500, Ruben Safir said: > Don't pretend to understand what I can and can not afford. Your not > picking security policy for Google. What your failing to address, > because you are so blinded to your own frame of reference, is that your > solution leaves out well

Re: Year 2038 time set problem

2018-03-05 Thread valdis . kletnieks
On Mon, 05 Mar 2018 07:20:35 -0500, Ruben Safir said: > So any system where you need to, or want to install it and forget about > it for a long period of time, the Linux kernel can not be considered a > choice for that usage because it needs contact oversite and upgrades. That's true for *any*

Re: Year 2038 time set problem

2018-02-26 Thread valdis . kletnieks
On Mon, 26 Feb 2018 14:15:53 +0100, Piotr Figiel said: > According to kernel.org website 4.1 has projected EOL in May 2018. Is > the information about kernel releases on kernel.org irrelevant/ > shouldn't be trusted? Or my understanding of longterm kernel trees is > incorrect? Do you *really*

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: 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: 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: 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: 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: 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: 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: 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: 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: 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 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: 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: [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: 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-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: 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: 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: 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: 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: 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: 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: 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: 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: 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

[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: 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

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: 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-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: [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 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: 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: 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: 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: 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: 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: 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: 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: [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: 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: 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: 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: 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: 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: 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-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

<    5   6   7   8   9   10   11   >