From nobody Sun Feb 8 22:52:15 2026 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD3DF28FD for ; Wed, 11 Jun 2025 00:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749600649; cv=none; b=N+pXlsmZTrVtoMG+T0K+qVyczeFH4JGGGbyNC6LJOHMeMJQLG8xdfFKSjXg5YLz1kWZGbNCJcUTJZb82hO8OER8qucodbT6v08jng8aHF3etRRvA954hxoVq+hNNEAyIW+IlBpmMRFxF7LmxwnVGpq7OCRVn4CY11O+l4NC1xu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749600649; c=relaxed/simple; bh=cgO6vD3DDYOorXGrSYxtut2nAefUtVb1kMw8GMCdCTU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Rrc6aVtY9Z3xRXGBA4T82nIGQxW0E7/Ctq3OlshAYKjhFXaPfMUCLkJZ4T0OJkpy3bzcDmlYstQmkY9ZMnxUbSxL6MGyywSoEeQQ4BE+rEtzz/86UO2xI1nphQYA+MYuaFZ45+CISso2nusRWT4C5iirCfkrj5vbXbmJ3b6wk+U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Alhps4R6; arc=none smtp.client-ip=209.85.215.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Alhps4R6" Received: by mail-pg1-f202.google.com with SMTP id 41be03b00d2f7-b2eb60594e8so3489062a12.1 for ; Tue, 10 Jun 2025 17:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1749600647; x=1750205447; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=T9v9a40eFZn9R1EW7cZiJp8oFw/IePLxWs4fhJywAPc=; b=Alhps4R61oHMWXRWi2hRUY5T77sF3wqpGtd1eGLGiOUk2I7EE673Rshly/brR3wGkn IwREaJHpk7fMbWjJy24/taWvykfmQSjpcGC1haDie4GQGcyuvlRf8nkopu97msjczkO2 O5UsyoUq7QhiDhiLiQtu/nMsAgq/v6e3JoXppq0WLS2o1oGNAeLq5dbo4nlTPkg5FGGi aH5jJXkQsGOX0z/0gHsavhECuiNJ/p7VgcW0s/10ykiQ/wKHCUeB34hskkw7j3UJ/f/K i2qe9Fetf8tBUzkhZNEpJ50GZCxlA3XZgwVj5hqBcmCGNYb2lszN5xU0120qOpGS9Iet 9ACw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749600647; x=1750205447; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=T9v9a40eFZn9R1EW7cZiJp8oFw/IePLxWs4fhJywAPc=; b=KJx7q4m0DvRXHS+6tF7NtqHC/nx1X0OO3pkzPEYKZqrl3QMxWaTiv1XLMAZo/TA6bx lGIm0lPR80tJvlIWQ97aOoZQfdEf65HG/ze6tYIZxeANSxWs/q3/cJLAYwRHOXAgDisS MO60sptT23T9Sd7s6uaoM79FfRW3PY68fVL4TXIetYw4ZCJdsY5a5nPQpihN2FNNf+C3 MGO9FtvTGKh0t//B0N9nGMxC4sJO1gYQsgIIi1WYtMVS9oX4TnAEgNejRSX8lQkDrGG2 WQGMJeEoiF85ODF+Bdq33y3n5tWsjOGDr7lodJYbdcwzAAVWM8ZeMuSNuhG8c99b2/Oy apSQ== X-Forwarded-Encrypted: i=1; AJvYcCU02JscTaUmAglxwuyY6ba2cNC4m9EJi2mtq146YLLQu1fED3AaykaD5jqUNuV9zyz21yXR2wnffER4MQs=@vger.kernel.org X-Gm-Message-State: AOJu0YyUpf/zWnJUS/iEO82v/5mzok2IvPBvB+3KCDPX+2aAMjwK96bY eNu5XxWHTgIFe5o8zd4oXUHbA/gvU7Ko+yEuBSN5oflJljQ935TFWrjJ9NhjaxSMAE5hhDQBNo5 7VTvmAQ== X-Google-Smtp-Source: AGHT+IEV2ehh3DZ0P6laELJQUxxjOzAbGJYmk59KPIK2LrFdETO4qOTGt38spkCAI0j7nNaUnHVLjxXIt54= X-Received: from pjbpl16.prod.google.com ([2002:a17:90b:2690:b0:311:e9bb:f8d4]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3a86:b0:311:df4b:4b7a with SMTP id 98e67ed59e1d1-313af23ff12mr1868472a91.29.1749600646996; Tue, 10 Jun 2025 17:10:46 -0700 (PDT) Reply-To: Sean Christopherson Date: Tue, 10 Jun 2025 17:10:35 -0700 In-Reply-To: <20250611001042.170501-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250611001042.170501-1-seanjc@google.com> X-Mailer: git-send-email 2.50.0.rc0.642.g800a2b2222-goog Message-ID: <20250611001042.170501-2-seanjc@google.com> Subject: [PATCH 1/8] KVM: arm64: Move arm_{psci,hypercalls}.h to an internal KVM path From: Sean Christopherson To: Marc Zyngier , Oliver Upton , Tianrui Zhao , Bibo Mao , Huacai Chen , Madhavan Srinivasan , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Sean Christopherson , Paolo Bonzini Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anish Ghulati , Colton Lewis , Thomas Huth Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Anish Ghulati Move arm_hypercalls.h and arm_psci.h into arch/arm64/kvm now that KVM no longer supports 32-bit ARM, i.e. now that there's no reason to make the hypercall and PSCI APIs "public". Signed-off-by: Anish Ghulati [sean: squash into one patch, write changelog] Signed-off-by: Sean Christopherson --- arch/arm64/kvm/arm.c | 5 +++-- {include =3D> arch/arm64}/kvm/arm_hypercalls.h | 0 {include =3D> arch/arm64}/kvm/arm_psci.h | 0 arch/arm64/kvm/guest.c | 2 +- arch/arm64/kvm/handle_exit.c | 2 +- arch/arm64/kvm/hyp/Makefile | 6 +++--- arch/arm64/kvm/hyp/include/hyp/switch.h | 4 ++-- arch/arm64/kvm/hyp/nvhe/switch.c | 4 ++-- arch/arm64/kvm/hyp/vhe/switch.c | 4 ++-- arch/arm64/kvm/hypercalls.c | 4 ++-- arch/arm64/kvm/psci.c | 4 ++-- arch/arm64/kvm/pvtime.c | 2 +- arch/arm64/kvm/trng.c | 2 +- 13 files changed, 20 insertions(+), 19 deletions(-) rename {include =3D> arch/arm64}/kvm/arm_hypercalls.h (100%) rename {include =3D> arch/arm64}/kvm/arm_psci.h (100%) diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index de2b4e9c9f9f..017c95c7bd03 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -42,9 +42,10 @@ #include #include =20 -#include #include -#include + +#include "arm_hypercalls.h" +#include "arm_psci.h" =20 #include "sys_regs.h" =20 diff --git a/include/kvm/arm_hypercalls.h b/arch/arm64/kvm/arm_hypercalls.h similarity index 100% rename from include/kvm/arm_hypercalls.h rename to arch/arm64/kvm/arm_hypercalls.h diff --git a/include/kvm/arm_psci.h b/arch/arm64/kvm/arm_psci.h similarity index 100% rename from include/kvm/arm_psci.h rename to arch/arm64/kvm/arm_psci.h diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 2196979a24a3..699a2f975350 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -27,6 +26,7 @@ #include #include =20 +#include "arm_hypercalls.h" #include "trace.h" =20 const struct _kvm_stats_desc kvm_vm_stats_desc[] =3D { diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c index 453266c96481..32a7b7c22924 100644 --- a/arch/arm64/kvm/handle_exit.c +++ b/arch/arm64/kvm/handle_exit.c @@ -22,7 +22,7 @@ #include #include =20 -#include +#include "arm_hypercalls.h" =20 #define CREATE_TRACE_POINTS #include "trace_handle_exit.h" diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile index d61e44642f98..b1a4884446c6 100644 --- a/arch/arm64/kvm/hyp/Makefile +++ b/arch/arm64/kvm/hyp/Makefile @@ -3,8 +3,8 @@ # Makefile for Kernel-based Virtual Machine module, HYP part # =20 -incdir :=3D $(src)/include -subdir-asflags-y :=3D -I$(incdir) -subdir-ccflags-y :=3D -I$(incdir) +hyp_includes :=3D -I$(src)/include -I$(srctree)/arch/arm64/kvm +subdir-asflags-y :=3D $(hyp_includes) +subdir-ccflags-y :=3D $(hyp_includes) =20 obj-$(CONFIG_KVM) +=3D vhe/ nvhe/ pgtable.o diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/i= nclude/hyp/switch.h index bb9f2eecfb67..340a57e0ed7c 100644 --- a/arch/arm64/kvm/hyp/include/hyp/switch.h +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h @@ -16,8 +16,6 @@ #include #include =20 -#include - #include #include #include @@ -32,6 +30,8 @@ #include #include =20 +#include "arm_psci.h" + struct kvm_exception_table_entry { int insn, fixup; }; diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/swi= tch.c index 73affe1333a4..e0610cf683ab 100644 --- a/arch/arm64/kvm/hyp/nvhe/switch.c +++ b/arch/arm64/kvm/hyp/nvhe/switch.c @@ -13,8 +13,6 @@ #include #include =20 -#include - #include #include #include @@ -28,6 +26,8 @@ =20 #include =20 +#include "arm_psci.h" + /* Non-VHE specific context */ DEFINE_PER_CPU(struct kvm_host_data, kvm_host_data); DEFINE_PER_CPU(struct kvm_cpu_context, kvm_hyp_ctxt); diff --git a/arch/arm64/kvm/hyp/vhe/switch.c b/arch/arm64/kvm/hyp/vhe/switc= h.c index c9b330dc2066..96be652caf3a 100644 --- a/arch/arm64/kvm/hyp/vhe/switch.c +++ b/arch/arm64/kvm/hyp/vhe/switch.c @@ -13,8 +13,6 @@ #include #include =20 -#include - #include #include #include @@ -28,6 +26,8 @@ #include #include =20 +#include "arm_psci.h" + /* VHE specific context */ DEFINE_PER_CPU(struct kvm_host_data, kvm_host_data); DEFINE_PER_CPU(struct kvm_cpu_context, kvm_hyp_ctxt); diff --git a/arch/arm64/kvm/hypercalls.c b/arch/arm64/kvm/hypercalls.c index 569941eeb3fe..002f4c593e90 100644 --- a/arch/arm64/kvm/hypercalls.c +++ b/arch/arm64/kvm/hypercalls.c @@ -6,8 +6,8 @@ =20 #include =20 -#include -#include +#include "arm_hypercalls.h" +#include "arm_psci.h" =20 #define KVM_ARM_SMCCC_STD_FEATURES \ GENMASK(KVM_REG_ARM_STD_BMAP_BIT_COUNT - 1, 0) diff --git a/arch/arm64/kvm/psci.c b/arch/arm64/kvm/psci.c index 3b5dbe9a0a0e..0566b5907497 100644 --- a/arch/arm64/kvm/psci.c +++ b/arch/arm64/kvm/psci.c @@ -13,8 +13,8 @@ #include #include =20 -#include -#include +#include "arm_hypercalls.h" +#include "arm_psci.h" =20 /* * This is an implementation of the Power State Coordination Interface diff --git a/arch/arm64/kvm/pvtime.c b/arch/arm64/kvm/pvtime.c index 4ceabaa4c30b..b07d250d223c 100644 --- a/arch/arm64/kvm/pvtime.c +++ b/arch/arm64/kvm/pvtime.c @@ -8,7 +8,7 @@ #include #include =20 -#include +#include "arm_hypercalls.h" =20 void kvm_update_stolen_time(struct kvm_vcpu *vcpu) { diff --git a/arch/arm64/kvm/trng.c b/arch/arm64/kvm/trng.c index 99bdd7103c9c..b5dc0f09797a 100644 --- a/arch/arm64/kvm/trng.c +++ b/arch/arm64/kvm/trng.c @@ -6,7 +6,7 @@ =20 #include =20 -#include +#include "arm_hypercalls.h" =20 #define ARM_SMCCC_TRNG_VERSION_1_0 0x10000UL =20 --=20 2.50.0.rc0.642.g800a2b2222-goog