qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Ying Fang <fangying1@huawei.com>
Cc: Andrew Jones <drjones@redhat.com>, qemu-arm <qemu-arm@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	wu.wubin@huawei.com,
	zhanghailiang <zhang.zhanghailiang@huawei.com>
Subject: Re: [PATCH] target/arm/cpu: adjust virtual time for cortex series cpu
Date: Mon, 1 Jun 2020 13:41:01 +0100	[thread overview]
Message-ID: <CAFEAcA91gsTpkeH6SVPoGKDFOgCJVxV=wvBOT57eagcYeMiarQ@mail.gmail.com> (raw)
In-Reply-To: <20200530092204.1746-1-fangying1@huawei.com>

On Sat, 30 May 2020 at 10:22, Ying Fang <fangying1@huawei.com> wrote:
>
> Virtual time adjustment was implemented for virt-5.0 machine type,
> but the cpu property was enabled only for host-passthrough and
> max cpu model. Let's add it for arm cortex series cpu which has
> the gernic timer feature enabled.
>
> Signed-off-by: Ying Fang <fangying1@huawei.com>
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index 32bec156f2..a564141b22 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -1973,6 +1973,9 @@ static void cortex_a7_initfn(Object *obj)
>      cpu->ccsidr[1] = 0x201fe00a; /* 32K L1 icache */
>      cpu->ccsidr[2] = 0x711fe07a; /* 4096K L2 unified cache */
>      define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */
> +    if (kvm_enabled()) {
> +        kvm_arm_add_vcpu_properties(obj);
> +    }
>  }

If we have the same bit of code in all these initfns,
that suggests we should probably actually be doing this
in some more generic place conditional on some cpu feature
or other test. The commit message suggests we should add
this property for every CPU which is using KVM and has
the generic timers, in which case we could perhaps
have the call to kvm_arm_add_vcpu_properties moved to
arm_cpu_post_init(), and then have the kvm_arm_add_vcpu_properties
function check the ARM_FEATURE_GENERIC_TIMER flag to see
whether to add the property or not.

thanks
-- PMM


  reply	other threads:[~2020-06-01 12:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30  9:22 [PATCH] target/arm/cpu: adjust virtual time for cortex series cpu Ying Fang
2020-06-01 12:41 ` Peter Maydell [this message]
2020-06-03  1:04   ` Ying Fang

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='CAFEAcA91gsTpkeH6SVPoGKDFOgCJVxV=wvBOT57eagcYeMiarQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=drjones@redhat.com \
    --cc=fangying1@huawei.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wu.wubin@huawei.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /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).