meta-openembedded/meta-oe/recipes-extended/redis/redis-7.2.2/0006-Define-correct-gregs-for-RISCV32.patch
Wang Mingyu d69b92233b redis: upgrade 7.2.1 -> 7.2.2
Changelog:
============
* (CVE-2023-45145) The wrong order of listen(2) and chmod(2) calls creates a
  race condition that can be used by another process to bypass desired Unix
  socket permissions on startup.
* Fix compilation error on MacOS 13 (#12611)
* WAITAOF could timeout in the absence of write traffic in case a new AOF is
  created and an AOF rewrite can't immediately start (#12620)
* Fix crash when running rebalance command in a mixed cluster of 7.0 and 7.2
  nodes (#12604)
* Fix the return type of the slot number in cluster shards to integer, which
  makes it consistent with past behavior (#12561)
* Fix CLUSTER commands are called from modules or scripts to return TLS info
  appropriately (#12569)
* redis-cli, fix crash on reconnect when in SUBSCRIBE mode (#12571)
* Fix overflow calculation for next timer event (#12474)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 8c749f1cd42ae250b059db5174933f4ed736b758)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2023-10-30 07:14:03 -04:00

63 lines
2.5 KiB
Diff

From b6b2c652abfa98093401b232baca8719c50cadf4 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 26 Oct 2020 21:32:22 -0700
Subject: [PATCH] Define correct gregs for RISCV32
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Updated patch for 6.2.8
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
src/debug.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/debug.c b/src/debug.c
index ebda858..90bc450 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -1168,7 +1168,9 @@ static void* getAndSetMcontextEip(ucontext_t *uc, void *eip) {
#endif
#elif defined(__linux__)
/* Linux */
- #if defined(__i386__) || ((defined(__X86_64__) || defined(__x86_64__)) && defined(__ILP32__))
+ #if defined(__riscv) && __riscv_xlen == 32
+ return (void*) uc->uc_mcontext.__gregs[REG_PC];
+ #elif defined(__i386__) || ((defined(__X86_64__) || defined(__x86_64__)) && defined(__ILP32__))
GET_SET_RETURN(uc->uc_mcontext.gregs[14], eip);
#elif defined(__X86_64__) || defined(__x86_64__)
GET_SET_RETURN(uc->uc_mcontext.gregs[16], eip);
@@ -1350,8 +1352,28 @@ void logRegisters(ucontext_t *uc) {
#endif
/* Linux */
#elif defined(__linux__)
+ /* Linux RISCV32 */
+ #if defined(__riscv) && __riscv_xlen == 32
+ serverLog(LL_WARNING,
+ "\n"
+ "RA:%08lx S0:%08lx S1:%08lx S2:%08lx\n"
+ "SP:%08lx PC:%08lx A0:%08lx A1:%08lx\n"
+ "A2 :%08lx A3:%08lx A4:%08lx",
+ (unsigned long) uc->uc_mcontext.__gregs[REG_RA],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_S0],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_S1],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_S2],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_SP],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_PC],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_A0 + 0],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_A0 + 1],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_A0 + 2],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_A0 + 3],
+ (unsigned long) uc->uc_mcontext.__gregs[REG_A0 + 4]
+ );
+ logStackContent((void**)uc->uc_mcontext.__gregs[REG_SP]);
/* Linux x86 */
- #if defined(__i386__) || ((defined(__X86_64__) || defined(__x86_64__)) && defined(__ILP32__))
+ #elif defined(__i386__) || ((defined(__X86_64__) || defined(__x86_64__)) && defined(__ILP32__))
serverLog(LL_WARNING,
"\n"
"EAX:%08lx EBX:%08lx ECX:%08lx EDX:%08lx\n"
--
2.25.1