Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50480E77188 for ; Wed, 8 Jan 2025 08:13:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.866957.1278344 (Exim 4.92) (envelope-from ) id 1tVRBb-0005sY-CY; Wed, 08 Jan 2025 08:13:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 866957.1278344; Wed, 08 Jan 2025 08:13:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tVRBb-0005sR-8h; Wed, 08 Jan 2025 08:13:07 +0000 Received: by outflank-mailman (input) for mailman id 866957; Wed, 08 Jan 2025 08:13:06 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tVRBa-0005sL-7K for xen-devel@lists.xenproject.org; Wed, 08 Jan 2025 08:13:06 +0000 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [2a00:1450:4864:20::432]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 62ce181a-cd98-11ef-a0df-8be0dac302b0; Wed, 08 Jan 2025 09:13:05 +0100 (CET) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-385eed29d17so7810749f8f.0 for ; Wed, 08 Jan 2025 00:13:04 -0800 (PST) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8acafesm52146369f8f.98.2025.01.08.00.13.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2025 00:13:04 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 62ce181a-cd98-11ef-a0df-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1736323984; x=1736928784; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=OSIyUPfivFUnhbOA8Qzhhz82TwuOzIj2UmuEY+OoQoU=; b=DFSLmEzQJ/p1K4PiCd3gMdkYxswGdX30O7rRbiaUA5HiwrjfH2ftVMuF7ATzb7aLhK IlrXv5mOB+jdzXmqJlEzyqIi0PfA87QQ5PAg1gWyE1IA6RycdnDCl4ZvR/QmHvengUWf 5hUeulbJH0lMSw/4c8WHxAf4RhDMEjpiPJpqQgDtuzh+ZWfovgDAbUVo7Z5rLGfZUP/y bKLqXBoCeXGVnNqkWlIMr8axAIEoJ0IIoxtlH/lc70JFUbtUZgL7OvEM/hPEPmWMo2TL 2NUz+gyZXKonZ7TzixrTt9Gys114qoY6+7scPAeKpSfi0XWV0it8nluY3aZt23hY1Dhe Pplw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736323984; x=1736928784; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OSIyUPfivFUnhbOA8Qzhhz82TwuOzIj2UmuEY+OoQoU=; b=a5QQdqUAdLmzmFl5nyVWHiFhYI5/E4ycnzIeIYKDN54Ei+5mLp1+fbU/EkWfLbP2vZ We/tXGprpxX4+Ysaw8+lbxgdxDgQC+zMNgulyhZEuVHFI2EqqE8x0mNGFOSh84q8OTw0 S+klzJK1o3SXsTj299U7ZVRb+hFRmOGFE07YDPman902misJPUFl/DjSIMkj6nMwegzn Xd4vvIJtzsgmwTnBmKJcuhApDm8iygPUwJjFuHomJoJvs7yF5sg3TuT1WW6SSGgAujzx suOEM074v9zbDcYr4RoBac+oKHrNXDBuf9xPuvuAlFtoZkxwp7wq1nLNgpkvBomFSGW6 D9PA== X-Forwarded-Encrypted: i=1; AJvYcCXvYBYGPkTFMh+iHyEkwDuGu6kpD1yPVybGZ+pyJTPSpelQa/4jek2E9xd4/aoUpbqtt+qLaozYJXw=@lists.xenproject.org X-Gm-Message-State: AOJu0Yw4Zv9hNi6yms7M8cK/xJ7fSeBMymjcqRmHrLpB0ClANDeUzbbG 96VuUNsejFDn/hppv1qrJKWEPsom9dNpptti9ZO69IC2VPImF//LPEQJOLmSew== X-Gm-Gg: ASbGncuHmuViE+yy42Oa0CNKni9SkRen4C8640tJT+ZLJoFSd8O0zX0kWvWNOStncY1 QnhgomhzPpxZHK4t+T1+bXm5AAW5tXRO/p9jVvxw5UtQ/hBsuDsDLmtVDCTFiR4psjkykY+gUR4 JQOoWaGTFKxiMz6f41UyKbsnIQWRt0/qiWmgIt03A7wf3VbhwORnYR8MVVDwfhkrArFDSbnORa5 5HHHfB9h770nTsxepG4Ko9PirlldrlpTLCh/hZSgnQB3DspHWlyx4rSQ1m3j8gXlAP5Rwf4BUqn ostIBEfnSzpl1WIlO4vqW6zdt0Pfk2qlHb+p2qkGjw== X-Google-Smtp-Source: AGHT+IHQAxj2fqVuhg1pSM2G7avPyiqDGFCStsqIlfJJrNu/NqdA2XBACTlCyD6NHsZlPYpfIxy8wg== X-Received: by 2002:a05:6000:1849:b0:386:2ebe:7ae2 with SMTP id ffacd0b85a97d-38a8733df9emr1384143f8f.45.1736323984353; Wed, 08 Jan 2025 00:13:04 -0800 (PST) Message-ID: <121ae72e-6229-40a4-8b9f-4f8b0764b712@suse.com> Date: Wed, 8 Jan 2025 09:13:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 20/35] xen/console: introduce console_owner_domid() To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: Stefano Stabellini , Denis Mukhin , dmukhin@ford.com, xen-devel@lists.xenproject.org, Andrew Cooper , Julien Grall , Bertrand Marquis , Michal Orzel References: <20241205-vuart-ns8250-v1-0-e9aa923127eb@ford.com> <20241205-vuart-ns8250-v1-20-e9aa923127eb@ford.com> <8a5a5a0f-72b0-4336-b0d2-142254319242@suse.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 08.01.2025 09:04, Roger Pau Monné wrote: > On Wed, Jan 08, 2025 at 08:28:32AM +0100, Jan Beulich wrote: >> On 08.01.2025 00:40, Stefano Stabellini wrote: >>> On Tue, 7 Jan 2025, Jan Beulich wrote: >>>> On 06.01.2025 19:48, Stefano Stabellini wrote: >>>>> On Mon, 6 Jan 2025, Jan Beulich wrote: >>>>>> On 04.01.2025 05:15, Denis Mukhin wrote: >>>>>>> >>>>>>> On Tuesday, December 10th, 2024 at 11:28 PM, Jan Beulich wrote: >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On 06.12.2024 05:41, Denis Mukhin via B4 Relay wrote: >>>>>>>> >>>>>>>>> From: Denis Mukhin dmukhin@ford.com >>>>>>>>> >>>>>>>>> console_owner_domid() is introduced to obtain the "console owner" domain ID. >>>>>>>>> >>>>>>>>> The call is used in NS8250 emulator to identify the case when physical xen >>>>>>>>> console focus is owned by the domain w/ NS8250 emulator, in which case, >>>>>>>>> messages from guest OS are formatted w/o '(XEN)' prefix. >>>>>>>> >>>>>>>> >>>>>>>> Such messages ought to be processed through guest_printk(), which wants a >>>>>>>> domain pointer, not a domid_t anyway. Plus isn't that going to be >>>>>>>> current->domain anyway at the callsite, eliminating the need for such a >>>>>>>> >>>>>>>> helper altogether? >>>>>>> >>>>>>> If the current domain is owning the physical console and printing, say, Linux >>>>>>> login prompt, there's no need to add "(XEN)" for every printout; adding timestamps >>>>>>> can be disabled from Xen command line. >>>>>> >>>>>> Surely there shouldn't be (XEN), but without (d) it'll be ambiguous in a log >>>>>> which domain a message came from. As long as only Dom0 messages are left un- >>>>>> prefixed, that's likely fine. Yet as soon as multiple domains can issue such >>>>>> messages (and have console "focus") I think the prefix needs to be there. >>>>> >>>>> It looks like we are aligned on the desired behavior, >>>> >>>> Hmm, no, I don't think we are. I don't ... >>>> >>>>> but for clarity, >>>>> see https://marc.info/?l=xen-devel&m=173405161613716, also copy/pasted >>>>> here: >>>>> >>>>> I think we should provide a consistent behavior across architectures. >>>>> The current behavior with vpl011 and dom0less on ARM is the following: >>>>> >>>>> - no prefix for Dom0 output >>>>> - DOM$NUM for DomUs when not in focus, otherwise no prefix >>>> >>>> ... view this model as a desirable one. It leaves room for ambiguity. >>> >>> Adding a few more people in CC for feedback. >>> >>> My priority is to keep the architectures aligned. It might be OK to >>> change output format, but then let's do it uniformly on ARM as well. >>> >>> Jan, please clarify what you think would be better than the above. Is it >>> the following? I don't think I understood your preference. >>> >>> - DOM$NUM for Dom0 and DomUs when not in focus, otherwise no prefix >> >> No, I mean like we have it with guest_printk() today. (XEN) for Xen's >> own messages, (d) for ordinary domains' ones, and no prefix >> exclusively for the hardware/control domain. What is best to do when >> hardware and control domains are distinct I'm uncertain - I'd be >> inclined to suggest that the hardware domain then stay the one without >> any prefix. > > One concern I have with this approach is whether the addition of the > (d) prefixes will skew output of interactive applications. So far > the prefix is added to output from all domains different than dom0 > because the console is not interactive for them, and hence no input > can be consumed. Hmm, that's an aspect I have to admit I didn't think of. > If that changes however, and domains different than dom0 can get input > from the Xen console then I wonder how much the added prefix will skew > output. Another possible option would be to not print the prefix for > the domain that has the console input assigned (current target), and > print it for all other domains (even for dom0 when not in focus). That's largely what aiui was proposed. My extra requirement there would then be that we make sure a log message is always emitted when console focus shifts, so it's possible to identify the owner for any part of the log. Jan