]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hyperv: Change hv_root_partition into a function
authorNuno Das Neves <nunodasneves@linux.microsoft.com>
Fri, 21 Feb 2025 19:56:34 +0000 (11:56 -0800)
committerWei Liu <wei.liu@kernel.org>
Sat, 22 Feb 2025 02:21:45 +0000 (02:21 +0000)
commitdb912b8954c23a55dbc6dc683e0e06ffcb433848
tree8a933867846cc3e373233cf25371f6c79f267502
parent9d8731a1757bef8630cb47e5ae3a1abbcf863e90
hyperv: Change hv_root_partition into a function

Introduce hv_curr_partition_type to store the partition type
as an enum.

Right now this is limited to guest or root partition, but there will
be other kinds in future and the enum is easily extensible.

Set up hv_curr_partition_type early in Hyper-V initialization with
hv_identify_partition_type(). hv_root_partition() just queries this
value, and shouldn't be called before that.

Making this check into a function sets the stage for adding a config
option to gate the compilation of root partition code. In particular,
hv_root_partition() can be stubbed out always be false if root
partition support isn't desired.

Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/1740167795-13296-3-git-send-email-nunodasneves@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1740167795-13296-3-git-send-email-nunodasneves@linux.microsoft.com>
arch/arm64/hyperv/mshyperv.c
arch/x86/hyperv/hv_init.c
arch/x86/kernel/cpu/mshyperv.c
drivers/clocksource/hyperv_timer.c
drivers/hv/hv.c
drivers/hv/hv_common.c
drivers/hv/vmbus_drv.c
drivers/iommu/hyperv-iommu.c
include/asm-generic/mshyperv.h