search for: smp_cache_byt

Displaying 20 results from an estimated 131 matches for "smp_cache_byt".

Did you mean: smp_cache_bytes
2005 Nov 22
2
RE: __ia64__ ifdef in xmalloc.c: "Fix ar.unat handling forfast paths"
>From: Rusty Russell >Sent: 2005年11月21日 12:53 >Hi all, > > While browsing the code, I noticed this in xmalloc.c: > >#ifndef __ia64__ > BUG_ON(align > SMP_CACHE_BYTES); >#endif > > This is clearly wrong: due to header alignment we cannot give you a >greater alignment than SMP_CACHE_BYTES. Overriding this will cause the >allocation to succeed, but not give the alignment requested. It usually >indicates the caller should be fixed. > >Do...
2014 Jul 14
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...tions(+), 1 deletion(-) > > diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c > index c4419ea..2a765fd 100644 > --- a/drivers/char/hw_random/core.c > +++ b/drivers/char/hw_random/core.c > @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > } > > -static void add_early_randomness(struct hwrng *rng) > +static void get_early_randomness(struct hwrng *rng) > { > unsigned char bytes[16]; > int bytes_read; > @@ -79,6 +79,21 @@ static void add_early_randomness(struct hwrng *...
2014 Jul 14
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...tions(+), 1 deletion(-) > > diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c > index c4419ea..2a765fd 100644 > --- a/drivers/char/hw_random/core.c > +++ b/drivers/char/hw_random/core.c > @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > } > > -static void add_early_randomness(struct hwrng *rng) > +static void get_early_randomness(struct hwrng *rng) > { > unsigned char bytes[16]; > int bytes_read; > @@ -79,6 +79,21 @@ static void add_early_randomness(struct hwrng *...
2005 Nov 23
0
RE: __ia64__ ifdef in xmalloc.c: "Fix ar.unat handling forfast paths"
...>Sent: 2005年11月23日 0:11 >This comment: >> /* >> * The "aligned" directive can only _increase_ alignment, so this is >> * safe and provides an easy way to avoid wasting space on a >> * uni-processor: >> */ >suggests that we only expected SMP_CACHE_BYTES to be used in "aligned" >directives, where having a smaller value than the actual alignment >requirement of some object would simply be ignored by the compiler. Understand. ;-) > >How much is this trick saving us? Static size of data area in >vmlinux doesn''t c...
2005 Nov 23
2
RE: __ia64__ ifdef in xmalloc.c: "Fix ar.unat handling forfast paths"
>It''s not hard to support arbitrary alignment, at the cost of burning >some space. We should probably do that. The "we" in that last sentence is the Xen team ... referring to making fixes to xmalloc? -Tony _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
2016 Jun 13
0
[PATCH v8 2/5] ptr_ring: ring test
...ing.c @@ -0,0 +1,192 @@ +#define _GNU_SOURCE +#include "main.h" +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <pthread.h> +#include <malloc.h> +#include <assert.h> +#include <errno.h> +#include <limits.h> + +#define SMP_CACHE_BYTES 64 +#define cache_line_size() SMP_CACHE_BYTES +#define ____cacheline_aligned_in_smp __attribute__ ((aligned (SMP_CACHE_BYTES))) +#define unlikely(x) (__builtin_expect(!!(x), 0)) +#define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a)) +typedef pthread_spinlock_t spinlock_t; + +typedef int gfp_t; +s...
2016 Jun 13
0
[PATCH v8 2/5] ptr_ring: ring test
...ing.c @@ -0,0 +1,192 @@ +#define _GNU_SOURCE +#include "main.h" +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <pthread.h> +#include <malloc.h> +#include <assert.h> +#include <errno.h> +#include <limits.h> + +#define SMP_CACHE_BYTES 64 +#define cache_line_size() SMP_CACHE_BYTES +#define ____cacheline_aligned_in_smp __attribute__ ((aligned (SMP_CACHE_BYTES))) +#define unlikely(x) (__builtin_expect(!!(x), 0)) +#define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a)) +typedef pthread_spinlock_t spinlock_t; + +typedef int gfp_t; +s...
2007 Apr 18
8
[patch 0/6] i386 gdt and percpu cleanups
Hi Andi, This is a series of patches based on your latest queue (as of the other day, at least). It includes: - the most recent patch to compute the appropriate amount of percpu space to allocate, using a separate reservation for modules where needed. - make the percpu sections page-aligned, so that percpu variables can be page aligned if needed (which is used by gdt_page) -
2007 Apr 18
8
[patch 0/6] i386 gdt and percpu cleanups
Hi Andi, This is a series of patches based on your latest queue (as of the other day, at least). It includes: - the most recent patch to compute the appropriate amount of percpu space to allocate, using a separate reservation for modules where needed. - make the percpu sections page-aligned, so that percpu variables can be page aligned if needed (which is used by gdt_page) -
2014 Jul 14
4
[RFC PATCH 0/3] hw_random: support for delayed init randomness requests
Hello, This series introduces a way to allow devices to contribute to initial system randomness after a certain delay. Specifically, the virtio-rng device can contribute initial randomness only after a successful probe(). A delayed workqueue item is queued in the system queue to fetch this randomness if the device indicates it's capable of contributing only after a delay, via the new
2014 Jul 14
4
[RFC PATCH 0/3] hw_random: support for delayed init randomness requests
Hello, This series introduces a way to allow devices to contribute to initial system randomness after a certain delay. Specifically, the virtio-rng device can contribute initial randomness only after a successful probe(). A delayed workqueue item is queued in the system queue to fetch this randomness if the device indicates it's capable of contributing only after a delay, via the new
2014 Jul 05
0
[PATCH v2 1/2] hwrng: fetch randomness only after device init
...andom/core.c +++ b/drivers/char/hw_random/core.c @@ -55,16 +55,37 @@ static DEFINE_MUTEX(rng_mutex); static int data_avail; static u8 *rng_buffer; +static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, + int wait); + static size_t rng_buffer_size(void) { return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; } +static void add_early_randomness(struct hwrng *rng) +{ + unsigned char bytes[16]; + int bytes_read; + + bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); + if (bytes_read > 0) + add_device_randomness(bytes, bytes_read); +} + static inline int hwrn...
2014 Jul 10
0
[PATCH v3 1/2] hwrng: fetch randomness only after device init
...andom/core.c +++ b/drivers/char/hw_random/core.c @@ -55,16 +55,35 @@ static DEFINE_MUTEX(rng_mutex); static int data_avail; static u8 *rng_buffer; +static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size, + int wait); + static size_t rng_buffer_size(void) { return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; } +static void add_early_randomness(struct hwrng *rng) +{ + unsigned char bytes[16]; + int bytes_read; + + bytes_read = rng_get_data(rng, bytes, sizeof(bytes), 1); + if (bytes_read > 0) + add_device_randomness(bytes, bytes_read); +} + static inline int hwrn...
2014 Jul 14
0
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...> > diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c > > index c4419ea..2a765fd 100644 > > --- a/drivers/char/hw_random/core.c > > +++ b/drivers/char/hw_random/core.c > > @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) > > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > > } > > > > -static void add_early_randomness(struct hwrng *rng) > > +static void get_early_randomness(struct hwrng *rng) > > { > > unsigned char bytes[16]; > > int bytes_read; > > @@ -79,6 +79,21 @@ static...
2014 Jul 14
0
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index c4419ea..2a765fd 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; } -static void add_early_randomness(struct hwrng *rng) +static void get_early_randomness(struct hwrng *rng) { unsigned char bytes[16]; int bytes_read; @@ -79,6 +79,21 @@ static void add_early_randomness(struct hwrng *rng) add_device_randomness(bytes, byt...
2023 Jan 20
0
[PATCH 1/2] virtio-rng: implement entropy leak feature
...t; + bool has_leakqs; > + struct virtqueue *leakq[2]; > + spinlock_t lock; > + int active_leakq; > + > char name[25]; > int index; > bool hwrng_register_done; > @@ -29,27 +37,159 @@ struct virtrng_info { > /* minimal size returned by rng_buffer_size() */ > #if SMP_CACHE_BYTES < 32 > u8 data[32]; > + u8 leak_data[32]; > #else > u8 data[SMP_CACHE_BYTES]; > + u8 leak_data[SMP_CACHE_BYTES]; > #endif > }; > > +/* Swaps the queues and returns the new active leak queue. */ > +static struct virtqueue *swap_leakqs(struct virtrng_info *...
2018 May 21
2
[RFC PATCH net-next 10/12] vhost_net: build xdp buff
...gt; + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) > PAGE_SIZE) > + return -ENOSPC; > + > + buflen += SKB_DATA_ALIGN(len + pad); maybe store the result of SKB_DATA_ALIGN in a local instead of doing the work twice? > + alloc_frag->offset = ALIGN((u64)alloc_frag->offset, SMP_CACHE_BYTES); > + if (unlikely(!skb_page_frag_refill(buflen, alloc_frag, GFP_KERNEL))) > + return -ENOMEM; > + > + buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset; > + > + /* We store two kinds of metadata in the header which will be > + * used for XDP_PASS to d...
2014 Jul 05
6
[PATCH v2 0/2] hwrng, virtio-rng: init-time fixes
v2: - this now separates both the patches; the virtio-rng fix is self-contained - re-work hwrng core to fetch randomness at device init time if ->init() is registered by the device, instead of not calling it at all. - virtio-rng: introduce a probe_done bool to ensure we don't ask host for data before successful probe Hi, When booting a recent kernel under KVM with the virtio-rng
2014 Jul 05
6
[PATCH v2 0/2] hwrng, virtio-rng: init-time fixes
v2: - this now separates both the patches; the virtio-rng fix is self-contained - re-work hwrng core to fetch randomness at device init time if ->init() is registered by the device, instead of not calling it at all. - virtio-rng: introduce a probe_done bool to ensure we don't ask host for data before successful probe Hi, When booting a recent kernel under KVM with the virtio-rng
2014 Jul 18
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...ivers/char/hw_random/core.c b/drivers/char/hw_random/core.c > > > index c4419ea..2a765fd 100644 > > > --- a/drivers/char/hw_random/core.c > > > +++ b/drivers/char/hw_random/core.c > > > @@ -63,7 +63,7 @@ static size_t rng_buffer_size(void) > > > return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES; > > > } > > > > > > -static void add_early_randomness(struct hwrng *rng) > > > +static void get_early_randomness(struct hwrng *rng) > > > { > > > unsigned char bytes[16]; > > > int bytes_read; &...