From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA992C433B4 for ; Fri, 14 May 2021 12:53:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F7C261460 for ; Fri, 14 May 2021 12:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233792AbhENMyL (ORCPT ); Fri, 14 May 2021 08:54:11 -0400 Received: from foss.arm.com ([217.140.110.172]:49200 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233764AbhENMyG (ORCPT ); Fri, 14 May 2021 08:54:06 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 707971476; Fri, 14 May 2021 05:52:49 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.0.219]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CCC43F73B; Fri, 14 May 2021 05:52:46 -0700 (PDT) Date: Fri, 14 May 2021 13:52:43 +0100 From: Mark Rutland To: Michael Kelley Cc: will@kernel.org, catalin.marinas@arm.com, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, arnd@arndb.de, wei.liu@kernel.org, ardb@kernel.org, daniel.lezcano@linaro.org, kys@microsoft.com Subject: Re: [PATCH v10 2/7] arm64: hyperv: Add Hyper-V hypercall and register access utilities Message-ID: <20210514125243.GC30645@C02TD0UTHF1T.local> References: <1620841067-46606-1-git-send-email-mikelley@microsoft.com> <1620841067-46606-3-git-send-email-mikelley@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1620841067-46606-3-git-send-email-mikelley@microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 12, 2021 at 10:37:42AM -0700, Michael Kelley wrote: > hyperv-tlfs.h defines Hyper-V interfaces from the Hyper-V Top Level > Functional Spec (TLFS), and #includes the architecture-independent > part of hyperv-tlfs.h in include/asm-generic. The published TLFS > is distinctly oriented to x86/x64, so the ARM64-specific > hyperv-tlfs.h includes information for ARM64 that is not yet formally > published. The TLFS is available here: > > docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs > > mshyperv.h defines Linux-specific structures and routines for > interacting with Hyper-V on ARM64, and #includes the architecture- > independent part of mshyperv.h in include/asm-generic. > > Use these definitions to provide utility functions to make > Hyper-V hypercalls and to get and set Hyper-V provided > registers associated with a virtual processor. > > Signed-off-by: Michael Kelley > Reviewed-by: Sunil Muthuswamy > --- > MAINTAINERS | 3 + > arch/arm64/Kbuild | 1 + > arch/arm64/hyperv/Makefile | 2 + > arch/arm64/hyperv/hv_core.c | 130 +++++++++++++++++++++++++++++++++++ > arch/arm64/include/asm/hyperv-tlfs.h | 69 +++++++++++++++++++ > arch/arm64/include/asm/mshyperv.h | 54 +++++++++++++++ > 6 files changed, 259 insertions(+) > create mode 100644 arch/arm64/hyperv/Makefile > create mode 100644 arch/arm64/hyperv/hv_core.c > create mode 100644 arch/arm64/include/asm/hyperv-tlfs.h > create mode 100644 arch/arm64/include/asm/mshyperv.h > +/* > + * hv_do_hypercall- Invoke the specified hypercall > + */ > +u64 hv_do_hypercall(u64 control, void *input, void *output) > +{ > + struct arm_smccc_res res; > + u64 input_address; > + u64 output_address; > + > + input_address = input ? virt_to_phys(input) : 0; > + output_address = output ? virt_to_phys(output) : 0; I may have asked this before, but are `input` and `output` always linear map pointers, or can they ever be vmalloc pointers? Otherwise, this looks fine to me. Mark. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27FEBC433ED for ; Fri, 14 May 2021 12:54:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D661261206 for ; Fri, 14 May 2021 12:54:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D661261206 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8eOBpz/gCQezzp2ztbbzXfW9c5H4RWdGVrva8hTCx7o=; b=IWwMJZ5tT9+684hhQuf6nrwLY EuFWkidv3pVbz8GnndBWElPkmkwd4DqNO9v5rtz3VBiROXAS6fcpk7YO4ziw/8hKWHKsrHAdlUV7A GNYb1V1DryEyGLJ0dnWcLWm8z2ZIfnTCK7FEBfAW19AHtghS+ysN9p5qLqKVzI5MjLGZWZ/F1mW9c NI/pKW9b7EKb7+9BlQLxhEQfftUK5DbXdwCJgjH3dsCn4d85RVNhDZmjTVK27a6Lz//wgXverdqpm DSnunou3i3Z6OnkfEsDz9Xu4TBZjRsPKgwhlMRX7CF+zz6LjoCShyrR8PlHFxlOI/+JLvTzkbuMDS xe67poM/g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhXJL-0084tS-25; Fri, 14 May 2021 12:52:59 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhXJG-0084sn-TR for linux-arm-kernel@desiato.infradead.org; Fri, 14 May 2021 12:52:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=XMdHErXqt+YwpwaSzuIdp5BhUlNYLEjqGfcbteYE/lc=; b=NiedvSesH/qTroknCAEeHhVfMg NUNVP3zjMPsgKRVKkvaMDb29zHWysWvwE1fhNZOqozNLB8yfh7rOdl4LKUKZTn39Rj1w85CKWfi13 K7ZRFf+jMdNB6xQ6d+Cck1zPyToysVSh1ZQqKpT/qbcFtKu7DEDTtPtIHGkKwQ8AyABGurl7c8irY vn4LJ4++JqTs5M6bA1SH8zOK+KvpWl6uaZpyBkeL4AEq0hT45TabOWFNNCb9bwMYpQZCdD0xPVA8p Vt1EMFO6FmZTV5mqz0XYxYWku2f2eDrwcX7+5OSBO6PHFyPENOHPlN6iGoTqHnbRNrw4ABkDTf/e9 ewDMDzNA==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhXJE-00Bz9c-9c for linux-arm-kernel@lists.infradead.org; Fri, 14 May 2021 12:52:53 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 707971476; Fri, 14 May 2021 05:52:49 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.0.219]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CCC43F73B; Fri, 14 May 2021 05:52:46 -0700 (PDT) Date: Fri, 14 May 2021 13:52:43 +0100 From: Mark Rutland To: Michael Kelley Cc: will@kernel.org, catalin.marinas@arm.com, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, arnd@arndb.de, wei.liu@kernel.org, ardb@kernel.org, daniel.lezcano@linaro.org, kys@microsoft.com Subject: Re: [PATCH v10 2/7] arm64: hyperv: Add Hyper-V hypercall and register access utilities Message-ID: <20210514125243.GC30645@C02TD0UTHF1T.local> References: <1620841067-46606-1-git-send-email-mikelley@microsoft.com> <1620841067-46606-3-git-send-email-mikelley@microsoft.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1620841067-46606-3-git-send-email-mikelley@microsoft.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_055252_402822_8CB40A02 X-CRM114-Status: GOOD ( 17.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 12, 2021 at 10:37:42AM -0700, Michael Kelley wrote: > hyperv-tlfs.h defines Hyper-V interfaces from the Hyper-V Top Level > Functional Spec (TLFS), and #includes the architecture-independent > part of hyperv-tlfs.h in include/asm-generic. The published TLFS > is distinctly oriented to x86/x64, so the ARM64-specific > hyperv-tlfs.h includes information for ARM64 that is not yet formally > published. The TLFS is available here: > > docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs > > mshyperv.h defines Linux-specific structures and routines for > interacting with Hyper-V on ARM64, and #includes the architecture- > independent part of mshyperv.h in include/asm-generic. > > Use these definitions to provide utility functions to make > Hyper-V hypercalls and to get and set Hyper-V provided > registers associated with a virtual processor. > > Signed-off-by: Michael Kelley > Reviewed-by: Sunil Muthuswamy > --- > MAINTAINERS | 3 + > arch/arm64/Kbuild | 1 + > arch/arm64/hyperv/Makefile | 2 + > arch/arm64/hyperv/hv_core.c | 130 +++++++++++++++++++++++++++++++++++ > arch/arm64/include/asm/hyperv-tlfs.h | 69 +++++++++++++++++++ > arch/arm64/include/asm/mshyperv.h | 54 +++++++++++++++ > 6 files changed, 259 insertions(+) > create mode 100644 arch/arm64/hyperv/Makefile > create mode 100644 arch/arm64/hyperv/hv_core.c > create mode 100644 arch/arm64/include/asm/hyperv-tlfs.h > create mode 100644 arch/arm64/include/asm/mshyperv.h > +/* > + * hv_do_hypercall- Invoke the specified hypercall > + */ > +u64 hv_do_hypercall(u64 control, void *input, void *output) > +{ > + struct arm_smccc_res res; > + u64 input_address; > + u64 output_address; > + > + input_address = input ? virt_to_phys(input) : 0; > + output_address = output ? virt_to_phys(output) : 0; I may have asked this before, but are `input` and `output` always linear map pointers, or can they ever be vmalloc pointers? Otherwise, this looks fine to me. Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel