This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, api-next has been updated
via 530fa00fb2d341a0869af63fa9ab003dc526dc6f (commit)
via 3875d6ebf690e07b69f11621caefab1afc58e100 (commit)
via b99095485be4ac14d16bef372b5c6521b396abaa (commit)
via f53fda91d2919eee33b5a177ef818be1092c890b (commit)
via 46e088c2f56d1463a598b4ac23308e19bf2b9031 (commit)
via 0b1dc8a9a69252ce56d13521284683faff0e3e35 (commit)
via 4132497ff67871d67c088c99b782cba10817bd28 (commit)
via cd83d5d1114a40abf554c59bd92c8a8199b10c7a (commit)
via 112209c3fc672aee4a3074aa784aefe00f32d250 (commit)
via 1837825e219b6bd62a3ecda2ed68873a958b8171 (commit)
via fda9a9e4887eff3f0526c7bcef5e29ff511cd4d8 (commit)
via 4aaa74fceecee7b1538546d0b67347569c1239c6 (commit)
via 4d0b7588251ed6a5de781f9220c3ace2831a68b2 (commit)
via 41febe9fe6ac762174579e86874d65ec8a2c5485 (commit)
via 6e09a7a90079b6789b83d9234306ac02a8f6d8da (commit)
via 6388e398998426c4b18cde893131d54630879bdf (commit)
via ca3b3950cc901d0e8db1f2bb9961c3bac9491c88 (commit)
via dd3031076b80cf6d8b9df6024c44555c77b150fb (commit)
via dfeba061509fb1451351ffb168a458e7d9ae4126 (commit)
via f20066c7949466430186cce217589910fa75fd61 (commit)
via 9fe4043f4cf402a4695e8c0e4887e87da60fcb33 (commit)
via 4d9de3d54c49ec69d2366a01ad5b2b987943a5c5 (commit)
via 970f7a4ae91932c49d1b9dc00bfa861f7f2a0197 (commit)
via 8ae51b0364e25e45eddb4cf2e175b269c0736436 (commit)
via 76543549b422a53dde44de5900071554f65aa212 (commit)
via 2c060a9d3b9f067f4cca2094be845e54392077ec (commit)
via b6e1fea7ef8a443579c8f197c96ca2acc7c0577d (commit)
via fe182fb0a97c1989747ae96b401a10d34c878480 (commit)
via 82c67c0b1755f4d4e0f5b1df2e6356150cca4166 (commit)
via 80a30e1513a9614622e08657b94dca56db9e250f (commit)
via 8ab727c5f3a5b5aa556a84e04870f1f3fe3a073b (commit)
via 2b36166d647c64aa545e6ecc23a1d464fcd2c3c0 (commit)
via d3a7028a5708506b63dc6a06846cd05c7552bbf4 (commit)
via 4208ef3e2ce9f6093ae540af7de20759849782b6 (commit)
via dba0f42c9e24d090b29df165f610fc0df051b018 (commit)
via 46b88467e667e26fed282b234c481a14fcecff62 (commit)
via f195caa92ef8457c2c670fd3449ea6521e7ad823 (commit)
via 7f97683b1afc4826825f0db0fcac40858892494a (commit)
via 52592157f25c9e2e3876dc3624cf91b1b71127ad (commit)
via 4a320c0af291c07f33b1a295f72704215169d562 (commit)
via f5cde8870a425d51d08df7a1b4b3fb1cf06406f0 (commit)
via c3830c3936b76faa423563bbd104e732120f9523 (commit)
via cc52f0675d1674a80cf1806dc8c1c4e3887afdd1 (commit)
via 4b698023210b7f742c053707ba131097b570276d (commit)
via 2eb3e87bc56b2a02cb10637e5ce3a7d1157472cf (commit)
via ba203281cfd10b88a5d5b8f143ea34d14d373b58 (commit)
via 527ee67cb434e5e7c8015fa8c7d15f2ac25b1d20 (commit)
via 101e8188088b91e8d85e0fef0d6674dae05c306e (commit)
via 343579dda50fcefd5498cfe146a438b8fdb3c065 (commit)
via b4e0a8b91a422cbf28e0406a5076025894103984 (commit)
via a611a514682dea61ca142b51a28194a39a286fa7 (commit)
via d345d75c975bd98f61bc2e04907b3e232d88083c (commit)
via 7e40217271ae17ce19abd873140439c51a525fb1 (commit)
via fbc400dc8c35c220cbb41531d12c933f7c4226d1 (commit)
via 6cef872afcac78016d095d426fa9f3d9055c3856 (commit)
via ffb22c37e4a483cc647c8ba8f4a9329fa83639aa (commit)
via 3fd85fb6f45d859e6f19eeadda69992858f06f22 (commit)
via e91877df47118468e940a58047d94fe4195e4b1e (commit)
via 4194d93ab8095ef850e332a1433d8d810b7418a1 (commit)
via f723bcef66945acb0738acc8a40b8ebd5851b84d (commit)
via fa4063b4104784bdc1c20fe3b519716e4413c245 (commit)
via 9c4d778148d514adf8586939123acdcdc022e8e5 (commit)
via b06ee329f944aeb7f3d03646aac384f88a00a7a5 (commit)
via a2676059469f61f1ffd58090b74f4dd975d172ac (commit)
via 39acf771084aa4f16b60a6bdf9e5f3bed4f88cd9 (commit)
via 0d6d0923b2dd4d3097ea992af76408fd4281d84e (commit)
via 2997a78f270cdb34c82f805f8103f660ed1bcdf2 (commit)
via bacd73a34768ce859f8136f29bda70bbccbdb45e (commit)
via 63ef9b3714c9410dd1b5a55e3bd50de49f23dfcb (commit)
via 4ee154864b47712a45cfdb23ea6c22b46bfb1abf (commit)
via 552e46339939933ee7ed305f1dda82ead362ece9 (commit)
via 1d61093f4ea7a9f62cc69e6fdb6fb82b246af817 (commit)
via 6d78d33df6d33ebe1b933383c4858df5e9f7f33b (commit)
via 4cf84d158adc7e84bed69ceac34bbbb3dee9587e (commit)
via 67abee1a4548878ccc93b57fbd84c3fe68147bf6 (commit)
via afb2ecf5e45e10b0e1258c85fc1b80f8ce447646 (commit)
via fe9c6cc8e5e88e068ee9f1f4dc29b7f32411f4d7 (commit)
via 6b5b78245c2ebbc0c907dba9809e9002c7214959 (commit)
via ba23aa731a85709a84ea0137a918b07cf4811fc2 (commit)
via 4b7e6b82f14ef2d09b91b1c197e84dbfe0e8a09b (commit)
via 683a975963d150e5dae12649cbd1abc003ee2c39 (commit)
via dcffa7faecf3bf4a66e6f5ce745bcde3a4f0b7ed (commit)
via c247659448bfd45c1bb648d7508f7db0b225b7b8 (commit)
via 95918aa496a22794af654c582830e2a2d8b914a7 (commit)
via 7bcd45812c020a9e67cf4d848e5bbef1384f58af (commit)
via 9e95d6a1a9025bfafb846b4d805b1dc146657a10 (commit)
via bd4a9492d862e0636fba99bd76aaa19952de2f44 (commit)
via d858987a1dfea90625389ab5a8e14379a23dbb52 (commit)
via 01ea9db19e2eb2f978d4fd22b1e341a741bb1e9c (commit)
via 0a0e4a684f8e5420295eda3df4fece6361b4d797 (commit)
via c6dc829d0c6a54a08756e13e2f3388f0bda61245 (commit)
via a296693d3dbbe98a5616406d6535dee85cbd31ba (commit)
via ec7a8e0fabe2269cf824ab809ad52a8763739be1 (commit)
via 02c46a3a671bca6de5159a59be45663bca516753 (commit)
via 123327606c2dd95a6a85c80e74ad172932195631 (commit)
via 936ce9f30a85285f70e26038eb5ea8637622fea2 (commit)
via ac2d233f2bcfb8d70fa005ae8fa19cce41b4a238 (commit)
via 97f2672e48ea08abd00ed7f3b1fd8420a217779c (commit)
via d9615289bf6f60bd3a04f8138d5b487efda96a49 (commit)
via b9877d54ec4c2259dec17751f6580f110fd447a5 (commit)
via ac563d15b95d884764ffa2f48eedce6f5b408fca (commit)
via 279ecc54b69ad1621fbba837bee31adcc9fd704a (commit)
via ad7f8f4ea11a8e40d853cd9b2b0bc3e6f7876a8b (commit)
via 50cfbff244a1fa29314520eb9ca9bdf5df445df6 (commit)
via 234dd2f623d73b069e43282baf96b48473d0ef1c (commit)
via b93fd7af775a04c50a064a241d82ba3b7bf999f7 (commit)
via 1e1312c15e96be77eccc0fb8e3aa35d4c7da72f6 (commit)
via eda2ce7c6d9998155edde42617501cbaea5e03f5 (commit)
via 9b648c4cd201ff8fbcbaf12512482b0a8f952d8f (commit)
via f62c9aa3f3f48080a61a1e71cd649f1d65539ff5 (commit)
via 244916315fdcb665f66b4f235782feee26a53c89 (commit)
via e5d2edccc685fcde88793f5514d1fdb2654ecfa4 (commit)
via 52553fa3972109a47e948321236dcabf29503f61 (commit)
via 4b751b4dd7e2f000d2ed0268d51878c5ff982c2b (commit)
via 21dad81b51443c49dc51ede63516f4a434e217cc (commit)
via 474dac39b8d4ad7f2ac3768887e36610188c16c2 (commit)
via b8c6689e4c81277067a2dd5f30598e0ddc7dc2c5 (commit)
via ff56734fa58db5043a6bb358611cdc2a1c5de4a3 (commit)
via fd86c7fd19820e21c182e2c0e043331e6aab6282 (commit)
via 4a58145d0ca4e62ff41b052ed800acee7d0a97e1 (commit)
via b2d4275c2df6a7fcd9796fafed74b59292cee26e (commit)
from f8efe73e2991c480d76eb636be61ab90f1053591 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 530fa00fb2d341a0869af63fa9ab003dc526dc6f
Merge: f8efe73 3875d6e
Author: Maxim Uvarov <maxim.uvarov(a)linaro.org>
Date: Thu Jan 26 16:48:29 2017 +0300
Merge tag 'v1.13.0.0' into api-next
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --cc platform/linux-generic/Makefile.am
index f4ef497,0bc9842..90024bd
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@@ -105,26 -101,7 +105,27 @@@ odpapiplatinclude_HEADERS =
odpdrvincludedir = $(includedir)/odp/drv
odpdrvinclude_HEADERS = \
- $(srcdir)/include/odp/drv/compiler.h
+ $(srcdir)/include/odp/drv/align.h \
+ $(srcdir)/include/odp/drv/atomic.h \
+ $(srcdir)/include/odp/drv/barrier.h \
+ $(srcdir)/include/odp/drv/byteorder.h \
+ $(srcdir)/include/odp/drv/compiler.h \
+ $(srcdir)/include/odp/drv/driver.h \
+ $(srcdir)/include/odp/drv/shm.h \
+ $(srcdir)/include/odp/drv/spinlock.h \
+ $(srcdir)/include/odp/drv/std_types.h \
+ $(srcdir)/include/odp/drv/sync.h
+
+odpdrvplatincludedir = $(includedir)/odp/drv/plat
+odpdrvplatinclude_HEADERS = \
+ $(srcdir)/include/odp/drv/plat/atomic_types.h \
+ $(srcdir)/include/odp/drv/plat/barrier_types.h \
+ $(srcdir)/include/odp/drv/plat/byteorder_types.h \
++ $(srcdir)/include/odp/drv/compiler.h \
+ $(srcdir)/include/odp/drv/plat/driver_types.h \
+ $(srcdir)/include/odp/drv/plat/shm_types.h \
+ $(srcdir)/include/odp/drv/plat/spinlock_types.h \
+ $(srcdir)/include/odp/drv/plat/strong_types.h
noinst_HEADERS = \
${srcdir}/include/_fdserver_internal.h \
diff --cc test/common_plat/validation/api/crypto/odp_crypto_test_inp.c
index 43ddb2f,de9d6e4..8068938
--- a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c
+++ b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c
@@@ -97,63 -63,70 +97,116 @@@ static void alg_test(odp_crypto_op_t op
int num, i;
int found;
- rc = odp_crypto_capability(&capability);
+ rc = odp_crypto_capability(&capa);
CU_ASSERT(!rc);
- if (capability.hw_ciphers.all_bits) {
- if (cipher_alg == ODP_CIPHER_ALG_3DES_CBC &&
- !(capability.hw_ciphers.bit.trides_cbc))
- rc = -1;
- if (cipher_alg == ODP_CIPHER_ALG_AES_CBC &&
- !(capability.hw_ciphers.bit.aes_cbc))
- rc = -1;
- if (cipher_alg == ODP_CIPHER_ALG_AES_GCM &&
- !(capability.hw_ciphers.bit.aes_gcm))
- rc = -1;
+ if (cipher_alg == ODP_CIPHER_ALG_3DES_CBC &&
+ !(capa.ciphers.bit.trides_cbc))
+ rc = -1;
+ if (cipher_alg == ODP_CIPHER_ALG_AES_CBC &&
+ !(capa.ciphers.bit.aes_cbc))
+ rc = -1;
+ if (cipher_alg == ODP_CIPHER_ALG_AES_GCM &&
+ !(capa.ciphers.bit.aes_gcm))
+ rc = -1;
+ if (cipher_alg == ODP_CIPHER_ALG_DES &&
+ !(capa.ciphers.bit.des))
+ rc = -1;
+ if (cipher_alg == ODP_CIPHER_ALG_NULL &&
+ !(capa.ciphers.bit.null))
+ rc = -1;
+
+ CU_ASSERT(!rc);
+ CU_ASSERT((~capa.ciphers.all_bits & capa.hw_ciphers.all_bits) == 0);
+
+ if (auth_alg == ODP_AUTH_ALG_AES_GCM &&
+ !(capa.auths.bit.aes_gcm))
+ rc = -1;
+ if (auth_alg == ODP_AUTH_ALG_MD5_HMAC &&
+ !(capa.auths.bit.md5_hmac))
+ rc = -1;
+ if (auth_alg == ODP_AUTH_ALG_NULL &&
+ !(capa.auths.bit.null))
+ rc = -1;
+ if (auth_alg == ODP_AUTH_ALG_SHA256_HMAC &&
+ !(capa.auths.bit.sha256_hmac))
+ rc = -1;
+
+ CU_ASSERT(!rc);
+ CU_ASSERT((~capa.auths.all_bits & capa.hw_auths.all_bits) == 0);
+
+ num = odp_crypto_cipher_capability(cipher_alg, cipher_capa,
+ MAX_ALG_CAPA);
+
+ if (cipher_alg != ODP_CIPHER_ALG_NULL) {
+ CU_ASSERT(num > 0);
+ found = 0;
} else {
- if (cipher_alg == ODP_CIPHER_ALG_3DES_CBC &&
- !(capability.ciphers.bit.trides_cbc))
- rc = -1;
- if (cipher_alg == ODP_CIPHER_ALG_AES_CBC &&
- !(capability.ciphers.bit.aes_cbc))
- rc = -1;
- if (cipher_alg == ODP_CIPHER_ALG_AES_GCM &&
- !(capability.ciphers.bit.aes_gcm))
- rc = -1;
+ CU_ASSERT(num == 0);
+ found = 1;
}
- CU_ASSERT(!rc);
+ CU_ASSERT(num <= MAX_ALG_CAPA);
+
+ if (num > MAX_ALG_CAPA)
+ num = MAX_ALG_CAPA;
+
+ /* Search for the test case */
+ for (i = 0; i < num; i++) {
+ if (cipher_capa[i].key_len == cipher_key.length &&
++ cipher_capa[i].iv_len == ses_iv.length) {
++ found = 1;
++ break;
++ }
++ }
+
- if (capability.hw_auths.all_bits) {
- if (auth_alg == ODP_AUTH_ALG_AES_GCM &&
- !(capability.hw_auths.bit.aes_gcm))
- rc = -1;
- if (auth_alg == ODP_AUTH_ALG_NULL &&
- !(capability.hw_auths.bit.null))
- rc = -1;
++ CU_ASSERT(found);
++
++ num = odp_crypto_auth_capability(auth_alg, auth_capa, MAX_ALG_CAPA);
++
++ if (auth_alg != ODP_AUTH_ALG_NULL) {
++ CU_ASSERT(num > 0);
++ found = 0;
+ } else {
- if (auth_alg == ODP_AUTH_ALG_AES_GCM &&
- !(capability.auths.bit.aes_gcm))
- rc = -1;
- if (auth_alg == ODP_AUTH_ALG_NULL &&
- !(capability.auths.bit.null))
- rc = -1;
++ CU_ASSERT(num == 0);
++ found = 1;
+ }
+
- CU_ASSERT(!rc);
++ CU_ASSERT(num <= MAX_ALG_CAPA);
++
++ if (num > MAX_ALG_CAPA)
++ num = MAX_ALG_CAPA;
++
++ /* Search for the test case */
++ for (i = 0; i < num; i++) {
++ if (auth_capa[i].digest_len == digest_len &&
++ auth_capa[i].key_len == auth_key.length) {
++ found = 1;
++ break;
++ }
++ }
++
++ CU_ASSERT(found);
+
+ num = odp_crypto_cipher_capability(cipher_alg, cipher_capa,
+ MAX_ALG_CAPA);
+
+ if (cipher_alg != ODP_CIPHER_ALG_NULL) {
+ CU_ASSERT(num > 0);
+ found = 0;
+ } else {
+ CU_ASSERT(num == 0);
+ found = 1;
+ }
+
+ CU_ASSERT(num <= MAX_ALG_CAPA);
+
+ if (num > MAX_ALG_CAPA)
+ num = MAX_ALG_CAPA;
+
+ /* Search for the test case */
+ for (i = 0; i < num; i++) {
+ if (cipher_capa[i].key_len == cipher_key.length &&
cipher_capa[i].iv_len == ses_iv.length) {
found = 1;
break;
-----------------------------------------------------------------------
Summary of changes:
CHANGELOG | 178 +++++++++++++++++++++
configure.ac | 6 +-
platform/linux-generic/Makefile.am | 1 +
.../validation/api/crypto/odp_crypto_test_inp.c | 53 ++++++
4 files changed, 235 insertions(+), 3 deletions(-)
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via a51c171ebe9e9b0aaced13bc0956bdb38c8cfc7b (commit)
from 0d6c0804640151f8aa9970cc74f1fef28a11fac1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a51c171ebe9e9b0aaced13bc0956bdb38c8cfc7b
Author: Maxim Uvarov <maxim.uvarov(a)linaro.org>
Date: Thu Jan 19 17:34:50 2017 +0300
example: hello: ask odp for available core
Core 0 might be not available and app should
ask for available core before pinning to it.
https://bugs.linaro.org/show_bug.cgi?id=2806
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
Reviewed-by: Mike Holmes <mike.holmes(a)linaro.org>
diff --git a/example/hello/odp_hello.c b/example/hello/odp_hello.c
index 6d114ee..dba3495 100644
--- a/example/hello/odp_hello.c
+++ b/example/hello/odp_hello.c
@@ -61,6 +61,7 @@ int main(int argc, char *argv[])
pid_t pid;
cpu_set_t cpu_set;
int i;
+ odp_cpumask_t mask;
memset(&opt, 0, sizeof(opt));
opt.cpu = 0;
@@ -70,6 +71,15 @@ int main(int argc, char *argv[])
return -1;
pid = getpid();
+
+ if (odp_init_global(&inst, NULL, NULL)) {
+ printf("Global init failed.\n");
+ return -1;
+ }
+
+ odp_cpumask_default_control(&mask, 0);
+ opt.cpu = odp_cpumask_first(&mask);
+
CPU_ZERO(&cpu_set);
CPU_SET(opt.cpu, &cpu_set);
@@ -78,11 +88,6 @@ int main(int argc, char *argv[])
return -1;
}
- if (odp_init_global(&inst, NULL, NULL)) {
- printf("Global init failed.\n");
- return -1;
- }
-
if (odp_init_local(inst, ODP_THREAD_CONTROL)) {
printf("Local init failed.\n");
return -1;
-----------------------------------------------------------------------
Summary of changes:
example/hello/odp_hello.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via 0d6c0804640151f8aa9970cc74f1fef28a11fac1 (commit)
from b17aeea11a9bac1f5d55463e81904af12c99b4c7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0d6c0804640151f8aa9970cc74f1fef28a11fac1
Author: Christophe Milard <christophe.milard(a)linaro.org>
Date: Mon Jan 23 16:38:37 2017 +0100
linux-gen: _ishmphy: fix possible race with malloc
_ishm prereserves address space for _ODP_ISHM_SINGLE_VA allocated memory
by reserving unreachable "memory", using PROT_NONE, hence really allocating
virtual space (as the memory cannot be hit).
The problem came when trying to use some of this preallocated space:
strangely, if a new mapping on the preallocated virtual space failed (e.g.
due to lack of huge pages), linux would returned MAP_FAILED (OK) but
also cancel the previous PROT_NONE mapping, hence making the virtual
memory space available for further mmaps. (code Point A)
Before this patch, the code simply re-reserved (PROT_NONE) the area
(point B):
This was NOT OK: yes, _ishm_reserve calls are mutexed, so no other
odpthread 2 could do a reserve between point A and B of opdthread1, but if
thread2 did its own mmap(), malloc(),..., there was a chance for thread 2
to get virtual space from the preserved area (which should be blocked).
This patch does not allow any A-B window by first doing an mmap (non fixed)
and then performing a second mapping at the correct address (in the
pre-reserved area), which is guaranteed to succeed, and finally removing
the non-fixed mapping.
The non-fix mapping just acts as a failure guard when the proper maping
is done.
Fixes https://bugs.linaro.org/show_bug.cgi?id=2834
(but very hard to trigger i.e. to prove)
Signed-off-by: Christophe Milard <christophe.milard(a)linaro.org>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/platform/linux-generic/_ishmphy.c b/platform/linux-generic/_ishmphy.c
index 2b2d100..d519af6 100644
--- a/platform/linux-generic/_ishmphy.c
+++ b/platform/linux-generic/_ishmphy.c
@@ -94,7 +94,7 @@ int _odp_ishmphy_unbook_va(void)
void *_odp_ishmphy_map(int fd, void *start, uint64_t size,
int flags)
{
- void *mapped_addr;
+ void *mapped_addr_tmp, *mapped_addr;
int mmap_flags = 0;
if (flags & _ODP_ISHM_SINGLE_VA) {
@@ -103,15 +103,37 @@ void *_odp_ishmphy_map(int fd, void *start, uint64_t size,
return NULL;
}
/* maps over fragment of reserved VA: */
- mapped_addr = mmap(start, size, PROT_READ | PROT_WRITE,
- MAP_SHARED | MAP_FIXED | mmap_flags, fd, 0);
- /* if mapping fails, re-block the space we tried to take
- * as it seems a mapping failure still affect what was there??*/
- if (mapped_addr == MAP_FAILED) {
- mmap_flags = MAP_SHARED | MAP_FIXED |
- MAP_ANONYMOUS | MAP_NORESERVE;
- mmap(start, size, PROT_NONE, mmap_flags, -1, 0);
- mprotect(start, size, PROT_NONE);
+ /* first, try a normal map. If that works, remap it where it
+ * should (on the prereverved space), and remove the initial
+ * normal mapping:
+ * This is because it turned out that if a mapping fails
+ * on a the prereserved virtual address space, then
+ * the prereserved address space which was tried to be mapped
+ * on becomes available to the kernel again! This was not
+ * according to expectations: the assumption was that if a
+ * mapping fails, the system should remain unchanged, but this
+ * is obvioulsy not true (at least for huge pages when
+ * exhausted).
+ * So the strategy is to first map at a non reserved place
+ * (which can then be freed and returned to the kernel on
+ * failure) and peform a new map to the prereserved space on
+ * success (which is then guaranteed to work).
+ * The initial free maping can then be removed.
+ */
+ mapped_addr = MAP_FAILED;
+ mapped_addr_tmp = mmap(NULL, size, PROT_READ | PROT_WRITE,
+ MAP_SHARED | mmap_flags, fd, 0);
+ if (mapped_addr_tmp != MAP_FAILED) {
+ /* If OK, do new map at right fixed location... */
+ mapped_addr = mmap(start,
+ size, PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_FIXED | mmap_flags,
+ fd, 0);
+ if (mapped_addr != start)
+ ODP_ERR("new map failed:%s\n", strerror(errno));
+ /* ... and remove initial mapping: */
+ if (munmap(mapped_addr_tmp, size))
+ ODP_ERR("munmap failed:%s\n", strerror(errno));
}
} else {
/* just do a new mapping in the VA space: */
-----------------------------------------------------------------------
Summary of changes:
platform/linux-generic/_ishmphy.c | 42 +++++++++++++++++++++++++++++----------
1 file changed, 32 insertions(+), 10 deletions(-)
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via bbabb79cfaf5e28ec9e804b95a23605038b39d39 (commit)
from c14ec3dc896e0dd14d0491f09f81ce09e9d53bc2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bbabb79cfaf5e28ec9e804b95a23605038b39d39
Author: Christophe Milard <christophe.milard(a)linaro.org>
Date: Mon Jan 23 09:25:23 2017 +0100
linux-gen: _ishm: checking fstat return value.
Hence fixing CID 174663
(Fixes https://bugs.linaro.org/show_bug.cgi?id=2827)
Signed-off-by: Christophe Milard <christophe.milard(a)linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c
index 3797f20..c1efd7d 100644
--- a/platform/linux-generic/_ishm.c
+++ b/platform/linux-generic/_ishm.c
@@ -818,7 +818,14 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd,
/* If a file descriptor is provided, get the real size and map: */
if (fd >= 0) {
- fstat(fd, &statbuf);
+ if (fstat(fd, &statbuf) < 0) {
+ close(fd);
+ odp_spinlock_unlock(&ishm_tbl->lock);
+ ODP_ERR("_ishm_reserve failed (fstat failed: %s).\n",
+ strerror(errno));
+ __odp_errno = errno;
+ return -1;
+ }
len = statbuf.st_size;
/* note that the huge page flag is meningless here as huge
* page is determined by the provided file descriptor: */
-----------------------------------------------------------------------
Summary of changes:
platform/linux-generic/_ishm.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
hooks/post-receive
--
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via c14ec3dc896e0dd14d0491f09f81ce09e9d53bc2 (commit)
from 50ebc616ddd9d05651923134d7bfaa02c103fbce (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c14ec3dc896e0dd14d0491f09f81ce09e9d53bc2
Author: Christophe Milard <christophe.milard(a)linaro.org>
Date: Mon Jan 23 09:47:57 2017 +0100
linux-gen: _ishm: fix normal page fallback
Fixing failure due to lack of huge pages.
Fixes: https://bugs.linaro.org/show_bug.cgi?id=2842
Signed-off-by: Christophe Milard <christophe.milard(a)linaro.org>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer(a)linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov(a)linaro.org>
diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c
index f889834..3797f20 100644
--- a/platform/linux-generic/_ishm.c
+++ b/platform/linux-generic/_ishm.c
@@ -547,7 +547,7 @@ static void *do_map(int block_index, uint64_t len, uint32_t align,
addr = alloc_fragment(len, block_index, align, &fragment);
if (!addr) {
ODP_ERR("alloc_fragment failed.\n");
- if (new_block->filename[0]) {
+ if (!new_block->external_fd) {
close(*fd);
*fd = -1;
delete_file(new_block);
@@ -562,7 +562,7 @@ static void *do_map(int block_index, uint64_t len, uint32_t align,
if (mapped_addr == NULL) {
if (flags & _ODP_ISHM_SINGLE_VA)
free_fragment(fragment);
- if (new_block->filename[0]) {
+ if (!new_block->external_fd) {
close(*fd);
*fd = -1;
delete_file(new_block);
-----------------------------------------------------------------------
Summary of changes:
platform/linux-generic/_ishm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--