Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-20 Thread Ard Biesheuvel
On 20 November 2017 at 14:43, Mark Rutland wrote: > On Mon, Nov 20, 2017 at 02:41:47PM +, Mark Rutland wrote: >> 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

Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-20 Thread Ard Biesheuvel
On 20 November 2017 at 14:43, Mark Rutland wrote: > On Mon, Nov 20, 2017 at 02:41:47PM +, Mark Rutland wrote: >> 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

Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-20 Thread Mark Rutland
On Mon, Nov 20, 2017 at 02:41:47PM +, Mark Rutland wrote: > 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 >

Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-20 Thread Mark Rutland
On Mon, Nov 20, 2017 at 02:41:47PM +, Mark Rutland wrote: > 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 >

Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-20 Thread Mark Rutland
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

Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-20 Thread Mark Rutland
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

Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-16 Thread Sami Tolvanen
On Thu, Nov 16, 2017 at 11:46:17AM +, Will Deacon wrote: > Can you elaborate a bit more on exactly what you saw failing here, > please? Mark noticed that clang built kernels fail to boot when the kernel starts at EL2: http://lkml.iu.edu/hypermail/linux/kernel/1711.0/02817.html Turns out

Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-16 Thread Sami Tolvanen
On Thu, Nov 16, 2017 at 11:46:17AM +, Will Deacon wrote: > Can you elaborate a bit more on exactly what you saw failing here, > please? Mark noticed that clang built kernels fail to boot when the kernel starts at EL2: http://lkml.iu.edu/hypermail/linux/kernel/1711.0/02817.html Turns out

Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-16 Thread Will Deacon
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. Can you elaborate a bit more on exactly what you saw failing here, please? Whilst it's obviously broken to jump to EL1 from EL2 w/o VHE,

Re: [PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-16 Thread Will Deacon
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. Can you elaborate a bit more on exactly what you saw failing here, please? Whilst it's obviously broken to jump to EL1 from EL2 w/o VHE,

[PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-15 Thread Sami Tolvanen
Use -fno-jump-tables to make sure clang doesn't generate branches to EL1 virtual addresses. Suggested-by: AKASHI Takahiro Signed-off-by: Sami Tolvanen --- arch/arm64/kvm/hyp/Makefile | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v2 06/18] arm64: kvm: use -fno-jump-tables with clang

2017-11-15 Thread Sami Tolvanen
Use -fno-jump-tables to make sure clang doesn't generate branches to EL1 virtual addresses. 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