qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/riscv: Fix page_check_range use in fault-only-first
@ 2023-07-29  3:16 LIU Zhiwei
  2023-07-29 21:18 ` Richard Henderson
  2023-08-02 13:30 ` Alistair Francis
  0 siblings, 2 replies; 4+ messages in thread
From: LIU Zhiwei @ 2023-07-29  3:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alistair.Francis, palmer, bin.meng, liweiwei, dbarboza,
	qemu-riscv, richard.henderson, LIU Zhiwei

Commit bef6f008b98(accel/tcg: Return bool from page_check_range) converts
integer return value to bool type. However, it wrongly converted the use
of the API in riscv fault-only-first, where page_check_range < = 0, should
be converted to !page_check_range.

Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
---
 target/riscv/vector_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
index 4d06754826..a059ef3900 100644
--- a/target/riscv/vector_helper.c
+++ b/target/riscv/vector_helper.c
@@ -583,7 +583,7 @@ vext_ldff(void *vd, void *v0, target_ulong base,
                                          cpu_mmu_index(env, false));
                 if (host) {
 #ifdef CONFIG_USER_ONLY
-                    if (page_check_range(addr, offset, PAGE_READ)) {
+                    if (!page_check_range(addr, offset, PAGE_READ)) {
                         vl = i;
                         goto ProbeSuccess;
                     }
-- 
2.17.1



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

* Re: [PATCH] target/riscv: Fix page_check_range use in fault-only-first
  2023-07-29  3:16 [PATCH] target/riscv: Fix page_check_range use in fault-only-first LIU Zhiwei
@ 2023-07-29 21:18 ` Richard Henderson
  2023-08-01  3:37   ` LIU Zhiwei
  2023-08-02 13:30 ` Alistair Francis
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2023-07-29 21:18 UTC (permalink / raw)
  To: LIU Zhiwei, qemu-devel
  Cc: Alistair.Francis, palmer, bin.meng, liweiwei, dbarboza,
	qemu-riscv

On 7/28/23 20:16, LIU Zhiwei wrote:
> Commit bef6f008b98(accel/tcg: Return bool from page_check_range) converts
> integer return value to bool type. However, it wrongly converted the use
> of the API in riscv fault-only-first, where page_check_range < = 0, should
> be converted to !page_check_range.
> 
> Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
> ---
>   target/riscv/vector_helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

As far as it goes,

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

though the test will never fail, because tlb_vaddr_to_host just succeeded.


r~


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

* Re: [PATCH] target/riscv: Fix page_check_range use in fault-only-first
  2023-07-29 21:18 ` Richard Henderson
@ 2023-08-01  3:37   ` LIU Zhiwei
  0 siblings, 0 replies; 4+ messages in thread
From: LIU Zhiwei @ 2023-08-01  3:37 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel
  Cc: Alistair.Francis, palmer, bin.meng, liweiwei, dbarboza,
	qemu-riscv


On 2023/7/30 5:18, Richard Henderson wrote:
> On 7/28/23 20:16, LIU Zhiwei wrote:
>> Commit bef6f008b98(accel/tcg: Return bool from page_check_range) 
>> converts
>> integer return value to bool type. However, it wrongly converted the use
>> of the API in riscv fault-only-first, where page_check_range < = 0, 
>> should
>> be converted to !page_check_range.
>>
>> Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
>> ---
>>   target/riscv/vector_helper.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> As far as it goes,
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
> though the test will never fail, because tlb_vaddr_to_host just 
> succeeded.

It fails one test case in linux-user mode, where tlb_vaddr_to_host 
always succeeded.

Zhiwei

>
>
> r~


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

* Re: [PATCH] target/riscv: Fix page_check_range use in fault-only-first
  2023-07-29  3:16 [PATCH] target/riscv: Fix page_check_range use in fault-only-first LIU Zhiwei
  2023-07-29 21:18 ` Richard Henderson
@ 2023-08-02 13:30 ` Alistair Francis
  1 sibling, 0 replies; 4+ messages in thread
From: Alistair Francis @ 2023-08-02 13:30 UTC (permalink / raw)
  To: LIU Zhiwei
  Cc: qemu-devel, Alistair.Francis, palmer, bin.meng, liweiwei,
	dbarboza, qemu-riscv, richard.henderson

On Fri, Jul 28, 2023 at 11:34 PM LIU Zhiwei
<zhiwei_liu@linux.alibaba.com> wrote:
>
> Commit bef6f008b98(accel/tcg: Return bool from page_check_range) converts
> integer return value to bool type. However, it wrongly converted the use
> of the API in riscv fault-only-first, where page_check_range < = 0, should
> be converted to !page_check_range.
>
> Signed-off-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>

Thanks!

Applied to riscv-to-apply.next

Alistair

> ---
>  target/riscv/vector_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
> index 4d06754826..a059ef3900 100644
> --- a/target/riscv/vector_helper.c
> +++ b/target/riscv/vector_helper.c
> @@ -583,7 +583,7 @@ vext_ldff(void *vd, void *v0, target_ulong base,
>                                           cpu_mmu_index(env, false));
>                  if (host) {
>  #ifdef CONFIG_USER_ONLY
> -                    if (page_check_range(addr, offset, PAGE_READ)) {
> +                    if (!page_check_range(addr, offset, PAGE_READ)) {
>                          vl = i;
>                          goto ProbeSuccess;
>                      }
> --
> 2.17.1
>
>


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

end of thread, other threads:[~2023-08-02 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-29  3:16 [PATCH] target/riscv: Fix page_check_range use in fault-only-first LIU Zhiwei
2023-07-29 21:18 ` Richard Henderson
2023-08-01  3:37   ` LIU Zhiwei
2023-08-02 13:30 ` Alistair Francis

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).