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

Re: [PATCH v2] xen/arm: set CPSR Z bit when creating aarch32 guests


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 23 Mar 2022 08:17:32 +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=24d05wNlI9gx55noH4ybuK5koG6OXEWX1QXEsQFXk74=; b=eQ4XKiT8fA4YzMfLu8xpBeCHIV9edifrdzG3NcNL0xccuqw85RC9mhiTx4usX4bKNPQpWScZbBN1VNk5CGM9K+6zcLFTawK/wbTB1igP6HN5uzEMQ83Kd81+F3UrwZh5G0mGRPI0llEkEE64kJ+Dd+8zEtV36UGEYABFL+3hOkRi+sqzzi2cpdaTqUHYDEV0PSgTerCx1YcaPNEC16I3hLnXeInw6EYyBObXNnLri9ozRTvdMZxepqQbLnm4O8VaHZONhG2YqpP7nyWhBo0+U+uwkPFVivrVqVOAmT2kBdfp9Gwh1ZRAqIKifZ+CY+qTImnmP2ylY9rNCr5/w70i+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n94tITH14Mhb18E6Xu97ErCcgNhGmtvx+wmkr3l1sCyqmBwVhg3CcI29Obpp1Dmx+n3iOydDook8fvwiJU9dJZrpJFXHoHbbAQS+3L5SIVM6KHWb8DYujM/YEH5Y+wY5SrML1AJEjjsNLSfKqPzNce3whYg//sByjLIHF9zEkWcsj3WUsnmZhlCfKgju1zjnMuJ87q5gvWOqwg4au5WlEkof2uSe95+L/vkx+Fwm5Y0DJ8QwAZX9x4lGiBEzWi7Y3npjZbf1bdQuUhfRvJ1jtxAbnsAPyUSA+clz7rziW/cbxpBLrtf05KjbmwWBdDNb6dCavmj+EXp0kzGTmbTfUA==
  • 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, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 23 Mar 2022 07:17:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.03.2022 21:28, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
> 
> The first 32 bytes of zImage are NOPs. When CONFIG_EFI is enabled in the
> kernel, certain versions of Linux will use an UNPREDICATABLE NOP
> encoding, sometimes resulting in an unbootable kernel. Whether the
> resulting kernel is bootable or not depends on the processor. See commit
> a92882a4d270 in the Linux kernel for all the details.

Is this a problem only under Xen or also on bare hardware? In the
latter case I'd be even more inclined to require this issue to be
dealt with in the kernels, rather than working around it by an ABI
change in Xen.

> All kernel releases starting from Linux 4.9 without commit a92882a4d270
> are affected.
> 
> Fortunately there is a simple workaround: setting the "Z" bit in CPSR
> make it so those invalid NOP instructions are never executed. That is
> because the instruction is conditional (not equal). So, on QEMU at
> least, the instruction will end up to be ignored and not generate an
> exception. Setting the "Z" bit makes those kernel versions bootable
> again and it is harmless in the other cases.

I'm afraid such an ABI change being harmless needs to be not just
claimed, but proven. There could certainly be reasons this is safe,
e.g. the same path being taken on bare hardware, and the state of
the bit not being specified there. Yet even in presence of such a
specification it cannot be excluded that non-standard (something
XTF-like, for example) uses might have grown a dependency on the
Xen ABI specification.

Jan




 


Rackspace

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