All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: arm64: Enable stack protection and branch profiling for VHE
@ 2022-10-04 15:42 ` Vincent Donnefort
  0 siblings, 0 replies; 6+ messages in thread
From: Vincent Donnefort @ 2022-10-04 15:42 UTC (permalink / raw)
  To: maz, oliver.upton
  Cc: james.morse, alexandru.elisei, suzuki.poulose, will,
	catalin.marinas, qperret, kvmarm, linux-arm-kernel,
	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.

Signed-off-by: Vincent Donnefort <vdonnefort@google.com>

diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile
index 687598e41b21..a38dea6186c9 100644
--- a/arch/arm64/kvm/hyp/Makefile
+++ b/arch/arm64/kvm/hyp/Makefile
@@ -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
diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile
index b5c5119c7396..48f6ae7cc6e6 100644
--- a/arch/arm64/kvm/hyp/nvhe/Makefile
+++ b/arch/arm64/kvm/hyp/nvhe/Makefile
@@ -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
-- 
2.38.0.rc1.362.ged0d419d3c-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] KVM: arm64: Enable stack protection and branch profiling for VHE
@ 2022-10-04 15:42 ` Vincent Donnefort
  0 siblings, 0 replies; 6+ messages in thread
From: Vincent Donnefort @ 2022-10-04 15:42 UTC (permalink / raw)
  To: maz, oliver.upton
  Cc: james.morse, alexandru.elisei, suzuki.poulose, will,
	catalin.marinas, qperret, kvmarm, linux-arm-kernel,
	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.

Signed-off-by: Vincent Donnefort <vdonnefort@google.com>

diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile
index 687598e41b21..a38dea6186c9 100644
--- a/arch/arm64/kvm/hyp/Makefile
+++ b/arch/arm64/kvm/hyp/Makefile
@@ -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
diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile
index b5c5119c7396..48f6ae7cc6e6 100644
--- a/arch/arm64/kvm/hyp/nvhe/Makefile
+++ b/arch/arm64/kvm/hyp/nvhe/Makefile
@@ -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
-- 
2.38.0.rc1.362.ged0d419d3c-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: arm64: Enable stack protection and branch profiling for VHE
  2022-10-04 15:42 ` Vincent Donnefort
@ 2022-10-06  7:17   ` Quentin Perret
  -1 siblings, 0 replies; 6+ messages in thread
From: Quentin Perret @ 2022-10-06  7:17 UTC (permalink / raw)
  To: Vincent Donnefort
  Cc: maz, oliver.upton, james.morse, alexandru.elisei, suzuki.poulose,
	will, catalin.marinas, kvmarm, linux-arm-kernel, dbrazdil

On Tuesday 04 Oct 2022 at 16:42:16 (+0100), Vincent Donnefort wrote:
> 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.

Reviewed-by: Quentin Perret <qperret@google.com>

> Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
> 
> diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile
> index 687598e41b21..a38dea6186c9 100644
> --- a/arch/arm64/kvm/hyp/Makefile
> +++ b/arch/arm64/kvm/hyp/Makefile
> @@ -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
> diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile
> index b5c5119c7396..48f6ae7cc6e6 100644
> --- a/arch/arm64/kvm/hyp/nvhe/Makefile
> +++ b/arch/arm64/kvm/hyp/nvhe/Makefile
> @@ -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
> -- 
> 2.38.0.rc1.362.ged0d419d3c-goog
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: arm64: Enable stack protection and branch profiling for VHE
@ 2022-10-06  7:17   ` Quentin Perret
  0 siblings, 0 replies; 6+ messages in thread
From: Quentin Perret @ 2022-10-06  7:17 UTC (permalink / raw)
  To: Vincent Donnefort
  Cc: maz, oliver.upton, james.morse, alexandru.elisei, suzuki.poulose,
	will, catalin.marinas, kvmarm, linux-arm-kernel, dbrazdil

On Tuesday 04 Oct 2022 at 16:42:16 (+0100), Vincent Donnefort wrote:
> 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.

Reviewed-by: Quentin Perret <qperret@google.com>

> Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
> 
> diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile
> index 687598e41b21..a38dea6186c9 100644
> --- a/arch/arm64/kvm/hyp/Makefile
> +++ b/arch/arm64/kvm/hyp/Makefile
> @@ -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
> diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile
> index b5c5119c7396..48f6ae7cc6e6 100644
> --- a/arch/arm64/kvm/hyp/nvhe/Makefile
> +++ b/arch/arm64/kvm/hyp/nvhe/Makefile
> @@ -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
> -- 
> 2.38.0.rc1.362.ged0d419d3c-goog
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: arm64: Enable stack protection and branch profiling for VHE
  2022-10-04 15:42 ` Vincent Donnefort
@ 2022-10-09  2:16   ` Marc Zyngier
  -1 siblings, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2022-10-09  2:16 UTC (permalink / raw)
  To: oliver.upton, Vincent Donnefort
  Cc: alexandru.elisei, james.morse, linux-arm-kernel, qperret, kvmarm,
	will, catalin.marinas, suzuki.poulose

On Tue, 4 Oct 2022 16:42:16 +0100, Vincent Donnefort wrote:
> 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.
-- 
Without deviation from the norm, progress is not possible.



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: arm64: Enable stack protection and branch profiling for VHE
@ 2022-10-09  2:16   ` Marc Zyngier
  0 siblings, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2022-10-09  2:16 UTC (permalink / raw)
  To: oliver.upton, Vincent Donnefort
  Cc: alexandru.elisei, james.morse, linux-arm-kernel, qperret, kvmarm,
	will, catalin.marinas, suzuki.poulose

On Tue, 4 Oct 2022 16:42:16 +0100, Vincent Donnefort wrote:
> 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.
-- 
Without deviation from the norm, progress is not possible.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-09  2:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 15:42 [PATCH] KVM: arm64: Enable stack protection and branch profiling for VHE Vincent Donnefort
2022-10-04 15:42 ` Vincent Donnefort
2022-10-06  7:17 ` Quentin Perret
2022-10-06  7:17   ` Quentin Perret
2022-10-09  2:16 ` Marc Zyngier
2022-10-09  2:16   ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.