From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751303AbdKTOly (ORCPT ); Mon, 20 Nov 2017 09:41:54 -0500 Received: from foss.arm.com ([217.140.101.70]:58218 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124AbdKTOlw (ORCPT ); Mon, 20 Nov 2017 09:41:52 -0500 Date: Mon, 20 Nov 2017 14:41:47 +0000 From: Mark Rutland To: Sami Tolvanen Cc: Alex Matveev , Andi Kleen , Ard Biesheuvel , Greg Hackmann , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Yury Norov , Matthias Kaehlcke Subject: Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang Message-ID: <20171120144147.7iawjcw644zc4xes@lakrids.cambridge.arm.com> References: <20171115213428.22559-1-samitolvanen@google.com> <20171115213428.22559-7-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171115213428.22559-7-samitolvanen@google.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 15, 2017 at 01:34:16PM -0800, Sami Tolvanen wrote: > Use -fno-jump-tables to make sure clang doesn't generate branches > to EL1 virtual addresses. Are there any other reasons that clang might generate absolute references/relocations? It would be nice if there was the option to disable that more generally, rather than disabling individual optimizations. Is there any PIC/PIE option that we could use? We might need something simnilar for GCC, even if we're not seeing problems today. Thanks, Mark. > Suggested-by: AKASHI Takahiro > Signed-off-by: Sami Tolvanen > --- > arch/arm64/kvm/hyp/Makefile | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/arm64/kvm/hyp/Makefile b/arch/arm64/kvm/hyp/Makefile > index f04400d494b7..19fa1c6b6b69 100644 > --- a/arch/arm64/kvm/hyp/Makefile > +++ b/arch/arm64/kvm/hyp/Makefile > @@ -5,6 +5,10 @@ > > ccflags-y += -fno-stack-protector -DDISABLE_BRANCH_PROFILING > > +ifeq ($(cc-name),clang) > +ccflags-y += -fno-jump-tables > +endif > + > KVM=../../../../virt/kvm > > obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v2-sr.o > -- > 2.15.0.448.gf294e3d99a-goog >