[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xen 4.18 pvshim console issue (with patch)


  • To: Manuel Bouyer <bouyer@xxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 18 Oct 2023 15:24:22 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=eQXX+HCySJXSG8XgZouesrCNnx8Pw90e0xf4eAuO3XE=; b=jOy7k5UJblZTSDLGSyyGZhuEhZl13OFVv1OIH9wXdX8cqtz2h5CXT+RDds8z8cftsUTcRv1EYfi4dPe3KE2nmU1lVXiAF3LQGAHFkBojtk10wP0YtaJq6fZpy+lV3I0xcWSvmcEyx7wIh0hXQTl81ysrE5YEqwIyRerx5GJNP5OF6Wnp/X3NC72k07df+sCwGX4YtffxAMupMYBpTT9wLQH8OLm7oGXSe+9Ct5U9PxaaXujAPKuWRhCLzQBNr1k+sUfrB4Wk6prFWuzVEs3zZXrlqRk17KwI2t3sS0NN/vYlgNo8sQSHC3hhjoA3dF0kLSAxj7MH9+9QdABhA1CEUw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XBlthEiBEBQh3kDdgAX+FGp/5TVR7HZC+tgu+qCkjzo5cGoYXaLSnkxdwCIISGw/BvdPCmtx2ij1ISBxxEJvn73YkvtZnL0Ww95qACVTluSY/eTHaZMbY14KXVNvYg3YPTPAn2AIP/zmqDmaklJPsS3ZbmnYAv59Z2skDX9LKtdJXh8K0Pq6bNEfwF8AZSC0EwBkOn+QglWH5MejrwGo9MHrQh5rHpioT+wSGRRZEmLO0ke3VyM0cQnMd3RlusOj//uUVrZYUmPWuHXLpMpUrjPguRc8fX1BvtcxJSQAjEfoQGpF+e4/WaQXacOdpPq1ros6C144SQyeA5jgqu0t1w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Henry Wang <Henry.Wang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Wed, 18 Oct 2023 13:24:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.10.2023 13:20, Manuel Bouyer wrote:
> On Wed, Oct 18, 2023 at 11:44:22AM +0100, Andrew Cooper wrote:
>> On 18/10/2023 11:38 am, Manuel Bouyer wrote:
>>> Hello,
>>> With Xen 4.18, a PV domain running under pvshim doesn't get console input.
>>> This is because the domain id in pvshim isn't 0 (and on x86 max_init_domid 
>>> is
>>> hardwired to 0), so console_input_domain() will never select that domain
>>> as input.
>>>
>>> The attached patch fixes it by translating 0 to the real domain id for
>>> pvshim, but there may be a better way to do this.
>>>
>>
>> Thankyou for the report.
>>
>> First, CC'ing Henry as 4.18 release manager.
>>
>> There have been changes in how this works recently in 4.18, notably c/s
>> c2581c58bec96.
> 
> Yes, it looks like this one introduced the problem.
> Before this, we would switch console_rx to 1 without checking if
> domain (console_rx - 1) exists, and console_rx == 1 is a special case
> in __serial_rx()
> 
>>
>> However, it's not obvious whether this worked in 4.17 or not.  i.e.
>> whether it's a regression in 4.18, or whether it's been broken since PV
>> Shim was introduced.
> 
> I don't know for 4.16 or 4.17 but I can tell that it's working in 4.15

>From looking at the code, it doesn't look like it would: There
switch_serial_input() toggles console_rx between 0 and 1 afaict, and
console_input_domain() handles value 0 as "Xen" (like in 4.18), while
otherwise it calls rcu_lock_domain_by_id(console_rx - 1) (i.e. trying
to get hold of Dom0's domain structure, not Dom1's).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.