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

Re: [PATCH v5 2/2] xen/riscv: introduce identity mapping


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 31 Jul 2023 16:07:41 +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=ZPLiK1XbXOnQUoytDgEAYxMT80OH8WkR05LKs9yzXXw=; b=OXJYMFL1p2smJoRIpYxPjp721ljja2mUIwpuGQB5xYF36Nv1J3lyIakK4vsNAOj3pytOsDrhA+WmqlBSOC/msm2EAbr57YIhL+F8M3hQfXZwfzyXum+dlLiOS1PQGibhPUSWt0paye+nGh0Rf8TbL/fpYgiEE+JGxAythT7qIaaOudGaSpYu7rjOF3akRw3NHIQLT0jEW5+XMWgOvggP5vasc/p44nt+fFuQzdpTAqZcK036J0RnE4qZRR6P91/r9tbydrgdoKqblftSQ7NShEHiOCrgrTxU/MNetqsK5mOmWHRLpBhQbPOt5j+sgzuImjtWw3BqXxRHSvMkR/0ZeQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LMk9JIzN8HwYkL6uQzk/ob2OV1bVkjvFxIoBBD5JCAKgnB8TvwCrMYIrDx1zvWlikunp1dHQnzWKYZ5fJAt7tgE0Kix+6+zmxYNLp0A+nIt16tB04d0JNIeuxWH4HvNjaE1vGiWulrMMVdw97DMt5Y5+Gz41TNpjxii7S8w1l1PtHSp/SJraaR5KX0XfW4wZi/1Lk8OpvgrbmSpJ9UyUZ6wm4+jq/yTNaNlpO4tbE4Wex2XaIH0dAHMH2Z807kwvJaQpzonydT60N+jAnKd7NTmGjcNoO6hR3qRnAr2n2acMy5WfbfGmBL1lHaULNS3/vBn2nA9YS0uy+AzBNncMlg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 31 Jul 2023 14:07:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.07.2023 15:38, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/riscv64/head.S
> +++ b/xen/arch/riscv/riscv64/head.S
> @@ -39,6 +39,23 @@ ENTRY(start)
>          jal     calc_phys_offset
>          mv      s2, a0
>  
> +        jal     setup_initial_pagetables
> +
> +        /* Calculate proper VA after jump from 1:1 mapping */
> +        la      t0, .L_primary_switched
> +        sub     t0, t0, s2
> +
> +        mv      a0, t0
> +        jal     turn_on_mmu

Any reason you don't do the calculation right in a0?

> @@ -54,3 +71,18 @@ ENTRY(reset_stack)
>  
>          ret
>  
> +        .section .text.ident, "ax", %progbits
> +
> +ENTRY(turn_on_mmu)
> +        sfence.vma
> +
> +        li      t0, RV_STAGE1_MODE
> +        li      t1, SATP_MODE_SHIFT
> +        sll     t0, t0, t1

Can't the last two be folded to

        slli     t0, t0, SATP_MODE_SHIFT

(I don't recall what li's valid value range is, so I'm not sure if

        li      t0, RV_STAGE1_MODE << SATP_MODE_SHIFT

would be an option.)

Everything else looks good to me now, but will of course want a
maintainer looking over.

Jan



 


Rackspace

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