Skip to contentSkip to conversation

KVM: arm64: Enable stack protection and branch profiling for VHE

PATCH Applied Vincent Donnefort 3 participants 3 messages Oct 4, 2022 – Oct 9, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: arm64: Enable stack protection and branch profiling for VHE

For historical reasons, the VHE code inherited the build configuration from nVHE. Now those two parts have their own folder and makefile, we can enable stack protection and branch profiling for VHE.

arch/arm64/kvm/hyp/Makefile +1 -4
index 687598e41b21..a38dea6186c9 100644
@@ -5,9 +5,6 @@
 
 incdir := $(srctree)/$(src)/include
 subdir-asflags-y := -I$(incdir)
-subdir-ccflags-y := -I$(incdir)				\
-		    -fno-stack-protector		\
-		    -DDISABLE_BRANCH_PROFILING		\
-		    $(DISABLE_STACKLEAK_PLUGIN)
+subdir-ccflags-y := -I$(incdir)
 
 obj-$(CONFIG_KVM) += vhe/ nvhe/ pgtable.o
arch/arm64/kvm/hyp/nvhe/Makefile +3 -0
index b5c5119c7396..48f6ae7cc6e6 100644
@@ -10,6 +10,9 @@ asflags-y := -D__KVM_NVHE_HYPERVISOR__ -D__DISABLE_EXPORTS
 # will explode instantly (Words of Marc Zyngier). So introduce a generic flag
 # __DISABLE_TRACE_MMIO__ to disable MMIO tracing for nVHE KVM.
 ccflags-y := -D__KVM_NVHE_HYPERVISOR__ -D__DISABLE_EXPORTS -D__DISABLE_TRACE_MMIO__
+ccflags-y += -fno-stack-protector	\
+	     -DDISABLE_BRANCH_PROFILING	\
+	     $(DISABLE_STACKLEAK_PLUGIN)
 
 hostprogs := gen-hyprel
 HOST_EXTRACFLAGS += -I$(objtree)/include
Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Vincent Donnefort

For historical reasons, the VHE code inherited the build configuration from nVHE. Now those two parts have their own folder and makefile, we can enable stack protection and branch profiling for VHE.

+CC David who has been messing with these Makefiles in the past to confirm, but this makes sense to me.

Quoted 34 lines
arch/arm64/kvm/hyp/Makefile +1 -4
index 687598e41b21..a38dea6186c9 100644
@@ -5,9 +5,6 @@
 
 incdir := $(srctree)/$(src)/include
 subdir-asflags-y := -I$(incdir)
-subdir-ccflags-y := -I$(incdir)				\
-		    -fno-stack-protector		\
-		    -DDISABLE_BRANCH_PROFILING		\
-		    $(DISABLE_STACKLEAK_PLUGIN)
+subdir-ccflags-y := -I$(incdir)
 
 obj-$(CONFIG_KVM) += vhe/ nvhe/ pgtable.o
arch/arm64/kvm/hyp/nvhe/Makefile +3 -0
index b5c5119c7396..48f6ae7cc6e6 100644
@@ -10,6 +10,9 @@ asflags-y := -D__KVM_NVHE_HYPERVISOR__ -D__DISABLE_EXPORTS
 # will explode instantly (Words of Marc Zyngier). So introduce a generic flag
 # __DISABLE_TRACE_MMIO__ to disable MMIO tracing for nVHE KVM.
 ccflags-y := -D__KVM_NVHE_HYPERVISOR__ -D__DISABLE_EXPORTS -D__DISABLE_TRACE_MMIO__
+ccflags-y += -fno-stack-protector	\
+	     -DDISABLE_BRANCH_PROFILING	\
+	     $(DISABLE_STACKLEAK_PLUGIN)
 
 hostprogs := gen-hyprel
 HOST_EXTRACFLAGS += -I$(objtree)/include
Signature · 1 line
2.38.0.rc1.362.ged0d419d3c-goog
maintainer Applied
#2 lore raw
In reply to Vincent Donnefort
Quoted 3 lines · Vincent Donnefort

For historical reasons, the VHE code inherited the build configuration from nVHE. Now those two parts have their own folder and makefile, we can enable stack protection and branch profiling for VHE.

Applied to fixes, thanks!

[1/1] KVM: arm64: Enable stack protection and branch profiling for VHE

      commit: 837d632a383f13df7a67207a196d6eb4aeb4adca

Cheers,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.