From patchwork Wed Aug 4 15:52:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 12419299 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=-22.4 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,MENTIONS_GIT_HOSTING,MSGID_FROM_MTA_HEADER, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 C9A6EC4338F for ; Wed, 4 Aug 2021 15:56:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 948E660F14 for ; Wed, 4 Aug 2021 15:56:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 948E660F14 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HwaJX+TS+aZMLrv7XA9DzS5HM7GxejyHt7GETPwx38k=; b=3VE5EbNMVVR1lp DcW7Bzf6b3yOxH4gGedFK++qvvBoU8AI5U4uWDg3qAPvqUHn4hgXvWbfrKIPolS+UuRsc+tz0nyCz gM++e/GhKgJZPHfj6CZyhUWrvLU6HeIITicin9HyzTl4cl94tswzQylZVVo5fFkti5hqBTwSh5PEc j8KCJhsYpYfQTfnwb7ITVAukFts4qqJWROD3ftwnAuBd/uDrlVyj+FOztNDrQv0rTnQXX0xbtXyLU PUNnD7KLpsDDD1QZzTE4RN3i6wK9XMKIB7xhOi0Rh9HE3eGfY06LZGjOG5kOW8n0+Nuw3aMfnsWav hrGmP18MSBPtXxFJjqdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJD2-006dvb-5h; Wed, 04 Aug 2021 15:53:32 +0000 Received: from mail-bn8nam08on2103.outbound.protection.outlook.com ([40.107.100.103] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJCo-006drJ-JC for linux-arm-kernel@lists.infradead.org; Wed, 04 Aug 2021 15:53:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UnJVA7qMPt0Z5YkUwUfEm9wccedyf57eIoGhdVcU2O93K0xFgPdD+01bRvHU8aIC14k+cUezCdU9+Pe6nJH4rOBGCHkV3+YctWSMYn5HPteBjTEs5EO8KL/V5w6fWAhefLwb44sfKiI8HefnW+OtpFHJ6fqU9X311o2/0LOtpdi78Njz6TYEC2pc1EUeGjBTBdbcmOZRF6ZDYvjbs++On0t9dWea7Hy4eSXV8msnKhfsWg3O68oeo4nPwT/nuBrLu7+Ia/physMSW6qhZMPXakBBtjYBH1XdtShE1sqbvxDhRxqx9u5E9CdggvHFI9ekwdNAiyNBT59C5REHxnGAgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xvNCojoRZoE+wNtnejsTm8UK5OmTGOwqzFoxNWA7a7Q=; b=D6rb+S41sgsgCTWTy8q4q75Ubet2cYME0DtBPOGKvjccrw8vJ0kgUf84WG8mjbEmIsSDpaW+711OBkvQp/cGmQGTRU23kqr83njGAXZE7gyNYZ+XlBqoJc+Pt+yMz8BNihm4xfiZT9VvELbPPql9nTlxyxQOqOf00hpol0qQMh5j2N+IqY5MOLyPTgNWSvBOzjR/Yjeg9aukfuh/+iqr2Ngp7zshBatjURgI7xRDr0XZB5YIVNTP/cbOgkM7NyPPuLxPNQpJVo6Aner9aLb5ODmczraHWRU0VexqhSNrTieW1NpTfco1MI48k5AlpiQE+EBBeHehK/IMAc1Jy6UlOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xvNCojoRZoE+wNtnejsTm8UK5OmTGOwqzFoxNWA7a7Q=; b=joITtJiMaXadnfOQ1yX3DPXYSrdVESr3yb+C6WQ78g0gqA/lUsGMxs9gkJHqUiiYVIOSH8hpCvynAbd26BgrJziET4DEHWDaVvg8paUA5D0zd+H2ldlK98VBvBeWeHyQu1udN20I1t3MoyL448LGcHKdAkcGiLi1LF8rmQKgWgI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) by DM5PR2101MB1094.namprd21.prod.outlook.com (2603:10b6:4:a2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.1; Wed, 4 Aug 2021 15:53:10 +0000 Received: from DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670]) by DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670%9]) with mapi id 15.20.4415.005; Wed, 4 Aug 2021 15:53:10 +0000 From: Michael Kelley To: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, wei.liu@kernel.org, kys@microsoft.com, sthemmin@microsoft.com, ardb@kernel.org Cc: mikelley@microsoft.com Subject: [PATCH v12 1/5] arm64: hyperv: Add Hyper-V hypercall and register access utilities Date: Wed, 4 Aug 2021 08:52:35 -0700 Message-Id: <1628092359-61351-2-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> References: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) To DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mhkdev.corp.microsoft.com (167.220.2.16) by CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Wed, 4 Aug 2021 15:53:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6b15b44c-28ab-4f23-83f6-08d9575ff5c0 X-MS-TrafficTypeDiagnostic: DM5PR2101MB1094: X-MS-Exchange-Transport-Forked: True X-LD-Processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jc7IyzLfv7eqMnAqPGzQQRBZx32krDM7OcGnUMitG8IcXWoXuEglgpsF2xC3PHORln6qko9iGq900Qd8KK5gw3uT5cwpqiCyW3R/YZm7peEe+EBQcbuGhpqTkYJuk40undgT6NB3lp+WaQznqmhbXZQDfznaldat7waY3UF1Iq3C3zzK0yan/q5RM5QOcVbevy9B7bi4+7LzmpyO41f+UYyrEdi2ZgC/psD2LpabyyR7UdIS9rZeFb6D7Ky3xOi+OPyAKVwj+0mE3AycM3/qDcnBu/J211p0bAMnHdktl5GbAG/8mY1In+BfGfq/7PGnzuQglirl2AXbX4EayokF4MnkFFxVzykBRqGh7tntPejCweLoTd3TdC1hRSjG8sc7ZVyHdG++uEBtKUNJfkB4r8+qJdWFtRCyIvqUnBZ4VOQ0Vjz+5Oli1fsYCtsK+EVQLtVG4CbWwvsYIxw/jn1Piv8J2FtQHvLHy+eMG4+1YBYzAHSQDRSgX0VeuMKcsQ1OIvN5xEOtyOsXK/iXPXwNpNxCF4anLPFCThivCFznop9pPgnbFzkDqFEsn2FCYJUVjzRXAf+JTQH+zWPfMLRbgqpmbeVrCwU25K4fewRQQEZZSWNECS8HuG/8ObAOoUFUxFZ4/kjmozDoanCWuFHsP4ifzAIc/WLxA2QuFdZR6c8XCntDZRJBY9K59XC/lIuxrPmn71NgSEW4CBxFk0nrsP7dhTxKgsx4aofbCdBulkZfGRvUTBN6utm6G7LXMjBckQFjKbXQrIOdsRVjXYOc0qbZE8Lf8Ood8MjmMEWqR3p9pFNaNv4GSw8EJ41ft6pI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR21MB1514.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(26005)(52116002)(6666004)(186003)(7696005)(86362001)(82950400001)(82960400001)(508600001)(10290500003)(921005)(38100700002)(38350700002)(83380400001)(2906002)(66476007)(36756003)(2616005)(66556008)(107886003)(8676002)(66946007)(956004)(966005)(4326008)(8936002)(316002)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XgYnihePhWfXosJG2UZtvuNXrUG/l0ADXmHABKyedQf2TJ2jSzw6drtGcBN9upn1Cfm2eKY2yyr18prn79uOLYZo8611qAAklJTgZFLK1RLjaU0ogql8pdYNNX4yo7l/VBR4vB0lbBh8TBKI87zSeIdG9UIRYxQbjSL+1QaAuqW/nAs46ppUoPwwnoljRzBWuxBfBMOU/m8PR9EzWaanxlcfnup89pNw2frlvom21eVqDEFDB2ZJY/SgdS6ikDvYwjXDeQwDCcW/So8PD0Fer4jGQtn0AMiSjWLzH6WSbyYYRkOlTVSlcJL94CFM6kGSnUmUTvtJEbj71/GEe2el+lHX2s/gEbUyP+cC0jBTU41Pp5qcFN2EsLFhOCO8pCWB7ezvoD4fsey49hvRkGAT2GT5cQjOkhoi1bdoY0LF/uHwPGHjOSs2fYmyJMnxRVdSs3M0gZHJrduV1/o0RRCmXxGpyh+/qgtVilNSnAoffYEX925lLbipO0aBNvfTqeQ7SmXhi1tw1gLqwE1wHEU1KiEOE+VActfcsJugOeonWoaYFCyf738kAY7RvvUQcAwUJMsI4pOlF0uJKjKwKmUBS3kA08Y8+o+8QFkeab78a2sqxgFG0ibRrudTn3Qo3duFhMiLdKOfN54ob2Y+SRtV54NaCTNVnVch/ddIUWSOuusLu/oPu44wWZ5+6W2TIbhIsUwaGw5nagF+Tb/PHRKyv7zf+kafVM9z9nByFXg0YYujTz4aZB3T8KiHVSLiOQ/ysVNNzD1auMu3Nkelxit5owZt0kKDwBN6BmoncXZaPl/Q9YvNio9qJvcfSH5YY/QFtnVVLjOgzleFoHdEqRzteTp8ELgZkt50bIJEi++eSOBxkbLu8jtfg2pfLWUDGDQ2YHL8llHx+c1VHPthp/qXcUFNFlqhyX5dKn0SfDhmlI8g/1sUXvQ6mTU4lL2JvJitLPkAmMhLUn1b0CspmoVdYZdXPqauNPom+SkGjwWRJKo3G4vMijPzrqdXLry4Sors2WHbed7KIuODsNixoEct/i0pL1NSEYT9QAJOPEV4NAO/h1za1afnNWG6N8bY1ulZqf/zvGnzLdWdqwhDtjr8F0T3R4dz+1iPFwxd1w1xNN9qZ6XoFJF3L69PSxXMWi04Bhyt2iViU/2+dBLCQMhJgX8eb4yh00IweEjSN+v4zpOQJeuHqIqVcJKqYUYuIf5o6TjlR+/xBK/tdM/Co3iraNwDtAW4KUD6JgBTgqcmZi3gX063a793M3NKFIloVmko7SWo6bgrTLnz0zdcnWjuLZ+EDVYs5zA8vDngm4ab32Xq4cKARjhadte0CMGq9iIe X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b15b44c-28ab-4f23-83f6-08d9575ff5c0 X-MS-Exchange-CrossTenant-AuthSource: DM6PR21MB1514.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2021 15:53:10.7315 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QhQspp8D1nZWrY5pZnOkXf43grDQTlGX5gAvIAsgxSjZTCpaXpDDleLs1skms4o1gHL9EcCaRxY1Q3azFHGk8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1094 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210804_085318_668250_5CF3AA77 X-CRM114-Status: GOOD ( 22.70 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Acked-by: Marc Zyngier Acked-by: Mark Rutland --- MAINTAINERS | 3 + arch/arm64/Kbuild | 1 + arch/arm64/hyperv/Makefile | 2 + arch/arm64/hyperv/hv_core.c | 129 +++++++++++++++++++++++++++++++++++ arch/arm64/include/asm/hyperv-tlfs.h | 69 +++++++++++++++++++ arch/arm64/include/asm/mshyperv.h | 54 +++++++++++++++ 6 files changed, 258 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 diff --git a/MAINTAINERS b/MAINTAINERS index 6993219..8f6f429 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8608,6 +8608,9 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux.git F: Documentation/ABI/stable/sysfs-bus-vmbus F: Documentation/ABI/testing/debugfs-hyperv F: Documentation/networking/device_drivers/ethernet/microsoft/netvsc.rst +F: arch/arm64/hyperv +F: arch/arm64/include/asm/hyperv-tlfs.h +F: arch/arm64/include/asm/mshyperv.h F: arch/x86/hyperv F: arch/x86/include/asm/hyperv-tlfs.h F: arch/x86/include/asm/mshyperv.h diff --git a/arch/arm64/Kbuild b/arch/arm64/Kbuild index 7b393cf..ea7ab4c 100644 --- a/arch/arm64/Kbuild +++ b/arch/arm64/Kbuild @@ -2,4 +2,5 @@ obj-y += kernel/ mm/ net/ obj-$(CONFIG_KVM) += kvm/ obj-$(CONFIG_XEN) += xen/ +obj-$(subst m,y,$(CONFIG_HYPERV)) += hyperv/ obj-$(CONFIG_CRYPTO) += crypto/ diff --git a/arch/arm64/hyperv/Makefile b/arch/arm64/hyperv/Makefile new file mode 100644 index 0000000..1697d30 --- /dev/null +++ b/arch/arm64/hyperv/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +obj-y := hv_core.o diff --git a/arch/arm64/hyperv/hv_core.c b/arch/arm64/hyperv/hv_core.c new file mode 100644 index 0000000..4c5dc0f --- /dev/null +++ b/arch/arm64/hyperv/hv_core.c @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * Low level utility routines for interacting with Hyper-V. + * + * Copyright (C) 2021, Microsoft, Inc. + * + * Author : Michael Kelley + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * 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; + + arm_smccc_1_1_hvc(HV_FUNC_ID, control, + input_address, output_address, &res); + return res.a0; +} +EXPORT_SYMBOL_GPL(hv_do_hypercall); + +/* + * hv_do_fast_hypercall8 -- Invoke the specified hypercall + * with arguments in registers instead of physical memory. + * Avoids the overhead of virt_to_phys for simple hypercalls. + */ + +u64 hv_do_fast_hypercall8(u16 code, u64 input) +{ + struct arm_smccc_res res; + u64 control; + + control = (u64)code | HV_HYPERCALL_FAST_BIT; + + arm_smccc_1_1_hvc(HV_FUNC_ID, control, input, &res); + return res.a0; +} +EXPORT_SYMBOL_GPL(hv_do_fast_hypercall8); + +/* + * Set a single VP register to a 64-bit value. + */ +void hv_set_vpreg(u32 msr, u64 value) +{ + struct arm_smccc_res res; + + arm_smccc_1_1_hvc(HV_FUNC_ID, + HVCALL_SET_VP_REGISTERS | HV_HYPERCALL_FAST_BIT | + HV_HYPERCALL_REP_COMP_1, + HV_PARTITION_ID_SELF, + HV_VP_INDEX_SELF, + msr, + 0, + value, + 0, + &res); + + /* + * Something is fundamentally broken in the hypervisor if + * setting a VP register fails. There's really no way to + * continue as a guest VM, so panic. + */ + BUG_ON(!hv_result_success(res.a0)); +} +EXPORT_SYMBOL_GPL(hv_set_vpreg); + +/* + * Get the value of a single VP register. One version + * returns just 64 bits and another returns the full 128 bits. + * The two versions are separate to avoid complicating the + * calling sequence for the more frequently used 64 bit version. + */ + +void hv_get_vpreg_128(u32 msr, struct hv_get_vp_registers_output *result) +{ + struct arm_smccc_1_2_regs args; + struct arm_smccc_1_2_regs res; + + args.a0 = HV_FUNC_ID; + args.a1 = HVCALL_GET_VP_REGISTERS | HV_HYPERCALL_FAST_BIT | + HV_HYPERCALL_REP_COMP_1; + args.a2 = HV_PARTITION_ID_SELF; + args.a3 = HV_VP_INDEX_SELF; + args.a4 = msr; + + /* + * Use the SMCCC 1.2 interface because the results are in registers + * beyond X0-X3. + */ + arm_smccc_1_2_hvc(&args, &res); + + /* + * Something is fundamentally broken in the hypervisor if + * getting a VP register fails. There's really no way to + * continue as a guest VM, so panic. + */ + BUG_ON(!hv_result_success(res.a0)); + + result->as64.low = res.a6; + result->as64.high = res.a7; +} +EXPORT_SYMBOL_GPL(hv_get_vpreg_128); + +u64 hv_get_vpreg(u32 msr) +{ + struct hv_get_vp_registers_output output; + + hv_get_vpreg_128(msr, &output); + + return output.as64.low; +} +EXPORT_SYMBOL_GPL(hv_get_vpreg); diff --git a/arch/arm64/include/asm/hyperv-tlfs.h b/arch/arm64/include/asm/hyperv-tlfs.h new file mode 100644 index 0000000..4d964a7 --- /dev/null +++ b/arch/arm64/include/asm/hyperv-tlfs.h @@ -0,0 +1,69 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* + * This file contains definitions from the Hyper-V Hypervisor Top-Level + * Functional Specification (TLFS): + * https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs + * + * Copyright (C) 2021, Microsoft, Inc. + * + * Author : Michael Kelley + */ + +#ifndef _ASM_HYPERV_TLFS_H +#define _ASM_HYPERV_TLFS_H + +#include + +/* + * All data structures defined in the TLFS that are shared between Hyper-V + * and a guest VM use Little Endian byte ordering. This matches the default + * byte ordering of Linux running on ARM64, so no special handling is required. + */ + +/* + * These Hyper-V registers provide information equivalent to the CPUID + * instruction on x86/x64. + */ +#define HV_REGISTER_HYPERVISOR_VERSION 0x00000100 /*CPUID 0x40000002 */ +#define HV_REGISTER_FEATURES 0x00000200 /*CPUID 0x40000003 */ +#define HV_REGISTER_ENLIGHTENMENTS 0x00000201 /*CPUID 0x40000004 */ + +/* + * Group C Features. See the asm-generic version of hyperv-tlfs.h + * for a description of Feature Groups. + */ + +/* Crash MSRs available */ +#define HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE BIT(8) + +/* STIMER direct mode is available */ +#define HV_STIMER_DIRECT_MODE_AVAILABLE BIT(13) + +/* + * Synthetic register definitions equivalent to MSRs on x86/x64 + */ +#define HV_REGISTER_CRASH_P0 0x00000210 +#define HV_REGISTER_CRASH_P1 0x00000211 +#define HV_REGISTER_CRASH_P2 0x00000212 +#define HV_REGISTER_CRASH_P3 0x00000213 +#define HV_REGISTER_CRASH_P4 0x00000214 +#define HV_REGISTER_CRASH_CTL 0x00000215 + +#define HV_REGISTER_GUEST_OSID 0x00090002 +#define HV_REGISTER_VP_INDEX 0x00090003 +#define HV_REGISTER_TIME_REF_COUNT 0x00090004 +#define HV_REGISTER_REFERENCE_TSC 0x00090017 + +#define HV_REGISTER_SINT0 0x000A0000 +#define HV_REGISTER_SCONTROL 0x000A0010 +#define HV_REGISTER_SIEFP 0x000A0012 +#define HV_REGISTER_SIMP 0x000A0013 +#define HV_REGISTER_EOM 0x000A0014 + +#define HV_REGISTER_STIMER0_CONFIG 0x000B0000 +#define HV_REGISTER_STIMER0_COUNT 0x000B0001 + +#include + +#endif diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/mshyperv.h new file mode 100644 index 0000000..20070a8 --- /dev/null +++ b/arch/arm64/include/asm/mshyperv.h @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* + * Linux-specific definitions for managing interactions with Microsoft's + * Hyper-V hypervisor. The definitions in this file are specific to + * the ARM64 architecture. See include/asm-generic/mshyperv.h for + * definitions are that architecture independent. + * + * Definitions that are specified in the Hyper-V Top Level Functional + * Spec (TLFS) should not go in this file, but should instead go in + * hyperv-tlfs.h. + * + * Copyright (C) 2021, Microsoft, Inc. + * + * Author : Michael Kelley + */ + +#ifndef _ASM_MSHYPERV_H +#define _ASM_MSHYPERV_H + +#include +#include +#include + +/* + * Declare calls to get and set Hyper-V VP register values on ARM64, which + * requires a hypercall. + */ + +void hv_set_vpreg(u32 reg, u64 value); +u64 hv_get_vpreg(u32 reg); +void hv_get_vpreg_128(u32 reg, struct hv_get_vp_registers_output *result); + +static inline void hv_set_register(unsigned int reg, u64 value) +{ + hv_set_vpreg(reg, value); +} + +static inline u64 hv_get_register(unsigned int reg) +{ + return hv_get_vpreg(reg); +} + +/* SMCCC hypercall parameters */ +#define HV_SMCCC_FUNC_NUMBER 1 +#define HV_FUNC_ID ARM_SMCCC_CALL_VAL( \ + ARM_SMCCC_STD_CALL, \ + ARM_SMCCC_SMC_64, \ + ARM_SMCCC_OWNER_VENDOR_HYP, \ + HV_SMCCC_FUNC_NUMBER) + +#include + +#endif From patchwork Wed Aug 4 15:52:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 12419301 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=-17.4 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,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 A0FFDC4338F for ; Wed, 4 Aug 2021 15:56:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6732C60ED6 for ; Wed, 4 Aug 2021 15:56:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6732C60ED6 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qmftpl5x67xkQUDTq8NATt3jcAX06cvDtjkjGIVT3pA=; b=VdqUOwD1go2aXW lGJIWkVA3mVmPq9tmluPBMv5oqpySdu0OvGLEG/hsLDGBuSND9fTY6l+NJuD6TNheUGpZ/d4gQIhA Y3sO6lXRdkDP6f2KSemCkPmZSHWq6xoHfTxWqcWw5cJT8MaBrBNb2Qgid/hhIJw+6MxxLRRbnOcnz GYC95gRSC9smqQTIgvcBuFbU8Znw5m1d/CO98G+yrK0VTXmrhPSicps4lPy/CNB3hYkEbzgnO1ouZ 20AEe0Yp28gE9KIDdfv0pMP27Ja4WROHWhfq1S603lIeQIFC7D26NKvgPKihckDzZGQeZkpCUmphi 2/Yyis+3aa1JzH47KKIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJDC-006dxM-VY; Wed, 04 Aug 2021 15:53:43 +0000 Received: from mail-bn8nam08on2103.outbound.protection.outlook.com ([40.107.100.103] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJCq-006drJ-S8 for linux-arm-kernel@lists.infradead.org; Wed, 04 Aug 2021 15:53:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hMOeLZc9b1eGBkxxO5e1yipeYNAu44mr+MullA1EKIdKg+p1MRt7AZrcP95iJZ5k6KuUo+eKRb5EGAt1H1WIOqW7J3yDubRHGzBgwUzOlSJqvz5NrnYoccCrSuDiCAmtfsIugSq2dimYyoZGzoYvfnSTu/uJ9dBfD86khSb5YWdiVE+s+HL29nN0j3vZ4SrFfhUniuR6xqJxZVbtQHVhDgEUSMgH0oaNf3t/ZDlqwbOQfUU0uYIyo5UBn7gTtMuKyFeQ2pQfqBMIgf80BSPBn6QfCsURtqy0Rd8wH2HDsJUHLjLr983anEsD6l21ji6BT8rRqxYsG58I4gEZVs0fnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bR6yWwIC12Qn9oJTNddmHO1SwcRXNllw2dBR67NLJVc=; b=dMjZYCOBJ0tOI80rolgpHMapgkAaioklEPmbHErPsPmOlTFTIVwUoQ75Wr2ae73Y3UCUKKqCK54eJtGw+tjQqlxkg0ruyhf3pedzz/pHg2YfgdUu0UldggW00Wx2fVQpLoYB5HYvt+fyiwrIqPHDnixZmTCH+gEvOe5MVshhl6d7Hygdg8XuTEaO6wav510b2jf8hI5fJ8XehHJCO7dPEYzGLGVwZ+BV4nPNe1Omf6o4Ev1qiVjIZpdY7+6Xb7iAR7IqaO4IUMVKVnaAIN/AKykJY8dF2+m30/3ACQjfwBzMDrmNBELpBIA1+SNPvs7zuzC/vuotZTIFSt0Z7gEu8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bR6yWwIC12Qn9oJTNddmHO1SwcRXNllw2dBR67NLJVc=; b=NRbiS6iHEkf/lSDBUuzDHGAbBVnQCA/e3OqviILUvByWtzOI7DHVlqQvUxfQ61ZYhOOzCVEdRC6j3/Qxl/Nz2ntQxXBlQ20T4QorXr/1jenFQaaGypDNeqVlmZ5rwzCfumtBANocYgIa3MkgzS/N0JLORhc+WhuLEmBv6QTEUaE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) by DM5PR2101MB1094.namprd21.prod.outlook.com (2603:10b6:4:a2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.1; Wed, 4 Aug 2021 15:53:11 +0000 Received: from DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670]) by DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670%9]) with mapi id 15.20.4415.005; Wed, 4 Aug 2021 15:53:11 +0000 From: Michael Kelley To: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, wei.liu@kernel.org, kys@microsoft.com, sthemmin@microsoft.com, ardb@kernel.org Cc: mikelley@microsoft.com Subject: [PATCH v12 2/5] arm64: hyperv: Add panic handler Date: Wed, 4 Aug 2021 08:52:36 -0700 Message-Id: <1628092359-61351-3-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> References: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) To DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mhkdev.corp.microsoft.com (167.220.2.16) by CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Wed, 4 Aug 2021 15:53:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 30930c07-85df-4475-a9f4-08d9575ff652 X-MS-TrafficTypeDiagnostic: DM5PR2101MB1094: X-MS-Exchange-Transport-Forked: True X-LD-Processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sIVoVmfnHxpTqG+Jkz8Ed/M9EmQEUODWewenrXcYCVbq98mzWD+mr5LYPbn/3HFSGwB4QtlpBtXOKuB/iYaKgYzZt9LF0QzxXIq5H9ngVxBDuKOahxjN6EZqaRBnFWB8Qw2CmV3YGqHddHYbAnjrAlXFUjlaqzLTZpq+a9Pgfs05DPG3Ts13eFpPCpO7jFDj4Uuhc54hN9S/I801+XRtNAjfcvwg/dgvk4wFbRhk5ZsRxflnSUbUQyh4Plwomi+MI7gaNUebSIlBUYVc+xF9/IIJ8xlBeaJ0MgzeW0v3Ye2CXZLjIyjKQNQoTlCX2rIt23npxmTaO1BSrjI2Z65Pyb6EPIjr+ZN8nXTwRACJat6vw67nTIX7wV3boDVehnFMqZ9gWypBPY0YJY1Ggf/KOrUj7fVJVkgGK7sfLmf5CByQyWse02bumO3iAsVKv7HMWCzPzv8LYk8yyG9V4F/6AHZAFRQY0eVd23pAYo9nzKDhRCj9ljKAIZ+hy92XFNWM+0QowtrlSDeu2pfRjupSfmgMfzD8TbMnfjgC93P7GLJ9UPL9xqYvUoLFJ6A+1xqKBff5dRwCdrt9hEYgDl9uezi0gr8BkoVrZ9ULsRijd6fwwuagCpdP2znolXDhHVD2QBjZiIR5dsFsVFvO4h4+SpWNgEujqwwmOGXUvPrp5N/z1wEv58RTEP6rVwoATka8xTAE7lLFTjR1FEIiK5CrOlNcIr5h7xGjw7ofi2+Tcu4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR21MB1514.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(26005)(52116002)(6666004)(186003)(7696005)(86362001)(82950400001)(82960400001)(508600001)(10290500003)(921005)(38100700002)(38350700002)(83380400001)(2906002)(66476007)(36756003)(2616005)(66556008)(107886003)(8676002)(66946007)(956004)(4326008)(8936002)(316002)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Tbj+hl77BVe8I5bN5N9G0ESQi1Eij32YAY1WT7QpzpLUajDER3gLXo9QVl/OYpeO8M7exMoutuZngzgzRQsowFET1zpYgdJJ+2ajqkkt4tpI8Suj9iEVCW3qkKcaTkHKlxbb4OHWMlYvcYDetZpOny1QkGD0G4XkSkSKgPkjO/hw/5PgkoGvsNT0XFzUrBkcsLznNCrPc/Sw09zafwL8WkXFqQfZQVzYD10KHTPOGq4tn+GTeKWMLcOQmOdKtGbVooaW+4n0NQlNndU1VpGO8rk7OtC1JBvP/7kijbc9NbKSYJbrt/8myj3UkeGKvoIkBiWlvsx0qBstAZU28M7lNIB5eHyqq8xece1+IH6uwnb/8WCyU+3dHPqOqholUvINmvZNGZgACK3g3/ly+WoEAjnnlZ2ODkrCl5EM1+lt3hB4pnAUE6mFlmOje+UdESo+WKBDXCrjaOkRXBKvvT33voCTp3g107jn+VaVeXUQqSB7m309XHr55MsppeRtBCig9j6XN7GryhLZTHayQtN//d9g2cyGsx9DMRoKVdwu3Qp08V7vZislAYFQXfqVwW4m8O3ggfLvBGM9dRmZyWPRZZKxWDyF/ApFI3+re5iRVKJqrXZWjpaePp21qwPqbXRoHdbhhR0fqsd1+ROkmfeFxiMDctrpsCVW2zMgS7TuQLz+yUAHUQKt0ogYutHmrkYL9phrLKaBqg34aXQGSq7hcMcv601jD3jTyZxAUdXL/iZzPTjmgKP4Dx2uZiv7DkdHVFKtCU0aWCpCeDTawVTf+BYqFJ+/Tqpm7zpAv+wx8QebPxA0YsZRJw/hiUWYLgRFF0XLm9F1hElj7h9onpilncwf+gOtZT1ntZG01sXTtfqaRVx2Po2yeFhOttMDiX8N0MJNdlTrD2SW20/Khy6y5dwz0bikzHAoUZ0Z7lsH/Yqk9JAmX3VkElSilkNo77Hl/fZ8vCxJw5a8/RhWbnfl4OOt7qG2Svsgiex2xzxZo5GonwQHpydgd0wbH9DrQlc7zU6O8OqPJpafSvGvKE5J30vGQjLcsPdrh+/1cbPseUEmEcTJg6V/+irxNENurk2vOjL0HRmP4Bc6wGvLOCnmLa40I9C2Q2oK7JUsbhklF0i5GOlWvZ8oxMKD+buBMEFGII1RcaYNzCRiysH5jahYN+YQk+Yp5oOtLh0CP71lK16ymEi1kLb7y7tRWOsX5zTDYHE95erriL7CNskMim4FaR/hRndHLYTD5Qvyiu6/K4TCQBaTUTwIOVLMJDhpH014H5KIJHNY3FqrgMwKeL0dpJ4c6+VfZNKI8K8oEUrJXWH6o29GH5wKJQk4Rskh78z8 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30930c07-85df-4475-a9f4-08d9575ff652 X-MS-Exchange-CrossTenant-AuthSource: DM6PR21MB1514.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2021 15:53:11.6833 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wCwRb8hVCBfRAIOeAdSA0djxOAxrVIpy3IuWwVAvAchATkUVyDqNRNE5nmuNfgHHlacRLR6KLaybC5xHRkbPzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1094 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210804_085320_953462_987E77A9 X-CRM114-Status: GOOD ( 19.00 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a function to inform Hyper-V about a guest panic. This code is built only when CONFIG_HYPERV is enabled. Signed-off-by: Michael Kelley Reviewed-by: Sunil Muthuswamy Reviewed-by: Boqun Feng Acked-by: Marc Zyngier Acked-by: Mark Rutland --- arch/arm64/hyperv/hv_core.c | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/arch/arm64/hyperv/hv_core.c b/arch/arm64/hyperv/hv_core.c index 4c5dc0f..b54c347 100644 --- a/arch/arm64/hyperv/hv_core.c +++ b/arch/arm64/hyperv/hv_core.c @@ -127,3 +127,55 @@ u64 hv_get_vpreg(u32 msr) return output.as64.low; } EXPORT_SYMBOL_GPL(hv_get_vpreg); + +/* + * hyperv_report_panic - report a panic to Hyper-V. This function uses + * the older version of the Hyper-V interface that admittedly doesn't + * pass enough information to be useful beyond just recording the + * occurrence of a panic. The parallel hv_kmsg_dump() uses the + * new interface that allows reporting 4 Kbytes of data, which is much + * more useful. Hyper-V on ARM64 always supports the newer interface, but + * we retain support for the older version because the sysadmin is allowed + * to disable the newer version via sysctl in case of information security + * concerns about the more verbose version. + */ +void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die) +{ + static bool panic_reported; + u64 guest_id; + + /* Don't report a panic to Hyper-V if we're not going to panic */ + if (in_die && !panic_on_oops) + return; + + /* + * We prefer to report panic on 'die' chain as we have proper + * registers to report, but if we miss it (e.g. on BUG()) we need + * to report it on 'panic'. + * + * Calling code in the 'die' and 'panic' paths ensures that only + * one CPU is running this code, so no atomicity is needed. + */ + if (panic_reported) + return; + panic_reported = true; + + guest_id = hv_get_vpreg(HV_REGISTER_GUEST_OSID); + + /* + * Hyper-V provides the ability to store only 5 values. + * Pick the passed in error value, the guest_id, the PC, + * and the SP. + */ + hv_set_vpreg(HV_REGISTER_CRASH_P0, err); + hv_set_vpreg(HV_REGISTER_CRASH_P1, guest_id); + hv_set_vpreg(HV_REGISTER_CRASH_P2, regs->pc); + hv_set_vpreg(HV_REGISTER_CRASH_P3, regs->sp); + hv_set_vpreg(HV_REGISTER_CRASH_P4, 0); + + /* + * Let Hyper-V know there is crash data available + */ + hv_set_vpreg(HV_REGISTER_CRASH_CTL, HV_CRASH_CTL_CRASH_NOTIFY); +} +EXPORT_SYMBOL_GPL(hyperv_report_panic); From patchwork Wed Aug 4 15:52:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 12419303 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=-17.4 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,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 F3FCAC4338F for ; Wed, 4 Aug 2021 15:56:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BDB7760ED6 for ; Wed, 4 Aug 2021 15:56:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BDB7760ED6 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=t7nukz07H/zIOB3LnQfXqj0k+bhd0m+x37y2CRpUGm4=; b=o0//J1/kDM+1xM a95Thbz/Qk17QJLj219bIFcN65Hy4kL3tk3gAQkAcMya3w9tLuDDJshNA2nlsOLwfKOV1l8k62dKq mftb0lMPnYmouPlttmULEYxFC4XH2Jy0TF/t8bDWqvkeSYW1z/fdSp2zx+j3W5DkPkJTKwPSNch6p KJWtbRlOvfM3jPBHh26N+5K6tQ4Fl7uY7ocPmnLSJTLw9+58TAxTZKJqA+TIWUe1toVJ9yBAjVYFX Mi2xAg7hVhWm/dUELKPJQozoyNezpNsUXHs2njL6Ey8MeLSqmwwVYvqr9GYMl3076RT1JTNftxcVN hR+uTmMnBiOPhOFDM+RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJDR-006dze-Bu; Wed, 04 Aug 2021 15:53:57 +0000 Received: from mail-bn8nam08on2103.outbound.protection.outlook.com ([40.107.100.103] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJCs-006drJ-Dd for linux-arm-kernel@lists.infradead.org; Wed, 04 Aug 2021 15:53:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B2bBPvskEeFNF/1cCWhMBCAfgs63EQ9EWkTmwyU8TE2FppiuonprjX/EmGzWCxVc5hokW+85n1uCUITr8o5PEypvIEol1ExBMNGPam6JkPjS5ubrIbAVF+rXPsPnXkcE9pcaoEMCjOpQB7hNlz7O3rQf61HDuqBWZ+STQdoCggl2lr5LBoiGUyklBPGKIHEMWUvetil9gEK6Sqesr0FfM7L48WKKD/8E/IlpH9PJsfzyQyOPdsjZ9XLpdHl6htA2/UOJkxeTvqrM3WziEhPE27hnSiZI94oY8+eebHbrvBEd26sYoLQkbKPGp6rxHK/JWoPD4byMBp0+yOyuO54o7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yeanwBBvMjpPwyFziZQ6X0gIeTmIfa8OzqXPTMw7nko=; b=gOuX2ZO7iZcaS4vKGkrbAJGAi6sMkb6vlTUwz9qx/RLIQd8w2rEKlZyy5QhQDP22Z3uxM717NNncIs6RUcxmtjU79tF5JEmdfJ9+V/ARdXGJ/g1/5cu9bTzMGS/H3kCHdt6lgKFGePw0ev7lJev6vSx0N9I6Js2x5yoeRsr+FGEaV6wMz/VIxwjUl5kBldyMcwYGp7vm9yOTY+JFwT3X6C6/Tg+y3VPZogqt6LMXmAvLaIGhUJxg+iSTtSNbPpw7o/HTlJPa1Qyom5dUNGvXBQt9DwJvlueJlyx8Q6TeClNA+s1Cv9mM74AM3muurmPUb/Iof5cCdjGESCB2NeLYjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yeanwBBvMjpPwyFziZQ6X0gIeTmIfa8OzqXPTMw7nko=; b=VWoMKbhX6eUVzyZvj3vRP3X8mgVXpnCJK64R1kL2MwmhPSlpcj2VxD0bkaTErV3u+dxEZ7UB8gfD72D+UjOjOrWtj4aDTlK0vuDDxvqstr4nMfuPw5zp1YnYBYz4S5fKIbvyIrZhvbR/UdVpoiAN/CRlgivYk3KSWZUYIuy6H2g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) by DM5PR2101MB1094.namprd21.prod.outlook.com (2603:10b6:4:a2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.1; Wed, 4 Aug 2021 15:53:12 +0000 Received: from DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670]) by DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670%9]) with mapi id 15.20.4415.005; Wed, 4 Aug 2021 15:53:12 +0000 From: Michael Kelley To: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, wei.liu@kernel.org, kys@microsoft.com, sthemmin@microsoft.com, ardb@kernel.org Cc: mikelley@microsoft.com Subject: [PATCH v12 3/5] arm64: hyperv: Initialize hypervisor on boot Date: Wed, 4 Aug 2021 08:52:37 -0700 Message-Id: <1628092359-61351-4-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> References: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) To DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mhkdev.corp.microsoft.com (167.220.2.16) by CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Wed, 4 Aug 2021 15:53:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06bfa1dd-7411-4de2-a5a0-08d9575ff6df X-MS-TrafficTypeDiagnostic: DM5PR2101MB1094: X-MS-Exchange-Transport-Forked: True X-LD-Processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kUwOJtW5POJ6voInjPZhXeJIR502rKZAyfqkg5vZcbD26dDyiuyaZlSPqkjoV6Xx3+xTwi+dX7kHAl981/c2VkPNnYMhIyaBqiHWm25a+B54frYa2rHK6ZsvH1NFYikuIhADCJJUkMOHFtM6/XGqtoUgKT87enRQvDn32hPiLUF7NtL20k4lHovfqeBs95kGqe3QdwewspdWaPJYR1+SMCMP9k3LVoWSjvQsmLw/vTzvf1x9mZ9oR/Vd0LMi+CaVfw1eMnJcxp1YjELycYrSL4XmvwWhLZygHF448NHhQoAb9demwy+NhBelwqKdAWaGli7FAN8JRKdg1nzaGbVe2l0LExLGyUR5xq9/ZjzdE+24QmejWZIQUZFFaVgIgiGxDDLTSddhytc/245o9L99V6SxAUcRscPk2vtON4tW3P0rieVZRu022kS2OyHjKtW5ajualjIGb2UO1MOKWphs+k/ocNPSLrlkmSIqm9KUUtIHE7c/4xg9nafFxay+sdw1eXI3A8sN8RzApFKpDaYoKguJg/hYWIQPhXpLKXDTh78W/bboCTATYg8eJpKOpgyS8Pe/0VpaVyp6WRUMnkXU5eG4zAxO76BleLOrv+5HfezgDEqXqj+MnZ05ysSEJC9nvvs6rNrC95t2KS5Fgq1wPZtZ329J420K8MDmhbpwqkQwUC+AkNHlLupOLZlOQ+gbMluA8/qQcBoM6iUs6DPvwwzcH8JsK2dg7kshAAUkDgg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR21MB1514.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(26005)(52116002)(6666004)(186003)(7696005)(86362001)(82950400001)(82960400001)(508600001)(10290500003)(921005)(38100700002)(38350700002)(83380400001)(2906002)(66476007)(36756003)(2616005)(66556008)(107886003)(8676002)(66946007)(956004)(4326008)(8936002)(316002)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: me1juUWTE+FUgtC0M2jZFM+CAZsQ7vGO0YrPdmzq3K2Z6ZUd1+ikuqqLHMrmYlyisKR0C/wCnAHWAWoL/sUExqtlqlXVhhx/A5/KXHsc2+oJk9fgXzoOFOPU+OBArRgex2xlXcawbzD9mpW7jrycugjGKgrS0Thqai85x/tsHZ+6SA3OY1xwfmGZEk1Ncum/0zVBad+WMmb6B9GVD/FysahHlwJAfbJMZpdQ/ucJLON+4lVNJRzW4DHF0cKjo4jrvZ/29+luTtWxWhb0tGn9IoBJFJRM0t1t+p+Ly8ntP9GCheb6OHHj4rjMN3oJD0nA9T9Bs84PhHtHU3jn38StnzMyUzYhY4e3GbbhcFmpF7oG9JO+L1qy074RrmJn1NBWAfnoqBf1J0u6i7g8Qya7vaRg+oq1iW1iyMQGu4McTHaig5D+GG3988V7cIuSS4+yXJ5foPP9fQdMCRo/dla3/r8X+JdqVL0TBcR20UAqZ2pZ3/6i+g+aad2+0eJtBgSAAFiOEMP2F47mJIysIBwluhz1KUxUJqtBwnxLBCp/rrTx/DWqN9BeCaFyETSJK5UpHiItSf17MI/s2DnWDA3yksxSoyAqIN704TPHuNMgxfuYCObzFd+bQ94bo/xAZTQ7uPjnnnIgqJ/vW8v+UmDJW33N1Y16o6rcdlaHXAykQSyx9ArBmakKKKauS4im+DhrfMOPgQiBXBKVf8Lu34EVe26qCC+/cShnZSXRW21mYmS45bOsHnc+eRxkitOSkDAkp8RYWPnoLQs7tVi2R9AyFT74hm4cOpLgDl+/SucyJm2feMFXSHECDfvgV/npAUFP7kKvcGieDct5p8V8nJr8YIs/WyNl62FinS/sBdYMfBDcoii4IEmh+xyY+zD3gVUMUAFfMEp+1YmzBvI4qjyuo6wpVfEvwXjR1CG98e6wNJYCPj/KPJYyOUq/9j8eXSyS/dwQXqnBEO22eRjRgizhVf5VSfEMCm5EfUnYPDqog+XsyrlmgOEhFjXqG1k8tYfSikZSYgL6sbwPHYBcnmJOuXPG6baVG0X6Hfp6sToVHXg4MQvd6aUIEDZGZ2kJb6tZ7Tq7xcpLkXyyLWOjZ0CPgQSbFThYR7WWVZZfZlzCrBcEtdPTqtswNw0kqaMelqwG2TXqLIQsRsH4CWGLTQ9Q5fidGfm28Vftsh8AlV00iXldBTjkXapwcFhZa82CT0Tq4J1d9OWlRA3HJBBq/xlkc2IhkmOkk01Afv2Z08qrYNhqs0jjKCxDmt0G2/Mdov7Imgzx8sfCbshk6I/Un3KD6hekRcro2S8VvhF3l9FgNeFo1rUPfVs0bS6gjZTG2G0B X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06bfa1dd-7411-4de2-a5a0-08d9575ff6df X-MS-Exchange-CrossTenant-AuthSource: DM6PR21MB1514.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2021 15:53:12.6321 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: r6Ta/Np1fJbcqdLyJdRuwx0ioL7idD4l1v7a/LfPglVaq543w66COsuTQ7XD7Wf2mv2WfsmiJFkVI4pBdbmpqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1094 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210804_085322_498604_8B225884 X-CRM114-Status: GOOD ( 19.79 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add ARM64-specific code to initialize the Hyper-V hypervisor when booting as a guest VM. This code is built only when CONFIG_HYPERV is enabled. Signed-off-by: Michael Kelley Acked-by: Marc Zyngier Acked-by: Mark Rutland --- arch/arm64/hyperv/Makefile | 2 +- arch/arm64/hyperv/mshyperv.c | 87 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/hyperv/mshyperv.c diff --git a/arch/arm64/hyperv/Makefile b/arch/arm64/hyperv/Makefile index 1697d30..87c31c0 100644 --- a/arch/arm64/hyperv/Makefile +++ b/arch/arm64/hyperv/Makefile @@ -1,2 +1,2 @@ # SPDX-License-Identifier: GPL-2.0 -obj-y := hv_core.o +obj-y := hv_core.o mshyperv.o diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c new file mode 100644 index 0000000..bbbe351 --- /dev/null +++ b/arch/arm64/hyperv/mshyperv.c @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * Core routines for interacting with Microsoft's Hyper-V hypervisor, + * including hypervisor initialization. + * + * Copyright (C) 2021, Microsoft, Inc. + * + * Author : Michael Kelley + */ + +#include +#include +#include +#include +#include +#include +#include + +static bool hyperv_initialized; + +static int __init hyperv_init(void) +{ + struct hv_get_vp_registers_output result; + u32 a, b, c, d; + u64 guest_id; + int ret; + + /* + * Allow for a kernel built with CONFIG_HYPERV to be running in + * a non-Hyper-V environment, including on DT instead of ACPI. + * In such cases, do nothing and return success. + */ + if (acpi_disabled) + return 0; + + if (strncmp((char *)&acpi_gbl_FADT.hypervisor_id, "MsHyperV", 8)) + return 0; + + /* Setup the guest ID */ + guest_id = generate_guest_id(0, LINUX_VERSION_CODE, 0); + hv_set_vpreg(HV_REGISTER_GUEST_OSID, guest_id); + + /* Get the features and hints from Hyper-V */ + hv_get_vpreg_128(HV_REGISTER_FEATURES, &result); + ms_hyperv.features = result.as32.a; + ms_hyperv.priv_high = result.as32.b; + ms_hyperv.misc_features = result.as32.c; + + hv_get_vpreg_128(HV_REGISTER_ENLIGHTENMENTS, &result); + ms_hyperv.hints = result.as32.a; + + pr_info("Hyper-V: privilege flags low 0x%x, high 0x%x, hints 0x%x, misc 0x%x\n", + ms_hyperv.features, ms_hyperv.priv_high, ms_hyperv.hints, + ms_hyperv.misc_features); + + /* Get information about the Hyper-V host version */ + hv_get_vpreg_128(HV_REGISTER_HYPERVISOR_VERSION, &result); + a = result.as32.a; + b = result.as32.b; + c = result.as32.c; + d = result.as32.d; + pr_info("Hyper-V: Host Build %d.%d.%d.%d-%d-%d\n", + b >> 16, b & 0xFFFF, a, d & 0xFFFFFF, c, d >> 24); + + ret = hv_common_init(); + if (ret) + return ret; + + ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "arm64/hyperv_init:online", + hv_common_cpu_init, hv_common_cpu_die); + if (ret < 0) { + hv_common_free(); + return ret; + } + + hyperv_initialized = true; + return 0; +} + +early_initcall(hyperv_init); + +bool hv_is_hyperv_initialized(void) +{ + return hyperv_initialized; +} +EXPORT_SYMBOL_GPL(hv_is_hyperv_initialized); From patchwork Wed Aug 4 15:52:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 12419307 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=-17.4 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,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 EDE2FC4338F for ; Wed, 4 Aug 2021 15:56:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BD09260F14 for ; Wed, 4 Aug 2021 15:56:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BD09260F14 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FEhYUslYus5y4Io9GnwdK6FjpHCjm+OX6kQHST7An9M=; b=xQzw6YYrS13bZT Xkgn5FwWs8Pe2m9WxsL+hmyCu+iC8s00IRWSaZf4iHLPvZnMPtaiiDx1eouLkI/rJ3QiTdPEYpR+N vUFun8xvA3GDx/3OMGoKu1sz66Cma8pIFgfRwVXoYaarP7owsudhdntxdwD6Fd0f3hWT8v7nvOWNY sqVVTJi9u28x3bSW3PXETKCLWeYAw7QrvLv7ceO9lv0PqNgVSpM14rbyYksmjSr6uKTiFFh7KhMsa qNPenb/8FK5Up6W2Ke1gV3y8h+kVy2IqQmqJjzO6YRPKr17z43mZSgqgImBR3uhGyH0k/OKWtlcE9 FAbsBMrVROPGTnDhIh3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJE0-006eB6-FU; Wed, 04 Aug 2021 15:54:33 +0000 Received: from mail-bn8nam08on2103.outbound.protection.outlook.com ([40.107.100.103] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJCv-006drJ-EW for linux-arm-kernel@lists.infradead.org; Wed, 04 Aug 2021 15:53:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nnpQUdBZtzaiC4ln3vlHDkC0r1S8fXw2Iy+udUDTDmc+teLF1Y+QLi9MzNtuK2STx13dKR1Q4CuA3dpaBM3h4zobKhwAQA8tSGYuipNQZRAzepYk0auY2+P05IHxMGvytEM0vzgLX8kKagMLOANcUvoMAvjZQ99yexQ6bR6OAS2y3+nRloc3LAOb6TjAYIEANjGswRq46EaF0te4WITISma2TziMuwVE6EqVE5eZhmTv+z9ThzfrpMawFUIuUKAk6ljJERvP2L4qEgczuWFGZnyLEw8YAHWQhXT8tPQ6uPTElcXswgEFwF+xRFMofY8cwvGuaHMRz5TV63nUbrBevw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/5c8TFRJoxKgaZcY7eK1KPeB8RnRqqNBzVRmNevhv9U=; b=AvKofbai+qB+72exFRhkHz8V0O6NQsskb21v7zS/g//s7TZHJfPIgXeHsZPNcb563mnyRbnZd6HqF4K8r2L7SevYhFpWwadJZgGqiE587OA3kyjqtuTdaQBkJWpm/lqJT0C4QUg0nVzE2nIrsxPUQVS7VB8Sq1KKzUAbavvlI+SgASgd0U7d/BGPRmdbKI6zQmh1nl+1K8xsdwvyfVwez74e2YofYEjgI3y4UVYvrZk3CY30gJvc2vBR9G6e11xxG3LdXYDfOWsq2h9KEG/2B2J1DKXKHtXwwvGtDbE052ZlAIoaXkXK7Xgi4Xg1WmPu8rp/Tf37DP4F+I+rqohDkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/5c8TFRJoxKgaZcY7eK1KPeB8RnRqqNBzVRmNevhv9U=; b=fqyuJv2msX4KcoEfk08FiP73pD+DblrFKinXGni/NLUPimM8kMK23/0zNb8HgOx4BqdYGMRmr9kimG40h7dKSoxmhqZvRzzhVhGQHkhySEaflkzqUMwEmKPtU75La40ra1PW6Wu7KWk5XztQF0pVuV2Tpyme5vDhwhzLqR+jeW0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) by DM5PR2101MB1094.namprd21.prod.outlook.com (2603:10b6:4:a2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.1; Wed, 4 Aug 2021 15:53:13 +0000 Received: from DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670]) by DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670%9]) with mapi id 15.20.4415.005; Wed, 4 Aug 2021 15:53:13 +0000 From: Michael Kelley To: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, wei.liu@kernel.org, kys@microsoft.com, sthemmin@microsoft.com, ardb@kernel.org Cc: mikelley@microsoft.com Subject: [PATCH v12 4/5] arm64: efi: Export screen_info Date: Wed, 4 Aug 2021 08:52:38 -0700 Message-Id: <1628092359-61351-5-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> References: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) To DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mhkdev.corp.microsoft.com (167.220.2.16) by CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Wed, 4 Aug 2021 15:53:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a3ebf57-d84d-4f01-4d2a-08d9575ff76e X-MS-TrafficTypeDiagnostic: DM5PR2101MB1094: X-MS-Exchange-Transport-Forked: True X-LD-Processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AMvG73IEz4sIWY50MSLj0XDb7tVTlJyeSBiZavjeMp82RhovjoBn/dI351IlN2MHQejph8B4SF4CuymZ76XJJnTsfiAtz/8n48inhw5H4g0O7OCw+C1521wasTkVKHJsv64MllcpTHF2BOjxU5fX19IgBTBK9XcfHpjp7liHKW3d4JrZHURZy19m8ZPj9Zj6iS3vzHqv57x8qt3fEbDyiV4EXcUCtg8X2Nv31pueqvfY866/MB7Fx8hzIS/Lnius39+RPShNCMWTTVagYyOtK/6aKZcuKpm+zUPJEWMiU+zIfACOVKe3+2HQW+bxd9WvA1be9/0nYYbIjFNRJncePG73KDJQ0owc0fs+qW7Ym6CynoWrkwZvXwh2nM4+p6PTn88UBGpQ+wnamZa3d1vfm/IZrb0TPGFtotPiiXDqvHIttsoDbaGVU47LBJxbaHOiuKEiV+G2MiHYF9KuTJrv+ipMgf70mQ+0TCCi4cSydrkjGRSSNyr3Pk+6OsUPwAcO64aElM5Xrsbt8+zl3ID0GS5Pqnh2sIBAwXiJgz24QykNXhOV3oYK2pTMxQPjlkOvBY0RJIyVeQ5tC8hWrVyLYaVhtezluxJwnPYPop80Zk67Al6PAPNkI3R5KBCsBOdeL/ykOV6t7QtEIl9NjUOOGTzdxHfFCNIiqSzldfsD0ZduOHvfTZNq9FWDYA4KficrEz2fg4jem8nmshZw56eBeQqBVPehXMDIuBnuDXej4HE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR21MB1514.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(26005)(52116002)(6666004)(186003)(7696005)(4744005)(86362001)(82950400001)(82960400001)(508600001)(10290500003)(921005)(38100700002)(38350700002)(83380400001)(2906002)(66476007)(36756003)(2616005)(66556008)(107886003)(8676002)(66946007)(956004)(4326008)(8936002)(316002)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: y693cCRMzWM2+N61+BDaKSkHRB0LvOO5nEtAZek8Uxt3hIh9rOvZqN3InOdCbjiisPWk5Y/Xbk0hDcbGdKLakHl802zzf2ssDNf4mRGHEwG1NUl/pOaangIx9yG4dl058lkzFVHHFmOZB1fcYOuaIEkOPQqBOagbovyveldvm8hJ7Cu4KyxezUnnKSgj0C38te80Xwx+iOk+MTXej2x9V+EtzCltthCfN5O1ypDbQt7/aMspBAO4B2IVFkaEU6aHkyvS2HxvH43vNETa+NqD0C6gB34X40fvZJJUgdQdzaXqEH1pntcAu+3Mlmt6fmGdSp5FtaP0GjyNFXlErFKb4IZO0Uj3RF+2+HoXHcL/gmB3/09SQ757LxBvarq8D3ayufKHNT/CaMQ4rnDj/mc2swjcJW+zarqzMapX2ZdGXsDAr//N5iC5gOvQGULNuc1W6q9NG1T5c041iptLfsWq3mHpzrUaBT0lwQcCQswSW5dJ5YoAw35Uo+n1zXJK+MIuyHZt1AspIxKiiEwFHSBj3/fjhbLEtxhFn9WYlwGPairQfn3TYdSOT2ZX9z2PTesw/0c1HCiKm66m7qUdYp2wdC6Dw5prvsZemrdnxhD4n+CN9VjpgH+PGcEc7XNVecZLJcIfiVVjv4EsurSJZevHS2Yd/RC1e6+3idA1vffjEqIJPaZpyMB9BExWv8sVroAphXtCG74x6WnwlGJDPOnU+NKYjXX1aAqwElSuxquHTVEB2lWcC3tGcaEjPpAdctfV3Qwlpr5m1lQUkjX9weUKQMVOz6wBS0PjosG0ABOfOq7ug61W24qQVSC8S2ZBvK4uiFGSyPkkn/uZmqDUenly9HuOUC5+diJL3gvkukSNfsKjlW0pXcVjzqBRxZsmavYvsYwkb0X/2V7kGlFH41YRmGJloPmdwhwgbcMcwMEtgegMd8wcSqxDyq+uxUZJgCnVPTI4BqxErMMVcwEYJ84Y5ELdkGNZOWYpEnVagy4j5V0DXeBVqUWHKe0aXTOO3d9Jr7zGhAh1zH4G/TcjHgKVXFsUdFFh7J8ihwy3gowJUnki1Ov4XV2MJTb1ClI2dpaMW5DpmCA0V7clKShAasyD9Fbf7N46b5L39zvbvFjRJFZwHT29VkZYI9yeimIy0wfvyFkWTfSEPv4C6o7VFINtYp5hKUgh/vfK3LG6ZxSH/4I4kUHHYPjhHmUQBtkqKrUoS6w8Df41k2IHnZAtW/plu/JKYIDxDZDsWbOvPx6OpCQX8ZTXp4jWRbGvMWPglAlmOCAWxkTZtuEKtA6h7fgZBMkwM6EM4QqKhl7ExTp73lVPHfYUdZhMVrcVVcwNWbUJ X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a3ebf57-d84d-4f01-4d2a-08d9575ff76e X-MS-Exchange-CrossTenant-AuthSource: DM6PR21MB1514.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2021 15:53:13.5730 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZudPyQPQyQIOrr6IhywZ+fXrTKOuw/JDFDpGo8MvchuZBTDfS5XdxMMGYUBWVeDE730qBD4f5Tt3ShkY9/BkuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1094 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210804_085325_511186_98B16DE4 X-CRM114-Status: GOOD ( 10.92 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Hyper-V frame buffer driver may be built as a module, and it needs access to screen_info. So export screen_info. Signed-off-by: Michael Kelley Acked-by: Ard Biesheuvel Acked-by: Marc Zyngier Acked-by: Mark Rutland --- arch/arm64/kernel/efi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index fa02efb..e1be6c4 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -55,6 +55,7 @@ static __init pteval_t create_mapping_protection(efi_memory_desc_t *md) /* we will fill this structure from the stub, so don't put it in .bss */ struct screen_info screen_info __section(".data"); +EXPORT_SYMBOL(screen_info); int __init efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md) { From patchwork Wed Aug 4 15:52:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 12419305 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=-17.4 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,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 B08C1C4338F for ; Wed, 4 Aug 2021 15:56:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 80DAD60ED6 for ; Wed, 4 Aug 2021 15:56:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 80DAD60ED6 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LZ9fj0PCNplJ1R7cHn9pFn+9lU/vZx9qX5rO1QVQhAY=; b=PeTM5s85TvEzPy xhOPquW85aukdQYcExxkeRpGNe5BxImamCKWx09NIfIKmb+xccVETBNTMlOMxYl9dBaFxWlcGsQi5 WNcPbT1KO+4ZJ7phvrPFLYTtWWCMYn2avNXTPh//9Sl/PxbzfHuCvMYZw3OajdHSWCJsIgyE/uQRA C4WzA4gejmMQVOxFbKR29QgoXgYg6E9+T4+36iy+Oy6GHpn/BqQUdy773pE+A8FliC/k9OD1FHKbJ 10GbnblpTttPHA8fPpCjb3w+pQGpXn00IDXEkxJi7SLnYO+1+IwbBtWEu+rfrF4Uw8Ssoued737bH /YXfmZw4tBsXjS919IQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJDf-006e3P-No; Wed, 04 Aug 2021 15:54:12 +0000 Received: from mail-bn8nam08on2103.outbound.protection.outlook.com ([40.107.100.103] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mBJCu-006drJ-0K for linux-arm-kernel@lists.infradead.org; Wed, 04 Aug 2021 15:53:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PksQ7Qv7KHZcy7bb+p88m5FgFF0is0whlYQG+JlkV5dwZ7HdzAkoJXNzi+QuT17Abs5zTR51MBkC8JitTy/4ERay21SS3edb5iyfxPK+hz+NHqI4VZcmev5qBh0b7kxndEsnsQbpetMDMOq3tHdm/aRkYbCzG07+Nn5dm91Zm8n5G5NasnkYae/VPVJVxsSn/VQSy9YgOA42ekRAGN2nPAFL5bmF1OlvrDbJHdKUqF//7+MiCsGgp4GvofYh+nAJLpEVPK2dg1PiFJichDDUo1v5b0ShBCkS/bZEn5B9UyPq2MlT3EsvT9iD4kpwUfcFeIvbPH24rbnJXHTRUX2eSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9rpPs3JZVdGzVoLMlyhr9/Esisvt7xpDaBPNqb0B/7E=; b=HCvBCkM3LlaN4Gq99NixhTY1ivoTLZsKvU8G2mvcB7lN4TTbsSF4NgY0HgNpDoiPs2s8rQkpMZ+8lUuwQQmm7EzO8cS23DPY/HM0axN1wCIw775UxHvk9Fy1G3KdA9TOgdV3QxvOGO/XpzeoyTcUViok4yHUl50aBSHRQTUQYaS8TlICIG0f5SS/5RU0dpm9NOPIfumgyRkKk5M0pO1JvEpTvkgEgL//UsYU4auF5AqBYCS9qUfE1k+sxVimYPbeJraVq1Bo8US3hFfBwPLLgmNJaZqhHPcE9HdrP2tlluhZ9vyHMPd+48Hg/VyCnjqTXYHiIbIgqTSATMdYkHPxuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9rpPs3JZVdGzVoLMlyhr9/Esisvt7xpDaBPNqb0B/7E=; b=C9FvsZo9s9c4RTfFLDHgjp/e0C5xqm5GvkgjE6sb2yV2fG4r2+u26T1SntqmWQGG0T88g+JBYoeBEuOBbL2IsDkqVYDhe6RXi2tMJ2eDty7vUvQf6/myVJZDsE1Do+kJMi+mDQUqxmFHlkAFqL+oCo+vqW7azEPaKNunYhzrfkM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) by DM5PR2101MB1094.namprd21.prod.outlook.com (2603:10b6:4:a2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.1; Wed, 4 Aug 2021 15:53:14 +0000 Received: from DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670]) by DM6PR21MB1514.namprd21.prod.outlook.com ([fe80::b170:236f:1f2:5670%9]) with mapi id 15.20.4415.005; Wed, 4 Aug 2021 15:53:14 +0000 From: Michael Kelley To: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, wei.liu@kernel.org, kys@microsoft.com, sthemmin@microsoft.com, ardb@kernel.org Cc: mikelley@microsoft.com Subject: [PATCH v12 5/5] Drivers: hv: Enable Hyper-V code to be built on ARM64 Date: Wed, 4 Aug 2021 08:52:39 -0700 Message-Id: <1628092359-61351-6-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> References: <1628092359-61351-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) To DM6PR21MB1514.namprd21.prod.outlook.com (2603:10b6:5:22d::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mhkdev.corp.microsoft.com (167.220.2.16) by CO2PR04CA0175.namprd04.prod.outlook.com (2603:10b6:104:4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Wed, 4 Aug 2021 15:53:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83fa7f1f-5c40-449b-e466-08d9575ff7fb X-MS-TrafficTypeDiagnostic: DM5PR2101MB1094: X-MS-Exchange-Transport-Forked: True X-LD-Processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /2U/jQyeSt1dDzMvxGSryLsVT8fJFkzdporScZWJKG1Fawt2QCr44ItUUK1wgLTVr0KaQw88E9qS4JR9yQ73gtdiB4Pd3vBE3B5D9GUk6uW96we5jcfUSKanOulT6O5T0RIGWkicFdRnpF7vJVyuLcbk58/CxyLJMCa9y3J7hAsQfND1JG+3NZkH+RFBO6Ldh5MvnhkKWq2KGKtuydUR/bw+QBQcqBXBUY/eaGRZPWGOoxWP0TiLbTm/zYUI+eXNOloP3pAiiER47cdQpE2TvKGLWhk+Z3XBHPohie4gFFiZTtow4NpkhKaN2VY4R/Vn5A08gWnmI3mvKvhq8Vx8Eh1J7Gh/dubJi0fnVLcoQt6Ccoh++cNHePaF7IKRsRFplFF4TM1+Bq/tHRq1PJgTNF6UcXnNCEbJb/VzjW+j2gi6QiY9fP3Ysd7A6elmq6WrL//OV++pxAj5zhi0NtSuYfGRqk16Kq3YncxyiecLWLpC2QQW7pDAQhha/iLVdFps43RaXgC21RsPgYZPAmGXWMrxXB+0yeGw9M6/GsK8b+KA99kI3bZkXFLS6K+fvEqJh9wmTIhi7KxnoEWsTFI09z+U1KSrAi6MRJQ3LXPtp/NX7wkSFNa3kNy7/6ecS8ExUIq2jhRDrUFZkncHXrJKcrb8tJi6IgpAsBsDgFqgUac6dMJLtswpjYr83c9Of9wyhHITP2Gtuc/U6afA0we9eQc5BtQfE/9/6XqvHlv3Q6s= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR21MB1514.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(26005)(52116002)(6666004)(186003)(7696005)(86362001)(82950400001)(82960400001)(508600001)(10290500003)(921005)(38100700002)(38350700002)(83380400001)(2906002)(66476007)(36756003)(2616005)(66556008)(107886003)(8676002)(66946007)(956004)(4326008)(8936002)(316002)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5qhPBKLldukdxD6Vl/JkAQ/lN72x0OYVV/74wB+t714kijbgt9EKFVBDqsYC1kU4SMb2PucDuo2mgjPtQ32KbtAVbXBQ0TeT8CyjMzc5dAhcRH7qWvgmgQZ1L/gEhkqa4hmqNfm2LQGe4nYIXIDrLsCTLbmvZilQV8U4AvP9MFVfybxUFjtrIim+xbD1shbB8StYN+hYWndI2+pltdsQ2EXKv5UPTpYI2ht5rj3BqvcmG/gyw/UKjnDiyMxOQdYez8Uu7DNVgwFooNfmWabU40zeSPYa6Pe2hippeh6yyz4UV3lPX7I7WM3Fc/YHox2wEGoy5idLqRTh1dRRf9CGbtRhS2V5tL6r5Vo5QcN6H/l+CLl4BkzMMShnu2oVrNCEolOYV7WU49+Gs/S0nGZx2P6d0DDCqdxmDpOg9quskTSzgPZhZASRkJ5ragqDbFyqdqtz3o4nlXhErlHPfx3oDXOMeVH5thyyC5Gpu5tO3odrQhnZ3qf/xaygJBXetLrc/I10Pil8wCEp9D1DGjliadqhxJqrDzCue0niixQ9PAUW/EFHTIYlJiOMJISZA/bZ8uKgcGIikuJ+qwMp0p0qS13wNjL4sqqeB/7dqDlfPekfUh41QCs+D5AimTDecsUg3XdEYZ63+x6j54Dk+0hfitA9pBuF7PA/U5TbB6XS+b4BjZkcvmyM0KxlGyxS16i37nSVqcvonEGF3oMK/hhe4SAX7Z2qzXm2VqFiiMsArFUsujLhsWbBaXtIFqJy82Bam4P0kyYyxcNnJwkqk4E74dX+q7nE1t695y1AzPN/4GzgSBCiwa2n233utbiIEjZ3ZT8NOafK+it7x2WMrymn61H2lxl8ik141iQlIKw2/qmzAgNnU85LiOVxZERHvv1S1HJsTz8SkAu8d+r+c+xMMgM3jXqcKRueGGS8E8KxaPLmkEdntvoYd9X0vhlV+W+Ih4f+3lOakYLpaMih3mRYNiCO1ZJ8tzftqUwGYX7RGlXuTwAAsbUnklcShb6cKNvCqcW8ftj/OmLaCb7xy0yAr8MI+h7qIgWV8pa6HJH9DghI3XtiCSTnH1I4Za8QC2XhVkDD5JXUBTfhB4WR74gWvFTQ18dhTOlafEDtHPBKppPkrJ6NXHJ/07SnbQMMoCHTP/4NfVuMEYQGcjbmeNOPkp9ZbaitjJ7sbc26qL7U9uKUTQgayUxbUF6mLlIt69y6SJp+oFd0Qrsou/kz106Ot+vwSvmslgyi+QC8c3EyLeQdtyZolkmYV5mPMEh2GNN9MaDsj9V3Az1bEA51v6dwCNB9Kh+LTrQXotTWK7Z4S9urDhCByDshiwKsdFMt57Gw X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83fa7f1f-5c40-449b-e466-08d9575ff7fb X-MS-Exchange-CrossTenant-AuthSource: DM6PR21MB1514.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2021 15:53:14.4979 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ScBR/fsOU+6urkB4PD7HWqr0OLsu3v9LPRL6qUL25ZXoTeejpugxdHONhuGBJYxuGat1xR3VXWgLQ5angVLODA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1094 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210804_085324_078342_78641A21 X-CRM114-Status: GOOD ( 12.14 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Update drivers/hv/Kconfig so CONFIG_HYPERV can be selected on ARM64, causing the Hyper-V specific code to be built. Exclude the Hyper-V enlightened clocks/timers code from being built for ARM64. Signed-off-by: Michael Kelley Reviewed-by: Boqun Feng Acked-by: Marc Zyngier Acked-by: Mark Rutland --- drivers/hv/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig index 66c794d..e509d5d 100644 --- a/drivers/hv/Kconfig +++ b/drivers/hv/Kconfig @@ -4,7 +4,8 @@ menu "Microsoft Hyper-V guest support" config HYPERV tristate "Microsoft Hyper-V client drivers" - depends on X86 && ACPI && X86_LOCAL_APIC && HYPERVISOR_GUEST + depends on ACPI && ((X86 && X86_LOCAL_APIC && HYPERVISOR_GUEST) \ + || (ARM64 && !CPU_BIG_ENDIAN)) select PARAVIRT select X86_HV_CALLBACK_VECTOR help @@ -12,7 +13,7 @@ config HYPERV system. config HYPERV_TIMER - def_bool HYPERV + def_bool HYPERV && X86 config HYPERV_UTILS tristate "Microsoft Hyper-V Utilities driver"