Re: [PATCH -tip v2] x86/kprobes: Drop removed INT3 handling code

From: Matthieu Baerts
Date: Sun Jan 21 2024 - 16:59:34 EST


Hi Steven,

On 21/01/2024 17:20, Matthieu Baerts wrote:
> On 21/01/2024 16:31, Steven Rostedt wrote:

(...)

>> The thing is, the bug is with qemu and *not* the kernel. Masami's patch
>> just paper's over the real bug, and worse, if the kernel has a bug
>> that's not doing proper synchronization, the patch will keep it from
>> being detected. So no, I do not think this is the proper solution.
>>
>> The real problem is that qemu does not seem to be honoring the memory
>> barriers of an interrupt. The reason the code does the ipi's is to
>> force a full memory barrier across all CPUs so that they all see the
>> same memory before going forward to the next step.
>>
>> My guess is that qemu does not treat the IPI being sent as a memory
>> barrier, and then the CPUs do not see a consistent memory view after
>> the IPIs are sent. That's a bug in qemu!
>>
>> This should be reported to the qemu community and should be fixed
>> there. In the mean time, feel free to use Masami's patch in your local
>> repo until qemu is fixed, but it should not be added to Linux mainline.
>
> Thank you for the explanation!
>
> For QEmu, I'm currently not using a recent version: v6.2.0, while the
> latest one is v8.2.0. I was already suspecting that QEmu could be
> responsible for this issue -- we don't have the issue with KVM, only TCG
> -- but it looks like it is not that easy to upgrade it: for the CI, we
> use virtme, which doesn't support newer versions. We will switch to
> virtme-ng, upgrade QEmu to a version that is still supported, try to
> reproduce the issue without Masami's patch, and report that to QEmu
> community.

FYI, I managed to upgrade QEmu to 8.2.0, and launch the tests: I was not
able to reproduce this issue.

I guess the bug has already been fixed, I'm sorry for the noise!

Cheers,
Matt
--
Sponsored by the NGI0 Core fund.