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

Re: request for feedback on a Xen/Linux compatibility issue


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 6 Jan 2022 15:03:12 +0100
  • 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=U9OG7Mt3nj1MTF+F5dsEJcvWLLMMpxGVlaMwAuuxSTw=; b=kw1243sfZjA5nO/d7QqW02fmpwRM/AdzLl4XQ5CaNzS7A8pVh7zRU6R68KtbFGFhQkvf4Z3P2EHZ+kxntDT8D1OwbUJAC8t1aVW4BGpoXB3SqKPgmNcYbK/mOpAtW+YGomNpZj6IObFOyoBddHQoGdrHyd1fUy8whbpP2my5qMVjBxvEr0Mpf4m1Weau/e8k8fMuJ5/XImJUtxea6ZB84Mk9s1U2npcvuHGQnFpiQNi1LCaW32nCoqv0Ufhzr16WWISYXnXeCX5lnce6icvZc3RbjNYN+bDvf9Q6uws+jh5raSyNxivr9RI4+PbYqtajVZsgtG6BzJykBiG/4hDDCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CswebqODQSg3vUDicyndRidA6bjH8As1KR045LxaArDTPRDMFaDvpPrDdNiYYA50XGd9h10JhqJKxOhjhUrLHU4pY2KYeZh7ThZ8XOwHkNaS8bbujoiniY0fp4mWbx2UxECvCcR5Y0Zz9J0rNIBzaDBpgUuPpGfTKUjTYS5mW13XH7J4R9rEy39j8a5WHatnvlS6AzkYMII+E/q+IezX31vUV//YGMkjRIakuuWCQ/kWp09G0phJAZvkvSzd+HmZWQsO5K8Zt1LBpGMatOjSmkIDTz8sMMLYti3Y8LnhQIh4NBgeziqone4Q+VaqKIzDlJvRAn9QcusnElVQIzekNA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: julien@xxxxxxx, bertrand.marquis@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, boris.ostrovsky@xxxxxxxxxx
  • Delivery-date: Thu, 06 Jan 2022 14:03:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.01.2022 08:13, Juergen Gross wrote:
> On 06.01.22 01:40, Stefano Stabellini wrote:
>> Hi all,
>>
>> Today Xen dom0less guests are not "Xen aware": the hypervisor node
>> (compatible = "xen,xen") is missing from dom0less domUs device trees and
>> as a consequence Linux initializes as if Xen is not present. The reason
>> is that interfaces like grant table and xenstore (xenbus in Linux) don't
>> work correctly in a dom0less environment at the moment.
>>
>> The good news is that I have patches for Xen to implement PV drivers
>> support for dom0less guests. They also add the hypervisor node to device
>> tree for dom0less guests so that Linux can discover the presence of Xen
>> and related interfaces.
>>
>> When the Linux kernel is booting as dom0less kernel, it needs to delay
>> the xenbus initialization until the interface becomes ready. Attempts to
>> initialize xenbus straight away lead to failure, which is fine because
>> xenbus has never worked in Linux when running as dom0less guest up until
>> now. It is reasonable that a user needs a newer Linux to take advantage
>> of dom0less with PV drivers. So:
>>
>> - old Xen + old/new Linux -> Xen not detected in Linux
>> - new Xen + old Linux     -> xenbus fails to initialize in Linux
>> - new Xen + new Linux     -> dom0less PV drivers working in Linux
>>
>>
>> The problem is that Linux until recently couldn't deal with any errors
>> in xenbus initialization. Instead of returning error and continuing
>> without xenbus, Linux would crash at boot.
>>
>> I upstreamed two patches for Linux xenbus_probe to be able to deal with
>> initialization errors. With those two fixes, Linux can boot as a
>> dom0less kernel with the hypervisor node in device tree. The two fixes
>> got applied to master and were already backported to all the supported
>> Linux stable trees, so as of today:
>>
>> - dom0less with hypervisor node + Linux 5.16+           -> works
>> - dom0less with hypervisor node + stable Linux 5.10     -> works
>> - dom0less with hypervisor node + unpatched Linux 5.10  -> crashes
>>
>>
>> Is this good enough? Or for Xen/Linux compatibility we want to also be
>> able to boot vanilla unpatched Linux 5.10 as dom0less kernel? If so,
>> the simplest solution is to change compatible string for the hypervisor
>> node, so that old Linux wouldn't recognize Xen presence and wouldn't try
>> to initialize xenbus (so it wouldn't crash on failure). New Linux can of
>> course learn to recognize both the old and the new compatible strings.
>> (For instance it could be compatible = "xen,xen-v2".) I have prototyped
>> and tested this solution successfully but I am not convinced it is the
>> right way to go.
>>
>> Do you have any suggestion or feedback?
>>
>> The Linux crash on xenbus initialization failure is a Linux bug, not a
>> Xen issue. For this reason, I am tempted to say that we shouldn't change
>> compatible string to work-around a Linux bug, especially given that the
>> Linux stable trees are already all fixed.
> 
> What about adding an option to your Xen patches to omit the hypervisor
> node in the device tree? This would enable the user to have a mode
> compatible to today's behavior.

While this sounds nice at the first glance, this would need to be a per-
domain setting. Which wouldn't be straightforward to express via command
line option (don't know how feasible it would be to express such via other
means).

Jan




 


Rackspace

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