[PATCH v2] virtio: reject shm region if length is zero

2025-05-11 Thread Sami
From: Sami Uddin Prevent usage of shared memory regions where the length is zero, as such configurations are not valid and may lead to unexpected behavior. Signed-off-by: Sami Uddin --- v2: - Fixed coding style issue: added space after 'if' statement include/linux/virtio_config.h

[PATCH] virtio: reject shm region if length is zero

2025-05-11 Thread Sami
From: Sami Uddin Prevent usage of shared memory regions where the length is zero, as such configurations are not valid and may lead to unexpected behavior. Signed-off-by: Sami Uddin --- include/linux/virtio_config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux

[PATCH v3] virtio: reject shm region if length is zero

2025-05-11 Thread Sami
From: Sami Uddin Prevent usage of shared memory regions where the length is zero, as such configurations are not valid and may lead to unexpected behavior. Signed-off-by: Sami Uddin --- v3: - Use idiomatic 'if (!region->len)' as suggested by reviewer v2: - Fixed coding style issue

[PATCH] iommu/tegra: Add missing spinlock initialization

2013-02-04 Thread Sami Liedes
Fix tegra_smmu_probe() to initialize client_lock spinlocks in per-address-space structures. Signed-off-by: Sami Liedes --- drivers/iommu/tegra-smmu.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index f08dbcd

[PATCH 01/01] Drivers: MMB and PI ZigBee USB Device Support in cp210x.c

2013-07-08 Thread Sami Rahman
From: Sami Rahman Kernel Version: 3.5.0-34-generic Added support for MMB Networks and Planet Innovation Ingeni ZigBee USB devices using customized Silicon Labs' CP210x.c USB to UART bridge drivers with PIDs: 88A4, 88A5. Signed-off-by: Sami Rahman Tested-by: Sami Rahman --- ---

ipc: object information data in proc and sysfs

2012-11-18 Thread Sami Kerola
g the concept makes sense and could be considered part of upstream kernel (assuming my coding meets the usual quality criteria). Any thoughts, comments, recommendations? -- Sami Kerola http://www.iki.fi/kerolasa/ -- To unsubscribe from this list: send the line "unsubscribe linux-kern

[PATCH] proc: make high precision system boot time available

2013-06-29 Thread Sami Kerola
he boot time as precisily as it can. CC: Karel Zak CC: Lennart Poettering CC: Kay Sievers CC: Eric W. Biederman References: http://www.spinics.net/lists/util-linux-ng/msg08092.html Measurement: https://plus.google.com/u/0/117341944650953092607/posts/SHy5qu1HpSU Signed-off-by: Sami Kerola --

Re: [PATCH] proc: make high precision system boot time available

2013-06-29 Thread Sami Kerola
On 29 June 2013 15:23, Eric W. Biederman wrote: > > Nacked-by: "Eric W. Biederman" > > The pach does not solve the problem described. Which might be true, and I am open to better proposals. > Sami Kerola writes: > >> The kernel does not expose precise

Re: [PATCH] proc: make high precision system boot time available

2013-06-30 Thread Sami Kerola
On 30 June 2013 16:10, Kay Sievers wrote: > On Sat, Jun 29, 2013 at 10:53 PM, Sami Kerola wrote: > >> BTW having a way to measure effect of suspend/resume could lead to a >> way to fix time time distortion. > >> Perhaps there is better alternative to fix user space p

[PATCH] tools/power/x86: add .gitignore files

2012-08-05 Thread Sami Kerola
Make resulted to untraced files, which where the binaries make produced, such need to be ignored. Signed-off-by: Sami Kerola --- tools/power/x86/turbostat/.gitignore | 1 + tools/power/x86/x86_energy_perf_policy/.gitignore | 1 + 2 files changed, 2 insertions(+) create mode 100644

Re: ipc: object information data in proc and sysfs

2012-11-25 Thread Sami Kerola
On Tue, Nov 20, 2012 at 12:21 PM, Karel Zak wrote: > On Mon, Nov 19, 2012 at 04:12:50PM -0800, Andrew Morton wrote: >> Where's the benefit in switching ipcs over to using /proc? >> >> procfs reads are probably slower than the syscalls? > > 32bit userspace and 64bit kernel (RHEL ppc64), it seems m

Re: BTTV problems in 2.4.3

2001-04-03 Thread Sami Nieminen
cture is fine. Also overlay looks good if I keep the window size small enough. Sami -- Whoa...I did a 'zcat /vmlinuz > /dev/audio' and I think I heard God... - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTEC

Re: 2.6.22.6 + oprofile oops

2007-10-11 Thread Sami Farin
On Thu, Oct 11, 2007 at 16:36:10 +0200, Philippe Elie wrote: > On Sat, 29 Sep 2007 at 20:05 +0000, Sami Farin wrote: > > > > x86_64 SMP kernel v2.6.22.6 (not using callgraph). > > > sometimes oprofile works for a longer time... but not this time. > > > >

drivers/char/random.c:write_pool() -- cond_resched needed?

2007-11-30 Thread Sami Farin
In write_pool(), isn't cond_resched() needed after call to add_entropy_words() because otherwise there can be large latencies (think of command "dd if=/dev/zero of=/dev/random bs=1" ) ? -- Do what you love because life is too short for anything else. - To unsubscribe from this list: send

