qemu-riscv
[Top][All Lists]
Advanced

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

Re: [RFC v2 16/76] target/riscv: rvv-0.9: add VMA and VTA


From: Richard Henderson
Subject: Re: [RFC v2 16/76] target/riscv: rvv-0.9: add VMA and VTA
Date: Wed, 22 Jul 2020 11:00:26 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 7/22/20 2:15 AM, frank.chang@sifive.com wrote:
> -static void vext_clear(void *tail, uint32_t cnt, uint32_t tot)
> +static void vext_clear(void *tail, uint32_t vta, uint32_t cnt, uint32_t tot)
>  {
> +    if (vta == 0) {
> +        /* tail element undisturbed */
> +        return;
> +    }
> +
>      /*
> +     * Tail element agnostic.
>       * Split the remaining range to two parts.
>       * The first part is in the last uint64_t unit.
>       * The second part start from the next uint64_t unit.
> @@ -152,41 +168,50 @@ static void vext_clear(void *tail, uint32_t cnt, 
> uint32_t tot)
>      if (cnt % 8) {
>          part1 = 8 - (cnt % 8);
>          part2 = tot - cnt - part1;
> -        memset((void *)((uintptr_t)tail & ~(7ULL)), 0, part1);
> -        memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 0, part2);
> +        memset((void *)((uintptr_t)tail & ~(7ULL)), 1, part1);
> +        memset((void *)(((uintptr_t)tail + 8) & ~(7ULL)), 1, part2);
>      } else {
> -        memset(tail, 0, part2);
> +        memset(tail, 1, part2);
>      }
>  }

"1s" surely means all bits set to 1, not each byte to 1.

Is there any reason to do anything with VTA/VMA at all?  One alternative for
"agnostic" is to leave the values undisturbed.  So the quickest thing for qemu
to do is remove all of this code.  Then we don't have to pass the values in
translate either.

Which is exactly what is recommended in the 4th paragraph of the notes
following the VTA/VMA description.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]