diff mbox series

[v2,03/23] linux-user/arm: Split out v2_frame

Message ID 20210618192951.125651-4-richard.henderson@linaro.org
State New
Headers show
Series linux-user: Move signal trampolines to new page | expand

Commit Message

Richard Henderson June 18, 2021, 7:29 p.m. UTC
Split out a helper function to test for a v2 signal frame.

Cc: qemu-arm@nongnu.org
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 linux-user/arm/signal.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

-- 
2.25.1

Comments

Peter Maydell June 29, 2021, 1:53 p.m. UTC | #1
On Fri, 18 Jun 2021 at 20:32, Richard Henderson
<richard.henderson@linaro.org> wrote:
>

> Split out a helper function to test for a v2 signal frame.

>

> Cc: qemu-arm@nongnu.org

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  linux-user/arm/signal.c | 13 +++++++++----

>  1 file changed, 9 insertions(+), 4 deletions(-)

>

> diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c

> index 32b68ee302..cb65623965 100644

> --- a/linux-user/arm/signal.c

> +++ b/linux-user/arm/signal.c

> @@ -165,6 +165,11 @@ static inline int valid_user_regs(CPUARMState *regs)

>      return 1;

>  }

>

> +static bool v2_frame(void)

> +{

> +    return get_osversion() >= 0x020612;

> +}


Not sure how much we care about supporting claiming to be a 15-year-old
kernel any more (especially since we set UNAME_MINIMUM_RELEASE to 2.6.32...)
so it's awfully tempting to just blow away the v1 frame support instead...

Anyway
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>


thanks
-- PMM
Richard Henderson June 29, 2021, 2:30 p.m. UTC | #2
On 6/29/21 6:53 AM, Peter Maydell wrote:
> On Fri, 18 Jun 2021 at 20:32, Richard Henderson

> <richard.henderson@linaro.org> wrote:

>>

>> Split out a helper function to test for a v2 signal frame.

>>

>> Cc: qemu-arm@nongnu.org

>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

>> ---

>>   linux-user/arm/signal.c | 13 +++++++++----

>>   1 file changed, 9 insertions(+), 4 deletions(-)

>>

>> diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c

>> index 32b68ee302..cb65623965 100644

>> --- a/linux-user/arm/signal.c

>> +++ b/linux-user/arm/signal.c

>> @@ -165,6 +165,11 @@ static inline int valid_user_regs(CPUARMState *regs)

>>       return 1;

>>   }

>>

>> +static bool v2_frame(void)

>> +{

>> +    return get_osversion() >= 0x020612;

>> +}

> 

> Not sure how much we care about supporting claiming to be a 15-year-old

> kernel any more (especially since we set UNAME_MINIMUM_RELEASE to 2.6.32...)

> so it's awfully tempting to just blow away the v1 frame support instead...

> 

> Anyway

> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>


I hadn't noticed the minimum release setting.  Yes, I think it would be better to remove 
the v1 support instead of bodging around it like this.


r~
diff mbox series

Patch

diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c
index 32b68ee302..cb65623965 100644
--- a/linux-user/arm/signal.c
+++ b/linux-user/arm/signal.c
@@ -165,6 +165,11 @@  static inline int valid_user_regs(CPUARMState *regs)
     return 1;
 }
 
+static bool v2_frame(void)
+{
+    return get_osversion() >= 0x020612;
+}
+
 static void
 setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,*/
                  CPUARMState *env, abi_ulong mask)
@@ -422,7 +427,7 @@  sigsegv:
 void setup_frame(int usig, struct target_sigaction *ka,
                  target_sigset_t *set, CPUARMState *regs)
 {
-    if (get_osversion() >= 0x020612) {
+    if (v2_frame()) {
         setup_frame_v2(usig, ka, set, regs);
     } else {
         setup_frame_v1(usig, ka, set, regs);
@@ -516,7 +521,7 @@  void setup_rt_frame(int usig, struct target_sigaction *ka,
                     target_siginfo_t *info,
                     target_sigset_t *set, CPUARMState *env)
 {
-    if (get_osversion() >= 0x020612) {
+    if (v2_frame()) {
         setup_rt_frame_v2(usig, ka, info, set, env);
     } else {
         setup_rt_frame_v1(usig, ka, info, set, env);
@@ -734,7 +739,7 @@  badframe:
 
 long do_sigreturn(CPUARMState *env)
 {
-    if (get_osversion() >= 0x020612) {
+    if (v2_frame()) {
         return do_sigreturn_v2(env);
     } else {
         return do_sigreturn_v1(env);
@@ -823,7 +828,7 @@  badframe:
 
 long do_rt_sigreturn(CPUARMState *env)
 {
-    if (get_osversion() >= 0x020612) {
+    if (v2_frame()) {
         return do_rt_sigreturn_v2(env);
     } else {
         return do_rt_sigreturn_v1(env);