Re: Is there any word about this bug in gcc ?

2007-11-20 Thread Sami Farin
On Tue, Nov 20, 2007 at 13:52:52 +0100, Alessandro Suardi wrote: > On Nov 20, 2007 7:52 AM, Herbert Xu <[EMAIL PROTECTED]> wrote: > > On Mon, Nov 19, 2007 at 10:47:59PM -0800, H. Peter Anvin wrote: > > > > > > This one is definitely messy. There is absolutely no way to know what > > > gcc has misc

Re: [OOPS] 2.6.10, ReiserFS errors, preempt

2005-02-17 Thread Sami Farin
On Thu, Feb 17, 2005 at 01:59:47AM +0100, Guennadi Liakhovetski wrote: > Hi > > The machine was running updatedb, while I was trying to burn on an ATAPI > CDR (hdc) and read a SCSI DVD-ROM not very intensively, ran a couple of > random applications, when my /home partition (hda7) became unaccess

Re: [PATCH - 2.6.10] generic_file_buffered_write handle partial DIO writes with multiple iovecs

2005-01-18 Thread Sami Farin
On Tue, Jan 18, 2005 at 05:22:44PM -0800, Daniel McNeil wrote: > Andrew, > > This is a patch to generic_file_buffered_write() to correctly > handle partial O_DIRECT writes (because of unallocated blocks) > when there is more than 1 iovec. Without this patch, the code is > writing the wrong iovec

Re: [PATCH - 2.6.10] generic_file_buffered_write handle partial DIO writes with multiple iovecs

2005-01-19 Thread Sami Farin
On Wed, Jan 19, 2005 at 08:55:40AM -0800, Daniel McNeil wrote: > On Tue, 2005-01-18 at 18:31, Sami Farin wrote: ... > > I have Linux 2.6.10-ac9 + bio clone memory corruption -patch, > > and dio_bug does not give errors (without your patch). > > I should have mentioned that m

kernel 2.6.22: what IS the VM doing?

2007-08-30 Thread Sami Farin
Using SMP kernel 2.6.22.6pre-CFS-v20.5 on Pentium D (IA-32). I think this bug (or whatever you want to call it) got triggered when you first allocate several megabytes of memory in a kernel module and then free them, and then run e.g. X and when memory gets tight, you end up with this situation...

Re: kernel 2.6.22: what IS the VM doing?

2007-09-05 Thread Sami Farin
On Tue, Sep 04, 2007 at 21:37:35 -0400, Rik van Riel wrote: > Sami Farin wrote: >> Using SMP kernel 2.6.22.6pre-CFS-v20.5 on Pentium D (IA-32). >> I think this bug (or whatever you want to call it) got triggered >> when you first allocate several megabytes of memory in a kern

Re: kernel 2.6.22: what IS the VM doing?

2007-09-05 Thread Sami Farin
large margin to continue putting equal > pressure on all zones in normal situations. > > Sami, could you try out this patch to see if it helps your > situation? Thanks, Rik. bzImage is ready, I probably reboot inside one month for a reason or other 8-) -- Do what you love because

Re: [patch 1/2] oProfile: oops when profile_pc() return ~0LU

2007-10-23 Thread Sami Farin
On Mon, Oct 22, 2007 at 19:38:10 -0700, Linus Torvalds wrote: > > This set of two patches look ok by me, but I'd like sign-offs.. Also, were > they tested and found to fix the problem by Sami? > > Linus The previous patch I tested by Philippe, oprof-fix-

Re: [patch 1/2] oProfile: oops when profile_pc() return ~0LU

2007-10-23 Thread Sami Farin
On Tue, Oct 23, 2007 at 18:13:21 +0200, Philippe Elie wrote: > On Tue, 23 Oct 2007 at 13:10 +0000, Sami Farin wrote: > > > On Mon, Oct 22, 2007 at 19:38:10 -0700, Linus Torvalds wrote: > > > > > > This set of two patches look ok by me, but I'd like sign-o

x86: randomize brk() and RLIMIT_DATA

