qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Ard Biesheuvel <ardb@kernel.org>, qemu-arm@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Alex Bennee <alex.bennee@linaro.org>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] target/arm/cpu64: Use 32-bit GDBstub when running in 32-bit KVM mode
Date: Fri, 7 Jan 2022 12:29:25 -0800	[thread overview]
Message-ID: <6a8576f3-2e45-a58d-7a56-692a8bba54f7@linaro.org> (raw)
In-Reply-To: <20220107155406.344273-1-ardb@kernel.org>

On 1/7/22 7:54 AM, Ard Biesheuvel wrote:
> diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
> index 15245a60a8c7..3dede9e2ec31 100644
> --- a/target/arm/cpu64.c
> +++ b/target/arm/cpu64.c
> @@ -903,9 +903,15 @@ static bool aarch64_cpu_get_aarch64(Object *obj, Error **errp)
>       return arm_feature(&cpu->env, ARM_FEATURE_AARCH64);
>   }
>   
> +static gchar *arm_gdb_arch_name(CPUState *cs)
> +{
> +    return g_strdup("arm");
> +}
> +
>   static void aarch64_cpu_set_aarch64(Object *obj, bool value, Error **errp)
>   {
>       ARMCPU *cpu = ARM_CPU(obj);
> +    CPUClass *cc = CPU_GET_CLASS(obj);
>   
>       /* At this time, this property is only allowed if KVM is enabled.  This
>        * restriction allows us to avoid fixing up functionality that assumes a
> @@ -919,6 +925,12 @@ static void aarch64_cpu_set_aarch64(Object *obj, bool value, Error **errp)
>               return;
>           }
>           unset_feature(&cpu->env, ARM_FEATURE_AARCH64);
> +
> +        cc->gdb_read_register = arm_cpu_gdb_read_register;
> +        cc->gdb_write_register = arm_cpu_gdb_write_register;
> +        cc->gdb_num_core_regs = 26;
> +        cc->gdb_core_xml_file = "arm-core.xml";
> +        cc->gdb_arch_name = arm_gdb_arch_name;

It would be nice to split out a function in cpu.c for this,
perhaps arm_cpu_class_gdb_init().

Otherwise this looks like the correct approach.


r~


      reply	other threads:[~2022-01-07 20:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 15:54 [PATCH] target/arm/cpu64: Use 32-bit GDBstub when running in 32-bit KVM mode Ard Biesheuvel
2022-01-07 20:29 ` Richard Henderson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a8576f3-2e45-a58d-7a56-692a8bba54f7@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=ardb@kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).