diff mbox

[v2,3/9] target-i386: Ensure bit 10 on DR7 is never cleared

Message ID 1445012619-23772-4-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost Oct. 16, 2015, 4:23 p.m. UTC
Bit 10 of DR7 is documented as always set to 1, so ensure that's
always the case.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/bpt_helper.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Richard Henderson Oct. 18, 2015, 10:58 p.m. UTC | #1
On 10/16/2015 06:23 AM, Eduardo Habkost wrote:
> Bit 10 of DR7 is documented as always set to 1, so ensure that's
> always the case.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>   target-i386/bpt_helper.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/target-i386/bpt_helper.c b/target-i386/bpt_helper.c
> index 23ce828..493deba 100644
> --- a/target-i386/bpt_helper.c
> +++ b/target-i386/bpt_helper.c
> @@ -113,6 +113,8 @@ void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7)
>               hw_breakpoint_insert(env, i);
>           }
>       }
> +
> +    env->dr[7] |= DR7_FIXED_1;

Better to do this to new_dr7, above the xor test with old_dr7, so that we still 
pass the xor test.


r~
diff mbox

Patch

diff --git a/target-i386/bpt_helper.c b/target-i386/bpt_helper.c
index 23ce828..493deba 100644
--- a/target-i386/bpt_helper.c
+++ b/target-i386/bpt_helper.c
@@ -113,6 +113,8 @@  void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7)
             hw_breakpoint_insert(env, i);
         }
     }
+
+    env->dr[7] |= DR7_FIXED_1;
 }
 #endif