On Tue, 27 Jan 2026 at 18:29, Mohamed Mediouni <mohamed@unpredictable.fr> wrote:
>
> While figuring out a better spot for it, put it in whpx_accel_init.
>
> Needs to be done before WHvSetupPartition.
>
> Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> ---
> target/arm/whpx/whpx-all.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/target/arm/whpx/whpx-all.c b/target/arm/whpx/whpx-all.c
> index c88c67a9e2..55773555b7 100644
> --- a/target/arm/whpx/whpx-all.c
> +++ b/target/arm/whpx/whpx-all.c
> @@ -939,6 +939,29 @@ int whpx_accel_init(AccelState *as, MachineState *ms)
>
> memset(&prop, 0, sizeof(prop));
>
> + WHV_ARM64_IC_PARAMETERS ic_params = {
> + .EmulationMode = WHvArm64IcEmulationModeGicV3,
> + .GicV3Parameters = {
> + .GicdBaseAddress = 0x08000000,
> + .GitsTranslaterBaseAddress = 0x08080000,
> + .GicLpiIntIdBits = 0,
> + .GicPpiPerformanceMonitorsInterrupt = VIRTUAL_PMU_IRQ,
> + .GicPpiOverflowInterruptFromCntv = ARCH_TIMER_VIRT_IRQ
> + }
> + };
> + prop.Arm64IcParameters = ic_params;
> +
> + hr = whp_dispatch.WHvSetPartitionProperty(
> + whpx->partition,
> + WHvPartitionPropertyCodeArm64IcParameters,
> + &prop,
> + sizeof(prop));
> + if (FAILED(hr)) {
> + error_report("WHPX: Failed to enable GICv3 interrupt controller, hr=%08lx", hr);
> + ret = -EINVAL;
> + goto error;
> + }
So what happens if the user asked for a GICv2 ?
Can we have a comment to explain the ordering requirement
mentioned in the commit message that is forcing this to be
here rather than in the GIC code ?
> +
> hr = whp_dispatch.WHvSetupPartition(whpx->partition);
> if (FAILED(hr)) {
> error_report("WHPX: Failed to setup partition, hr=%08lx", hr);
> --
> 2.50.1 (Apple Git-155)
-- PMM