Skip to content

Commit

Permalink
linux-user/elfload: Set V in ELF_HWCAP for RISC-V
Browse files Browse the repository at this point in the history
Set V bit for hwcap if misa is set.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1793
Signed-off-by: Nathan Egge <negge@xiph.org>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Tested-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-Id: <20230803131424.40744-1-negge@xiph.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit 4333f09)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
negge authored and Michael Tokarev committed Sep 10, 2023
1 parent 9ba474e commit 50a3c9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion linux-user/elfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,8 @@ static uint32_t get_elf_hwcap(void)
#define MISA_BIT(EXT) (1 << (EXT - 'A'))
RISCVCPU *cpu = RISCV_CPU(thread_cpu);
uint32_t mask = MISA_BIT('I') | MISA_BIT('M') | MISA_BIT('A')
| MISA_BIT('F') | MISA_BIT('D') | MISA_BIT('C');
| MISA_BIT('F') | MISA_BIT('D') | MISA_BIT('C')
| MISA_BIT('V');

return cpu->env.misa_ext & mask;
#undef MISA_BIT
Expand Down

0 comments on commit 50a3c9a

Please sign in to comment.