All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] target/riscv: fix user-mode build issue because mhartid
@ 2022-06-27 16:40 Rahul Pathak
  2022-06-29  2:01 ` Alistair Francis
  0 siblings, 1 reply; 7+ messages in thread
From: Rahul Pathak @ 2022-06-27 16:40 UTC (permalink / raw)
  To: qemu-riscv, qemu-devel
  Cc: alistair.francis, bmeng.cn, palmer, apatel, rpathak,
	rpathakmailbox, victor.colombo

mhartid csr is not available in user-mode code path and
user-mode build fails because of its reference in
riscv_cpu_realize function

Commit causing the issue is currently in Alistair's
riscv-to-apply.next branch and need to be squashed there.

Fixes: 7ecee770d40 ("target/riscv: Force disable extensions if priv spec version does not match")

Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
---

Changes in V2:
- remove the stray format specifier
- add the Fixes tag and reference to external tree
---
 target/riscv/cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index e4ec05abf4..509923f15e 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -636,9 +636,15 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
         if (isa_ext_is_enabled(cpu, &isa_edata_arr[i]) &&
             (env->priv_ver < isa_edata_arr[i].min_version)) {
             isa_ext_update_enabled(cpu, &isa_edata_arr[i], false);
+#ifndef CONFIG_USER_ONLY
             warn_report("disabling %s extension for hart 0x%lx because "
                         "privilege spec version does not match",
                         isa_edata_arr[i].name, (unsigned long)env->mhartid);
+#else
+            warn_report("disabling %s extension for hart because "
+                        "privilege spec version does not match",
+                        isa_edata_arr[i].name);
+#endif
         }
     }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] target/riscv: fix user-mode build issue because mhartid
  2022-06-27 16:40 [PATCH v2] target/riscv: fix user-mode build issue because mhartid Rahul Pathak
@ 2022-06-29  2:01 ` Alistair Francis
  2022-06-29  2:07   ` Rahul Pathak
  0 siblings, 1 reply; 7+ messages in thread
From: Alistair Francis @ 2022-06-29  2:01 UTC (permalink / raw)
  To: Rahul Pathak
  Cc: open list:RISC-V, qemu-devel@nongnu.org Developers,
	Alistair Francis, Bin Meng, Palmer Dabbelt, Anup Patel,
	Rahul Pathak, Víctor Colombo

On Tue, Jun 28, 2022 at 3:03 AM Rahul Pathak <rpathak@ventanamicro.com> wrote:
>
> mhartid csr is not available in user-mode code path and
> user-mode build fails because of its reference in
> riscv_cpu_realize function
>
> Commit causing the issue is currently in Alistair's
> riscv-to-apply.next branch and need to be squashed there.
>
> Fixes: 7ecee770d40 ("target/riscv: Force disable extensions if priv spec version does not match")

Can you please re-send the original patch with the fix? I have removed
this patch from my tree

Alistair

>
> Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
> ---
>
> Changes in V2:
> - remove the stray format specifier
> - add the Fixes tag and reference to external tree
> ---
>  target/riscv/cpu.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index e4ec05abf4..509923f15e 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -636,9 +636,15 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
>          if (isa_ext_is_enabled(cpu, &isa_edata_arr[i]) &&
>              (env->priv_ver < isa_edata_arr[i].min_version)) {
>              isa_ext_update_enabled(cpu, &isa_edata_arr[i], false);
> +#ifndef CONFIG_USER_ONLY
>              warn_report("disabling %s extension for hart 0x%lx because "
>                          "privilege spec version does not match",
>                          isa_edata_arr[i].name, (unsigned long)env->mhartid);
> +#else
> +            warn_report("disabling %s extension for hart because "
> +                        "privilege spec version does not match",
> +                        isa_edata_arr[i].name);
> +#endif
>          }
>      }
>
> --
> 2.34.1
>
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] target/riscv: fix user-mode build issue because mhartid
  2022-06-29  2:01 ` Alistair Francis
@ 2022-06-29  2:07   ` Rahul Pathak
  2022-06-29  3:52     ` Bin Meng
  0 siblings, 1 reply; 7+ messages in thread
From: Rahul Pathak @ 2022-06-29  2:07 UTC (permalink / raw)
  To: Alistair Francis
  Cc: open list:RISC-V, qemu-devel@nongnu.org Developers,
	Alistair Francis, Bin Meng, Palmer Dabbelt, Anup Patel,
	Rahul Pathak, Víctor Colombo

Hi Alistair

