lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DF1VQ45KF0JL.3E3GIL93DGBWL@nvidia.com>
Date: Fri, 19 Dec 2025 12:39:47 +0900
From: "Alexandre Courbot" <acourbot@...dia.com>
To: "Timur Tabi" <ttabi@...dia.com>, "Alexandre Courbot"
 <acourbot@...dia.com>, "Joel Fernandes" <joelagnelf@...dia.com>
Cc: "dakr@...nel.org" <dakr@...nel.org>, "lossin@...nel.org"
 <lossin@...nel.org>, "a.hindborg@...nel.org" <a.hindborg@...nel.org>,
 "boqun.feng@...il.com" <boqun.feng@...il.com>, "ojeda@...nel.org"
 <ojeda@...nel.org>, "simona@...ll.ch" <simona@...ll.ch>,
 "tmgross@...ch.edu" <tmgross@...ch.edu>, "linux-pci@...r.kernel.org"
 <linux-pci@...r.kernel.org>, "nouveau@...ts.freedesktop.org"
 <nouveau@...ts.freedesktop.org>, "dri-devel@...ts.freedesktop.org"
 <dri-devel@...ts.freedesktop.org>, "linux-kernel@...r.kernel.org"
 <linux-kernel@...r.kernel.org>, "rust-for-linux@...r.kernel.org"
 <rust-for-linux@...r.kernel.org>, "bjorn3_gh@...tonmail.com"
 <bjorn3_gh@...tonmail.com>, "Eliot Courtney" <ecourtney@...dia.com>,
 "aliceryhl@...gle.com" <aliceryhl@...gle.com>, "kwilczynski@...nel.org"
 <kwilczynski@...nel.org>, "bhelgaas@...gle.com" <bhelgaas@...gle.com>,
 "gary@...yguo.net" <gary@...yguo.net>, "Alistair Popple"
 <apopple@...dia.com>
Subject: Re: [PATCH 6/7] gpu: nova-core: send UNLOADING_GUEST_DRIVER GSP
 command GSP upon unloading

On Fri Dec 19, 2025 at 7:33 AM JST, Timur Tabi wrote:
> On Thu, 2025-12-18 at 22:27 +0900, Alexandre Courbot wrote:
>> > > +    loop {
>> > > +        match cmdq.receive_msg::<UnloadingGuestDriverReply>(Delta::from_secs(5)) {
>> > > +            Ok(resp) => return Ok(resp),
>> > > +            Err(ERANGE) => continue,
>> > > +            Err(e) => return Err(e),
>> > > +        }
>> > 
>> > This outer loop can go on infinitely, lets bound it?
>> > 
>> > Either outer timeout or bounded number of tries. Bounded tries better since it has inner
>> > timeout.
>> 
>> Yes. And what we really want is a more generic way to do this, because
>> this pattern occurs with several commands so far (and more to come).
>
> Isn't the real problem that we are polling for a specific message, when all message should be
> handled asynchronously as events, like Nouveau does?

Does Nouveau really handle all messages asynchronously? Just taking a
look at `r535_gsp_rpc_send` I see:

* A potential busy-loop with `r535_gsp_rpc_handle_reply`, An argument to
* define whether we should wait for a reply (`policy`).

So it seems like each GSP command expecting a reply is effectively
looping until it arrives, with some messages (LIBOS_PRINT, SEQUENCER,
etc.) being managed by a notifier registered with the command queue. But
messages sent explicitly by the driver don't seem to make use of it and
instead process messages until they find their reply.

This seems to work because IIUC the GSP sends replies in the same order
as it received the messages (so one caller cannot consume the reply
intended to another) and GSP messages are a replacement for the CPU
messing with the hardware itself anyway. So in that context that design
is not particularly awful, but maybe we will want to switch to something
interrupt-based in Nova long-term anyway.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