Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp648856imm; Wed, 29 Aug 2018 08:44:56 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYoFZhGTEwLpV59zbms5JCoBYcvxUgveTr81GOxGu5o5sL1ly5kxZ7/W4W2ZnFEhtpSBbbY X-Received: by 2002:a62:c90a:: with SMTP id k10-v6mr6485519pfg.180.1535557496796; Wed, 29 Aug 2018 08:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535557496; cv=none; d=google.com; s=arc-20160816; b=jpxYaj9xGwMIh22lRe3s9Ne9Gd+j/L2MFQvAzBi5eVY81iV+VPPP+N7wg4stt+sIHU zpZGH6cTU+ul4S3roPMqjbSekWsdiM6cGIKXLwzZoWzJ9SlIlX8mYk+a3K+MlkEsHJAB dg5q0lt2NOOJ6XFQ01fXnRdgBmOX4DY7udkvBkggGXCGH8OxlMu+y08rC4kMZXXJlLFo o8h3QVYKck2zfznxJkv02fYMwmgi3Nll8w3WjXmH+6A4OY6TnCA73qVOM/Xz2mMUAHwo gkwvNUt+jE3xbiT2ik8zSsSDeje8bvenjxM8YphmF4cUljXlss077/L01MQUKOwDpcCt Rsjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=/YDwQsThjmPLdlPjCV+wqui3+DoIsxT3Y8bTH3kVInw=; b=trCgqhYyGsBu95tzyKQQPZVPKzylF/g32zeAk1rgbsxBjKbO+WiEeMLIOrOZoJO9lh 2EU3zn1iBxF3x0FfyB4lhvYeiA4KPOstUqIsddvGT2qZGJAWIgFl6dxcgcpaonkTTUd0 3ZTLrjyxVh4gD28t0lQggIxXsdiEn4LoF2BsDocCv60r6S0FvhfUnnzS80BqEZ7zltH5 MLTm2l+dvr40MkiW+KBEx7MSyOiAsC9gUTW9jfIksTqO8QsY+JkauqtKcnmkjnhDsP6r erdizIm9ZszNpzSqGsXq19cfq4gR0K1GM1bfdflWGv2qs0Cms4A11hTyWw5dC3QzIFB9 tgRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IJMNW8vf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3-v6si4132400pgc.447.2018.08.29.08.44.42; Wed, 29 Aug 2018 08:44:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IJMNW8vf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729194AbeH2Tks (ORCPT + 99 others); Wed, 29 Aug 2018 15:40:48 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43784 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729107AbeH2Tks (ORCPT ); Wed, 29 Aug 2018 15:40:48 -0400 Received: by mail-pg1-f193.google.com with SMTP id v66-v6so2488009pgb.10 for ; Wed, 29 Aug 2018 08:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:reply-to; bh=/YDwQsThjmPLdlPjCV+wqui3+DoIsxT3Y8bTH3kVInw=; b=IJMNW8vfTpTWe1niz7k0sdsv5AxKbBPozrjYQO8mFWQkuAbulwqThXuijPvRqJdCnv aYQM7RuGOPp7YbGITEjSOeRlWcWG1WiQlN0K81iOtxwMbZT8NIAJyIEfBq6BWFr58B8I w/ETPpgIUy2+x7xFGvRauffMdHQ4Et/6MQ0zGYdipYQqCoI7lQ5KxwAsJSGp9lFPq1Ay HZ78R7i+KtveEdsEUlnmdqn3SF75sblv6F3nFaM20jC7ST55U5euDxb2pSDBP/o3l7Hw o4HOyeI0jZpPLY5jtpUNmGifbsb1dCDpZ1nHLFC8fFU/5doZHQra5bqo82H5nBEbd9Oi nyxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/YDwQsThjmPLdlPjCV+wqui3+DoIsxT3Y8bTH3kVInw=; b=PevA0p1GTJnNVTWvSxEi+F95h7K637Bvjx6/th0Kq+ZUze6QjCWcnHT5rBf9o5SKYx ZU5NhKI6Ocaklpi45Aq/Y+jmv6fw7zfCcrADf/11zTQStsJCVbG/0tL1P5bNrUYV2l2+ vZ1RUfJMVcVXw/gulrxaee6R+6IQ+jbfhVX4lAcDjcJkG0eq7H7pLXSjG556lynAQUsk /35DRTt4YNUE22Pe1uvtQ+J8ngzw4XWMx+797zl1QhgQTwKlw+jsKOPbej3sMRnZA1+f j+J7ipakChTTg5a4DcEvtSAsEJNrRwNsAcqjwheNVIB1VEgU3VDYHalNQSaZG/pR4Aw6 tg7A== X-Gm-Message-State: APzg51Dm2qTpGKTENRtwdSyDvcF1SX0xBgE0zlwm7CgiEIdPyMKKdeXr VNH/qqEPMm1/JjlUIsKHF4o= X-Received: by 2002:a62:6547:: with SMTP id z68-v6mr6528506pfb.20.1535557397034; Wed, 29 Aug 2018 08:43:17 -0700 (PDT) Received: from mhkkerneltest.corp.microsoft.com ([131.107.160.79]) by smtp.gmail.com with ESMTPSA id z6-v6sm6178821pgr.41.2018.08.29.08.43.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Aug 2018 08:43:16 -0700 (PDT) From: mhkelley58@gmail.com X-Google-Original-From: mikelley@microsoft.com To: will.deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, marcelo.cerri@canonical.com, sthemmin@microsoft.com, kys@microsoft.com Cc: mikelley@microsoft.com Subject: [PATCH v2 0/4] Enable Linux guests on Hyper-V on ARM64 Date: Wed, 29 Aug 2018 08:22:24 -0700 Message-Id: <1535556148-10452-1-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 Reply-To: mikelley@microsoft.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Kelley This series enables Linux guests running on Hyper-V on ARM64 hardware. New ARM64-specific code in arch/arm64/hyperv initializes Hyper-V, including its synthetic clocks and hypercall mechanism. Existing architecture independent drivers for Hyper-V's VMbus and synthetic devices just work when built for ARM64. Hyper-V code is built and included in the image and modules only if CONFIG_HYPERV is enabled. The four patches are organized as follows: 1) Add include files that define the Hyper-V interface as described in the Hyper-V Top Level Functional Spec (TLFS), plus additional definitions specific to Linux running on Hyper-V. 2) Add core Hyper-V support on ARM64, including hypercalls, synthetic clock initialization, and interrupt handlers. 3) Update the existing VMbus driver to generalize interrupt management across x86/x64 and ARM64. 4) Make CONFIG_HYPERV selectable on ARM64 in addition to x86/x64. Some areas of Linux guests on Hyper-V on ARM64 are a work- in-progress, primarily due to work still being done in Hyper-V: * Hyper-V on ARM64 currently runs with a 4 Kbyte page size, and only supports guests with a 4 Kbyte page size. Because Hyper-V uses shared pages to communicate between the guest and the hypervisor, there are open design decisions on the page size to use when the guest is using 16K/64K pages. Once those issues are resolved and Hyper-V fully supports 16K/64K guest pages, changes may be needed in the Linux drivers for Hyper-V synthetic devices. * Hyper-V on ARM64 does not currently support mapping PCI devices into the guest address space. The Hyper-V PCI driver at drivers/pci/host/pci-hyperv.c has x86/x64-specific code and is not being built for ARM64. In a few cases, terminology from the x86/x64 world has been carried over into the ARM64 code ("MSR", "TSC"). Hyper-V still uses the x86/x64 terminology and has not replaced it with something more generic, so the code uses the Hyper-V terminology. This will be fixed when Hyper-V updates the usage in the TLFS. Changes in v2: * Remove patch to implement slow_virt_to_phys() on ARM64. Use of slow_virt_to_phys() in arch independent Hyper-V drivers has been eliminated by commit 6ba34171bcbd ("Drivers: hv: vmbus: Remove use of slow_virt_to_phys()") * Minor tweaks to rebase to latest linux-next code Michael Kelley (4): arm64: hyperv: Add core Hyper-V include files arm64: hyperv: Add support for Hyper-V as a hypervisor Drivers: hv: vmbus: Add hooks for per-CPU IRQ Drivers: hv: Enable CONFIG_HYPERV on ARM64 MAINTAINERS | 3 + arch/arm64/Makefile | 1 + arch/arm64/hyperv/Makefile | 2 + arch/arm64/hyperv/hv_hvc.S | 54 +++++ arch/arm64/hyperv/hv_init.c | 437 +++++++++++++++++++++++++++++++++++ arch/arm64/hyperv/mshyperv.c | 178 ++++++++++++++ arch/arm64/include/asm/hyperv-tlfs.h | 338 +++++++++++++++++++++++++++ arch/arm64/include/asm/mshyperv.h | 295 +++++++++++++++++++++++ arch/x86/include/asm/mshyperv.h | 4 + drivers/hv/Kconfig | 3 +- drivers/hv/hv.c | 2 + 11 files changed, 1316 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/hyperv/Makefile create mode 100644 arch/arm64/hyperv/hv_hvc.S create mode 100644 arch/arm64/hyperv/hv_init.c create mode 100644 arch/arm64/hyperv/mshyperv.c create mode 100644 arch/arm64/include/asm/hyperv-tlfs.h create mode 100644 arch/arm64/include/asm/mshyperv.h -- 1.8.3.1