[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 4/5] xen/console: handle multiple domains using console_io hypercalls
- To: Stefano Stabellini <stefano.stabellini@xxxxxxx>
- From: dmukhin@xxxxxxxx
- Date: Fri, 6 Feb 2026 14:29:32 -0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DCpJL48mHSGuimrJ3uKpy6OQ6ZzZTNdC3hoqo6FRy7I=; b=HrwDzywb1zjrYhtY4ckkWCAbo7EwjezxxpMYtF1DNux3NUWzbAatHEoYwnoUtjst2FT++P7+XQ1KwFR9TIQAXC/26OressEMTxUfSJu3j4fX0OpSVVSH+lb8x3xI5XdZ/frkUYEX9oGALnqDogxTkFNqlsMArNMxi4SqUpkvwSUeSMXRupEbAl3fwmQrPNcjuq85j8iI8RCYgsPRgia4/M/T0pgIrc6kNpXIwdW7e9XscvqTdvBL9CcxP/gKKLIbtBzVRS73bydk1ZpSdHew4645vLcy+akfoVPzerb8n/aTX+ekKHlkBtD43NdjAK07WXdX5WnXP4BqyCsDcNhV5Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NHwMLtB2rinTHATegU/tPnRnMK0lZRDncsjdvWJG/HoFhctBtE9EezPSgOZlSWKLHaOh305QQO1j93Tt14lCiLeWBgANgi4PIuaSy7MO5ilGaZBAsiaQA8RDv1oR40zwJAI4QVeAt7PlapxLtSIcMmJsd+KPH/OSNqMfyUpyp1GdmAKGB5E7j4I7j3gsWLLwyRlApH+U544/j5FrgXBkeBF19SLuo1nLENlPRqbsFJFXRRmJfxmjpsUX25SYusGDOgomQcNFReo1FpVqmDyCzXqq504wZl6rn5Y1IZJGNDew1kA974O/7/diraL4hoVp0glSO3avYVMSd2dOW4sKdA==
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, grygorii_strashko@xxxxxxxx, anthony.perard@xxxxxxxxxx, michal.orzel@xxxxxxx, julien@xxxxxxx, roger.pau@xxxxxxxxxx, jason.andryuk@xxxxxxx, victorm.lira@xxxxxxx, andrew.cooper3@xxxxxxxxxx, jbeulich@xxxxxxxx, sstabellini@xxxxxxxxxx
- Delivery-date: Fri, 06 Feb 2026 22:29:46 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Pser-m365-app: SER-APP
On Wed, Feb 04, 2026 at 03:37:11PM -0800, Stefano Stabellini wrote:
> Allow multiple dom0less domains to use the console_io hypercalls to
> print to the console. Handle them in a similar way to vpl011: only the
> domain which has focus can read from the console. All domains can write
> to the console but the ones without focus have a prefix. In this case
> the prefix is applied by using guest_printk instead of printk or
> console_puts which is what the original code was already doing.
>
> When switching focus using Ctrl-AAA, discard any unread data in the
> input buffer. Input is read quickly and the user would be aware of it
> being slow or stuck as they use Ctrl-AAA to switch focus domain.
> In that situation, it is to be expected that the unread input is lost.
>
> The domain writes are buffered when the domain is not in focus. Push out
> the buffer after the domain enters focus on the first guest write.
>
> Locking updates:
>
> - Discard unread input under the lock when switching focus (including
> when returning to Xen) so that cross-domain reads can't see stale data
>
> - Require is_focus_domain() callers to hold console_lock, and re-check
> focus after each chunk in the CONSOLEIO_read loop so a focus change
> simply stops further copies without duplicating or leaking input
>
> - Hold cons->lock while flushing buffered writes in the focus path so
> the direct-write fast path does not race buffered guests or HVM debug
> output
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
Reviewed-by: Denis Mukhin <dmukhin@xxxxxxxx>
|