Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8B6BC433F5 for ; Fri, 19 Nov 2021 17:40:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8053611F2 for ; Fri, 19 Nov 2021 17:40:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237185AbhKSRnS (ORCPT ); Fri, 19 Nov 2021 12:43:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:46044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236157AbhKSRnB (ORCPT ); Fri, 19 Nov 2021 12:43:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9D28B61BD2; Fri, 19 Nov 2021 17:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637343599; bh=Jhm74Mi1ZhcGI93tNO6ogfoxfG8D0uozbBy/Q5idFYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aCWvk6QZzP35P1Pt8SkfxLzgGFQ+bpeVohAzeO/wW1kj7zHDY6QSUYNyBG/EsPiFV sVX5GDSJVXrOfnalJd1Mqt+MXbrQCcI0lQKiSxFoarEc8+5aKmyzUP+g12xz4AFeae KhqqAQ091BhEW4Ane0geggXzF1QUxZ7mZRvNTnQY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , David Woodhouse , Paolo Bonzini Subject: [PATCH 5.15 04/20] KVM: Fix steal time asm constraints Date: Fri, 19 Nov 2021 18:39:22 +0100 Message-Id: <20211119171444.786349477@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211119171444.640508836@linuxfoundation.org> References: <20211119171444.640508836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Woodhouse commit 964b7aa0b040bdc6ec1c543ee620cda3f8b4c68a upstream. In 64-bit mode, x86 instruction encoding allows us to use the low 8 bits of any GPR as an 8-bit operand. In 32-bit mode, however, we can only use the [abcd] registers. For which, GCC has the "q" constraint instead of the less restrictive "r". Also fix st->preempted, which is an input/output operand rather than an input. Fixes: 7e2175ebd695 ("KVM: x86: Fix recording of guest steal time / preempted status") Reported-by: kernel test robot Signed-off-by: David Woodhouse Message-Id: <89bf72db1b859990355f9c40713a34e0d2d86c98.camel@infradead.org> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/x86.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3242,9 +3242,9 @@ static void record_steal_time(struct kvm "xor %1, %1\n" "2:\n" _ASM_EXTABLE_UA(1b, 2b) - : "+r" (st_preempted), - "+&r" (err) - : "m" (st->preempted)); + : "+q" (st_preempted), + "+&r" (err), + "+m" (st->preempted)); if (err) goto out;