Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752509AbeADRFT (ORCPT + 1 other); Thu, 4 Jan 2018 12:05:19 -0500 Received: from mail-io0-f171.google.com ([209.85.223.171]:46282 "EHLO mail-io0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294AbeADRFS (ORCPT ); Thu, 4 Jan 2018 12:05:18 -0500 X-Google-Smtp-Source: ACJfBoufW1RJUY35PpsKG98iXmHwdbRhupTQ/+0ZIA2TCAzGnZ6TMmZjS0S3WrIRm4vHWkNE8tNgJTJXQpS+aKNXuAE= MIME-Version: 1.0 In-Reply-To: <060b7c34-bce9-da78-f9cb-2e67dd2ee142@arm.com> References: <1515078515-13723-1-git-send-email-will.deacon@arm.com> <1515078515-13723-9-git-send-email-will.deacon@arm.com> <060b7c34-bce9-da78-f9cb-2e67dd2ee142@arm.com> From: Ard Biesheuvel Date: Thu, 4 Jan 2018 17:05:16 +0000 Message-ID: Subject: Re: [PATCH 08/11] arm64: KVM: Use per-CPU vector when BP hardening is enabled To: Marc Zyngier Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Lorenzo Pieralisi , Christoffer Dall , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 4 January 2018 at 17:04, Marc Zyngier wrote: > On 04/01/18 16:28, Ard Biesheuvel wrote: >> On 4 January 2018 at 15:08, Will Deacon wrote: >>> From: Marc Zyngier >>> >>> Now that we have per-CPU vectors, let's plug then in the KVM/arm64 code. >>> >> >> Why does bp hardening require per-cpu vectors? > > The description is not 100% accurate. We have per *CPU type* vectors. > This stems from the following, slightly conflicting requirements: > > - We have systems with more than one CPU type (think big-little) > - Different implementations require different BP hardening sequences > - The BP hardening sequence must be executed before doing any branch > > The natural solution is to have one set of vectors per CPU type, > containing the BP hardening sequence for that particular implementation, > ending with a branch to the common code. > Crystal clear, thanks.