Re: [PATCH RFC v3 2/4] x86/bus_lock: Handle warn and fatal in #DB for bus lock

From: Fenghua Yu
Date: Fri Nov 06 2020 - 15:31:51 EST


Hi, Xiaoyao,

On Tue, Nov 03, 2020 at 08:15:27PM +0800, Xiaoyao Li wrote:
> On 10/31/2020 8:27 AM, Fenghua Yu wrote:
> > diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> > index 3c70fb34028b..1c3442000972 100644
> > --- a/arch/x86/kernel/traps.c
> > +++ b/arch/x86/kernel/traps.c
> > @@ -953,6 +953,13 @@ static __always_inline void exc_debug_user(struct pt_regs *regs,
> > goto out_irq;
> > }
> > + /*
> > + * Handle bus lock. #DB for bus lock can only be triggered from
> > + * userspace.
> > + */
> > + if (!(dr6 & DR_BUS_LOCK))
>
> it should be
>
> if (dr6 & DR_BUS_LOCK)
>
> since you keep DR6.[bit 11] reserved in this version. bit 11 of
> debug_read_clear_dr6() being set to 1 means bus lock detected.

You are right. Will fix it in the next version.

Thank you very much!

-Fenghua