My fix patch needs to be dropped since Anup took care of this issue
in his yesterdays series update in this patch -
[PATCH v8 4/4] target/riscv: Force disable extensions if priv spec
version does not match

Thanks
Rahul

On Wed, Jun 29, 2022 at 7:32 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Tue, Jun 28, 2022 at 3:03 AM Rahul Pathak <rpathak@ventanamicro.com> wrote:
> >
> > mhartid csr is not available in user-mode code path and
> > user-mode build fails because of its reference in
> > riscv_cpu_realize function
> >
> > Commit causing the issue is currently in Alistair's
> > riscv-to-apply.next branch and need to be squashed there.
> >
> > Fixes: 7ecee770d40 ("target/riscv: Force disable extensions if priv spec version does not match")
>
> Can you please re-send the original patch with the fix? I have removed
> this patch from my tree
>
> Alistair
>
> >
> > Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
> > ---
> >
> > Changes in V2:
> > - remove the stray format specifier
> > - add the Fixes tag and reference to external tree
> > ---
> >  target/riscv/cpu.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> > index e4ec05abf4..509923f15e 100644
> > --- a/target/riscv/cpu.c
> > +++ b/target/riscv/cpu.c
> > @@ -636,9 +636,15 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
> >          if (isa_ext_is_enabled(cpu, &isa_edata_arr[i]) &&
> >              (env->priv_ver < isa_edata_arr[i].min_version)) {
> >              isa_ext_update_enabled(cpu, &isa_edata_arr[i], false);
> > +#ifndef CONFIG_USER_ONLY
> >              warn_report("disabling %s extension for hart 0x%lx because "
> >                          "privilege spec version does not match",
> >                          isa_edata_arr[i].name, (unsigned long)env->mhartid);
> > +#else
> > +            warn_report("disabling %s extension for hart because "
> > +                        "privilege spec version does not match",
> > +                        isa_edata_arr[i].name);
> > +#endif
> >          }
> >      }
> >
> > --
> > 2.34.1
> >
> >



-- 

Thanks
Rahul Pathak


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] target/riscv: fix user-mode build issue because mhartid
  2022-06-29  2:07   ` Rahul Pathak
@ 2022-06-29  3:52     ` Bin Meng
  2022-06-29  4:30       ` Anup Patel
  0 siblings, 1 reply; 7+ messages in thread
From: Bin Meng @ 2022-06-29  3:52 UTC (permalink / raw)
  To: Rahul Pathak
  Cc: Alistair Francis, open list:RISC-V,
	qemu-devel@nongnu.org Developers, Alistair Francis,
	Palmer Dabbelt, Anup Patel, Rahul Pathak, Víctor Colombo

Hi Rahul,

On Wed, Jun 29, 2022 at 10:07 AM Rahul Pathak <rpathak@ventanamicro.com> wrote:
>
> Hi Alistair
>
> My fix patch needs to be dropped since Anup took care of this issue
> in his yesterdays series update in this patch -
> [PATCH v8 4/4] target/riscv: Force disable extensions if priv spec
> version does not match

I don't understand. Each patch should keep bisectability.

This sounds like to me, that
[PATCH v8 4/4] target/riscv: Force disable extensions if priv spec
version does not match

has an issue that it does 2 things: one is to fix this bug, and the
other one is to force disable extensions.

Which is not right.

Regards,
Bin


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] target/riscv: fix user-mode build issue because mhartid
  2022-06-29  3:52     ` Bin Meng
@ 2022-06-29  4:30       ` Anup Patel
  0 siblings, 0 replies; 7+ messages in thread
From: Anup Patel @ 2022-06-29  4:30 UTC (permalink / raw)
  To: Bin Meng
  Cc: Rahul Pathak, Alistair Francis, open list:RISC-V,
	qemu-devel@nongnu.org Developers, Alistair Francis,
	Palmer Dabbelt, Anup Patel, Rahul Pathak, Víctor Colombo

On Wed, Jun 29, 2022 at 9:27 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Rahul,
>
> On Wed, Jun 29, 2022 at 10:07 AM Rahul Pathak <rpathak@ventanamicro.com> wrote:
> >
> > Hi Alistair
> >
> > My fix patch needs to be dropped since Anup took care of this issue
> > in his yesterdays series update in this patch -
> > [PATCH v8 4/4] target/riscv: Force disable extensions if priv spec
> > version does not match
>
> I don't understand. Each patch should keep bisectability.

The patches are already bisectable. There was a compile error until
v6 which was fixed in v7 by squashing this patch into PATCH4.

>
> This sounds like to me, that
> [PATCH v8 4/4] target/riscv: Force disable extensions if priv spec
> version does not match
>
> has an issue that it does 2 things: one is to fix this bug, and the
> other one is to force disable extensions.
>
> Which is not right.

The bug is fixed as a result of force disabling extensions which
don't match the priv spec version.

Regards,
Anup


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] target/riscv: fix user-mode build issue because mhartid
  2022-06-27 16:49 Rahul Pathak
@ 2022-06-27 17:01 ` Rahul Pathak
  0 siblings, 0 replies; 7+ messages in thread
