All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Connor Davis <connojdavis@gmail.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5 2/2] xen/riscv: introduce identity mapping
Date: Mon, 31 Jul 2023 16:07:41 +0200	[thread overview]
Message-ID: <911eba8e-a92b-896c-e5dc-e54dcd570664@suse.com> (raw)
In-Reply-To: <ab2e719bbe071c3d5c4e3341573c0848dfcee3ee.1690464789.git.oleksii.kurochko@gmail.com>

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


  reply	other threads:[~2023-07-31 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 13:37 [PATCH v5 0/2] xen/riscv: introduce identity mapping Oleksii Kurochko
2023-07-27 13:38 ` [PATCH v5 1/2] xen/riscv: introduce function for physical offset calculation Oleksii Kurochko
2023-07-27 13:38 ` [PATCH v5 2/2] xen/riscv: introduce identity mapping Oleksii Kurochko
2023-07-31 14:07   ` Jan Beulich [this message]
2023-08-01  8:50     ` Oleksii
2023-08-01  9:12       ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=911eba8e-a92b-896c-e5dc-e54dcd570664@suse.com \
    --to=jbeulich@suse.com \
    --cc=alistair.francis@wdc.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bobbyeshleman@gmail.com \
    --cc=connojdavis@gmail.com \
    --cc=oleksii.kurochko@gmail.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.