From patchwork Tue Oct 4 15:42:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Donnefort X-Patchwork-Id: 12998538 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84036C433FE for ; Tue, 4 Oct 2022 15:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: Mime-Version:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=t9AAmwYBZwpZUllvrhnHnWGiIKd7faZkh0a6gYTM4G0=; b=LgO kn6bqQQRvqaDYUjHTNUG/VPnzjd8j9bGUEpfGSM0ImuruTggA+pdJ9YnGkezBmz3UjMU56k6oMmNp 6UEijg52ERnkt0UdhB+720WSZPzGE7HpNq2msLmEAwyK0E37goMTxNM5Strp2G0cjYcDnwPqRr/w3 9MQYkBqo2d6zrlPjNnacTk01rB7vBPHkwe8PawRBYr4j1zYcvczSWXSzxrM1Bg8nmUxrGYaxo5+zg OKHumNOydpftRp97k6LVqlHbZoaj8D9GHj1p/tRjC/0BeI0QGyBhPHQAm1CgqPRkLcb9BBF1ZMFGO 7HgtrPPPfl7JvRDDn5f9enSqhQZGnlg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofk4E-00A6Nb-DZ; Tue, 04 Oct 2022 15:42:46 +0000 Received: from mail-wm1-x349.google.com ([2a00:1450:4864:20::349]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ofk4C-00A6NC-3m for linux-arm-kernel@lists.infradead.org; Tue, 04 Oct 2022 15:42:45 +0000 Received: by mail-wm1-x349.google.com with SMTP id fc12-20020a05600c524c00b003b5054c70d3so8032431wmb.5 for ; Tue, 04 Oct 2022 08:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date; bh=WWVFqgTWQ8azi8GP+rBbYb12Qu9xWjqzGv+CBZNgnNI=; b=oBoEqzDio3nthQUeORwSc9WqF78dq3gSRCADIdTK4NdWKqLEsBPU2JwA1vCmZkUVuv el5KvOgAJcF9TjbnNc12of/1cAuIoS5HEabUiOkhoq8H2DyBgBA1dElxP47hVaDV+nE2 /9cDFIXxTw8pptszy5hWYfNZh7lWhc5pFIZfQl3IHXOZsCAt/KoCjFJIlmOFcmkC3dZn svG465k/9ngQ4cJ2OQ3tu6AwbprWZJMycIG8OJ1LZAV3uqSKeLQeGzpGkJEB5eHAnVd1 MX/Ah6RV4u4WVfQGqRHdsT08gTri7KH8HXnAqN3FCMOKlFVFFULAEuijckgcHhAUeI3E pr1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date; bh=WWVFqgTWQ8azi8GP+rBbYb12Qu9xWjqzGv+CBZNgnNI=; b=aFt8ypw03S635Gttzw5LOPEEZ9B2oOM0nILjrC7jkPjstCItscryVFe1B5YiJIewut UP3yZ3YGMMmD9h2dVBDuUxr5g8Wy+KvgNMPvbK3r+fbCleye4OS1ZQZ2byH0iUULbycF GdyXpzs0S8UwNaq621PHK+X+Wyo4dX7z5g9GwAahm67hQ3fQRdQEPWj6e5ic/xmJo33+ o2sBFLqlbQaofUhCAVGTMSv+62e01trUi1uwLsNXrwrDW8bs3zBOhBUlvM0/Ew1wfgjV GzLlnP+Y12lRZGtka2LoTP+cw7KimN490c7PS4nf4Z+7Qz6VrhtSZbLu5vLdyTo78soY Q0hQ== X-Gm-Message-State: ACrzQf2I8oRyMgZ/Z6zD0XsuV3JscqCQZRGAkKs9oj7IyRld2m+Fw0JP rEcbrXijf747l7SXAwhfX/y9qMQWTfheubyT X-Google-Smtp-Source: AMsMyM4Ksa4T0ArbfPMDLZVlL5cHxR1tviks7FEOUK08OSlqKrb5KWwNP7bKMDffZ41Q+zvTqKilvIy1hcZ2MllU X-Received: from vdonnefort.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:2eea]) (user=vdonnefort job=sendgmr) by 2002:a05:600c:3483:b0:3b4:99f4:1191 with SMTP id a3-20020a05600c348300b003b499f41191mr251856wmq.147.1664898160929; Tue, 04 Oct 2022 08:42:40 -0700 (PDT) Date: Tue, 4 Oct 2022 16:42:16 +0100 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog Message-ID: <20221004154216.2833636-1-vdonnefort@google.com> Subject: [PATCH] KVM: arm64: Enable stack protection and branch profiling for VHE From: Vincent Donnefort To: maz@kernel.org, oliver.upton@linux.dev Cc: james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, will@kernel.org, catalin.marinas@arm.com, qperret@google.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Vincent Donnefort X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221004_084244_175846_2D083E78 X-CRM114-Status: UNSURE ( 7.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Quentin Perret 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