[Qemu-devel] [PATCH] target/ppc: reset reservation in do_rfi()

Nikunj A Dadhania posted 1 patch 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170515083509.24607-1-nikunj@linux.vnet.ibm.com
Test checkpatch passed
Test docker passed
Test s390x passed
target/ppc/excp_helper.c | 3 +++
1 file changed, 3 insertions(+)
[Qemu-devel] [PATCH] target/ppc: reset reservation in do_rfi()
Posted by Nikunj A Dadhania 6 years, 10 months ago
For transitioning back to userspace after the interrupt.

Suggested-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---
 target/ppc/excp_helper.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index a6bcb47..9cb2123 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -995,6 +995,9 @@ static inline void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr)
      */
     cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
 
+    /* Reset the reservation */
+    env->reserve_addr = -1;
+
     /* Context synchronizing: check if TCG TLB needs flush */
     check_tlb_flush(env, false);
 }
-- 
2.9.3


Re: [Qemu-devel] [PATCH] target/ppc: reset reservation in do_rfi()
Posted by David Gibson 6 years, 10 months ago
On Mon, May 15, 2017 at 02:05:09PM +0530, Nikunj A Dadhania wrote:
> For transitioning back to userspace after the interrupt.
> 
> Suggested-by: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>

Applied to ppc-for-2.10. thanks.

> ---
>  target/ppc/excp_helper.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index a6bcb47..9cb2123 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -995,6 +995,9 @@ static inline void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr)
>       */
>      cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
>  
> +    /* Reset the reservation */
> +    env->reserve_addr = -1;
> +
>      /* Context synchronizing: check if TCG TLB needs flush */
>      check_tlb_flush(env, false);
>  }

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson