From patchwork Tue Oct 16 03:07:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 1598491 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5AD8ADF238 for ; Tue, 16 Oct 2012 03:07:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755269Ab2JPDH2 (ORCPT ); Mon, 15 Oct 2012 23:07:28 -0400 Received: from ozlabs.org ([203.10.76.45]:57839 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752604Ab2JPDH1 (ORCPT ); Mon, 15 Oct 2012 23:07:27 -0400 Received: by ozlabs.org (Postfix, from userid 1003) id 959F32C00A5; Tue, 16 Oct 2012 14:07:25 +1100 (EST) Date: Tue, 16 Oct 2012 14:07:20 +1100 From: Paul Mackerras To: Alexander Graf Cc: kvm@vger.kernel.org Subject: [PATCH 8/8] KVM: PPC: Book3S HV: Fix thinko in try_lock_hpte() Message-ID: <20121016030720.GI1218@drongo> References: <20121016030303.GA1218@drongo> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121016030303.GA1218@drongo> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This fixes an error in the inline asm in try_lock_hpte() where we were erroneously using a register number as an immediate operand. The bug only affects an error path, and in fact the code will still work as long as the compiler chooses some register other than r0 for the "bits" variable. Nevertheless it should still be fixed. Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_book3s_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h index 0dd1d86..1472a5b 100644 --- a/arch/powerpc/include/asm/kvm_book3s_64.h +++ b/arch/powerpc/include/asm/kvm_book3s_64.h @@ -60,7 +60,7 @@ static inline long try_lock_hpte(unsigned long *hpte, unsigned long bits) " ori %0,%0,%4\n" " stdcx. %0,0,%2\n" " beq+ 2f\n" - " li %1,%3\n" + " mr %1,%3\n" "2: isync" : "=&r" (tmp), "=&r" (old) : "r" (hpte), "r" (bits), "i" (HPTE_V_HVLOCK)