openssl: Update the RV32 append to 1.1.1d

While we are updating OpenSSL let's also update the patch based on the
latest submission.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
Alistair Francis
2019-09-16 08:12:37 -07:00
committed by Khem Raj
parent 270c8cb7c1
commit 55a188ec70
2 changed files with 22 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
From 9d503bf3bc38c7d71d76cc7978aaacd1dddd2e28 Mon Sep 17 00:00:00 2001
From d1a1b797d961301fd58513e50ac5de9ad5b8bc08 Mon Sep 17 00:00:00 2001
From: Alistair Francis <alistair.francis@wdc.com>
Date: Thu, 29 Aug 2019 13:56:21 -0700
Subject: [PATCH] Add support for io_pgetevents_time64 syscall
@@ -12,39 +12,47 @@ This patch changes the io_getevents() function to use the correct
syscall based on the avaliable syscalls and the time_t size. We will
only use the new 64-bit time_t syscall if the architecture is using a
64-bit time_t. This is to avoid having to deal with 32/64-bit
conversions. In the future if a 32-bit time_t architecture wants to use
the 64-bit syscalls we can handle the conversion.
conversions and relying on a 64-bit timespec struct on 32-bit time_t
platforms. As of Linux 5.3 there are no 32-bit time_t architectures
without __NR_io_getevents. In the future if a 32-bit time_t architecture
wants to use the 64-bit syscalls we can handle the conversion.
This fixes build failures on 32-bit RISC-V.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Upstream-Status: Pending
Upstream-Status: Submitted [https://github.com/openssl/openssl/pull/9819]
---
engines/e_afalg.c | 10 ++++++++++
1 file changed, 10 insertions(+)
engines/e_afalg.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/engines/e_afalg.c b/engines/e_afalg.c
index dacbe358cb..7bb4b9f733 100644
index dacbe358cb..99516cb1bb 100644
--- a/engines/e_afalg.c
+++ b/engines/e_afalg.c
@@ -125,7 +125,17 @@ static ossl_inline int io_getevents(aio_context_t ctx, long min, long max,
@@ -125,7 +125,23 @@ static ossl_inline int io_getevents(aio_context_t ctx, long min, long max,
struct io_event *events,
struct timespec *timeout)
{
+#if defined(__NR_io_getevents)
return syscall(__NR_io_getevents, ctx, min, max, events, timeout);
+#elif __TIMESIZE == 64
+ /* Let's only suppor the 64 suffix syscalls for 64-bit time_t.
+ * This simplifies the code for us as we don't need to convert
+#elif defined(__NR_io_pgetevents_time64)
+ /* Let's only support the 64 suffix syscalls for 64-bit time_t.
+ * This simplifies the code for us as we don't need to use a 64-bit
+ * version of timespec with a 32-bit time_t and handle converting
+ * between 64-bit and 32-bit times and check for overflows.
+ */
+ return syscall(__NR_io_pgetevents_time64, ctx, min, max, events, timeout, NULL);
+ if (sizeof(timeout->tv_sec) == 8)
+ return syscall(__NR_io_pgetevents_time64, ctx, min, max, events, timeout, NULL);
+ else {
+ errno = ENOSYS;
+ return -1;
+ }
+#else
+# error "We require either the io_getevents syscall or a 64-bit time_t."
+# error "We require either the io_getevents syscall or __NR_io_pgetevents_time64."
+#endif
}
static void afalg_waitfd_cleanup(ASYNC_WAIT_CTX *ctx, const void *key,
--
2.22.0
2.23.0