Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Vladimir Murzin <vladimir.murzin@arm.com>
To: Sascha Bischoff <sascha.bischoff@arm.com>,
	will@kernel.org, julien.thierry.kdev@gmail.com
Cc: maz@kernel.org, kvm@vger.kernel.org, kvmarm@lists.linux.dev,
	timothy.hayes@arm.com, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [PATCH kvmtool v5 15/23] arm64: Describe the GICv5 IRS in the DT
Date: Thu, 19 Nov 2026 10:43:25 +0000	[thread overview]
Message-ID: <6b61fcb7-e9ee-4f25-9484-5bf7e000f148@arm.com> (raw)
In-Reply-To: <20261118175755.1946977-16-sascha.bischoff@arm.com>

On 11/18/26 17:57, Sascha Bischoff wrote:
> Describe the IRS CONFIG and SETLPI frames and associate each CPU
> phandle with its IAFFID. This lets the guest discover and configure
> the IRS for shared interrupts.
> 
> Tested-by: Vladimir Murzin <vladimir.murzin@arm.com>
> Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
> ---
>  arm64/gic.c | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/arm64/gic.c b/arm64/gic.c
> index 9a8f9916..e5a26252 100644
> --- a/arm64/gic.c
> +++ b/arm64/gic.c
> @@ -588,6 +588,16 @@ void gic__generate_fdt_nodes(void *fdt, struct kvm *kvm)
>  
>  static void gic__generate_gicv5_fdt_nodes(void *fdt, struct kvm *kvm)
>  {
> +	char node_at_addr[64];
> +	u32 cpus[kvm->nrcpus];
> +	u16 iaffids[kvm->nrcpus];
> +	u64 irs_reg_prop[] = {
> +		cpu_to_fdt64(ARM_GICV5_IRS_CONFIG_BASE),
> +		cpu_to_fdt64(ARM_GICV5_IRS_CONFIG_SIZE),
> +		cpu_to_fdt64(ARM_GICV5_IRS_SETLPI_BASE),
> +		cpu_to_fdt64(ARM_GICV5_IRS_SETLPI_SIZE)
> +	};
> +
>  	_FDT(fdt_begin_node(fdt, "gicv5-cpuif"));
>  	_FDT(fdt_property_string(fdt, "compatible", "arm,gic-v5"));
>  	_FDT(fdt_property_cell(fdt, "#interrupt-cells", GIC_FDT_IRQ_NUM_CELLS));
> @@ -599,6 +609,31 @@ static void gic__generate_gicv5_fdt_nodes(void *fdt, struct kvm *kvm)
>  	/* Use a hard-coded phandle for the GIC to help wire things up */
>  	_FDT(fdt_property_cell(fdt, "phandle", PHANDLE_GIC));
>  
> +	/*
> +	 * GICv5 IRS node
> +	 */
> +	snprintf(node_at_addr, sizeof(node_at_addr), "irs@%llx",
> +		 (unsigned long long)ARM_GICV5_IRS_CONFIG_BASE);
> +	_FDT(fdt_begin_node(fdt, node_at_addr));
> +	_FDT(fdt_property_string(fdt, "compatible", "arm,gic-v5-irs"));
> +	_FDT(fdt_property_cell(fdt, "#address-cells", 2));
> +	_FDT(fdt_property_cell(fdt, "#size-cells", 2));
> +	_FDT(fdt_property(fdt, "ranges", NULL, 0));
> +
> +	_FDT(fdt_property(fdt, "reg", irs_reg_prop, sizeof(irs_reg_prop)));
> +	_FDT(fdt_property(fdt, "reg-names", "ns-config\0ns-setlpi",
> +			  sizeof("ns-config\0ns-setlpi")));
> +
> +	for (int cpu = 0; cpu < kvm->nrcpus; cpu++) {
> +		cpus[cpu] = cpu_to_fdt32(PHANDLE_CPU_BASE + cpu);
> +		iaffids[cpu] = cpu_to_fdt16(cpu);
> +	}
> +
> +	_FDT(fdt_property(fdt, "cpus", cpus, sizeof(u32) * kvm->nrcpus));
> +	_FDT(fdt_property(fdt, "arm,iaffids", iaffids, sizeof(u16) * kvm->nrcpus));
> +
> +	_FDT(fdt_end_node(fdt));
> +
>  	_FDT(fdt_end_node(fdt));
>  }
>  
> -- 2.34.1
> 

With SETLPI dropped form DT (and commit message) as agreed [1], feel free to add

Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>

[1] https://lore.kernel.org/kvmarm/d0e948c8-0d25-4207-bc04-01bc2bb6b7ec@arm.com/T/#m0dd67277b59609783e294e30cc681ee1a97a966a

  reply	other threads:[~2026-11-19 10:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 17:57 [PATCH kvmtool v5 00/23] arm64: Support GICv5-based guests Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 01/23] arm64: Propagate IRQ routing initialisation errors Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 02/23] arm64: Close the ITS descriptor when setup fails Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 03/23] arm64: Split GIC device setup Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 04/23] Sync kernel UAPI headers with v7.4-rc1 Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 05/23] arm64: Add GICv5 irqchip device support Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 06/23] arm64: Configure GIC interrupt bases Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 07/23] irq: Allow the initial interrupt line number to be set Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 08/23] arm64: Start GICv5 SPI line allocation at zero Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 09/23] arm64: Configure the GICv5 IRS Sascha Bischoff
2026-11-19  9:40   ` Vladimir Murzin
2026-11-18 17:57 ` [PATCH kvmtool v5 10/23] arm64: Define GICv5 interrupt types Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 11/23] arm64: Describe the PMU interrupt for GICv5 Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 12/23] arm64: Describe timer PPIs " Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 13/23] arm64: Assign CPU DT phandles Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 14/23] arm64: Describe the GICv5 CPU interface in the DT Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 15/23] arm64: Describe the GICv5 IRS " Sascha Bischoff
2026-11-19 10:43   ` Vladimir Murzin [this message]
2026-11-18 17:57 ` [PATCH kvmtool v5 16/23] arm64: Generate GICv5 SPI specifiers for platform devices Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 17/23] arm64: Generate GICv5 PCI INTx specifiers Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 18/23] arm64: Expose the GICv5 irqchip option Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 19/23] arm64: Add proposed GICv5 ITS UAPI definitions Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 20/23] arm64: Add GICv5 ITS device support Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 21/23] arm64: Describe the GICv5 ITS in the DT Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 22/23] arm64: Map PCI MSI requester IDs to the GICv5 ITS Sascha Bischoff
2026-11-18 17:57 ` [PATCH kvmtool v5 23/23] arm64: Expose the GICv5 ITS irqchip option Sascha Bischoff

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=6b61fcb7-e9ee-4f25-9484-5bf7e000f148@arm.com \
    --to=vladimir.murzin@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=sascha.bischoff@arm.com \
    --cc=timothy.hayes@arm.com \
    --cc=will@kernel.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