Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1858477rwb; Fri, 19 Aug 2022 10:33:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR5BsLqFsQoOXfzp6lpb3e4z+6DzceF3+5kMcpdQ35odVzu+PFyPrfABJnWUgr1UNYGlfiN9 X-Received: by 2002:a65:42c8:0:b0:41a:8138:f47f with SMTP id l8-20020a6542c8000000b0041a8138f47fmr7171270pgp.476.1660930390050; Fri, 19 Aug 2022 10:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930390; cv=none; d=google.com; s=arc-20160816; b=BmTwYR6YwQhHLvwR7Bqa37NT7sPWVi1tQSCbiE/29clewbOlmXycZC8djxds9JKHkY fDWqzCF6wildUJAQ6gTKJKNAgX4rFq7TmSkwXBCPTVQa0erToRa3t29dE+KgjbA0qdy7 0Aa9AsOFZhaGHEfUY8+8ZzcIesiN7A36/TDyZWQXNEgipBmX21FYYY6oMBmw22slgcxQ yQVAlhB4iiJLbHVF2PddHgMhhi3YAQZlvA7qycKD589HsrJkbGxowU5UPiwfMk95vHef txwZ9tfBEJOrHrwf50WQemUIaAOVEwuvUEZrzRddeqJzWm8zrglb1HeIxYMxU6hu/f4O dKew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XZqO0xnMAeBs2JAw1Scubxm/nv4wK264XXl41mPP3cY=; b=b8/l1O9pB7mvDxVB2GfCLw436RsCxX7IEocewBJuKcLfTi5U71XWtGECdb5b9JfcCt JzG/PzDrSwTZozxGsDIXv0EfPluG165hGZFCU0bQvWo9YnwUD8pu02SvFRNgPWPqnBve Bkom7Jfa7Ex/8d+C/fpIXrwYp5tAKwKRwHHZYAWeURlho49YcygTKaU1W3I8XUKVK+K1 zG4DtEj4yPFlCQ35kF9m+oVIBazBBDAB/Xj1scSrSxEfBNbYa6JWfs6h7c6lKDzS8k40 +LvvVcCq1IcwGOEv25MqJIg3Ip0Ts8PqwHqVB4k5aYPggS0Lwr2QtQn7xCoiHxf2633O TTww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tZFXvWZF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a17090332c800b00172aa1ed560si4720666plr.138.2022.08.19.10.32.59; Fri, 19 Aug 2022 10:33:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tZFXvWZF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352240AbiHSQ2k (ORCPT + 99 others); Fri, 19 Aug 2022 12:28:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352964AbiHSQZ4 (ORCPT ); Fri, 19 Aug 2022 12:25:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B3CCD7AA; Fri, 19 Aug 2022 09:03:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 95B376177D; Fri, 19 Aug 2022 16:03:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DCA4C433C1; Fri, 19 Aug 2022 16:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925008; bh=pqdQLRP42is6J4yONh0EUvZdjqKEWNKz2KLGxYYby6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tZFXvWZFhveLQopamTKTkRoE3RxIN2pxGztPRs9H2DHp9cklOdx7rgGjhCYFWzav+ aNi/r0hLZhdrGQQJ2JBgNjDB8DuBeOcF6m0u6wIVgGXHI0s6cdR4549mzP8f+D3nV1 uTLCN/zLVcOh0eFYEu5khICvrUxryegWDLiE5rtI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrei Vagin , Paolo Bonzini , Sasha Levin Subject: [PATCH 5.10 354/545] selftests: kvm: set rax before vmcall Date: Fri, 19 Aug 2022 17:42:04 +0200 Message-Id: <20220819153845.226419355@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrei Vagin [ Upstream commit 281106f938d3daaea6f8b6723a8217a2a1ef6936 ] kvm_hypercall has to place the hypercall number in rax. Trace events show that kvm_pv_test doesn't work properly: kvm_pv_test-53132: kvm_hypercall: nr 0x0 a0 0x0 a1 0x0 a2 0x0 a3 0x0 kvm_pv_test-53132: kvm_hypercall: nr 0x0 a0 0x0 a1 0x0 a2 0x0 a3 0x0 kvm_pv_test-53132: kvm_hypercall: nr 0x0 a0 0x0 a1 0x0 a2 0x0 a3 0x0 With this change, it starts working as expected: kvm_pv_test-54285: kvm_hypercall: nr 0x5 a0 0x0 a1 0x0 a2 0x0 a3 0x0 kvm_pv_test-54285: kvm_hypercall: nr 0xa a0 0x0 a1 0x0 a2 0x0 a3 0x0 kvm_pv_test-54285: kvm_hypercall: nr 0xb a0 0x0 a1 0x0 a2 0x0 a3 0x0 Signed-off-by: Andrei Vagin Message-Id: <20220722230241.1944655-5-avagin@google.com> Fixes: ac4a4d6de22e ("selftests: kvm: test enforcement of paravirtual cpuid features") Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- tools/testing/selftests/kvm/lib/x86_64/processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c index d10c5c05bdf0..f5d2d27bee05 100644 --- a/tools/testing/selftests/kvm/lib/x86_64/processor.c +++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c @@ -1253,6 +1253,6 @@ uint64_t kvm_hypercall(uint64_t nr, uint64_t a0, uint64_t a1, uint64_t a2, asm volatile("vmcall" : "=a"(r) - : "b"(a0), "c"(a1), "d"(a2), "S"(a3)); + : "a"(nr), "b"(a0), "c"(a1), "d"(a2), "S"(a3)); return r; } -- 2.35.1