2007-10-25 Thread Sami Farin
Would be neat if randomized brk and setrlimit(RLIMIT_DATA, ...) worked in a predictable way: $ gcc brk.c -fPIC -pie -m64;./a.out;./a.out;./a.out sbrk=0x7f721b815000 main=0x7f721af04860 sbrk succeeded (brk=0x7f721b909240) sbrk=0x7fc3d77e2000 main=0x7fc3d66fa860 sbrk failed: Cannot allocate memory (

Re: x86: randomize brk() and RLIMIT_DATA

2007-10-25 Thread Sami Farin
gt; regardless of what you do. > > I tend to agree here with Arjan. However it probably would make no harm to > make at least a little bit consisten behavior of setrlimit(), though it > has a little use in such cases. > > Sami, does the patch below work for you? Thanks, Jiri, now

Re: kernel 2.6.23: what IS the VM doing?

2007-11-02 Thread Sami Farin
On Fri, Sep 14, 2007 at 20:17:46 +0300, Sami Farin wrote: > On Wed, Sep 05, 2007 at 18:48:51 -0400, Rik van Riel wrote: > > Sami Farin wrote: > >> On Wed, Sep 05, 2007 at 12:24:26 -0400, Rik van Riel wrote: > >> ... > >>>> *shrug* > >>> The a

I broke my port numbers :(

2007-01-15 Thread Sami Farin
I know this may be entirely my fault but I have tried reversing all of my _own_ patches I applied to 2.6.19.2 but can't find what broke this. I did three times "netcat 127.0.0.69 42", notice the different port numbers. First, if someone could attempt this on 2.6.19.2 or 2.6.20-rc* , and tell it wo

Re: I broke my port numbers :(

2007-01-15 Thread Sami Farin
On Mon, Jan 15, 2007 at 23:55:15 +0200, Sami Farin wrote: > I know this may be entirely my fault but I have tried reversing > all of my _own_ patches I applied to 2.6.19.2 but can't find what broke this. > I did three times "netcat 127.0.0.69 42", notice the different >

Re: I broke my port numbers :(

2007-01-16 Thread Sami Farin
On Tue, Jan 16, 2007 at 14:57:56 +0100, Jan Engelhardt wrote: > > >Subject: Re: I broke my port numbers :( > > > >On Mon, Jan 15, 2007 at 23:55:15 +0200, Sami Farin wrote: > >> I know this may be entirely my fault but I have tried reversing > >> all of my

Re: 2.6.20-rc5: known unfixed regressions

2007-01-18 Thread Sami Farin
On Wed, Jan 17, 2007 at 14:43:29 +1100, David Chinner wrote: ... > > > Subject: BUG: at mm/truncate.c:60 cancel_dirty_page() (XFS) > > > References : http://lkml.org/lkml/2007/1/5/308 > > > Submitter : Sami Farin <[EMAIL PROTECTED]> > > > Ha

Re: PROBLEM: 2.6.19 + highmem = BUG at do_wp_page

2006-12-29 Thread Sami Farin
On Tue, Dec 12, 2006 at 15:10:56 -0500, Chuck Ebbert wrote: > In-Reply-To: <[EMAIL PROTECTED]> > > On Tue, 5 Dec 2006 19:25:13 +0200, Sami Farin wrote: > > > BUG: unable to handle kernel paging request at virtual address fffb9dc0 > > > eax: fffb8000 eb

xfs_file_ioctl / xfs_freeze: BUG: warning at kernel/mutex-debug.c:80/debug_mutex_unlock()

2007-01-03 Thread Sami Farin
just a simple test I did... xfs_freeze -f /mnt/newtest cp /etc/fstab /mnt/newtest xfs_freeze -u /mnt/newtest 2007-01-04 01:44:30.341979500 <4>BUG: warning at kernel/mutex-debug.c:80/debug_mutex_unlock() 2007-01-04 01:44:30.385771500 <4> [] dump_trace+0x215/0x21a 2007-01-04 01:44:30.385774500 <4>

Re: [RFC] div64_64 support

2007-02-24 Thread Sami Farin
On Fri, Feb 23, 2007 at 17:05:27 -0800, Stephen Hemminger wrote: > Since there already two users of full 64 bit division in the kernel, > and other places maybe hiding out as well. Add a full 64/64 bit divide. > > Yes this expensive, but there are places where it is necessary. > It is not clear if

XFS internal error xfs_da_do_buf

2007-01-30 Thread Sami Farin
I setup namespace for /tmp and /var/tmp ( pam_namespace.so into /etc/pam.d/{su,login} ) and something did not like something I did: [322593.844838] 0x0: 00 00 00 00 2b 00 00 11 20 21 00 00 00 68 ff ff [322593.844854] Filesystem "sda8": XFS internal error xfs_da_do_buf(2) at line 2087 of file fs

Re: PROBLEM: 2.6.19 + highmem = BUG at do_wp_page

2006-12-12 Thread Sami Farin
On Wed, Dec 06, 2006 at 11:41:38 +0200, Sami Farin wrote: > On Tue, Dec 05, 2006 at 22:39:45 -0800, Andrew Morton wrote: > > On Tue, 5 Dec 2006 19:25:13 +0200 > > Sami Farin <[EMAIL PROTECTED]> wrote: > > > > > [1.] PROBLEM: 2.6.19 + highmem = BUG at do_wp_pag

Re: PROBLEM: 2.6.19 + highmem = BUG at do_wp_page

2006-12-12 Thread Sami Farin
On Tue, Dec 12, 2006 at 12:46:01 +0200, Sami Farin wrote: > On Wed, Dec 06, 2006 at 11:41:38 +0200, Sami Farin wrote: > > On Tue, Dec 05, 2006 at 22:39:45 -0800, Andrew Morton wrote: > > > On Tue, 5 Dec 2006 19:25:13 +0200 > > > Sami Farin <[EMAIL PROTECTED]> w

Re: PROBLEM: 2.6.19 + highmem = BUG at do_wp_page

2006-12-12 Thread Sami Farin
On Tue, Dec 12, 2006 at 15:10:56 -0500, Chuck Ebbert wrote: > In-Reply-To: <[EMAIL PROTECTED]> > > On Tue, 5 Dec 2006 19:25:13 +0200, Sami Farin wrote: > > > BUG: unable to handle kernel paging request at virtual address fffb9dc0 > > > eax: fffb8000 eb

execve hanging in selinux_bprm_post_apply_creds

2007-01-04 Thread Sami Farin
Kernel 2.6.19.1 SMP on Pentium D. I ran command restorecon -R /wrk. After a while or two programs stopped responding and I had to reboot. I'm not sure is this bug or feature... I upgraded selinux policy before running restorecon. 2007-01-04 22:41:55.360538500 <4>softlimit D 61707865 0 18

Re: execve hanging in selinux_bprm_post_apply_creds

2007-01-04 Thread Sami Farin
On Thu, Jan 04, 2007 at 16:03:34 -0800, Andrew Morton wrote: > On Fri, 5 Jan 2007 00:26:42 +0200 > Sami Farin <[EMAIL PROTECTED]> wrote: > > > Kernel 2.6.19.1 SMP on Pentium D. I ran command restorecon -R /wrk. > > After a while or two programs stopped res

BUG: warning at mm/truncate.c:60/cancel_dirty_page()

2007-01-05 Thread Sami Farin
Linux 2.6.19.1 SMP [2] on Pentium D... I was running dt-15.14 [2] and I ran "cinfo datafile" (it does mincore()). Well it went OK but when I ran "strace cinfo datafile"...: 04:18:48.062466 mincore(0x37f1f000, 2147266560, ... 2007-01-06 04:19:03.788181500 <4>BUG: warning at mm/truncate.c:60/cancel

Re: BUG: warning at mm/truncate.c:60/cancel_dirty_page()

2007-01-05 Thread Sami Farin
On Sat, Jan 06, 2007 at 04:39:07 +0200, Sami Farin wrote: > Linux 2.6.19.1 SMP [2] on Pentium D... > I was running dt-15.14 [2] and I ran > "cinfo datafile" (it does mincore()). > Well it went OK but when I ran "strace cinfo datafile"...: > 04:18:48.062466 minco

Re: BUG: warning at mm/truncate.c:60/cancel_dirty_page()

2007-01-06 Thread Sami Farin
On Sat, Jan 06, 2007 at 21:11:07 +, Hugh Dickins wrote: > On Sat, 6 Jan 2007, Sami Farin wrote: > > > Linux 2.6.19.1 SMP [2] on Pentium D... > > I was running dt-15.14 [2] and I ran > > "cinfo datafile" (it does mincore()). > > Well it went OK but when

Re: xfs_file_ioctl / xfs_freeze: BUG: warning at kernel/mutex-debug.c:80/debug_mutex_unlock()

2007-01-08 Thread Sami Farin
> mutexes complain loudly when a the process unlocking the mutex is > not the process that locked it. > > Basically, the generic code is broken - the bd_mount_mutex needs to > be reverted back to a semaphore because it is locked and unlocked > by different processes. The following

Re: BUG: warning at mm/truncate.c:60/cancel_dirty_page()

2007-01-08 Thread Sami Farin
On Mon, Jan 08, 2007 at 10:04:36 +1100, David Chinner wrote: > On Sun, Jan 07, 2007 at 02:48:12PM -0800, Andrew Morton wrote: > > On Mon, 8 Jan 2007 09:23:41 +1100 > > David Chinner <[EMAIL PROTECTED]> wrote: > > > > > How are you supposed to invalidate a range of pages in a mapping for > > > this

e1000: eth0: e1000_clean_tx_irq: Detected Tx Unit Hang

2007-01-09 Thread Sami Farin
Linux 2.6.19.1 SMP on Pentium D, Intel DQ965GF mobo. Got this while bittorrenting knoppix: 2007-01-09 22:53:40.020693500 <4>NETFILTER drop IN=eth0 OUT= MAC=00:19:d1:00:5f:01:00:05:00:1c:58:1c:08:00 SRC=83.46.5.76 DST=80.223.106.128 LEN=121 TOS=0x00 PREC=0x00 TTL=112 ID=53273 PROTO=ICMP TYPE=3 CO

Re: e1000: eth0: e1000_clean_tx_irq: Detected Tx Unit Hang

2007-01-09 Thread Sami Farin
On Tue, Jan 09, 2007 at 15:59:30 -0800, Auke Kok wrote: > Sami Farin wrote: ... > >I do "ethtool -K eth0 tso off" now and check if I get the hang again. =) > > I'm unsure whether v7.2.x already automatically disables TSO for 100mbit > speed link, probably not.

Re: e1000: eth0: e1000_clean_tx_irq: Detected Tx Unit Hang

2007-01-09 Thread Sami Farin
On Tue, Jan 09, 2007 at 17:48:04 -0800, Auke Kok wrote: > Sami Farin wrote: > >On Tue, Jan 09, 2007 at 15:59:30 -0800, Auke Kok wrote: > >>Sami Farin wrote: > >... > >>>I do "ethtool -K eth0 tso off" now and check if I get the hang again. =) >

Linux 2.6.22: had to reboot after OOM

2007-07-15 Thread Sami Farin
After I got this error [1], system got real slow, like 386 having 32 MB of RAM and swapping constantly. My system is P4 SMP with 1GB of RAM. I got this same behavior with 2.6.19, too, but then I used GNU cp v6.9 which had micro-optimization which did not bother doing read() for regular files, like

Re: asm volatile [Was: [RFC] div64_64 support]

2007-03-08 Thread Sami Farin
On Wed, Mar 07, 2007 at 00:24:35 +0200, Sami Farin wrote: > On Tue, Mar 06, 2007 at 23:53:49 +0200, Sami Farin wrote: > ... > > And I found bug in gcc-4.1.2, it gave 0 for ncubic results > > when doing 1000 loops test... gcc-4.0.3 works. > > Found it. > > --- cbrt

Linux 2.6.19.7 + oprofile = BUG: unable to handle kernel NULL pointer dereference at virtual address 00000020

2007-03-21 Thread Sami Farin
Not sure if this is oprofile's fault, but I got this when I started opreport. 10 min after BUG system needed to be rebooted (cycling power). With earlier kernel (without oprofile) everything worked for a month without hiccups. [295318.822839] BUG: unable to handle kernel NULL pointer dereference a

Re: [RFC] div64_64 support

2007-03-06 Thread Sami Farin
On Tue, Mar 06, 2007 at 16:00:55 -0800, Stephen Hemminger wrote: ... > > Now Linux 2.6 does not have "memory" in fls, maybe it causes > > some gcc funnies some people are seeing. > > > > That code was copy-paste from: > include/asm-x86_64/bitops.h > > So shouldn't both fls() and ffs() be f

Re: [RFC] div64_64 support

2007-03-06 Thread Sami Farin
On Tue, Mar 06, 2007 at 10:29:41 -0800, Stephen Hemminger wrote: > Don't count the existing Newton-Raphson out. It turns out that to get enough > precision for 32 bits, only 4 iterations are needed. By unrolling those, it > gets much better timing. > > Slightly gross test program (with original cu

Re: [RFC] div64_64 support

2007-03-06 Thread Sami Farin
On Tue, Mar 06, 2007 at 23:53:49 +0200, Sami Farin wrote: ... > And I found bug in gcc-4.1.2, it gave 0 for ncubic results > when doing 1000 loops test... gcc-4.0.3 works. Found it. --- cbrt-test.c~2007-03-07 00:20:54.735248105 +0200 +++ cbrt-test.c 2007-03-07 00:21:03.964864343

Re: [patch v2] epoll use a single inode ...

2007-03-07 Thread Sami Farin
On Tue, Mar 06, 2007 at 21:20:33 +0100, Eric Dumazet wrote: ... > I rewrote the reciprocal_div() for i386 so that one multiply is used. > > static inline u32 reciprocal_divide(u32 A, u32 R) > { > #if __i386 > unsigned int edx, eax; > asm("mul %2":"=a" (eax), "=d" (edx):"rm" (R), "0

Re: [RFC] div64_64 support

2007-03-07 Thread Sami Farin
On Wed, Mar 07, 2007 at 11:11:49 -0500, Chuck Ebbert wrote: > Sami Farin wrote: > > On Tue, Mar 06, 2007 at 23:53:49 +0200, Sami Farin wrote: > > ... > >> And I found bug in gcc-4.1.2, it gave 0 for ncubic results > >> when doing 1000 loops test... g

oprofile / selinux / security_port_sid

2007-03-27 Thread Sami Farin
is there room for improvement in security_port_sid() ? little test with dns queries (dnsfilter (the client) on local host using poll() and dnscache (the server) using epoll (at max 4000 concurrent queries): (stats for only vmlinux) CPU: P4 / Xeon, speed 2797.32 MHz (estimated) Counted GLOBAL_POWE

Re: oprofile / selinux / security_port_sid

2007-03-27 Thread Sami Farin
On Tue, Mar 27, 2007 at 09:40:23 -0400, Stephen Smalley wrote: > On Tue, 2007-03-27 at 13:06 +0300, Sami Farin wrote: > > is there room for improvement in security_port_sid() ? > > Yes, lots of room. Also, it won't get called per-packet if you enable > secmark (echo 0 &

[PATCH 05/15] scripts/mod: disable LTO for empty.c

2017-11-03 Thread Sami Tolvanen
With CONFIG_CLANG_LTO, clang generates LLVM IR instead of ELF object files. As empty.o is used for probing target properties, disable LTO for it to produce an object file instead. Signed-off-by: Sami Tolvanen --- scripts/mod/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts

[PATCH 01/15] kbuild: add ld-name macro and support for GNU gold

2017-11-03 Thread Sami Tolvanen
GNU gold may require different flags than GNU ld. Add a macro for detecting the linker and conditionally add gold specific flags from LDFLAGS_GOLD. Signed-off-by: Sami Tolvanen --- Makefile | 5 + scripts/Kbuild.include | 4 2 files changed, 9 insertions(+) diff --git a

[PATCH 13/15] arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS

2017-11-03 Thread Sami Tolvanen
when RANDOMIZE_MODULE_REGION_FULL is selected, 2) and disables RANDOMIZE_MODULE_REGION_FULL with clang LTO. Signed-off-by: Sami Tolvanen --- arch/arm64/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 43ccddb7c8ec..a301fdc90319 1

[PATCH 14/15] arm64: crypto: disable LTO for aes-ce-cipher.c

2017-11-03 Thread Sami Tolvanen
CONFIG_CLANG_LTO requires the use of clang's integrated assembler, which doesn't understand the inline assembly in aes-ce-cipher.c. Disable LTO for the file to work around the issue. Signed-off-by: Sami Tolvanen --- arch/arm64/crypto/Makefile | 2 +- 1 file changed, 1 insertion(+),

[PATCH 12/15] arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS

2017-11-03 Thread Sami Tolvanen
when RANDOMIZE_MODULE_REGION_FULL is selected, 2) and disables RANDOMIZE_MODULE_REGION_FULL with clang LTO. Signed-off-by: Sami Tolvanen --- arch/arm64/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 43ccddb7c8ec..a301fdc90319 1

[PATCH 13/15] arm64: fix mrs_s/msr_s macros for clang LTO

2017-11-03 Thread Sami Tolvanen
9 As binutils doesn't allow macros to be redefined, this change adds C preprocessor macros that define the assembly macros globally for binutils and locally for clang's integrated assembler. Suggested-by: Greg Hackmann Suggested-by: Nick Desaulniers Signed-off-by: Sami Tolvanen --- arc

[PATCH 15/15] arm64: select ARCH_SUPPORTS_CLANG_LTO

2017-11-03 Thread Sami Tolvanen
Allow CONFIG_CLANG_LTO to be enabled for the architecture. Signed-off-by: Sami Tolvanen --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a301fdc90319..6ae31f0c58ee 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig

[PATCH 10/15] arm64: disable ARM64_ERRATUM_843419 for clang LTO

2017-11-03 Thread Sami Tolvanen
CONFIG_CLANG_LTO depends on GNU gold, which can generate ADR_PREL_PG_HI21 relocations even with --fix-cortex-a53-843419. Since ARM64_ERRATUM_843419 disables kernel support for these relocations, disable the erratum when LTO is used. Signed-off-by: Sami Tolvanen --- arch/arm64/Kconfig | 1 + 1

[PATCH 11/15] arm64: fix mrs_s/msr_s macros for clang LTO

2017-11-03 Thread Sami Tolvanen
9 As binutils doesn't allow macros to be redefined, this change adds C preprocessor macros that define the assembly macros globally for binutils and locally for clang's integrated assembler. Suggested-by: Greg Hackmann Suggested-by: Nick Desaulniers Signed-off-by: Sami Tolvanen --- arc

[PATCH 11/15] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold

2017-11-03 Thread Sami Tolvanen
e the erratum fix is not used even if the linker is configured to enable it by default. Signed-off-by: Sami Tolvanen --- arch/arm64/Makefile | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index c16bd1ab37f8..0c1fb297c98e 100644 --- a/arch/arm64/Mak

[PATCH 12/15] arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold

2017-11-03 Thread Sami Tolvanen
e the erratum fix is not used even if the linker is configured to enable it by default. Signed-off-by: Sami Tolvanen --- arch/arm64/Makefile | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index c16bd1ab37f8..0c1fb297c98e 100644 --- a/arch/arm64/Mak

[PATCH 09/15] arm64: keep .altinstructions and .altinstr_replacement

2017-11-03 Thread Sami Tolvanen
Make sure the linker doesn't remove .altinstructions or .altinstr_replacement when CONFIG_LD_DEAD_CODE_DATA_ELIMINATION is enabled. Signed-off-by: Sami Tolvanen --- arch/arm64/kernel/vmlinux.lds.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/k

[PATCH 08/15] arm64: don't pass -maarch64linux to GNU gold

2017-11-03 Thread Sami Tolvanen
This change fixes the following error message when linking with GNU gold: ld.gold: error: unrecognized emulation aarch64linux Signed-off-by: Sami Tolvanen --- arch/arm64/Makefile | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index

[PATCH 03/15] kbuild: add support for clang LTO

2017-11-03 Thread Sami Tolvanen
C=clang LD=ld.gold LD_FINAL_VMLINUX=ld Recommended versions are >= 5.0 for clang, and >= 2.27 for binutils. Signed-off-by: Sami Tolvanen --- .gitignore | 2 ++ Makefile | 16 - arch/Kconfig | 32 + scripts/Makef

[PATCH 07/15] arm64: use -mno-implicit-float instead of -mgeneral-regs-only

2017-11-03 Thread Sami Tolvanen
From: Greg Hackmann LLVM bug 30792 causes clang's AArch64 backend to crash compiling arch/arm64/crypto/aes-ce-cipher.c. Replacing -mgeneral-regs-only with -mno-implicit-float is the suggested workaround. Signed-off-by: Greg Hackmann Cc: Matthias Kaehlcke Signed-off-by: Sami Tol

[PATCH 06/15] efi/libstub: disable LTO

2017-11-03 Thread Sami Tolvanen
With CONFIG_CLANG_LTO, we produce LLVM IR instead of object files. Since LTO is not really needed here and the Makefile assumes we produce an object file, disable LTO for libstub. Signed-off-by: Sami Tolvanen --- drivers/firmware/efi/libstub/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 04/15] kbuild: fix dynamic ftrace with clang LTO

2017-11-03 Thread Sami Tolvanen
gnore, and a __norecordmcount attribute for moving functions to this section. Signed-off-by: Sami Tolvanen --- arch/Kconfig | 2 +- include/asm-generic/vmlinux.lds.h | 2 +- include/linux/compiler-clang.h| 7 +++ include/linux/compiler.h | 4 kernel/

[PATCH 06/15] efi/libstub: disable clang LTO

2017-11-03 Thread Sami Tolvanen
With CONFIG_CLANG_LTO, we produce LLVM IR instead of object files. Since LTO is not really needed here and the Makefile assumes we produce an object file, disable LTO for libstub. Signed-off-by: Sami Tolvanen --- drivers/firmware/efi/libstub/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 02/15] kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION with GNU gold

2017-11-03 Thread Sami Tolvanen
Don't remove .head.text or .exitcall.exit when linking with --gc-sections, and include .init.text.* in .init.text and .init.rodata.* in .init.rodata. Signed-off-by: Sami Tolvanen --- include/asm-generic/vmlinux.lds.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --

[PATCH 00/15] Add support for clang LTO

2017-11-03 Thread Sami Tolvanen
ld issues with KASLR, for example. Greg Hackmann (1): arm64: use -mno-implicit-float instead of -mgeneral-regs-only Sami Tolvanen (14): kbuild: add ld-name macro and support for GNU gold kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION with GNU gold kbuild: add support for clang LTO kbuild: fix

Re: [PATCH 00/15] Add support for clang LTO

2017-11-03 Thread Sami Tolvanen
-DLLVM_BINUTILS_INCDIR=/path/to/binutils-2.27/include \ -DLLVM_TARGETS_TO_BUILD="X86;AArch64" && \ ninja Sami

Re: [PATCH 00/15] Add support for clang LTO

2017-11-03 Thread Sami Tolvanen
On Fri, Nov 03, 2017 at 07:26:35PM +, Mark Rutland wrote: > I guess that in Google you haven't tested on a platform with EL2 > available? Correct. I'll look into this and include a fix in v2. Does this work on a clang build without LTO? Sami

Re: [PATCH 07/15] arm64: use -mno-implicit-float instead of -mgeneral-regs-only

2017-11-03 Thread Sami Tolvanen
eam clang doesn't generate any worse code with -mno-implicit-float, so there should be no harm in using this workaround with all versions. This might change in future, of course, so I don't have objections to adding a check for clang version < 6.0 here. Sami

Re: [PATCH 13/15] arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS

2017-11-03 Thread Sami Tolvanen
. I'll see if I can find a better workaround for this for v2. Sami

Re: [PATCH 08/15] arm64: don't pass -maarch64linux to GNU gold

2017-11-06 Thread Sami Tolvanen
te, but at the same time, it supports a number of emulations, just with different names than ld.bfd. I'll take a closer look at this and see if there's a different flag we should be passing here instead. Looks like I also have some 0-day issues to address for v2. Sami

Re: Linux 4.9.93

2018-04-09 Thread Sami Tolvanen
On Mon, Apr 9, 2018 at 10:02 AM Greg Hackmann wrote: > Sami, what are the plans for upstreaming this work? CFI is a clang-specific feature that depends on LTO. Based on the earlier LTO discussion, we decided to collect some more evidence that clang's LTO doesn't actually break an

[PATCH] arm64: kvm: use -fno-jump-tables with clang

2018-05-18 Thread Sami Tolvanen
: VCPU:000804fc20001221 This change adds -fno-jump-tables to arm64/hyp to work around the bug. Suggested-by: AKASHI Takahiro Signed-off-by: Sami Tolvanen --- arch/arm64/kvm/hyp/Makefile | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kvm/hyp/Makefile b/arch

[PATCH] modpost: validate symbol names also in find_elf_symbol

2018-10-23 Thread Sami Tolvanen
set_reset_devices() to the variable .init.text:$x.0 This change adds a call to is_valid_name to find_elf_symbol, similarly to how it's already used in find_elf_symbol2. Signed-off-by: Sami Tolvanen --- scripts/mod/modpost.c | 50 ++- 1 file changed, 26 inser

Re: [PATCH -fixes] riscv: Fix ftrace syscall handling which are now prefixed with __riscv_

2023-10-03 Thread Sami Tolvanen
const char *name) > +{ > + /* > +* Since all syscall functions have __riscv_ prefix, we must skip it. > +* However, as we described above, we decided to ignore compat > +* syscalls, so we don't care about __riscv_compat_ prefix here. > +*/ > + return !strcmp(sym + 8, name); > +} Good catch, thanks for fixing this! Reviewed-by: Sami Tolvanen Sami

[PATCH 01/15] tools: Add gendwarfksyms

2024-06-17 Thread Sami Tolvanen
compatibility. Signed-off-by: Sami Tolvanen --- tools/Makefile | 11 +-- tools/gendwarfksyms/Build | 2 + tools/gendwarfksyms/Makefile| 49 +++ tools/gendwarfksyms/gendwarfksyms.c | 128 tools/gendwarfksyms

[PATCH 00/15] Implement MODVERSIONS for Rust

2024-06-17 Thread Sami Tolvanen
l.org/lkml/2023061155.1349375-1-g...@garyguo.net/ [2] https://lore.kernel.org/rust-for-linux/20231118025748.2778044-1-mmau...@google.com/ [3] https://lore.kernel.org/rust-for-linux/cagsqo005hriuzdeppcifdqg9zfdjrwahpble4x7-myfjscn...@mail.gmail.com/ Sami Sami Tolvanen (15): tools: Add gen

[PATCH 02/15] gendwarfksyms: Add symbol list input handling

2024-06-17 Thread Sami Tolvanen
ols, where only one name appears in the debugging information. Signed-off-by: Sami Tolvanen --- tools/gendwarfksyms/Build | 1 + tools/gendwarfksyms/gendwarfksyms.c | 2 + tools/gendwarfksyms/gendwarfksyms.h | 17 tools/gendwarfksyms/symbols.c

[PATCH 03/15] gendwarfksyms: Add CRC calculation

2024-06-17 Thread Sami Tolvanen
emove13assert_failed 0x985f94dd ... Note that type strings are not yet expanded, so the CRCs can only distinguish between functions and variables for now. Signed-off-by: Sami Tolvanen --- tools/gendwarfksyms/Build | 1 + tools/gendwarfksyms/crc32.c | 69

[PATCH 04/15] gendwarfksyms: Expand base_type

2024-06-17 Thread Sami Tolvanen
ug vmlinux.o Output: gendwarfksyms: symbol_read_list: adding { 4b0, "loops_per_jiffy" } gendwarfksyms: process_modules: vmlinux.o gendwarfksyms: process_exported_symbols: loops_per_jiffy (@ 4b0) variable base_type unsigned long byte_size(8); #SYMVER loops_per_jiffy 0xc694aefc Signed-off

[PATCH 05/15] gendwarfksyms: Add a cache

2024-06-17 Thread Sami Tolvanen
Basic types in DWARF repeat frequently and traversing the DIEs using libdw is relatively slow. Add a simple hashtable based cache for the processed DIEs. Signed-off-by: Sami Tolvanen --- tools/gendwarfksyms/Build | 1 + tools/gendwarfksyms/cache.c | 147

[PATCH 06/15] gendwarfksyms: Expand type modifiers and typedefs

2024-06-17 Thread Sami Tolvanen
Add support for expanding DWARF type modifiers, such as pointers, const values etc., and typedefs. These types all have DW_AT_type attribute pointing the underlying type, and thus produce similar output. Signed-off-by: Sami Tolvanen --- tools/gendwarfksyms/gendwarfksyms.h | 3 ++ tools

[PATCH 07/15] gendwarfksyms: Add pretty-printing

2024-06-17 Thread Sami Tolvanen
byte_size(1)}; Signed-off-by: Sami Tolvanen --- tools/gendwarfksyms/cache.c | 13 + tools/gendwarfksyms/gendwarfksyms.c | 3 +++ tools/gendwarfksyms/gendwarfksyms.h | 5 - tools/gendwarfksyms/types.c | 22 ++ 4 files changed, 42 insertions(+), 1

