<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/include/asm/bitops.h, branch linux-5.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-06-15T12:10:08Z</updated>
<entry>
<title>x86, kcsan: Remove __no_kcsan_or_inline usage</title>
<updated>2020-06-15T12:10:08Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2020-06-02T12:24:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e82587336695f14283987c9aa0bfd775b520856d'/>
<id>urn:sha1:e82587336695f14283987c9aa0bfd775b520856d</id>
<content type='text'>
Now that KCSAN relies on -tsan-distinguish-volatile we no longer need
the annotation for constant_test_bit(). Remove it.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>Rebase locking/kcsan to locking/urgent</title>
<updated>2020-06-11T18:02:46Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2020-06-11T18:02:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37d1a04b13a6d2fec91a6813fc034947a27db034'/>
<id>urn:sha1:37d1a04b13a6d2fec91a6813fc034947a27db034</id>
<content type='text'>
Merge the state of the locking kcsan branch before the read/write_once()
and the atomics modifications got merged.

Squash the fallout of the rebase on top of the read/write once and atomic
fallback work into the merge. The history of the original branch is
preserved in tag locking-kcsan-2020-06-02.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
</entry>
<entry>
<title>x86: bitops: fix build regression</title>
<updated>2020-05-23T17:26:31Z</updated>
<author>
<name>Nick Desaulniers</name>
</author>
<published>2020-05-23T05:22:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c071b0f11e7fb944525b12c80e728af69648d967'/>
<id>urn:sha1:c071b0f11e7fb944525b12c80e728af69648d967</id>
<content type='text'>
This is easily reproducible via CC=clang + CONFIG_STAGING=y +
CONFIG_VT6656=m.

It turns out that if your config tickles __builtin_constant_p via
differences in choices to inline or not, these statements produce
invalid assembly:

    $ cat foo.c
    long a(long b, long c) {
      asm("orb	%1, %0" : "+q"(c): "r"(b));
      return c;
    }
    $ gcc foo.c
    foo.c: Assembler messages:
    foo.c:2: Error: `%rax' not allowed with `orb'

Use the `%b` "x86 Operand Modifier" to instead force register allocation
to select a lower-8-bit GPR operand.

The "q" constraint only has meaning on -m32 otherwise is treated as
"r".  Not all GPRs have low-8-bit aliases for -m32.

Fixes: 1651e700664b4 ("x86: Fix bitops.h warning with a moved cast")
Reported-by: kernelci.org bot &lt;bot@kernelci.org&gt;
Suggested-by: Andy Shevchenko &lt;andriy.shevchenko@intel.com&gt;
Suggested-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Suggested-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Suggested-by: Ilie Halip &lt;ilie.halip@gmail.com&gt;
Signed-off-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Tested-by: Sedat Dilek &lt;sedat.dilek@gmail.com&gt;
Tested-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;	[build, clang-11]
Reviewed-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Reviewed-By: Brian Gerst &lt;brgerst@gmail.com&gt;
Reviewed-by: Jesse Brandeburg &lt;jesse.brandeburg@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Marco Elver &lt;elver@google.com&gt;
Cc: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Cc: Andrey Ryabinin &lt;aryabinin@virtuozzo.com&gt;
Cc: Luc Van Oostenryck &lt;luc.vanoostenryck@gmail.com&gt;
Cc: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Cc: Daniel Axtens &lt;dja@axtens.net&gt;
Cc: "Peter Zijlstra (Intel)" &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20200508183230.229464-1-ndesaulniers@google.com
Link: https://github.com/ClangBuiltLinux/linux/issues/961
Link: https://lore.kernel.org/lkml/20200504193524.GA221287@google.com/
Link: https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#x86Operandmodifiers
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v5.7-rc1' into locking/kcsan, to resolve conflicts and refresh</title>
<updated>2020-04-13T07:44:39Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2020-04-13T07:44:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3b02a051d25d9600e9d403ad3043aed7de00160e'/>
<id>urn:sha1:3b02a051d25d9600e9d403ad3043aed7de00160e</id>
<content type='text'>
Resolve these conflicts:

	arch/x86/Kconfig
	arch/x86/kernel/Makefile

Do a minor "evil merge" to move the KCSAN entry up a bit by a few lines
in the Kconfig to reduce the probability of future conflicts.

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86: Fix bitops.h warning with a moved cast</title>
<updated>2020-03-18T11:30:19Z</updated>
<author>
<name>Jesse Brandeburg</name>
</author>
<published>2020-03-10T22:17:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1651e700664b4597ddf4f8adfe435252a0d11277'/>
<id>urn:sha1:1651e700664b4597ddf4f8adfe435252a0d11277</id>
<content type='text'>
Fix many sparse warnings when building with C=1. These are useless noise
from the bitops.h file and getting rid of them helps developers make
more use of the tools and possibly find real bugs.

When the kernel is compiled with C=1, there are lots of messages like:

  arch/x86/include/asm/bitops.h:77:37: warning: cast truncates bits from constant value (ffffff7f becomes 7f)

CONST_MASK() is using a signed integer "1" to create the mask which is
later cast to (u8), in order to yield an 8-bit value for the assembly
instructions to use. Simplify the expressions used to clearly indicate
they are working on 8-bit values only, which still keeps sparse happy
without an accidental promotion to a 32 bit integer.

The warning was occurring because certain bitmasks that end with a bit
set next to a natural boundary like 7, 15, 23, 31, end up with a mask
like 0x7f, which then results in sign extension due to the integer type
promotion rules[1]. It was really only clear_bit() that was having
problems, and it was only on some bit checks that resulted in a mask
like 0xffffff7f being generated after the inversion.

