Re: [PATCH] x86/math64: handle #DE in mul_u64_u64_div_u64()

From: Oleg Nesterov
Date: Thu Jul 24 2025 - 10:08:17 EST


On 07/24, David Laight wrote:
>
> On Thu, 24 Jul 2025 10:25:48 +0200
> Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> > --- a/arch/x86/mm/extable.c
> > +++ b/arch/x86/mm/extable.c
> > @@ -38,6 +38,9 @@ static bool ex_handler_default(const struct exception_table_entry *e,
> > if (e->data & EX_FLAG_CLEAR_DX)
> > regs->dx = 0;
> >
> > + if (e->data & EX_FLAG_XXX_AX)
> > + regs->ax = -1ul;
>
> That would need to set %eax to a 64bit ~0u;
> I don't think the above would sign extend the value.

Hmm... could you spell please?

pt_regs->ax is always 'unsigned long', regardless of bitness...

> Makes me think - always bad.
> I wonder how hard it would be to implement EX_FLAG_WARN_ONCE.
> Mostly it would need a writeable bitmap with one bit for each
> extable entry.

Would be nice... But who else will use this feature ? ;) I mean, it needs
some justification.

Oleg.