From: Rahul Pathak @ 2022-06-27 17:01 UTC (permalink / raw)
  To: open list:RISC-V, qemu-devel@nongnu.org Developers
  Cc: Alistair Francis, Bin Meng, Palmer Dabbelt, Anup Patel,
	Rahul Pathak, victor.colombo

Sorry for spamming but my send-email script misbehaved
and sent the v2 patch two times. Please ignore one of
the v2 patch

On Mon, Jun 27, 2022 at 10:20 PM Rahul Pathak <rpathak@ventanamicro.com> wrote:
>
> mhartid csr is not available in user-mode code path and
> user-mode build fails because of its reference in
> riscv_cpu_realize function
>
> Commit causing the issue is currently in Alistair's
> riscv-to-apply.next branch and need to be squashed there.
>
> Fixes: 7ecee770d40 ("target/riscv: Force disable extensions if priv spec version does not match")
>
> Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
> ---
>
> Changes in V2:
> - remove the stray format specifier
> - add the Fixes tag and reference to external tree
> ---
>  target/riscv/cpu.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index e4ec05abf4..509923f15e 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -636,9 +636,15 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
>          if (isa_ext_is_enabled(cpu, &isa_edata_arr[i]) &&
>              (env->priv_ver < isa_edata_arr[i].min_version)) {
>              isa_ext_update_enabled(cpu, &isa_edata_arr[i], false);
> +#ifndef CONFIG_USER_ONLY
>              warn_report("disabling %s extension for hart 0x%lx because "
>                          "privilege spec version does not match",
>                          isa_edata_arr[i].name, (unsigned long)env->mhartid);
> +#else
> +            warn_report("disabling %s extension for hart because "
> +                        "privilege spec version does not match",
> +                        isa_edata_arr[i].name);
> +#endif
>          }
>      }
>
> --
> 2.34.1
>


-- 

Thanks
Rahul Pathak


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] target/riscv: fix user-mode build issue because mhartid
@ 2022-06-27 16:49 Rahul Pathak
  2022-06-27 17:01 ` Rahul Pathak
  0 siblings, 1 reply; 7+ messages in thread
From: Rahul Pathak @ 2022-06-27 16:49 UTC (permalink / raw)
  To: qemu-riscv, qemu-devel
  Cc: alistair.francis, bmeng.cn, palmer, apatel, rpathak,
	rpathakmailbox, victor.colombo

mhartid csr is not available in user-mode code path and
user-mode build fails because of its reference in
riscv_cpu_realize function

Commit causing the issue is currently in Alistair's
riscv-to-apply.next branch and need to be squashed there.

Fixes: 7ecee770d40 ("target/riscv: Force disable extensions if priv spec version does not match")

Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
---

Changes in V2:
- remove the stray format specifier
- add the Fixes tag and reference to external tree
---
 target/riscv/cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index e4ec05abf4..509923f15e 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -636,9 +636,15 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
         if (isa_ext_is_enabled(cpu, &isa_edata_arr[i]) &&
             (env->priv_ver < isa_edata_arr[i].min_version)) {
             isa_ext_update_enabled(cpu, &isa_edata_arr[i], false);
+#ifndef CONFIG_USER_ONLY
             warn_report("disabling %s extension for hart 0x%lx because "
                         "privilege spec version does not match",
                         isa_edata_arr[i].name, (unsigned long)env->mhartid);
+#else
+            warn_report("disabling %s extension for hart because "
+                        "privilege spec version does not match",
+                        isa_edata_arr[i].name);
+#endif
         }
     }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-29  4:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 16:40 [PATCH v2] target/riscv: fix user-mode build issue because mhartid Rahul Pathak
2022-06-29  2:01 ` Alistair Francis
2022-06-29  2:07   ` Rahul Pathak
2022-06-29  3:52     ` Bin Meng
2022-06-29  4:30       ` Anup Patel
2022-06-27 16:49 Rahul Pathak
2022-06-27 17:01 ` Rahul Pathak

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.