Verify with a test module (see next patch) and assembly inspection that
the fix doesn't introduce any change in generated code.

 [ bp: Massage. ]

Signed-off-by: Jesse Brandeburg &lt;jesse.brandeburg@intel.com&gt;
Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@intel.com&gt;
Acked-by: Luc Van Oostenryck &lt;luc.vanoostenryck@gmail.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://stackoverflow.com/questions/46073295/implicit-type-promotion-rules [1]
Link: https://lkml.kernel.org/r/20200310221747.2848474-1-jesse.brandeburg@intel.com
</content>
</entry>
<entry>
<title>Merge tag 'v5.5-rc4' into locking/kcsan, to resolve conflicts</title>
<updated>2019-12-30T07:10:51Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2019-12-30T07:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=28336be568bb473d16ba80db0801276fb4f1bbe5'/>
<id>urn:sha1:28336be568bb473d16ba80db0801276fb4f1bbe5</id>
<content type='text'>
Conflicts:
	init/main.c
	lib/Kconfig.debug

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86, kcsan: Enable KCSAN for x86</title>
<updated>2019-11-16T15:23:16Z</updated>
<author>
<name>Marco Elver</name>
</author>
<published>2019-11-14T18:03:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=40d04110f87940b6a03bf0aa19cd29e84f465f20'/>
<id>urn:sha1:40d04110f87940b6a03bf0aa19cd29e84f465f20</id>
<content type='text'>
This patch enables KCSAN for x86, with updates to build rules to not use
KCSAN for several incompatible compilation units.

Signed-off-by: Marco Elver &lt;elver@google.com&gt;
Acked-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>kasan: support instrumented bitops combined with generic bitops</title>
<updated>2019-11-07T02:15:39Z</updated>
<author>
<name>Daniel Axtens</name>
</author>
<published>2019-08-20T02:49:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=81d2c6f81996e01fbcd2b5aeefbb519e21c806e9'/>
<id>urn:sha1:81d2c6f81996e01fbcd2b5aeefbb519e21c806e9</id>
<content type='text'>
Currently bitops-instrumented.h assumes that the architecture provides
atomic, non-atomic and locking bitops (e.g. both set_bit and __set_bit).
This is true on x86 and s390, but is not always true: there is a
generic bitops/non-atomic.h header that provides generic non-atomic
operations, and also a generic bitops/lock.h for locking operations.

powerpc uses the generic non-atomic version, so it does not have it's
own e.g. __set_bit that could be renamed arch___set_bit.

Split up bitops-instrumented.h to mirror the atomic/non-atomic/lock
split. This allows arches to only include the headers where they
have arch-specific versions to rename. Update x86 and s390.

(The generic operations are automatically instrumented because they're
written in C, not asm.)

Suggested-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Reviewed-by: Christophe Leroy &lt;christophe.leroy@c-s.fr&gt;
Signed-off-by: Daniel Axtens &lt;dja@axtens.net&gt;
Acked-by: Marco Elver &lt;elver@google.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20190820024941.12640-1-dja@axtens.net
</content>
</entry>
<entry>
<title>x86/bitops: Use __builtin_constant_p() directly instead of IS_IMMEDIATE()</title>
<updated>2019-07-23T11:44:18Z</updated>
<author>
<name>Masahiro Yamada</name>
</author>
<published>2019-07-23T07:44:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bdd50d7421b2f8fd99f953e1f747e0cb3f3bed64'/>
<id>urn:sha1:bdd50d7421b2f8fd99f953e1f747e0cb3f3bed64</id>
<content type='text'>
__builtin_constant_p(nr) is used everywhere now. It does not make much
sense to define IS_IMMEDIATE() as its alias.

Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lkml.kernel.org/r/20190723074415.26811-1-yamada.masahiro@socionext.com

</content>
</entry>
<entry>
<title>asm-generic, x86: add bitops instrumentation for KASAN</title>
<updated>2019-07-12T18:05:42Z</updated>
<author>
<name>Marco Elver</name>
</author>
<published>2019-07-12T03:54:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=751ad98d5f881df91ba47e013b82422912381e8e'/>
<id>urn:sha1:751ad98d5f881df91ba47e013b82422912381e8e</id>
<content type='text'>
This adds a new header to asm-generic to allow optionally instrumenting
architecture-specific asm implementations of bitops.

This change includes the required change for x86 as reference and
changes the kernel API doc to point to bitops-instrumented.h instead.
Rationale: the functions in x86's bitops.h are no longer the kernel API
functions, but instead the arch_ prefixed functions, which are then
instrumented via bitops-instrumented.h.

Other architectures can similarly add support for asm implementations of
bitops.

The documentation text was derived from x86 and existing bitops
asm-generic versions: 1) references to x86 have been removed; 2) as a
result, some of the text had to be reworded for clarity and consistency.

Tested using lib/test_kasan with bitops tests (pre-requisite patch).
Bugzilla ref: https://bugzilla.kernel.org/show_bug.cgi?id=198439

Link: http://lkml.kernel.org/r/20190613125950.197667-4-elver@google.com
Signed-off-by: Marco Elver &lt;elver@google.com&gt;
Acked-by: Mark Rutland &lt;mark.rutland@arm.com&gt;
Reviewed-by: Andrey Ryabinin &lt;aryabinin@virtuozzo.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
