qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Alexey Baturo <baturo.alexey@gmail.com>
Cc: qemu-riscv@nongnu.org, sagark@eecs.berkeley.edu,
	kbastian@mail.uni-paderborn.de, Bin Meng <bin.meng@windriver.com>,
	qemu-devel@nongnu.org, space.monkey.delivers@gmail.com,
	Alistair.Francis@wdc.com, kupokupokupopo@gmail.com,
	palmer@dabbelt.com
Subject: Re: [PATCH v13 6/7] [RISCV_PM] Implement address masking functions required for RISC-V Pointer Masking extension
Date: Fri, 15 Oct 2021 17:01:20 -0700	[thread overview]
Message-ID: <c66f7198-362e-8311-b063-e88b018044b1@linaro.org> (raw)
In-Reply-To: <20211015192931.227387-7-space.monkey.delivers@gmail.com>

On 10/15/21 12:29 PM, Alexey Baturo wrote:
>   FIELD(TB_FLAGS, MSTATUS_HS_FS, 10, 2)
> +/* If PointerMasking should be applied */
> +FIELD(TB_FLAGS, PM_ENABLED, 10, 1)

Merge error.

> +    if (riscv_has_ext(env, RVJ)) {
> +        int priv = cpu_mmu_index(env, false) & TB_FLAGS_PRIV_MMU_MASK;

cpu_mmu_index has already been computed.
You want

     int priv = flags & TB_FLAGS_PRIV_MMU_MASK;

> @@ -118,16 +125,6 @@ static void gen_nanbox_s(TCGv_i64 out, TCGv_i64 in)
>      tcg_gen_ori_i64(out, in, MAKE_64BIT_MASK(32, 32));
>  }
>  
> -/*
> - * Temp stub: generates address adjustment for PointerMasking
> - */
> -static void gen_pm_adjust_address(DisasContext *s,
> -                                  TCGv         *dst,
> -                                  TCGv          src)
> -{
> -    tcg_gen_mov_tl(*dst, src);
> -}
> -

You might as well place the function correctly in the previous patch.
Drop the silly alignment of parameters.

> +    int priv = cpu_mmu_index(env, false) & TB_FLAGS_PRIV_MMU_MASK;
> +    ctx->pm_mask = pm_mask[priv];

Using cpu_mmu_index within the translator is incorrect.  You want

     priv = tb_flags & TB_FLAGS_PRIV_MMU_MASK;


r~


  reply	other threads:[~2021-10-16  0:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 19:29 [PATCH v13 0/7] RISC-V Pointer Masking implementatio Alexey Baturo
2021-10-15 19:29 ` [PATCH v13 1/7] [RISCV_PM] Add J-extension into RISC-V Alexey Baturo
2021-10-15 19:29 ` [PATCH v13 2/7] [RISCV_PM] Add CSR defines for RISC-V PM extension Alexey Baturo
2021-10-15 19:29 ` [PATCH v13 3/7] [RISCV_PM] Support CSRs required for RISC-V PM extension except for the h-mode Alexey Baturo
2021-10-16  0:03   ` Richard Henderson
2021-10-15 19:29 ` [PATCH v13 4/7] [RISCV_PM] Print new PM CSRs in QEMU logs Alexey Baturo
2021-10-15 19:29 ` [PATCH v13 5/7] [RISCV_PM] Support pointer masking for RISC-V for i/c/f/d/a types of instructions Alexey Baturo
2021-10-15 23:49   ` Richard Henderson
2021-10-17 17:21     ` Alexey Baturo
2021-10-15 19:29 ` [PATCH v13 6/7] [RISCV_PM] Implement address masking functions required for RISC-V Pointer Masking extension Alexey Baturo
2021-10-16  0:01   ` Richard Henderson [this message]
2021-10-17 17:14     ` Alexey Baturo
2021-10-15 19:29 ` [PATCH v13 7/7] [RISCV_PM] Allow experimental J-ext to be turned on Alexey Baturo
2021-10-16  0:04   ` Richard Henderson

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=c66f7198-362e-8311-b063-e88b018044b1@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=Alistair.Francis@wdc.com \
    --cc=baturo.alexey@gmail.com \
    --cc=bin.meng@windriver.com \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=kupokupokupopo@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=sagark@eecs.berkeley.edu \
    --cc=space.monkey.delivers@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).