[PATCH 08/15] gendwarfksyms: Expand subroutine_type

2024-06-17 Thread Sami Tolvanen
oid; Signed-off-by: Sami Tolvanen --- tools/gendwarfksyms/gendwarfksyms.h | 1 + tools/gendwarfksyms/types.c | 58 - 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/tools/gendwarfksyms/gendwarfksyms.h b/tools/gendwarfksyms/gendwarfksyms.h in

[PATCH 09/15] gendwarfksyms: Expand array_type

2024-06-17 Thread Sami Tolvanen
Add support for expanding DW_TAG_array_type, and the subrange type indicating array size. Example output with --debug: variable array_type [34] { pointer_type { const_type { base_type char byte_size(1) } } }; Signed-off-by: Sami Tolvanen --- tools

[PATCH 11/15] gendwarfksyms: Limit structure expansion

2024-06-17 Thread Sami Tolvanen
levels inside the pointer. This should be plenty for catching ABI differences and stops us from pulling in half the kernel for structs that contain pointers to large structs like task_struct. Signed-off-by: Sami Tolvanen --- tools/gendwarfksyms/cache.c | 49 tools

[PATCH 12/15] gendwarfksyms: Add inline debugging

2024-06-17 Thread Sami Tolvanen
Understanding the operation and caching of the tool can be somewhat challenging without a debugger. Add inline debugging information with the --inline-debug command, which adds highlighted tags to the --debug output with information about cache states etc. Signed-off-by: Sami Tolvanen --- tools

[PATCH 13/15] modpost: Add support for hashing long symbol names

2024-06-17 Thread Sami Tolvanen
if needed. Suggested-by: Matthew Maurer Signed-off-by: Sami Tolvanen --- scripts/mod/Makefile | 4 +- scripts/mod/modpost.c | 20 ++- scripts/mod/modpost.h | 20 +++ scripts/mod/symhash.c | 327 ++ 4 files changed, 364 insertions(+), 7 deletions(-)

[PATCH 14/15] module: Support hashed symbol names when checking modversions

2024-06-17 Thread Sami Tolvanen
When checking modversions for symbol names longer than MODULE_NAME_LEN, look for the hashed symbol name instead. This is needed for Rust modules, which frequently use symbol names longer than the maximum length supported by struct modversion_info. Suggested-by: Matthew Maurer Signed-off-by: Sami

  1   2   3   4   5   6   7   8   9   10   >