Re: [Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-06 Thread Geert Martin Ijewski
Am 06.06.2017 um 23:38 schrieb Emilio G. Cota: > On Tue, Jun 06, 2017 at 22:28:23 +0200, Geert Martin Ijewski wrote: >> On a fully patched Windows 10 with an i5-4690 this code works for me (TM): > > Thanks! > Can you please test this? > >Emilio > --- > #include "qemu/osdep.h" > #incl

Re: [Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-06 Thread Emilio G. Cota
On Tue, Jun 06, 2017 at 22:28:23 +0200, Geert Martin Ijewski wrote: > On a fully patched Windows 10 with an i5-4690 this code works for me (TM): Thanks! Can you please test this? Emilio --- #include "qemu/osdep.h" #include static unsigned int linesize_win(PROCESSOR_CACHE_TYPE ty

Re: [Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-06 Thread Geert Martin Ijewski
Am 06.06.2017 um 19:39 schrieb Richard Henderson: On 06/06/2017 09:11 AM, Emilio G. Cota wrote: On Tue, Jun 06, 2017 at 01:39:45 -0400, Pranith Kumar wrote: On Mon, Jun 5, 2017 at 6:49 PM, Emilio G. Cota wrote: This is a constant used as a hint for padding structs to hopefully avoid false ca

Re: [Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-06 Thread Richard Henderson
On 06/06/2017 09:11 AM, Emilio G. Cota wrote: On Tue, Jun 06, 2017 at 01:39:45 -0400, Pranith Kumar wrote: On Mon, Jun 5, 2017 at 6:49 PM, Emilio G. Cota wrote: This is a constant used as a hint for padding structs to hopefully avoid false cache line sharing. The constant can be set at config

Re: [Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-06 Thread Emilio G. Cota
On Tue, Jun 06, 2017 at 01:39:45 -0400, Pranith Kumar wrote: > On Mon, Jun 5, 2017 at 6:49 PM, Emilio G. Cota wrote: > > This is a constant used as a hint for padding structs to hopefully avoid > > false cache line sharing. > > > > The constant can be set at configure time by defining QEMU_CACHELI

Re: [Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-06 Thread Richard Henderson
On 06/05/2017 10:39 PM, Pranith Kumar wrote: Is there any reason not to use sysconf(_SC_LEVEL1_DCACHE_LINESIZE)? That's an excellent idea. In fact... see reply to 3/3. r~

Re: [Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-05 Thread Pranith Kumar
On Mon, Jun 5, 2017 at 6:49 PM, Emilio G. Cota wrote: > This is a constant used as a hint for padding structs to hopefully avoid > false cache line sharing. > > The constant can be set at configure time by defining QEMU_CACHELINE_SIZE > via --extra-cflags. If not set there, we try to obtain the va

[Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-05 Thread Emilio G. Cota
This is a constant used as a hint for padding structs to hopefully avoid false cache line sharing. The constant can be set at configure time by defining QEMU_CACHELINE_SIZE via --extra-cflags. If not set there, we try to obtain the value from the machine running the configure script. If we fail, w