Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp956845iob; Fri, 13 May 2022 17:40:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCIsdkGBOnlL/FcDLziS/hAtDH3Kv0coOt2i2l8Gj/56xgFB34yL1qiTRgO9mbR7o8hDNY X-Received: by 2002:adf:f346:0:b0:20a:c23f:fb14 with SMTP id e6-20020adff346000000b0020ac23ffb14mr5920011wrp.25.1652488807188; Fri, 13 May 2022 17:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652488807; cv=none; d=google.com; s=arc-20160816; b=jvswUYgWsyw4VEA4RqjPbLmkkYYaITHRFGA2XssyRVbJGzCGgm4XvW7ma+4KzTlKCA 7bp/m8XpR8Qgg/fPEu/3fb0kC2PoGCRFsHb/scEARrKipb+9xQeq053M71wgI01Vhcua ulxuIeH1qz+NXwM8IRvARsFtAvU3zMfuwSwR8XTxdRSegVwz7KNHyo+aO88sEE2/gfb6 G5EG8odsBhBIq5Cuk/jhiq4LCbooDDY1SPtmdmRwvOQ9oBZEjiKwmEUOgVMGD+YBl6nI k/2EiQWiiexb26CT8foBifPcSiAGR6xeX6JgsLrc1NJvOVnnq/fhlL0sVLzZIDP97Tcc RMiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Jy6c2iz4pBZ4h+6A8F5x31O1bbz13zfB7+MvdwkltFQ=; b=pRpeaMrJfWHYGaucRDljyBAChsW3OIKkXb5LGxPq0m9arWnalQ3jXwDnp/B6Ax5b1i ytJwNA/mOV/MTizYwqFRUsPUj5+4omfwLU10ZrKrynH6VTHdPYoYCFrJ+AYFUbbI68cS KlzstWFrWu6w+IwodVFMBIzqZXKH+4MYifz9RGGceiwA30CYBYmTBfdeXKLmAWW9x0eV IwT5Vqqze2qN+D3izKzw542/nU6/CQwBh1ZhyraYsrucqoUEHRYe1nEGobqhbDoqBout yfdXow6/m2coIE/8anpFmGbWqadxmM4jNXJK97MUxL/ZeRct5OpzSeDKAuLRWR5Rashq gsaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=V5E2LbmU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j32-20020a05600c1c2000b00393fbaea5dfsi4278474wms.187.2022.05.13.17.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:40:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=V5E2LbmU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2826F34EEAB; Fri, 13 May 2022 16:30:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357083AbiELRbu (ORCPT + 99 others); Thu, 12 May 2022 13:31:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357084AbiELRbr (ORCPT ); Thu, 12 May 2022 13:31:47 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07B8853E08 for ; Thu, 12 May 2022 10:31:46 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id z12so4021492ilp.8 for ; Thu, 12 May 2022 10:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Jy6c2iz4pBZ4h+6A8F5x31O1bbz13zfB7+MvdwkltFQ=; b=V5E2LbmUQEz+VqDpvO+TqhyA1VCGZZb3ILk4eW9F+NnQyIENOHalX+haeb7RBvqORn jBh4SYWNLX6kNf7FdM/WCCwrR6Pefkq6GfBB1ON1K7lYr1k0jaN1QnNC4B3I1FZqj1Nz A4Uhq6rzpkVVaHd2yzKh7gJ6MjwdWl3o6sNAk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Jy6c2iz4pBZ4h+6A8F5x31O1bbz13zfB7+MvdwkltFQ=; b=BRskMev2IWKOBeMRHSp8oR77F/wjB14u0F7DhmZdM3MJLBzgzEbabTl/zYBX+O8h8f s4m2EWzyFlJy63Yqeo7GoTjv/h5LgSD1BwahuRw78mHV/QJqf41VDltxdR8B2pcgdYUR G/xlXzJPzF7td+OE8TG/VNBdc1e7m7kW8jehjGPF/Pzt2frxu6+H7ZtqW0krUNWINlKm Vr0OeVH+ee9zh6f9gBi+/v2qwJQ/AVa/14VgGjH9qTGskDjuUDOzLSXkoinb+9Cv3/j1 hZDbBz2ql6Waj7Sz2j5BqAS+4asaN37FpjQR925/x8dzoxKy85j1A5d65HbCSNjo4Wik KrPg== X-Gm-Message-State: AOAM531gMyQFjJ6kdsYbeSXNMjHAg9RaBRkxNH2/gRgfnNg6+D0lsNli H9QgxLvfO9nT4AM+onOxqs0b6Q== X-Received: by 2002:a05:6e02:1a44:b0:2cf:d085:949a with SMTP id u4-20020a056e021a4400b002cfd085949amr571164ilv.131.1652376705348; Thu, 12 May 2022 10:31:45 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id x8-20020a056638034800b0032bee2b5acasm20650jap.165.2022.05.12.10.31.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 May 2022 10:31:44 -0700 (PDT) Subject: Re: [RFC V2 PATCH 1/8] selftests: kvm: Fix inline assembly for hypercall To: Vishal Annapurve , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: pbonzini@redhat.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, shauh@kernel.org, yang.zhong@intel.com, drjones@redhat.com, ricarkol@google.com, aaronlewis@google.com, wei.w.wang@intel.com, kirill.shutemov@linux.intel.com, corbet@lwn.net, hughd@google.com, jlayton@kernel.org, bfields@fieldses.org, akpm@linux-foundation.org, chao.p.peng@linux.intel.com, yu.c.zhang@linux.intel.com, jun.nakajima@intel.com, dave.hansen@intel.com, michael.roth@amd.com, qperret@google.com, steven.price@arm.com, ak@linux.intel.com, david@redhat.com, luto@kernel.org, vbabka@suse.cz, marcorr@google.com, erdemaktas@google.com, pgonda@google.com, nikunj@amd.com, seanjc@google.com, diviness@google.com, Shuah Khan References: <20220511000811.384766-1-vannapurve@google.com> <20220511000811.384766-2-vannapurve@google.com> From: Shuah Khan Message-ID: <506a2e59-eea5-8c1e-ee1b-fbb7a401bd8d@linuxfoundation.org> Date: Thu, 12 May 2022 11:31:43 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220511000811.384766-2-vannapurve@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 5/10/22 6:08 PM, Vishal Annapurve wrote: > Fix inline assembly for hypercall to explicitly set > eax with hypercall number to allow the implementation > to work even in cases where compiler would inline the > function. > Please explain what happens without this change as well. > Signed-off-by: Vishal Annapurve > --- > 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 9f000dfb5594..4d88e1a553bf 100644 > --- a/tools/testing/selftests/kvm/lib/x86_64/processor.c > +++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c > @@ -1461,7 +1461,7 @@ 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; > } > > With the above change to commit log: Reviewed-by: Shuah Khan thanks, -- Shuah