Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3170827rwb; Fri, 9 Dec 2022 10:49:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf5EjolbpjZUva9dBQQ3h1YGmZW08nNMdJODdP3sqySRz+MS5PuUgRzhPmjLPhScJ46e7Q0s X-Received: by 2002:aa7:c79a:0:b0:467:b851:6057 with SMTP id n26-20020aa7c79a000000b00467b8516057mr5816662eds.18.1670611797306; Fri, 09 Dec 2022 10:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670611797; cv=none; d=google.com; s=arc-20160816; b=Zv5jRJqGuWLqnbAwnCWC4v/HiH458LPUGw9G75UVGs8h+qhZwOsCr/ZsYr7akhqgm4 I6uE+oKc87Ff90t2QVVWZQfY6UhPucY6O30jMAvTagpIFQO/ur+IKlR2mDQC3B1vIDAt 1GOudS5wf5sO9LIaMZCIyflFjea9PMit6A2wYX9QgtzsxM6JAovus39NgOkq1RxPx1HS fybnzxcfsh8udw6/u3llsWtqEbKPPZbsAhV0uqo8q37rSrwHxTqlDlyqE3JYDFRMYLJT 4FWY+Nx3GGqrDuwuCCybWxmlQvdVLe7cSq4GmzYkEtmZYvb2eC3tXr4t8qeQ2hC7+XcL Fjgw== 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:dkim-filter; bh=mPQ5Pjo/m7v+67q4Raz9XyS5DasZGKCTCRBKkqpVwoU=; b=TqNnG3OnJRlvcrO7ZFy3NZI29lII0HFQIS9ORonvh1J1XeMwSCEB9Scyl+lhMRUhA8 PidDQkykiRQjU3CkEAk9Bvf4oKE5+1IK+YZez92i+J9kk6+ROep0TxLlh5TLutSHXPJo v25ZFUWH7kZbshuUj9uCSHkT3/3Gmdi+UUHCgEFV99QjtudF5pwepw9y7GD67DWzA7WI j0L3eMKMZHluDSSxM9GcGZ9sGBJPtsXboDwGL/fztgafX58UYLIvGhGLROJ9bUmJgT/v x4o/cI4xhRiqoGCFe9HNDqs7Btffkhaz1J54JeA+DHNujDCKFv+VxjhH3w9RjR1kGNCu /ojQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=ShBUGDBl; 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=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a056402274400b0046b392e8c56si2434101edd.10.2022.12.09.10.49.40; Fri, 09 Dec 2022 10:49:57 -0800 (PST) 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=@linux.microsoft.com header.s=default header.b=ShBUGDBl; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbiLISQg (ORCPT + 74 others); Fri, 9 Dec 2022 13:16:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiLISQc (ORCPT ); Fri, 9 Dec 2022 13:16:32 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7E652A56FC; Fri, 9 Dec 2022 10:16:32 -0800 (PST) Received: from [192.168.0.5] (71-212-113-106.tukw.qwest.net [71.212.113.106]) by linux.microsoft.com (Postfix) with ESMTPSA id E537320B83C2; Fri, 9 Dec 2022 10:16:31 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E537320B83C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1670609792; bh=mPQ5Pjo/m7v+67q4Raz9XyS5DasZGKCTCRBKkqpVwoU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ShBUGDBlna8wyI2PHoqAqGDivoLGnwR+7ys0zXXEIeH005+Ss6uH19gwWvsBzQuZh 8avQvjYV611vJ/9Jc6rDiRIseqhPR4yTrIYYolQfxhpCK4SJ9CFCY69zjVAfpkP8Yq 3Ld9Lm6+8W2YPTzPvvhyhoK7BLmzega4+w+0X8Qg= Subject: Re: [PATCH v8 3/5] x86/hyperv: Add an interface to do nested hypercalls To: Jinank Jain , jinankjain@microsoft.com Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, arnd@arndb.de, peterz@infradead.org, jpoimboe@kernel.org, seanjc@google.com, kirill.shutemov@linux.intel.com, ak@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, anrayabh@linux.microsoft.com, mikelley@microsoft.com References: From: Nuno Das Neves Message-ID: <45e8cd93-29a8-c80b-52a2-bde6d0c70856@linux.microsoft.com> Date: Fri, 9 Dec 2022 10:16:31 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-20.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 On 12/8/2022 9:32 PM, Jinank Jain wrote: > /* Fast hypercall with 8 bytes of input and no output */ > -static inline u64 hv_do_fast_hypercall8(u16 code, u64 input1) > +static inline u64 _hv_do_fast_hypercall8(u64 control, u16 code, u64 input1) > { > - u64 hv_status, control = (u64)code | HV_HYPERCALL_FAST_BIT; > + u64 hv_status; The parameter 'code' seems to be unused in this function now. Can we just replace it with 'control'? > > #ifdef CONFIG_X86_64 > { > @@ -105,10 +111,24 @@ static inline u64 hv_do_fast_hypercall8(u16 code, u64 input1) > return hv_status; > } > > +static inline u64 hv_do_fast_hypercall8(u16 code, u64 input1) > +{ > + u64 control = (u64)code | HV_HYPERCALL_FAST_BIT; > + > + return _hv_do_fast_hypercall8(control, code, input1); > +} > + > +static inline u64 hv_do_fast_nested_hypercall8(u16 code, u64 input1) > +{ > + u64 control = (u64)code | HV_HYPERCALL_FAST_BIT | HV_HYPERCALL_NESTED; > + > + return _hv_do_fast_hypercall8(control, code, input1); > +} > + > /* Fast hypercall with 16 bytes of input */ > -static inline u64 hv_do_fast_hypercall16(u16 code, u64 input1, u64 input2) > +static inline u64 _hv_do_fast_hypercall16(u64 control, u16 code, u64 input1, u64 input2) > { > - u64 hv_status, control = (u64)code | HV_HYPERCALL_FAST_BIT; > + u64 hv_status; Ditto > > #ifdef CONFIG_X86_64 > { > @@ -139,6 +159,20 @@ static inline u64 hv_do_fast_hypercall16(u16 code, u64 input1, u64 input2) > return hv_status; > } > > +static inline u64 hv_do_fast_hypercall16(u16 code, u64 input1, u64 input2) > +{ > + u64 control = (u64)code | HV_HYPERCALL_FAST_BIT; > + > + return _hv_do_fast_hypercall16(control, code, input1, input2); > +} > + > +static inline u64 hv_do_fast_nested_hypercall16(u16 code, u64 input1, u64 input2) > +{ > + u64 control = (u64)code | HV_HYPERCALL_FAST_BIT | HV_HYPERCALL_NESTED; > + > + return _hv_do_fast_hypercall16(control, code, input1, input2); > +}