mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
FROMGIT: KVM: arm64: Generate hyp_constants.h for the host
In order to avoid exposing hypervisor (EL2) data structures directly to
the host, generate hyp_constants.h to provide constants such as structure
sizes to the host without dragging in the definitions themselves.
Signed-off-by: Will Deacon <will@kernel.org>
Tested-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211202171048.26924-3-will@kernel.org
(cherry picked from commit ed4ed15d57
git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next)
Bug: 209777660
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I24957ea3ef1da8863a60dcf53c146b3a78f56fa5
This commit is contained in:
2
arch/arm64/kvm/.gitignore
vendored
Normal file
2
arch/arm64/kvm/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
hyp_constants.h
|
||||
@@ -25,3 +25,19 @@ kvm-y := $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o \
|
||||
vgic/vgic-its.o vgic/vgic-debug.o
|
||||
|
||||
kvm-$(CONFIG_HW_PERF_EVENTS) += pmu-emul.o
|
||||
|
||||
always-y := hyp_constants.h hyp-constants.s
|
||||
|
||||
define rule_gen_hyp_constants
|
||||
$(call filechk,offsets,__HYP_CONSTANTS_H__)
|
||||
endef
|
||||
|
||||
CFLAGS_hyp-constants.o = -I $(srctree)/$(src)/hyp/include
|
||||
$(obj)/hyp-constants.s: $(src)/hyp/hyp-constants.c FORCE
|
||||
$(call if_changed_dep,cc_s_c)
|
||||
|
||||
$(obj)/hyp_constants.h: $(obj)/hyp-constants.s FORCE
|
||||
$(call if_changed_rule,gen_hyp_constants)
|
||||
|
||||
obj-kvm := $(addprefix $(obj)/, $(kvm-y))
|
||||
$(obj-kvm): $(obj)/hyp_constants.h
|
||||
|
||||
10
arch/arm64/kvm/hyp/hyp-constants.c
Normal file
10
arch/arm64/kvm/hyp/hyp-constants.c
Normal file
@@ -0,0 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
#include <linux/kbuild.h>
|
||||
#include <nvhe/memory.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
DEFINE(STRUCT_HYP_PAGE_SIZE, sizeof(struct hyp_page));
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user