The meson build never checked for the presence of rdrand and rdseed
instructions, while make build never checked for rdseed. Ensure builds
always have the appropriate checks - and therefore defines - for these
instructions. For runtime, we also add in rdseed to the list of known
bits returned from cpuid() instruction, so we can confirm its presence at
application init time.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Rather than checking flag by flag individually, use a loop to make it
easier to check new flags.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Just syntax change to reduce indentation, no functional change.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
On Skylake platform, with native build, KNI kernel module crashes
because of the corrupted values passed to kernel module.
The corruption occurs because the userspace kni library works
unexpectedly. Compiler [1] is using AVX512 instructions and generated
binary is wrong [2].
It turned around gcc does its job correct, but gas is generating binary
wrong. And expected binutils 2.30, 2.31 & 2.31.1 are affected. Issue has
been fixed in binutils 2.32 with:
Commit x86: don't mistakenly scale non-8-bit displacements
AVX512 was already disabled with bintuils 2.30 [3], extending it to
2.31 & 2.31.1 too.
[1] gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2)
[2] gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028
[3] Bugzilla ID 97 has the details.
Bugzilla ID: 249
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The '-mno-avx512f' compiler flag is not passed to the compiler,
detection of the binutils and setting flags works fine, but the flag
itself not used by compiler.
Removing the interim 'march_opt' variable and using directly
'machine_args' and setting '-mno-avx512f' to 'machine_args'
Fixes: 566b4d7a96 ("build: fix meson check for binutils 2.30")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Define variables for "is_linux", "is_freebsd" and "is_windows"
to make the code shorter for comparisons and more readable.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Added initial stub source files and required meson changes
for Windows support.
kernel/windows/meson is a stub file added to support
Windows specific source in future releases.
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
Rather than relying on the target machine architecture, use the
size of a pointer from the compiler to determine if we are 64-bits
or not. This allows correct behaviour when you pass -m32 as a compile
option. It also allows us to use this value repeatedly throughout the
repo rather than continually testing for the sizeof(void*).
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Luca Boccassi <bluca@debian.org>
Acked-by: Luca Boccassi <bluca@debian.org>
This commit reworks the checks for binutils 2.30 and how
the flags to disable AVX512F are passed to the compiler.
Previously the #define for including AVX512 code was set,
while the -mno-avx512f argument was given to the compiler.
This would cause gcc to correctly refuse to emit AVX512
instructions, but the rte_memcpy code that includes AVX512
optimizations was being added to the build.
The check for binutils check is now moved to x86 as it is
irrelevant for other architectures, and the -mno-avx512f
flag is passed to a march_opts array in meson. As the
-mno-avx512 flag is added earlier in the build, the code
in rte_memcpy is no longer attempted to be compiled.
This commit also adds a message print in the meson configure
stage to alert the user of the workaround being employed.
Fixes: a32ca9a4eb ("mk: fix scope of disabling AVX512F support")
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Previous code only added in AVX, and a few other non-SSE flags to the
compile-time cpuflags because all SSE instruction set levels are now
required for an x86 build. However, some apps may still be checking for the
existing SSE ones in the legacy build system, so add them here for
completeness and compatibility.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
To build with meson and ninja, we need some initial infrastructure in
place. The build files for meson always need to be called "meson.build",
and options get placed in meson_options.txt
This commit adds a top-level meson.build file, which sets up the global
variables for tracking drivers, libraries, etc., and then includes other
build files, before finishing by writing the global build configuration
header file and a DPDK pkgconfig file at the end, using some of those same
globals.
From the top level build file, the only include file thus far is for the
config folder, which does some other setup of global configuration
parameters, including pulling in architecture specific parameters from an
architectural subdirectory. A number of configuration build options are
provided for the project to tune a number of global variables which will be
used later e.g. max numa nodes, max cores, etc. These settings all make
their way to the global build config header "rte_build_config.h". There is
also a file "rte_config.h", which includes "rte_build_config.h", and this
file is meant to hold other build-time values which are present in our
current static build configuration but are not normally meant for
user-configuration. Ideally, over time, the values placed here should be
moved to the individual libraries or drivers which want those values.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>