From patchwork Sun Nov 14 08:59:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 12617841 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 02D78C433F5 for ; Sun, 14 Nov 2021 08:59:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB31460C40 for ; Sun, 14 Nov 2021 08:59:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231912AbhKNJC3 (ORCPT ); Sun, 14 Nov 2021 04:02:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbhKNJCU (ORCPT ); Sun, 14 Nov 2021 04:02:20 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5743EC061746; Sun, 14 Nov 2021 00:59:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=MIME-Version:Content-Type:References: In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LEewlx/lPJSCHeagFTqoKloFM6YxEwP0ZfC42v17AN4=; b=X6xcRH6oW5ZpvKaOGe4HWPtGei Ok1vYRT7BhWSSEFUsFEfYIDSS+9f+l4eePLgxz/3zvbuDHgCj8m+5PAM6ztclcOFEMhun73Z3WPBS dUfciFXvWL0+Xcu5E4ucijyP8CetYZ3j1JKSF8+Fbn3mOYQey/4QWK7IsC/ILOTGMkgkGrezJzk+P 60d7Ryi1P6sR++/ceNozEprCWPyNymvGppC5cTbbU+XnN5fZdVTW4y9SnWPtA+TYtdF+XQ9crJfMY d2hl3Fv/pKjXd+UqqVgtTNkGhFh63YXPAGgFWMo9TBvr/qosiIVvOCinsghAIaRZHXl3fpDuA3NRI l4HcbR1g==; Received: from [2001:8b0:10b:1::3ae] (helo=u3832b3a9db3152.ant.amazon.com) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mmBLu-00DTYg-Ol; Sun, 14 Nov 2021 08:59:07 +0000 Message-ID: <89bf72db1b859990355f9c40713a34e0d2d86c98.camel@infradead.org> Subject: [PATCH] KVM: Fix steal time asm constraints in 32-bit mode From: David Woodhouse To: kernel test robot , kvm Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Boris Ostrovsky , Joao Martins , "jmattson@google.com" , "wanpengli@tencent.com" , "seanjc@google.com" , "vkuznets@redhat.com" , "mtosatti@redhat.com" , "joro@8bytes.org" , karahmed@amazon.com Date: Sun, 14 Nov 2021 08:59:02 +0000 In-Reply-To: <202111141550.hY7mszt8-lkp@intel.com> References: <202111141550.hY7mszt8-lkp@intel.com> User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: David Woodhouse 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". Fixes: 7e2175ebd695 ("KVM: x86: Fix recording of guest steal time / preempted status") Reported-by: kernel test robot Signed-off-by: David Woodhouse --- arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 8f156905ae38..0a689bb62e9e 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3307,7 +3307,7 @@ static void record_steal_time(struct kvm_vcpu *vcpu) "xor %1, %1\n" "2:\n" _ASM_EXTABLE_UA(1b, 2b) - : "+r" (st_preempted), + : "+q" (st_preempted), "+&r" (err) : "m" (st->preempted)); if (err)