qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v3 05/14] tcg/arm: Examine QEMU_TCG_DEBUG environment variabl


From: Peter Maydell
Subject: Re: [PATCH v3 05/14] tcg/arm: Examine QEMU_TCG_DEBUG environment variable
Date: Fri, 20 Aug 2021 12:01:53 +0100

On Wed, 18 Aug 2021 at 22:42, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Use the environment variable to test an older ISA from
> the one supported by the host.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

I think we should document this environment variable somewhere...



> +    /*
> +     * For debugging/testing purposes, allow the ISA to be reduced
> +     * (but not extended) from the set detected above.
> +     */
> +#ifdef CONFIG_DEBUG_TCG
> +    {
> +        char *opt = g_strdup(getenv("QEMU_TCG_DEBUG"));

Consider g_autofree ?

> +        if (opt) {
> +            for (char *o = strtok(opt, ","); o ; o = strtok(NULL, ",")) {
> +                if (o[0] == 'v' &&
> +                    o[1] >= '4' &&
> +                    o[1] <= '0' + arm_arch &&
> +                    o[2] == 0) {
> +                    arm_arch = o[1] - '0';
> +                    continue;
> +                }
> +                if (strcmp(o, "!neon") == 0) {
> +                    use_neon_instructions = false;
> +                    continue;
> +                }
> +                if (strcmp(o, "help") == 0) {
> +                    printf("QEMU_TCG_DEBUG=<opt>{,<opt>} where <opt> is\n"
> +                           "  v<N>   select ARMv<N>\n"
> +                           "  !neon  disable ARM NEON\n");
> +                    exit(0);
> +                }

We should complain about something in the variable we don't understand,
rather than just ignoring it.

> +            }
> +            g_free(opt);
> +        }
> +    }
> +#endif
> +

-- PMM



reply via email to

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