Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1758631pxb; Sun, 18 Apr 2021 06:12:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLP6OgV2tIIuSaVztjl4s4LG3e2bvwvU/WlFVsMrUJ4vqHfEQnWMg9EfJSsnZKaVehuv/p X-Received: by 2002:a17:907:f93:: with SMTP id kb19mr17225816ejc.207.1618751541385; Sun, 18 Apr 2021 06:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618751541; cv=none; d=google.com; s=arc-20160816; b=Qy7a0MctzGnT0ooltf/KrHOdsfzV82/noiGTKuoCqmkSlmTYOGCgcc4/wcTzTwG+bl HiemgQXhpdiTLY8guv1abtnxhzcvb0o6acHNQfODTy4+6Oe0O4/0fU2Kv4JXacC4TAC0 EnQA95Xmu1+Nngsys1rBRhK8teNMXyvDsEtyF4A03D5ZdN7DxHDecIoLT3mkip8Z7fqe 3C/3/+gUUJXGDsR2F4Vy3E9O5O3oCMHbRPtqLAKyksIhaQUdwhvdnCGNEApEyVYwa5SU AbFEgxFiEc/bjmRhr7ItTOvvEqnKT2Q86/IucLexRgvNkLEVmpb7E1ie+FAgAk8hgwQT ufgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=1ZUeIciP6NTjRRy3hWXPiKcVedDmBXRhvWpAyqIu7Co=; b=e/+eTxpP/LdnXWU8PMlx1VHQlJnke3sPhTRNeXcvMz4j+1BAdbk8Fjt1li4zL5rBVx 110OmBvW6XCN4WvswHeZUtURlYDtzg7ygsMK7lXjFTy8qYJSTTeqLGLKcaTInzuLdh8R w5b/T2euZkd0SIvb+tYbmpepVJ+mxGm6HYETzZ1HtIfx9TU5OrCJwkSF9BXl4u9MeeBT nLR3Qle4pJdITEtJedyaqwvMi+H6GldVJ5Rt2kWJ14D9uSD81JesJZUchv5z7Rm61pMJ L4We3UnKJXX+f2Lr0VWEAXZvKOf8wtv8i2CvdAp8Mpz12p9pzoDyd6yAh0AazsltKHS2 NNXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d26si7827234edr.392.2021.04.18.06.11.58; Sun, 18 Apr 2021 06:12:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229986AbhDRNJh (ORCPT + 99 others); Sun, 18 Apr 2021 09:09:37 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:33626 "EHLO mail-wr1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbhDRNJf (ORCPT ); Sun, 18 Apr 2021 09:09:35 -0400 Received: by mail-wr1-f45.google.com with SMTP id g9so15177376wrx.0; Sun, 18 Apr 2021 06:09:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1ZUeIciP6NTjRRy3hWXPiKcVedDmBXRhvWpAyqIu7Co=; b=l0gU2yChu3RD8T0+jb0kXwsGOX9sD+uP+WdUSGCdMP9uWr8luB6x4Mp05BzE2zgJ8L 8r2QMJt4UIMiX1LJUz64zd6kc+YnC88rWtH/tdGrEUoUL7oI8ei4IP0v4G9e/hHUTfq3 0/AVdRp8f3a1Nbe8gyEfG0AprjRl9eaxa1eUPLxPVeHA81xjZvWECWSZns0Ro+2bGbJ6 QpJRvRb2EnSvsQzRPK5VZ1R/s9KgNLkNQE0/kL/KEc3WssVDK9XU3lC7tsRay38xondz oHRrBApKZTSNrz4nbotiCjJXKJx4p0Nysc88ns+FBh8JxeWMTzh97o1Wp4hcIb/4jSiL k1ww== X-Gm-Message-State: AOAM533vlw+r5xnw/8kT68LGA/PK9CiiVGXVYC/vHXDL6f+vPfKmNzcB vhgA04cUKvibfCjZxwlzR5J1c+aUgOs= X-Received: by 2002:a5d:6605:: with SMTP id n5mr9018275wru.116.1618751345104; Sun, 18 Apr 2021 06:09:05 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id a15sm18287943wrr.53.2021.04.18.06.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 06:09:04 -0700 (PDT) Date: Sun, 18 Apr 2021 13:09:03 +0000 From: Wei Liu To: joseph.salisbury@microsoft.com Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, mikelley@microsoft.com, x86@kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] x86/hyperv: Move hv_do_rep_hypercall to asm-generic Message-ID: <20210418130903.5r66yzm6qxizfrop@liuwe-devbox-debian-v2> References: <1618620183-9967-1-git-send-email-joseph.salisbury@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1618620183-9967-1-git-send-email-joseph.salisbury@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 05:43:02PM -0700, Joseph Salisbury wrote: > From: Joseph Salisbury > > This patch makes no functional changes. It simply moves hv_do_rep_hypercall() > out of arch/x86/include/asm/mshyperv.h and into asm-generic/mshyperv.h > > hv_do_rep_hypercall() is architecture independent, so it makes sense that it > should be in the architecture independent mshyperv.h, not in the x86-specific > mshyperv.h. > > This is done in preperation for a follow up patch which creates a consistent > pattern for checking Hyper-V hypercall status. > > Signed-off-by: Joseph Salisbury > --- [...] > +static inline u64 hv_do_rep_hypercall(u16 code, u16 rep_count, u16 varhead_size, > + void *input, void *output) > +{ > + u64 control = code; > + u64 status; > + u16 rep_comp; > + > + control |= (u64)varhead_size << HV_HYPERCALL_VARHEAD_OFFSET; > + control |= (u64)rep_count << HV_HYPERCALL_REP_COMP_OFFSET; > + > + do { > + status = hv_do_hypercall(control, input, output); > + if ((status & HV_HYPERCALL_RESULT_MASK) != HV_STATUS_SUCCESS) > + return status; > + > + /* Bits 32-43 of status have 'Reps completed' data. */ > + rep_comp = (status & HV_HYPERCALL_REP_COMP_MASK) >> > + HV_HYPERCALL_REP_COMP_OFFSET; > + > + control &= ~HV_HYPERCALL_REP_START_MASK; > + control |= (u64)rep_comp << HV_HYPERCALL_REP_START_OFFSET; > + > + touch_nmi_watchdog(); This seems to be missing in Arm. Does it compile? Wei. > + } while (rep_comp < rep_count); > + > + return status; > +} > > /* Generate the guest OS identifier as described in the Hyper-V TLFS */ > static inline __u64 generate_guest_id(__u64 d_info1, __u64 kernel_version, > -- > 2.17.1 >