[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 3/6] target/riscv: Add helper functions to calculate curre
From: |
Deepak Gupta |
Subject: |
Re: [PATCH v4 3/6] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking |
Date: |
Thu, 18 Jan 2024 09:21:00 -0800 |
On Tue, Jan 9, 2024 at 2:31 AM Alexey Baturo <baturo.alexey@gmail.com> wrote:
>
> From: Alexey Baturo <baturo.alexey@gmail.com>
>
> Signed-off-by: Alexey Baturo <baturo.alexey@gmail.com>
> ---
> +
> +bool riscv_cpu_virt_mem_enabled(CPURISCVState *env)
> +{
> + bool virt_mem_en = false;
> +#ifndef CONFIG_USER_ONLY
> + int satp_mode = 0;
> + int priv_mode = cpu_address_mode(env);
> + /* Get current PMM field */
> + if (riscv_cpu_mxl(env) == MXL_RV32) {
> + satp_mode = get_field(env->satp, SATP32_MODE);
> + } else {
> + satp_mode = get_field(env->satp, SATP64_MODE);
> + }
> + virt_mem_en = ((satp_mode != VM_1_10_MBARE) && (priv_mode != PRV_M));
> +#endif
> + return virt_mem_en;
Obsessing a little bit on how to test PM enabled binaries with qemu-user.
If we return false above then we're not allowed to test binaries with
pointer masking enabled with qemu-user.
That use case is not required?
> +}
> +
> +int riscv_pm_get_pmlen(RISCVPmPmm pmm)
> +{
> + switch (pmm) {
> + case PMM_FIELD_DISABLED:
> + return 0;
> + case PMM_FIELD_PMLEN7:
> + return 7;
> + case PMM_FIELD_PMLEN16:
> + return 16;
> + default:
> + g_assert_not_reached();
> + }
> + return -1;
> +}
> +
> #ifndef CONFIG_USER_ONLY
>
> /*
> --
> 2.34.1
>
>
- [PATCH v4 0/6] Pointer Masking update for Zjpm v0.8, Alexey Baturo, 2024/01/09
- [PATCH v4 1/6] target/riscv: Remove obsolete pointer masking extension code., Alexey Baturo, 2024/01/09
- [PATCH v4 2/6] target/riscv: Add new CSR fields for S{sn, mn, m}pm extensions as part of Zjpm v0.8, Alexey Baturo, 2024/01/09
- [PATCH v4 3/6] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking, Alexey Baturo, 2024/01/09
- Re: [PATCH v4 3/6] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking,
Deepak Gupta <=
- Re: [PATCH v4 3/6] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking, Richard Henderson, 2024/01/18
- Re: [PATCH v4 3/6] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking, Deepak Gupta, 2024/01/18
- Re: [PATCH v4 3/6] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking, Richard Henderson, 2024/01/20
- Re: [PATCH v4 3/6] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking, Alexey Baturo, 2024/01/21
- Re: [PATCH v4 3/6] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking, Deepak Gupta, 2024/01/23
[PATCH v4 4/6] target/riscv: Add pointer masking tb flags, Alexey Baturo, 2024/01/09
[PATCH v4 5/6] target/riscv: Update address modify functions to take into account pointer masking, Alexey Baturo, 2024/01/09
[PATCH v4 6/6] target/riscv: Enable updates for pointer masking variables and thus enable pointer masking extension, Alexey Baturo, 2024/01/09