From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH 3/3] arm64/kvm: use alternative auto-nop Date: Thu, 8 Sep 2016 13:16:48 +0200 Message-ID: <20160908111648.GZ23592@cbox> References: <1473242830-26246-1-git-send-email-mark.rutland@arm.com> <1473242830-26246-4-git-send-email-mark.rutland@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0235049B3F for ; Thu, 8 Sep 2016 07:05:51 -0400 (EDT) Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lP5vsIFgqFN8 for ; Thu, 8 Sep 2016 07:05:49 -0400 (EDT) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 2CABF49AF5 for ; Thu, 8 Sep 2016 07:05:48 -0400 (EDT) Received: by mail-wm0-f47.google.com with SMTP id w12so29129348wmf.0 for ; Thu, 08 Sep 2016 04:14:18 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1473242830-26246-4-git-send-email-mark.rutland@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: Mark Rutland Cc: marc.zyngier@arm.com, andre.przywara@arm.com, will.deacon@arm.com, dave.martin@arm.com, catalin.marinas@arm.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org List-Id: kvmarm@lists.cs.columbia.edu On Wed, Sep 07, 2016 at 11:07:10AM +0100, Mark Rutland wrote: > Make use of the new alternative_if and alternative_else_nop_endif and > get rid of our homebew NOP sleds, making the code simpler to read. homebew? > > Note that for __kvm_call_hyp the branch to __vhe_hyp_call has been moved > out of the alternative sequence, and in the default case there will be > four additional NOPs executed. > > Signed-off-by: Mark Rutland > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: kvmarm@lists.cs.columbia.edu Acked-by: Christoffer Dall > --- > arch/arm64/include/asm/kvm_mmu.h | 10 +++------- > arch/arm64/kvm/hyp.S | 6 +----- > 2 files changed, 4 insertions(+), 12 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h > index b6bb834..dff1098 100644 > --- a/arch/arm64/include/asm/kvm_mmu.h > +++ b/arch/arm64/include/asm/kvm_mmu.h > @@ -99,14 +99,10 @@ > .macro kern_hyp_va reg > alternative_if_not ARM64_HAS_VIRT_HOST_EXTN > and \reg, \reg, #HYP_PAGE_OFFSET_HIGH_MASK > -alternative_else > - nop > -alternative_endif > -alternative_if_not ARM64_HYP_OFFSET_LOW > - nop > -alternative_else > +alternative_else_nop_endif > +alternative_if ARM64_HYP_OFFSET_LOW > and \reg, \reg, #HYP_PAGE_OFFSET_LOW_MASK > -alternative_endif > +alternative_else_nop_endif > .endm > > #else > diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S > index 7ce9315..2726635 100644 > --- a/arch/arm64/kvm/hyp.S > +++ b/arch/arm64/kvm/hyp.S > @@ -46,10 +46,6 @@ alternative_if_not ARM64_HAS_VIRT_HOST_EXTN > hvc #0 > ldr lr, [sp], #16 > ret > -alternative_else > +alternative_else_nop_endif > b __vhe_hyp_call > - nop > - nop > - nop > -alternative_endif > ENDPROC(__kvm_call_hyp) > -- > 1.9.1 > From mboxrd@z Thu Jan 1 00:00:00 1970 From: christoffer.dall@linaro.org (Christoffer Dall) Date: Thu, 8 Sep 2016 13:16:48 +0200 Subject: [PATCH 3/3] arm64/kvm: use alternative auto-nop In-Reply-To: <1473242830-26246-4-git-send-email-mark.rutland@arm.com> References: <1473242830-26246-1-git-send-email-mark.rutland@arm.com> <1473242830-26246-4-git-send-email-mark.rutland@arm.com> Message-ID: <20160908111648.GZ23592@cbox> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Sep 07, 2016 at 11:07:10AM +0100, Mark Rutland wrote: > Make use of the new alternative_if and alternative_else_nop_endif and > get rid of our homebew NOP sleds, making the code simpler to read. homebew? > > Note that for __kvm_call_hyp the branch to __vhe_hyp_call has been moved > out of the alternative sequence, and in the default case there will be > four additional NOPs executed. > > Signed-off-by: Mark Rutland > Cc: Marc Zyngier > Cc: Christoffer Dall > Cc: kvmarm at lists.cs.columbia.edu Acked-by: Christoffer Dall > --- > arch/arm64/include/asm/kvm_mmu.h | 10 +++------- > arch/arm64/kvm/hyp.S | 6 +----- > 2 files changed, 4 insertions(+), 12 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h > index b6bb834..dff1098 100644 > --- a/arch/arm64/include/asm/kvm_mmu.h > +++ b/arch/arm64/include/asm/kvm_mmu.h > @@ -99,14 +99,10 @@ > .macro kern_hyp_va reg > alternative_if_not ARM64_HAS_VIRT_HOST_EXTN > and \reg, \reg, #HYP_PAGE_OFFSET_HIGH_MASK > -alternative_else > - nop > -alternative_endif > -alternative_if_not ARM64_HYP_OFFSET_LOW > - nop > -alternative_else > +alternative_else_nop_endif > +alternative_if ARM64_HYP_OFFSET_LOW > and \reg, \reg, #HYP_PAGE_OFFSET_LOW_MASK > -alternative_endif > +alternative_else_nop_endif > .endm > > #else > diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S > index 7ce9315..2726635 100644 > --- a/arch/arm64/kvm/hyp.S > +++ b/arch/arm64/kvm/hyp.S > @@ -46,10 +46,6 @@ alternative_if_not ARM64_HAS_VIRT_HOST_EXTN > hvc #0 > ldr lr, [sp], #16 > ret > -alternative_else > +alternative_else_nop_endif > b __vhe_hyp_call > - nop > - nop > - nop > -alternative_endif > ENDPROC(__kvm_call_hyp) > -- > 1.9.1 >