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

Re: [PATCH] xen/arm64: Zero the top 32 bits of gp registers on entry...


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 6 Dec 2021 15:45:49 +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=3W/txn/hWiilUjdldPJb2V129+5aZT5R3XJ2wEN0+gw=; b=fiNevMrajgFj7YLxe6pvHkWmWWgpGshh9zMPAb4pueKP24mSg5CQwN4z5IrRO4q6vMQlWrfvDz+aVGjgznW3/8uq3bWqsu5hanqrvXzh9BZCV7YFKbn8U977E82O0b+Q2xvex/eS/NjjhHnCpPhHDU33mZ3T6+9gzeWp+Q7sJtdD7EfX7yPnBk/OBHkw2SHPnDWvj54uhJHUGTWGDGkShiowghDOxj5SF5zToE37eGr+RRDnAs2+ctViYMbBU0DYIDtnjaz2KfUq3y8E4N2M6/hwxqHmzLkasnexbOdY1ppiiG3S3G0zYpFM12BqJFvUhOKL6qSErmW5aK3YBimtyw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hAKee9lki7UmMZIGbVrVMkbEj+ybYaLxZ9u6RqdmtlCS3+SlQvFJfjh/0ZtgO6kbrLiyHLHL5c7NuIP4EO5zKq+zrUBJI0XCadbdSVDCexH8CE2G5UHzN2TR5iCar8JHSlGyG/jmeW6Kn9N+B6R5H0hMVBnLlcQ49S4wsBUAgDi/L8FOD22aMBtZ+Bp1EE+EqB6zdDIxYFBBiwgHJQG8vE/kPuG08bmMth+i6y1JhSbzPG5sRYM862A/Lm8/4hkixeSYzn3nH99I3u8BYP+6i7ogFA7qf9hmRtj2ZuHMVoKXpOzE9tctJ93/m6no4cxdkPbzADCj7taJ3Ks7ke31IA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 06 Dec 2021 14:46:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.12.2021 15:20, Michal Orzel wrote:
> to hypervisor when switching to AArch32 state.

Do you perhaps mean "from AArch32 state" (also in further places below?
The 64-bit hypervisor runs in AArch64 state in all cases aiui.

> --- a/xen/arch/arm/arm64/entry.S
> +++ b/xen/arch/arm/arm64/entry.S
> @@ -109,8 +109,16 @@
>   * If 0, we rely on the on x0/x1 to have been saved at the correct
>   * position on the stack before.
>   */
> -        .macro  entry, hyp, compat, save_x0_x1=1
> +        .macro  entry, hyp, compat=0, save_x0_x1=1
>          sub     sp, sp, #(UREGS_SPSR_el1 - UREGS_LR) /* CPSR, PC, SP, LR */
> +
> +        /* Zero the upper 32 bits of the registers when switching to AArch32 
> */
> +        .if \compat == 1      /* AArch32 mode */
> +        .irp 
> nr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29
> +        mov w\nr, w\nr
> +        .endr
> +        .endif

Don't you at least want, perhaps even need to respect save_x0_x1 being
zero here?

Jan




 


Rackspace

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