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

Re: Need guidance to support reading GICR_TYPER (64 bit register) on Aarch32_v8r


  • To: Julien Grall <julien@xxxxxxx>, "Stabellini, Stefano" <stefano.stabellini@xxxxxxx>, bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "Volodymyr_Babchuk@xxxxxxxx" <Volodymyr_Babchuk@xxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Thu, 13 Oct 2022 15:30:31 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=fs1zAxQw8tKNOBH5t0SuT4gu1Cpm9Fc5tTfY/cvB80o=; b=n9k4Mp8uQEZI+AyKQhza7pBu5sQvjAjN/XjOfyorkPp9lid5KnX6IDXl58qb+c6dHcn1Fa9xbPU6nYBdPfVgAM1MiJ38vGJXg7QprQDxMJRbCRbr+raOU4Pqvfynk09wjE3DpgfmZDWWXqYpNuZGDpw93om+oySUwuT1vJ6854of4l4nFSMc8w/Vl/g/bVFHbaZHHUrABq9DvZbRvr3csBcoyi/VIZBBL/PxqHbhEscEcpAZqdxg+uLj58w2rGZ/GR4D/yHNiN0Els3paBKUZgg3bPNiHN5/B8j700i7H4zySeigSCUosePEZ9KhtgqN8c7TvCimZyFhwkl/KG0+xg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3UsbTqQZlizYhwp3NU6kZ6J84qPMqjPw5J3M1K3u9aYkghrSpXzEeG1IORfL6cSgXuJNpvC5xJrxfZIsYidNlNXtflw/W4MvRNiYK0KeGwqc1ZH6rblZXf9530bjRYPDe3x1DkdCJvcDlonOgY/MSRW2rYlo2cep0vQr2RrGExVfkmtCnwgQjBmEA06lu6Iywo3DSR0B7CYJn5m/m6IUduBD95kDhV+KgugC9yK5dT0tH88HLvObx41kRk7zyqLsZ0VSo027E4JWEWfIQxYMvFHwRi4RrZM/4Q1DlXkvb96tIR1kJ55sTdMYfb5eURPEni9PT+QPXuuAjb9pQ1bqg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Jaxson Han <jaxson.han@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 13 Oct 2022 14:30:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 13/10/2022 14:20, Julien Grall wrote:
On 13/10/2022 12:47, Ayan Kumar Halder wrote:
Hi Arm mantainers/Folks,

Hello,

Hi Julien,

Appreciate your help as always. :)


Please refer to the discussion https://github.com/zephyrproject-rtos/zephyr/pull/51163 .

We intend to run Zephyr as a domU guest on Xen on Aarch32_v8R fixed virtual platform.

Zephyr is trying to read GICR_TYPER which is a 64 bit register using ldrd instruction.

As GICR is emulated by Xen, so this instruction gets trapped with HSR = 0x9200000c.

As ISV is 0, so Xen cannot emulate this instruction.

The proposed solution is to use two sys_read32() on GICR_TYPER to return the lower and upper 32 bits.

With this, HSR = 0x9383 000c, ISV=1 so ISS is valid.

Now, for Xen to emulate this read, I have proposed the modifications (in my last comment).

I am confused. Looking at the emulation of GICR_TYPER in Xen (arch/arm/vgic-v3.c), the code should already be able to handle 32-bit access.

When I compile Xen for arm32, vreg_reg64_extract() definitions do not exist.

The reason being https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/arm/include/asm/vreg.h;h=f26a70d024e2d1f933ea66793ea6e42f81c7a8cf;hb=9029bc265cdf2bd63376dde9fdd91db4ce9c0586#l189 , BITS_PER_LONG is 32 (Refer xen/arch/arm/include/asm/config.h).

.Thus, the guest need to invoke sys_read32() twice (GICR_TYPER and GICR_TYPER+4).



I doesn't look like we need to modify Xen. What did I miss?

Cheers,




 


Rackspace

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