Re: [PATCH] irqchip/gic-v4: Fix ordering between vmapp and vpe locks

From: Thomas Gleixner
Date: Mon Jul 29 2024 - 05:48:33 EST


On Mon, Jul 29 2024 at 08:25, Marc Zyngier wrote:
> On Fri, 26 Jul 2024 21:52:40 +0100,
> Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>> Confused. This changes the locking from unconditional to
>> conditional. What's the rationale here?
>
> Haven't managed to sleep much, but came to the conclusion that I
> wasn't that stupid in my initial patch. Let's look at the full
> picture, starting with its_send_vmovp():
>
> if (!its_list_map) {
> its = list_first_entry(&its_nodes, struct its_node, entry);
> desc.its_vmovp_cmd.col = &its->collections[col_id];
> its_send_single_vcommand(its, its_build_vmovp_cmd, &desc);
> return;
> }
>
> /*
> * Protect against concurrent updates of the mapping state on
> * individual VMs.
> */
> guard(raw_spinlock_irqsave)(&vpe->its_vm->vmapp_lock);
>
> The vmapp locking *is* conditional. Which makes a lot of sense as the

Misread the patch ...