search for: __u

Displaying 20 results from an estimated 54 matches for "__u".

Did you mean: __u8
2019 Nov 08
0
[PATCH 01/13] compiler.h: Split {READ, WRITE}_ONCE definitions out into rwonce.h
...the size of the accessed data type exceeds the word size of + * the machine (e.g., 32 bits or 64 bits) READ_ONCE() and WRITE_ONCE() will + * fall back to memcpy(). There's at least two memcpy()s: one for the + * __builtin_memcpy() and then one for the macro doing the copy of variable + * - '__u' allocated on the stack. + * + * Their two major use cases are: (1) Mediating communication between + * process-level code and irq/NMI handlers, all running on the same CPU, + * and (2) Ensuring that the compiler does not fold, spindle, or otherwise + * mutilate accesses that either do not requ...
2018 Jan 25
0
[PATCH net-next 11/12] tools/virtio: copy READ/WRITE_ONCE
...)p = *(unsigned int *)res; break; + case 8: *(volatile unsigned long long *)p = *(unsigned long long *)res; break; + default: + barrier(); + __builtin_memcpy((void *)p, (const void *)res, size); + barrier(); + } +} + +#define READ_ONCE(x) \ +({ \ + union { typeof(x) __val; char __c[1]; } __u; \ + __read_once_size(&(x), __u.__c, sizeof(x)); \ + smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \ + __u.__val; \ +}) + +#define WRITE_ONCE(x, val) \ +({ \ + union { typeof(x) __val; char __c[1]; } __u = \ + { .__val = (typeof(x)) (val) }; \ + __write_on...
2020 Jun 30
0
[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y
...ension rcpc\n" \ + "ldapr" #sfx "\t" #regs, \ + ARM64_HAS_LDAPR) +#else +#define __LOAD_RCPC(sfx, regs...) "ldar" #sfx "\t" #regs +#endif /* CONFIG_AS_HAS_LDAPR */ + +#define __READ_ONCE(x) \ +({ \ + int atomic = 1; \ + union { __unqual_scalar_typeof(x) __val; char __c[1]; } __u; \ + typeof(&(x)) __x = &(x); \ + switch (sizeof(x)) { \ + case 1: \ + asm volatile(__LOAD_RCPC(b, %w0, %1) \ + : "=r" (*(__u8 *)__u.__c) \ + : "Q" (*__x) : "memory"); \ + break;...
2020 Jul 10
0
[PATCH v3 19/19] arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y
...uot; #sfx "\t" #regs, \ + ARM64_HAS_LDAPR) +#else +#define __LOAD_RCPC(sfx, regs...) "ldar" #sfx "\t" #regs +#endif /* CONFIG_AS_HAS_LDAPR */ + +#define __READ_ONCE(x) \ +({ \ + typeof(&(x)) __x = &(x); \ + int atomic = 1; \ + union { __unqual_scalar_typeof(*__x) __val; char __c[1]; } __u; \ + switch (sizeof(x)) { \ + case 1: \ + asm volatile(__LOAD_RCPC(b, %w0, %1) \ + : "=r" (*(__u8 *)__u.__c) \ + : "Q" (*__x) : "memory"); \ + break; \ + case 2: \ + asm volatile(_...
2007 Aug 20
2
SSE bug on Win32 with GCC 4.2.1
Jean-Marc Valin wrote: >> I recently found a .. weird bug on Win32 SSE with GCC 4.2.1. >> >> In libspeex/cb_search_sse.h, the following union is used: >> >> union { >> float __a[4]; >> __m128 __v; >> } __u; >> >> For some odd reason, this particular version of GCC will not 16-byte >> align the union. IE; the alignment requirement of __v isn't propagated. >> Changing it into this: >> >> union { >> float __a[4]; >> __m128 __v; >> } __u _...
2007 Aug 20
3
SSE bug on Win32 with GCC 4.2.1
...39;t spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I recently found a .. weird bug on Win32 SSE with GCC 4.2.1. In libspeex/cb_search_sse.h, the following union is used: union { float __a[4]; __m128 __v; } __u; [...] Content analysis details: (4.0 points, 3.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 BAYES_50 BODY: Bayesian spam probability is 40 to 60% [score: 0.4553...
2020 Jun 30
2
[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y
...Deacon <will at kernel.org> wrote: > +#define __READ_ONCE(x) \ > +({ \ > + int atomic = 1; \ > + union { __unqual_scalar_typeof(x) __val; char __c[1]; } __u; \ > + typeof(&(x)) __x = &(x); \ > + switch (sizeof(x)) { \ ... > + atomic ? (typeof(x))__u.__val : (*(volatile typeof(x) *)__x);...
2020 Jun 30
2
[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y
...Deacon <will at kernel.org> wrote: > +#define __READ_ONCE(x) \ > +({ \ > + int atomic = 1; \ > + union { __unqual_scalar_typeof(x) __val; char __c[1]; } __u; \ > + typeof(&(x)) __x = &(x); \ > + switch (sizeof(x)) { \ ... > + atomic ? (typeof(x))__u.__val : (*(volatile typeof(x) *)__x);...
2019 Nov 08
15
[PATCH 00/13] Finish off [smp_]read_barrier_depends()
Hi all, Although [smp_]read_barrier_depends() became part of READ_ONCE() in commit 76ebbe78f739 ("locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()"), it still limps on in the Linux memory model with the sinister hope of attracting innocent new users so that it becomes impossible to remove altogether. Let's strike before it's too late: there's only
2018 Jul 31
2
[PATCH 1/2] drm/nouveau: Print debug message on ACPI probe event
Signed-off-by: Lyude Paul <lyude at redhat.com> --- drivers/gpu/drm/nouveau/nouveau_display.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index ec7861457b84..b2a93e3fa67b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -387,6 +387,7 @@
2017 Dec 05
0
[PATCH tip/core/rcu 21/21] drivers/vhost: Remove now-redundant read_barrier_depends()
...> > That was already the case on everything except Alpha. And the canonical > match do the data dependency is store_release, not wmb. Oh, interesting static __always_inline void __write_once_size(volatile void *p, void *res, int size) { switch (size) { case 1: *(volatile __u8 *)p = *(__u8 *)res; break; case 2: *(volatile __u16 *)p = *(__u16 *)res; break; case 4: *(volatile __u32 *)p = *(__u32 *)res; break; case 8: *(volatile __u64 *)p = *(__u64 *)res; break; default: barrier(); __builtin_memcpy((void *)p,...
2017 Dec 05
2
[PATCH tip/core/rcu 21/21] drivers/vhost: Remove now-redundant read_barrier_depends()
On Tue, Dec 05, 2017 at 08:31:20PM +0200, Michael S. Tsirkin wrote: > Apropos, READ_ONCE is now asymmetrical with WRITE_ONCE. > > I can read a pointer with READ_ONCE and be sure the value > is sane, but only if I also remember to put in smp_wmb before > WRITE_ONCE. Otherwise the pointer is ok but no guarantees > about the data pointed to. That was already the case on
2017 Dec 05
2
[PATCH tip/core/rcu 21/21] drivers/vhost: Remove now-redundant read_barrier_depends()
On Tue, Dec 05, 2017 at 08:31:20PM +0200, Michael S. Tsirkin wrote: > Apropos, READ_ONCE is now asymmetrical with WRITE_ONCE. > > I can read a pointer with READ_ONCE and be sure the value > is sane, but only if I also remember to put in smp_wmb before > WRITE_ONCE. Otherwise the pointer is ok but no guarantees > about the data pointed to. That was already the case on
2020 Jul 01
0
[PATCH 18/18] arm64: lto: Strengthen READ_ONCE() to acquire when CLANG_LTO=y
...kernel.org> wrote: > > +#define __READ_ONCE(x) \ > > +({ \ > > + int atomic = 1; \ > > + union { __unqual_scalar_typeof(x) __val; char __c[1]; } __u; \ > > + typeof(&(x)) __x = &(x); \ > > + switch (sizeof(x)) { \ > ... > > + atomic ? (typeof(x))__u.__val : (*(volatil...
2007 Aug 22
0
SSE bug on Win32 with GCC 4.2.1
...: >>>> I recently found a .. weird bug on Win32 SSE with GCC 4.2.1. >>>> >>>> In libspeex/cb_search_sse.h, the following union is used: >>>> >>>> union { >>>> float __a[4]; >>>> __m128 __v; >>>> } __u; >>>> >>>> For some odd reason, this particular version of GCC will not 16-byte >>>> align the union. IE; the alignment requirement of __v isn't propagated. >>>> Changing it into this: >>>> >>>> union { >>>>...
2007 Aug 22
1
SSE bug on Win32 with GCC 4.2.1
...t; Jean-Marc Valin wrote: > >> I recently found a .. weird bug on Win32 SSE with GCC 4.2.1. > >> > >> In libspeex/cb_search_sse.h, the following union is used: > >> > >> union { > >> float __a[4]; > >> __m128 __v; > >> } __u; > >> > >> For some odd reason, this particular version of GCC will not 16-byte > >> align the union. IE; the alignment requirement of __v isn't propagated. > >> Changing it into this: > >> > >> union { > >> float __a[4]; > &...
2017 Oct 30
3
[locking/paravirt] static_key_disable_cpuslocked(): static key 'virt_spin_lock_key+0x0/0x20' used before call to jump_label_init()
.../linux-perf-x86_64-rhel-7.2-3d6dabc2c8b475c40d8f4a8b5da8c5d71b2fa13f/tools/include/linux/compiler.h:157:45: error: use of deleted function 'atomic_read(const atomic_t*)::<unnamed union>::<constructor>()' [ 77.033842] [ 77.035368] ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; }) [ 77.035369] [ 77.035930] ^ [ 77.035930] [ 77.038426] /usr/src/linux-perf-x86_64-rhel-7.2-3d6dabc2c8b475c40d8f4a8b5da8c5d71b2fa13f/tools/include/asm/../../arch/x86/include/asm/atomi...
2017 Oct 30
3
[locking/paravirt] static_key_disable_cpuslocked(): static key 'virt_spin_lock_key+0x0/0x20' used before call to jump_label_init()
.../linux-perf-x86_64-rhel-7.2-3d6dabc2c8b475c40d8f4a8b5da8c5d71b2fa13f/tools/include/linux/compiler.h:157:45: error: use of deleted function 'atomic_read(const atomic_t*)::<unnamed union>::<constructor>()' [ 77.033842] [ 77.035368] ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; }) [ 77.035369] [ 77.035930] ^ [ 77.035930] [ 77.038426] /usr/src/linux-perf-x86_64-rhel-7.2-3d6dabc2c8b475c40d8f4a8b5da8c5d71b2fa13f/tools/include/asm/../../arch/x86/include/asm/atomi...
2020 Jul 10
24
[PATCH 00/18] Allow architectures to override __READ_ONCE()
Hi all, This is version three of the patches I previously posted here: v1: https://lore.kernel.org/lkml/20191108170120.22331-1-will at kernel.org/ v2: https://lore.kernel.org/r/20200630173734.14057-1-will at kernel.org Changes since v2 include: * Actually add the barrier in READ_ONCE() for Alpha! * Implement Alpha's smp_load_acquire() using __READ_ONCE(), rather than the other
2017 Apr 04
0
[ANNOUNCE] libdrm 2.4.77
...mbol-check Junwei Zhang (1): amdgpu: add REPLACE and CLEAR checking for VA op (v2) Marek Olšák (1): configure.ac: bump the version to 2.4.77 Nicolai Hähnle (3): amdgpu: add amdgpu_bo_va_op_raw headers: sync amdgpu_drm.h from airlied/drm-next headers: the uint*_t vs. __u* discrepancy in amdgpu_drm is fixed Rob Herring (2): Android: fix building of modetest and proptest Android: disable pointer-arith and enum-conversion Seung-Woo Kim (5): exynos: fix type-punned pointer build warning exynos/fimg2d: remove unused-function build warning...