public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Upton <oliver.upton@linux.dev>
To: Colton Lewis <coltonlewis@google.com>
Cc: kvm@vger.kernel.org, Marc Zyngier <maz@kernel.org>,
	James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Ricardo Koller <ricarkol@google.com>,
	kvmarm@lists.linux.dev
Subject: Re: [PATCH v3 1/3] KVM: arm64: selftests: Standardize GIC base addresses
Date: Wed, 22 Nov 2023 17:43:55 +0000	[thread overview]
Message-ID: <ZV4924juGGCk2cjf@linux.dev> (raw)
In-Reply-To: <20231103192915.2209393-2-coltonlewis@google.com>

On Fri, Nov 03, 2023 at 07:29:13PM +0000, Colton Lewis wrote:
> Use default values during GIC initialization and setup to avoid
> multiple tests needing to decide and declare base addresses for GICD
> and GICR. Remove the repeated definitions of these addresses across
> tests.
> 
> Signed-off-by: Colton Lewis <coltonlewis@google.com>

<snip>

> -void gic_init(enum gic_type type, unsigned int nr_cpus,
> +void _gic_init(enum gic_type type, unsigned int nr_cpus,
>  		void *dist_base, void *redist_base)
>  {
>  	uint32_t cpu = guest_get_vcpuid();
> @@ -63,6 +63,11 @@ void gic_init(enum gic_type type, unsigned int nr_cpus,
>  	gic_cpu_init(cpu, redist_base);
>  }
>  
> +void gic_init(enum gic_type type, unsigned int nr_cpus)
> +{
> +	_gic_init(type, nr_cpus, (void *)GICD_BASE_GPA, (void *)GICR_BASE_GPA);
> +}
> +

</snip>

> -int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs,
> +int _vgic_v3_setup(struct kvm_vm *vm, uint32_t nr_vcpus, uint32_t nr_irqs,
>  		uint64_t gicd_base_gpa, uint64_t gicr_base_gpa)
>  {
>  	int gic_fd;
> @@ -79,6 +79,11 @@ int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs,
>  	return gic_fd;
>  }
>  
> +int vgic_v3_setup(struct kvm_vm *vm, uint32_t nr_vcpus, uint32_t nr_irqs)
> +{
> +	return _vgic_v3_setup(vm, nr_vcpus, nr_irqs, GICD_BASE_GPA, GICR_BASE_GPA);
> +}
> +

What's the point of having the internal implementations of these
functions that still take addresses? If we're standardizing GIC
placement then there's no need for allowing the caller to provide
different addresses.

-- 
Thanks,
Oliver

  reply	other threads:[~2023-11-22 17:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03 19:29 [PATCH v3 0/3] Add arch_timer_edge_cases selftest Colton Lewis
2023-11-03 19:29 ` [PATCH v3 1/3] KVM: arm64: selftests: Standardize GIC base addresses Colton Lewis
2023-11-22 17:43   ` Oliver Upton [this message]
2023-12-08 21:01     ` Colton Lewis
2023-11-03 19:29 ` [PATCH v3 2/3] KVM: arm64: selftests: Guarantee interrupts are handled Colton Lewis
2023-11-03 22:16   ` Oliver Upton
2023-11-07 18:45     ` Colton Lewis
2023-11-03 19:29 ` [PATCH v3 3/3] KVM: arm64: selftests: Add arch_timer_edge_cases selftest Colton Lewis
2023-11-22 20:26   ` Oliver Upton
2023-12-08 21:01     ` Colton Lewis

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=ZV4924juGGCk2cjf@linux.dev \
    --to=oliver.upton@linux.dev \
    --cc=coltonlewis@google.com \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=ricarkol@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=yuzenghui@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