pc/pc64: keep shadow copy of DR7 in Mach and use that to check whether we need to reset DR7 in procsave(); remove superfluous reset of DR7 in mmurelease()
This commit is contained in:
parent
e8082c1d1f
commit
13869bab11
6 changed files with 17 additions and 8 deletions
|
@ -258,6 +258,8 @@ struct Mach
|
|||
uvlong tscticks;
|
||||
int pdballoc;
|
||||
int pdbfree;
|
||||
|
||||
u32int dr7; /* shadow copy of dr7 */
|
||||
|
||||
int stack[1];
|
||||
};
|
||||
|
|
|
@ -844,8 +844,10 @@ procrestore(Proc *p)
|
|||
{
|
||||
uvlong t;
|
||||
|
||||
if(p->dr[7] != 0)
|
||||
if(p->dr[7] != 0){
|
||||
m->dr7 = p->dr[7];
|
||||
putdr(p->dr);
|
||||
}
|
||||
|
||||
if(p->kp)
|
||||
return;
|
||||
|
@ -863,8 +865,11 @@ procsave(Proc *p)
|
|||
{
|
||||
uvlong t;
|
||||
|
||||
if(p->dr[7] != 0)
|
||||
/* we could just always putdr7(0) but accessing DR7 might be slow in a VM */
|
||||
if(m->dr7 != 0){
|
||||
m->dr7 = 0;
|
||||
putdr7(0);
|
||||
}
|
||||
|
||||
cycles(&t);
|
||||
p->kentry -= t;
|
||||
|
|
|
@ -387,8 +387,6 @@ mmurelease(Proc* proc)
|
|||
proc->ldt = nil;
|
||||
proc->nldt = 0;
|
||||
}
|
||||
if(proc->dr[7] != 0)
|
||||
putdr7(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -223,6 +223,8 @@ struct Mach
|
|||
int havepge;
|
||||
int havewatchpt8;
|
||||
uvlong tscticks;
|
||||
|
||||
u64int dr7; /* shadow copy of dr7 */
|
||||
|
||||
uintptr stack[1];
|
||||
};
|
||||
|
|
|
@ -798,8 +798,10 @@ procrestore(Proc *p)
|
|||
{
|
||||
uvlong t;
|
||||
|
||||
if(p->dr[7] != 0)
|
||||
if(p->dr[7] != 0){
|
||||
m->dr7 = p->dr[7];
|
||||
putdr(p->dr);
|
||||
}
|
||||
|
||||
if(p->kp)
|
||||
return;
|
||||
|
@ -814,8 +816,10 @@ procsave(Proc *p)
|
|||
{
|
||||
uvlong t;
|
||||
|
||||
if(p->dr[7] != 0)
|
||||
if(m->dr7 != 0){
|
||||
m->dr7 = 0;
|
||||
putdr7(0);
|
||||
}
|
||||
|
||||
cycles(&t);
|
||||
p->kentry -= t;
|
||||
|
|
|
@ -425,8 +425,6 @@ mmurelease(Proc *proc)
|
|||
proc->kmapcount = proc->kmapindex = 0;
|
||||
}
|
||||
mmufree(proc);
|
||||
if(proc->dr[7] != 0)
|
||||
putdr7(0);
|
||||
taskswitch((uintptr)m+MACHSIZE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue