From patchwork Mon Aug 24 16:46:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CB8814E5 for ; Mon, 24 Aug 2020 17:13:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 13FDC2063A for ; Mon, 24 Aug 2020 17:13:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="J6/l8Me9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ph6BXJGy"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="J+JnWmIN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13FDC2063A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bBp5SZ++Iu0cXN4DguWtMEjAqbz3a6JW8govlCMnz7Q=; b=J6/l8Me98upOrWCj+qlk/djNK tJlnoVxhJz5dn4qhXJu7pi/URGZZjknJgi9JlwFdS1jE7yl6mVbDocoIZ1HZy1N6XSAEAmBMg4ZT5 bfKHLsybPCN5iyGI3YNDDcfNJJE1WzTnbNCCEh+mTynOodrOsUpRqTSEaaW8PQ7He9rDiUoCBcw1O vEPAoAQnJktQ4+dmunkBZxoFhhW2wHBvDtsJGvbQWsmraWqhjWdh8mY1PwYavtVmMeh2hj2SLnqPE WCCjliKRByqKH1+HuA6VRS7pyr6HScvcVL/1qzq4E4F/LSa1zZiSGE2M0x/oZKyWsn1dTQkz1yPSK OH9truNwA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAG0F-0003tg-Sf; Mon, 24 Aug 2020 17:11:28 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzi-0003ex-G7 for linux-arm-kernel@merlin.infradead.org; Mon, 24 Aug 2020 17:10:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vmze2nQ8/9ls2Gk++w5LIsR6HXsVIrPclx6MxH20zjI=; b=ph6BXJGyLYcQZ+UKT7tTstPSQC VffPGU9gilB2dMzEhwHrRtVNLjXl8tctIZ7Iau2FAni16AX0LrLN0PhlPlkhN+ECgCplWkrqGYF5c Qqc9Ga9ZVxkzNKQVy1Ngz0WAFwupgXG3n2b6uEPrLp00XFmHjUOsEVaojQIZGtTUN5pz/IAeKqivB QqW0bfMxHSR31b7Hy4JyhgD0UNj8e47/VFaKTQBU0UF1wQM7QlKBM6qOzOswtED45DaGJFVR8vL2X d1W9UJRCUQo/TLA6ZvQVaDkJCgqWo50hDWeF1XCHtXA+hl3JptjOYCYIKqy3tiAzDXyqer9y4OVS/ smHyFErg==; Received: from mail-dm6nam12on2128.outbound.protection.outlook.com ([40.107.243.128] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFdi-0001wk-Nm for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DGausWlDjfzJ9gSEUfARqZJB/jzt88J0ZD593O/C4AAHZPenD2gXj+XACQl+2mbYEN/CS3nc2H9G2mgNJknLkNZMrUiD4xk1P96jsMDCouIENCvRKtAZXiIaEpsexxaP3VSl38HePeVOnWVzAo3Ct+J1Pby+o1rn+LiR9oOwYjWK/I5Mk1QTLNuoPPyYR56znAn1Pcp4UWpGBduYXx/rQX4RFkuhuY1c0o7YdYiJzz/ilUWc34PzkcxXGmWz9PVNp4JysB4XbhPAWu4CDJC3Z97GA/uyFfBg+4NBIxEWkaFA5B8HUap0lMcIT+fN7dctecnlDoR/QAGUjFbRDKmDYg== 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=vmze2nQ8/9ls2Gk++w5LIsR6HXsVIrPclx6MxH20zjI=; b=FVAu1HB2mssyuBpe1/5/SLzmseuV2+QgU61LqJ7RdUKTbNJMaocmPy6QUGvB1jQOQ+Vqb7aGiMEPnp6/ULQLjeXGcvwz0J+HVd9K9Sk9Ry9fqY1jMBkejHCGZDHOiRUhRqKJqPrh6a6rjaPEqT2tygMiGjMMR06m8SxICQQ0kR1OQHopq2wH9Rp0Bs/TnknDmRlwfziT+NWuIsYERrkPyZSihuLGPr/mVtuqhOQmjMvrwbqfy4RHMxzP9po6WyclvZc55cofgcgf+4449ZxxUMdFk36h4DaGM2NlSC7LC0m4qoCf82s6I9rX3cw2tWEyDmofNkUk+6+OP32zwsYKOg== 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=vmze2nQ8/9ls2Gk++w5LIsR6HXsVIrPclx6MxH20zjI=; b=J+JnWmINPxscUailRBwumUc7VCnGl1GLVobPyVT1gRrWtiJOHaLA/KRpJVQgyvk5bV/SnBHBvl2MfVp2MWTmeHGusZTvz/m4B9SOSzZ57P/5+Plv6O9943RGX830u+q3Bduq/zB8C/NC1Zic+0CJ2ZfDzYdm7A1bCxMJst211QM= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:47:43 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:47:43 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 01/10] arm/arm64: smccc-1.1: Add vendor specific owner definition Date: Mon, 24 Aug 2020 09:46:14 -0700 Message-Id: <1598287583-71762-2-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:41 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: edd52061-fa6b-4240-9739-08d8484d6bba X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x6qM1XyiJpzV2ne3wnFQM3qq3AmwBu58Cw0okP1MIPwmPpReSo8GvNSpThZYiokHqprs4GqCpcYLK1Os9xehwLgqjakgfP+9f8wUcPqkAXWliH7uDlB662Vlq/HMq/s4IQEfi/xzpS0Z3aWYc6kb8040KFp/j8GGrKX9w5PEy5mTXYZ5IqzudHTYmzqs41DnEi/rAF+p2zSB3ChdBL06vOupWacL8ipFELP/ei1cWy4PUtNlajnrroKPyGwD1o/ppcsufEWdF2xyLcGX1SACPPC47NPX4lMC+gUXuVxPRnjpEM22TY4iu39bgH/XBxu0trWMXu4I6vQo42K/ElhDjPTpzQq9MKRCIr0l5Ti/4axtQ1xDbq5Ozw09DpiSI6Da X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(4744005)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(7416002)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 0M+U9om80NEr7GgteThBukqRDQd/gYsYCpUmNEbLXIJZysjqj2E6fxRwwovUTwtyzgpS91InrVPXBp2N3+/Y6XSnWYVCyN+EhdrkX0Fad5kHA01TyyVSFN92TCtm5r+yrMS7U/GKCXOJqQh6ZbvUzssca/VvBKKE9o0ovQUz2lwxhOVOXeYuvR29JueYPT4Dm3011VXf0u+TlFwcs8vqI+Z5T+bTtx0zFsobYO5C+eFfj07EZlmibJEKFhWVkqm07WhHrUQX2gftGp25+eS71U8LIQiavktozdpTWXGAimp3K5dGFZ9TrM5FaHvtah9NCPKmdYsxiH9H1KlIZ1hAHaNDa6bFgPICTD/79PC+t4dle8H55J/9FB2xeOe6xKEK8buAfg0yW52imGJBDFnUrZGe0r5rq+boaCkqEbM6du2NgH+SevmPI/K6GOkVZ9EkzWcA8sv+o8XV0VByFgwUXWKD7nWzMJUhzwaFEtCsp1ShNcFng1pMQxAC9zkmXbAAB/qN5DuupJIUIQ/V9yl3MO6kE7Dl8To0bvgvb8z8bQwAGKXNqZGdBCLQzW4tiZUA98lUI5ZXgmJtc7bRPvczDnN7zXeOt8iYjEIFEMHXq5BgZgE6Aq+R9RKQJ6P4pA/e79SIjGBqhrGTrfgjab25Dg== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: edd52061-fa6b-4240-9739-08d8484d6bba X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:47:43.1916 (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: Ti1rOcY+s9USJxw2aiCD0DWUW+qvMNHUqeK0jevpF6Jf3K9dYGAPcwfT0+LT0LgdJEZfvNm70nfiQtiMPm+CPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_174811_036668_CAF342BF X-CRM114-Status: UNSURE ( 8.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.128 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.128 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In the SMCCC v1.1 spec, the Owning Entity Number in the Function Identifier may have a value of 6 for a vendor specific hypervisor service call. Add this #define. Signed-off-by: Michael Kelley --- include/linux/arm-smccc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index 15c706f..ee286f5 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -49,6 +49,7 @@ #define ARM_SMCCC_OWNER_OEM 3 #define ARM_SMCCC_OWNER_STANDARD 4 #define ARM_SMCCC_OWNER_STANDARD_HYP 5 +#define ARM_SMCCC_OWNER_VENDOR_HYP 6 #define ARM_SMCCC_OWNER_TRUSTED_APP 48 #define ARM_SMCCC_OWNER_TRUSTED_APP_END 49 #define ARM_SMCCC_OWNER_TRUSTED_OS 50 From patchwork Mon Aug 24 16:46:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9247E14E5 for ; Mon, 24 Aug 2020 16:53:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 5650C2067C for ; Mon, 24 Aug 2020 16:53:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2c52RyrL"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="Ehe3dkeg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5650C2067C Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UhvvWJ2NtJ/8clKjZJzU5t5xDxiHYEPDIN88A8B2mYs=; b=2c52RyrLvjpcCER2SWG4J0Fce SSh1Jd3G+yzvoAxSMogl19tqz+VPM8Az6K94Qw8MzmypwTp3OqASc5Fii39RNDnhAOWRfIRAcs9LY dVXn63q6yx7xaTwkkNMSo9ocR3Fv3C5mt+/3pAMzvx2rlmI24GRR4BOS0Dya7AGH4iC/v1TJkjs5D 8btknbxpJQtTI3saaIGcvhn3yS4Joht2hzOUfGw6NT+skVudKgNRzgMaigFOkOYEcrrm7oXFUT9vn 7AnjViwYJ4zeMuVWTn03FSRppsVlwYG3vYclcrqLaaEwjeUt19wKCIWd2+sBag0ZfxEvu8PiSKeSm U9HSYPtZw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFgg-0007q3-5U; Mon, 24 Aug 2020 16:51:14 +0000 Received: from mail-dm6nam12on2139.outbound.protection.outlook.com ([40.107.243.139] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFdh-000650-IX for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MXtdlGIc60rR9Dgw12ZJsRetmU8/hyJ9roe+2QIT1KvxXjFA1cNqzVjctUB865P6Hn1Wuvq4tc8vCyVHjVRz32m7+UCRN0LedKcGWGOYikf4vyY1Ru2Y6s3fj66pulbFCUEF88vG19AoA1p2KqaXCaxAcp/ymRSKoqLaOt9+aoTxyQUYGbC3Clo6Me8HX2wAEqPPPqgNvB5smjhm57UopYovrNUDJOebit2Un0URKo0BLClh9pooalO6bwQzjVAwgUm20/PFu4g597FpALkDZfKsCmNH6ylokqPgJSwSu/+n0K+gE2hosTHxISns/yDAX/10SlZVJdtfW7n9HoBcjA== 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=PcCR/WoCm5Jo6xIeBKedm97HiNYcdoR2x1QnnxGq4IM=; b=dYa0o4d7Pj4+Z0GmtWWFLbF7AKEEMFlcp9BT8K4jmdSQxrIDMax/d/q3keaMYPNeRyUtwjTG6K3o71OMSI/elPmn1Dzc3vBNqET4IbHo440lAgQvZ0/gBvlBVsFNVRY7xVcamKcpS7q/6Ka6ohrk44twOpgwEpX/6tbBHdExac621OP70JzvPURTDf6Ub1yBBNfCFRtcxx86PzEzszPfBwzKq6zptYP7+m6bWldP/jl6M2SeYzYCA5y6jhU7MH0gdvPE7T4jm2Y7ICUzpgR5KL69y5tGCx8EMHZaNJIW2KKa1JHtrvo8lpYe9LIc4r0386edUMpD1wJDAf/PKnZNlQ== 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=PcCR/WoCm5Jo6xIeBKedm97HiNYcdoR2x1QnnxGq4IM=; b=Ehe3dkegZLKCfDM00R+zIxx5VxEIR2nm8ObiVn06n+r6BpijshxbtTJ7fdhKxC+Qgy/yELOXQk9acvK8TRXMMR9+6lU7YowwUwvzLbQgSXshFSYj6SNphqVhdy2fTgBsMD1XVkJzLVI4U9GPBADh3yMtSnWqwlNHiYaCk9pZX5E= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:47:45 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:47:45 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 02/10] arm64: hyperv: Add core Hyper-V include files Date: Mon, 24 Aug 2020 09:46:15 -0700 Message-Id: <1598287583-71762-3-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:43 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d8658d2c-1323-418f-5f7e-08d8484d6ce1 X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LaTUmnHsLYcuM241Bk0CtarUyCJ7NxqX+UwP2q4CQ3YdBzJoKlOKVhaQM1Yk68ap4gpVsl4zxEP5IY7s/xKuisNQgZxH8y19OSId1kQ3/T3RFzc4O/O9XQv0CirDwDLgNi/wdDmUaRCaHpWKz+Vj37cSk05fjU3dHgC2JszXAE7Lw7GLN7V5E2E731TkrUVW9b9ssPWLcEyM0GMDc6h6JVr87cNo24GuGue9ahwAx8J9BYsUy9qIua2A5RJuLv7hypmFCZCC+asKnk4eaZ7Jh20ZgeXv9bHvv5WCG6eT7xvVOgagwyP4RRfYbwOvyRSUdsTEJnH/2QdGY0n7TufEkNzUkzjSgiK5YcF9a8TxNKKX3ei2DUhEikmRneK4Oh6eWvFxYhsMvWRfjW54JNvML+LKsnLIJzii4QyMw4BOmODGmxT5f32sSYaqta8LIKm+gbbUK1MMHyWRjRLNAKW0FA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(83380400001)(7416002)(966005)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: tPggJf7ehwhRHGhkYrFFhZbQ0rsYLoEzozKz5mZEMoJANKb6ImKztAXNKAroq+xqeVeWxqJaovba+IO7vcj8Dl8iKSbW1qp5Nut1mtUKoDWeYt0B+ZRqQujH8kXugVgVzYwgqvQfePN8q051cjPoBcI/cGK7xcX97TAk7Jk0OdBnGvsdiN3x64cnmFHEffxvX7Z8E4EqhTnYJc217A60sIRtwfAhpEaiO6yB+HpMmRPQsrZ7ORbQiITDI80JAULp0L2c/zpI/mz9dZJW5Atro2KhpJs6oum/vQasCflwIeMz+NIjTLcwDL4bcL4NoKTA1tL9PdB+QZsg1qikYLUuoEkMwPPw333Nq0Y5kiQaR9s05i2Sxr89/+VAiLnISx7x2r8FOVWBXYfwurMpTAu/q+98+4Z71DbUZnHNZrwzxPF3PDT0DyNJRdHI1ks6NXLbLX04g+srlyiU9fRkSpliU+SUsXK0x/6AxxKeuzfbcJm6LCHqms6xeSmM6CZomSbfiB/oTxV5dwV9INCla6DL2ryZ6wEwfFTdxNGw8kVrXZWWTAQaFiCz6SUmo+8Bfdo8LbAQiQF0nr2eRNM9kSxW14XBOUIm5M3FPb8p7eUhg1g5gQ97nF7Ed+B/QWgzlNjXgiBHjCN0eLwZ2OOF9cNa1Q== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8658d2c-1323-418f-5f7e-08d8484d6ce1 X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:47:45.0605 (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: ryetExZqn4dJUxrljnL0fXmIS4ck29PSy2ThmW5LZrwIyaTSPlN39z7Eyi6nM4aJx5VmU4UV47+y4AyybPrXZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_124809_702355_F2A21283 X-CRM114-Status: GOOD ( 22.49 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.139 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.139 listed in list.dnswl.org] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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. Signed-off-by: Michael Kelley --- MAINTAINERS | 2 + arch/arm64/include/asm/hyperv-tlfs.h | 94 ++++++++++++++++++++++++++++++++++++ arch/arm64/include/asm/mshyperv.h | 76 +++++++++++++++++++++++++++++ 3 files changed, 172 insertions(+) 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 4179dfa..803bade 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8054,6 +8054,8 @@ 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/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/include/asm/hyperv-tlfs.h b/arch/arm64/include/asm/hyperv-tlfs.h new file mode 100644 index 0000000..09f5228 --- /dev/null +++ b/arch/arm64/include/asm/hyperv-tlfs.h @@ -0,0 +1,94 @@ +/* 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) 2019, 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_VPINDEX 0x00090003 +#define HV_REGISTER_TIME_REFCOUNT 0x00090004 +#define HV_REGISTER_REFERENCE_TSC 0x00090017 + +#define HV_REGISTER_SINT0 0x000A0000 +#define HV_REGISTER_SCONTROL 0x000A0010 +#define HV_REGISTER_SIFP 0x000A0012 +#define HV_REGISTER_SIPP 0x000A0013 +#define HV_REGISTER_EOM 0x000A0014 + +#define HV_REGISTER_STIMER0_CONFIG 0x000B0000 +#define HV_REGISTER_STIMER0_COUNT 0x000B0001 + +/* + * Define hypervisor message types. These must be + * included in the architecture specific hyperv-tlfs.h + * because there are processor specific values on the + * x86 side. + */ +enum hv_message_type { + HVMSG_NONE = 0x00000000, + + /* Memory access messages. */ + HVMSG_UNMAPPED_GPA = 0x80000000, + HVMSG_GPA_INTERCEPT = 0x80000001, + + /* Timer notification messages. */ + HVMSG_TIMER_EXPIRED = 0x80000010, + + /* Error messages. */ + HVMSG_INVALID_VP_REGISTER_VALUE = 0x80000020, + HVMSG_UNRECOVERABLE_EXCEPTION = 0x80000021, + HVMSG_UNSUPPORTED_FEATURE = 0x80000022, + + /* Trace buffer complete messages. */ + HVMSG_EVENTLOG_BUFFERCOMPLETE = 0x80000040, +}; + +#include + +#endif diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/mshyperv.h new file mode 100644 index 0000000..6b1f26c --- /dev/null +++ b/arch/arm64/include/asm/mshyperv.h @@ -0,0 +1,76 @@ +/* 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) 2019, Microsoft, Inc. + * + * Author : Michael Kelley + */ + +#ifndef _ASM_MSHYPERV_H +#define _ASM_MSHYPERV_H + +#include +#include +#include +#include +#include +#include +#include + +/* Access various Hyper-V synthetic registers */ +static inline void hv_set_simp(u64 val) +{ + hv_set_vpreg(HV_REGISTER_SIPP, val); +} + +#define hv_get_simp(val) (val = hv_get_vpreg(HV_REGISTER_SIPP)) + +static inline void hv_set_siefp(u64 val) +{ + hv_set_vpreg(HV_REGISTER_SIFP, val); +} + +#define hv_get_siefp(val) (val = hv_get_vpreg(HV_REGISTER_SIFP)) + +static inline void hv_set_synic_state(u64 val) +{ + hv_set_vpreg(HV_REGISTER_SCONTROL, val); +} + +#define hv_get_synic_state(val) (val = hv_get_vpreg(HV_REGISTER_SCONTROL)) + +static inline bool hv_recommend_using_aeoi(void) +{ + return false; +} + +static inline void hv_signal_eom(void) +{ + hv_set_vpreg(HV_REGISTER_EOM, 0); +} + +/* + * Hyper-V SINT registers are numbered sequentially, so we can just + * add the SINT number to the register number of SINT0 + */ + +static inline void hv_set_synint_state(u32 sint_num, u64 val) +{ + hv_set_vpreg(HV_REGISTER_SINT0 + sint_num, val); +} + +#define hv_get_synint_state(sint_num, val) \ + (val = hv_get_vpreg(HV_REGISTER_SINT0 + sint_num)) + +#include + +#endif From patchwork Mon Aug 24 16:46:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733801 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A35D314E5 for ; Mon, 24 Aug 2020 17:11:32 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 6ED74206F0 for ; Mon, 24 Aug 2020 17:11:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EoSQaNGK"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="IQjbBRg+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="Ltt4zHfU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6ED74206F0 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pPnWlEcARw1sO6Y9U04Of30+9GB9r5p6CJwg+OuvxmM=; b=EoSQaNGKbxOLOj/WU27yOc3Ft KqJiFkd9TTr/Yjmhb/cahfODwmBGGbnrfMK5cSXek7/XpYHjlgajnStXFsIjTNVyZpe8yF6g1rUK2 kpcUVtKCfP+Fy2yjBoGeu5ETU9JlENDFgUTpYswmJriT8KoMO0uaKHq3YJJtoa4EM6jvKeFsY/2+L ngRN+fIwYK4RSulHXpuSbFOK81nQdWEzmf+eikqIsGLAl4Jd4WmRI2UJ7Vq0BalB1TxXTyWcuCZMu lJQWBO6FzrKhwTrNc6uss3uENBI1I1JGXy4A3kdtfGWbroTqo5UnT1E+LVNdtZ7wU0bzIwU89/Cwv ZR6iy4ZzA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAG04-0003oI-R5; Mon, 24 Aug 2020 17:11:16 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzh-0003ex-DK for linux-arm-kernel@merlin.infradead.org; Mon, 24 Aug 2020 17:10:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VPEJ0LhBMi11K0Ceh46uoxwvptx+cBGqVsPdtnOFmDs=; b=IQjbBRg+XQ5ggQHwMbFPDUPWSS /eTT2jsc/IXyWCb5AyjwJSH5f/29IJCU5mWNJezzGWYjw6li+TKW2I0sAEB/o9eDe/qTDv0yy/Q0e 1PhsxBL7Z3d+nJVQqxB9KbHetvq5Rc9pLtbXolvpJw7rUYf7I7+AViDqLTq304USxZ/WqVK/l6av0 4hyRt15o+VtXJNjg32cmXo06INhNuIbcrqVT/Unvu2BhtsC5P0Z1YQMbAh2Ux4s6DDriIKAguKatM lr0wFpsfgr8lIc7lXTPv7tucdPGDnvyHLr5k4mVNIzDh2tdEMrIuE5nNxv/g8UkPi3XSvGitmHeIZ spHOvOkg==; Received: from mail-dm6nam12on2128.outbound.protection.outlook.com ([40.107.243.128] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFdq-0001wk-JF for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SY1g8XQiB/oy2ZmGf4fV67VPcYuUH2kBnxkKJTn4FbyGHWYrqLra2zg5kyMzGSG+XGXSqWzUgcm1EBxYCdWzzPDH6ROQIC2zBheyZ6U3VFmjMkHiKrWu5EzDZMWaLoub6YGL09/iowWD4pJ/eqAVSvnEHnr/D4VqFUZ0vIwK8xBLuBq7DFM0p62N7JRxw8EHbawZIkDl0wxNeQxSJZ7e3FlIjDujcot7qe2p/lbl1SRAZ5nhT7zGYmK9VowP+W+lLd/y2V4k7EleZU3FM5JbnIiaTmXgTZ6f6jzBSRPX/AOsMvtvprSXZFPkUnb6sPtNd7NSUyGWwjQ52TgakGuZAQ== 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=VPEJ0LhBMi11K0Ceh46uoxwvptx+cBGqVsPdtnOFmDs=; b=Qo0Rvh1VACgjPuDRvNrGtqLOamEEzFRMISslMpz38z4nwz4NGD0h9VIrnqx7Hs1h4oHkpRmjFn/qBwFrrgUhfNKZw/WtEhq4aEIVMyXKw7nKyUpNWANL8PqrZwtvgyUM+wxj8XyoFlcxtXGJ6gNn2/Km2/BucJrG+2d38usqi8RzqkLz3l7Sx9iL3u5E0QkEAiKl5BRhki8HDjL6of53z5afebMb0FqtoJgUR2Jws6vLad3YdLtMtZGx1c0elcNSl8mnNb75LTpXSJ8P0wlCTD3SJE+sYH5gp0YbM37I1Yb5MtI23iY1uch1LjJNoIO1aWh2U/1F02Hkqtdn3uN/Vw== 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=VPEJ0LhBMi11K0Ceh46uoxwvptx+cBGqVsPdtnOFmDs=; b=Ltt4zHfUQjH5WsGVRj1yxuy4je+4/z+1z4hseDgPq6KycR0hfJoOJo3V+mLLrRwalHuE/espKmPqBeqJET82brTLoVCyXePxuXTyNxLyV2SLST/D+XgDoTdfpHf6PfN+tNE8lWkKMlJ1wo5l8iaPo0e/KfygIK2Y9ywBvsAJP+I= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:47:47 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:47:47 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 03/10] arm64: hyperv: Add hypercall and register access functions Date: Mon, 24 Aug 2020 09:46:16 -0700 Message-Id: <1598287583-71762-4-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:45 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7a6c7132-c485-482a-7f73-08d8484d6dfb X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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:2000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NKLnWbe3nG96eEVc/lwsVnRi494T20LfGTLTZO26q2NnISbO+DZFK+vTJgMhQos9C+0YkKHUbCqi5yMAg3CzIApwTOfH9A6IeAlx9uBcz7wc/AxwyC5XQEpz5uPbc+o/8Oa6YL2qTxUa826fXDEjP4Gp1vqGC+lg7Bv3XXT6hferMcpfubG18VvtBoMOxIgBCEWLSjboSRtBvhRDUHxtJzBPkQJsJTfWOYbLg2jhccBihhAuuuoaAJChHTiykArkY2pA/RCPhce5TPz4NvI8BZ6byxDNQskeMJ4z3pynuXAo/BBi3lMXN2fcwPFvQQb7qahGqCG53G6XCO4s4vkjaA+4GhRFG5njyElBjVbQbmhqLKau/DJME0mnaM4BdKYd X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(83380400001)(7416002)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: oDZda5zL9jVjdJihUxd60n/KWejz+XQDuq6G60DtfamhU8kPUARDNywpYLYoLtwoIO7Dg4HtpQBFDRH4u9iDCVEVLajp+AZ9Nr7SqKW4l3G3WhaPhLGZdqaVGy51uupA3cAbt0hk56Zuj1c/wIEmDhV1eTP5gMtANLkCp01jLWAhfDmVwCa4PyT0yn5Gzj5jyUY3q4BJYDXqkHRVIc0Czcywxo4gVfOfRbOjwwxIoC7g5T4/EDml2/9B7zByzmqXCAHDRM6LbusWRqhlO+ajWvHZmIC62IIuZUueb+0+nrU7X6aVHlotEdfCqakACzpsW1/iqHDB//0GEyds+1Zatt1A7mBQfcGOkwEOF9f46V4/A+X/lLCou47evSRHgGqp/8eYGiailUIt/Nek/VdmPxL8O6mSfle5XZKeW5lcyvQBPaLjbUvz3KgbnO8QYps1y0uMk7V2zB52iar9f6WeQQBvkaDMZ6n/cElKumVgPYCGj1OCpJ9u+7FZhE6+7cavNTxQ9AZZChnTYykm4g5UUxN+EH2snsZrXtbGQNN0v1R8oA1tfOTV5N28v+t8A8f39Uujj+gCAkWQj6hMpU/3aSioD5CWvxXyKw3b7+6MzwGr77FYofz76Tgb5ZSw5Uu3eA+KAj9RkoWoESJNYwnnyQ== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a6c7132-c485-482a-7f73-08d8484d6dfb X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:47:46.9044 (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: zd5xBIA/OY6yc0m10dkWU++ye8n43jFacXJBpAScP9kcmb3oVog2eEWZC93K19I2jomNYZInZA5xqvUwIIiymA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_174818_799758_5A73DA2D X-CRM114-Status: GOOD ( 22.65 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.128 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.128 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add ARM64-specific code to make Hyper-V hypercalls and to access virtual processor synthetic registers via hypercalls. Hypercalls follow the SMC Calling Convention spec v1.1. This code is architecture dependent and is mostly driven by architecture independent code in the VMbus driver and the Hyper-V timer clocksource driver. This code is built only when CONFIG_HYPERV is enabled. Signed-off-by: Michael Kelley --- MAINTAINERS | 1 + arch/arm64/Kbuild | 1 + arch/arm64/hyperv/Makefile | 2 + arch/arm64/hyperv/hv_core.c | 170 ++++++++++++++++++++++++++++++++++++++ arch/arm64/include/asm/mshyperv.h | 17 ++++ 5 files changed, 191 insertions(+) create mode 100644 arch/arm64/hyperv/Makefile create mode 100644 arch/arm64/hyperv/hv_core.c diff --git a/MAINTAINERS b/MAINTAINERS index 803bade..f67d208 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8054,6 +8054,7 @@ 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 diff --git a/arch/arm64/Kbuild b/arch/arm64/Kbuild index d646582..7a37608 100644 --- a/arch/arm64/Kbuild +++ b/arch/arm64/Kbuild @@ -3,4 +3,5 @@ obj-y += kernel/ mm/ obj-$(CONFIG_NET) += 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..9b35011 --- /dev/null +++ b/arch/arm64/hyperv/hv_core.c @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * Initialization of the interface with Microsoft's Hyper-V hypervisor, + * and various low level utility routines for interacting with Hyper-V. + * + * Copyright (C) 2019, Microsoft, Inc. + * + * Author : Michael Kelley + */ + + +#include +#include +#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) +{ + u64 input_address; + u64 output_address; + struct arm_smccc_res res; + + 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) +{ + u64 control; + struct arm_smccc_res res; + + 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((res.a0 & HV_HYPERCALL_RESULT_MASK) != HV_STATUS_SUCCESS); +} +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. + */ + +static void __hv_get_vpreg_128(u32 msr, struct hv_get_vp_registers_output *res) +{ + struct hv_get_vp_registers_input *input; + u64 status; + + /* + * Allocate a power of 2 size so alignment to that size is + * guaranteed, since the hypercall input area must not cross + * a page boundary. + */ + + input = kzalloc(roundup_pow_of_two(sizeof(input->header) + + sizeof(input->element[0])), GFP_ATOMIC); + + input->header.partitionid = HV_PARTITION_ID_SELF; + input->header.vpindex = HV_VP_INDEX_SELF; + input->header.inputvtl = 0; + input->element[0].name0 = msr; + input->element[0].name1 = 0; + + + status = hv_do_hypercall( + HVCALL_GET_VP_REGISTERS | HV_HYPERCALL_REP_COMP_1, + input, 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((status & HV_HYPERCALL_RESULT_MASK) != HV_STATUS_SUCCESS); + + kfree(input); +} + +u64 hv_get_vpreg(u32 msr) +{ + struct hv_get_vp_registers_output *output; + u64 result; + + /* + * Allocate a power of 2 size so alignment to that size is + * guaranteed, since the hypercall output area must not cross + * a page boundary. + */ + output = kmalloc(roundup_pow_of_two(sizeof(*output)), GFP_ATOMIC); + + __hv_get_vpreg_128(msr, output); + + result = output->as64.low; + kfree(output); + return result; +} +EXPORT_SYMBOL_GPL(hv_get_vpreg); + +void hv_get_vpreg_128(u32 msr, struct hv_get_vp_registers_output *res) +{ + struct hv_get_vp_registers_output *output; + + /* + * Allocate a power of 2 size so alignment to that size is + * guaranteed, since the hypercall output area must not cross + * a page boundary. + */ + output = kmalloc(roundup_pow_of_two(sizeof(*output)), GFP_ATOMIC); + + __hv_get_vpreg_128(msr, output); + + res->as64.low = output->as64.low; + res->as64.high = output->as64.high; + kfree(output); +} +EXPORT_SYMBOL_GPL(hv_get_vpreg_128); diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/mshyperv.h index 6b1f26c..b17d4a1 100644 --- a/arch/arm64/include/asm/mshyperv.h +++ b/arch/arm64/include/asm/mshyperv.h @@ -26,6 +26,14 @@ #include #include +/* + * Declare calls to get and set Hyper-V VP register values on ARM64, which + * requires a hypercall. + */ +extern void hv_set_vpreg(u32 reg, u64 value); +extern u64 hv_get_vpreg(u32 reg); +extern void hv_get_vpreg_128(u32 reg, struct hv_get_vp_registers_output *result); + /* Access various Hyper-V synthetic registers */ static inline void hv_set_simp(u64 val) { @@ -71,6 +79,15 @@ static inline void hv_set_synint_state(u32 sint_num, u64 val) #define hv_get_synint_state(sint_num, val) \ (val = hv_get_vpreg(HV_REGISTER_SINT0 + sint_num)) + +/* 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 Mon Aug 24 16:46:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9424B14E5 for ; Mon, 24 Aug 2020 17:13:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 5DE322063A for ; Mon, 24 Aug 2020 17:13:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VENazrNs"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="bJLlDO5g"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="Crej1C1g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DE322063A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=673wYPdpfT3rNmf4ZK70K791erOxJW8QN7TgdVFYHjw=; b=VENazrNsnWpaCldxzdsXVwb2w 80l0KgX8xYVuzCj7RcKBOFuqAb9tc+t1sLJcFax8s6y2XlGkMkAemp9SanDDoIyjdDFIqCYp9nGSS 2J26E6PvxUMEI7vtkVjObWsfiaoxgkX/Is6HG2ybCyUqObtuiBxsG8PgU2HWDxZ+RUEP2lq9pwItH WyaU8k0RPntZXLIFMguwJlnfYOx7KWXw99RembZPvFy+tSUWKcCauJfQUxfsG8hPriIo5f3YHalfG mpQPS7hKCTxu2v7akhm60YRO1J3z04mX9mFrUdEHKUT2vqA3xgAkwp8jTq3AO9+sVcCttjzEk8FjB O/yafKNXw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAG01-0003nH-4r; Mon, 24 Aug 2020 17:11:13 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzg-0003ex-E4 for linux-arm-kernel@merlin.infradead.org; Mon, 24 Aug 2020 17:10:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=h90iRs2LNed01ztjCMOd97VyD/Aapry8OrQ+KqoQZhw=; b=bJLlDO5gCfk1I0Z0xHDCDoJGc6 jrXqQ/bcRrdPKIX2QjXuc5v3OtvhZe2X27McMWoZoGiU1uRGtBCIwt0rvFXtHro1Vrnm8mEPHl1u4 b0J7ikn0pU8f0+fky9t75n1iInYpOfbMBVI13/OQ5rWqg0VbJnhebUGHh1vXHdpkp7HhtzoaaFytN ChvTJPSaWxPO0Ow+yY91+6H9TcepNt9vLfqAKSRT5trNuoFkhmvOZWR7BbQ0il49TYQQYw/U+tuou cYqxlXhrjKHNSnLhQRAQjvuQtHCwJsRIktqcJ7ybY+JJKBJUXKnMxFZJ4VH4vueToKBEfm2E0rpmg iz66MnQw==; Received: from mail-dm6nam12on2128.outbound.protection.outlook.com ([40.107.243.128] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFdv-0001wk-9x for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WApy1dXTtbRFJVTg0PKD+APQCw295emjOQ99J2SdlmlL+KmzZpTtMiZHDjm3bFtMGPvKRB04hrAjy7SBlABDa9K4bv+DvSaCgIIuVZmX82R7Ge7mIKuET5dVmuDPBWY4XdHa7Sd7X4W3zFtKwCFB3Eh7/LYK+Uo0wdl+PBmC9WBpFhCmiE0PmOgiYbl1BJ0bcZIl6ChaL+NGG3wjmPhjedD/qjQkkZy8Br8EUAMyMvpDUp8e/g9nh3CIqgntf33WPb43dIPg1t8VlgDAcf9Tkj8O2sNQwwyMoeHaNjWoCmlGlNWsKBcpRKdkv20oyAfbQoKm6p1pdiNoift7mwKJhg== 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=h90iRs2LNed01ztjCMOd97VyD/Aapry8OrQ+KqoQZhw=; b=jHfSVzQa6cStXXqNzi6oDOidexrNLDH8Goge4z7UBoJsXLcw0jjJxNevFhrdFSSg4X96TDGT1Tf/jYCHDli7yp4gkHDQMbdIPJ1KjagWRRgvEDog0hFtQUJJPAFjEohh+IXE5xD+BKYNPGedjG2yTJwWj1ZQgZ82wJKEPziMoyPRUFwcuEtdM0rHxoXwY8de/Hi3YEF8Jx6io37kBelov/3PW44bwxjBwOLbddVkk6zlJyvDHU/P7oCl48PLi8ucv7kPNuZHsrV/kvfE9KfDlZUF2qDDa+Qm73I/HNUsqfXdQiMCNRM+QCV9dVv/XQqXu9o9ysBPsSO4aIUYB1nfhA== 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=h90iRs2LNed01ztjCMOd97VyD/Aapry8OrQ+KqoQZhw=; b=Crej1C1g+f6+rcJy/W/WdqFLKdiZWE0jGNvKctAiksBjRz4MliBM5uvJ1nUa3kF3naA6FBTgevlulrGwbjjkNuU8zl6A405BZFCZNnZNgBTsGsnLvI9Fe/+kAsrJFaKd0IhLBu2gjFTTDO/8AQNBg23e2/S8G0lVlaeZFmrlaRk= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:47:48 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:47:48 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 04/10] arm64: hyperv: Add memory alloc/free functions for Hyper-V size pages Date: Mon, 24 Aug 2020 09:46:17 -0700 Message-Id: <1598287583-71762-5-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:47 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6ffa684e-4fd2-4676-1901-08d8484d6f14 X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HXac9jyTZg9XHgzTC+Ls8xLP/V9eUrl7yqI/53PFWuNgOqJw27gtnh6frOuxOueq2Az4v0xj7CJfLK744+kQwyUkPVq3yHxRgQl6uQqq/c1bEBaXVDyQG60b7tY3rfbPqkykjyV1MnMFGKO1jiISI5nyA8Q0djZAjM79XfBOJ7y8K2A7PX+rB4KfMMlqakFoPAMO9L3hdLOxhhyy/FXqI3IuSnWE4xFd7u+bjSsbT/cVkhvvEWX12pO0mIyht9BxJ+He3XPrMCx2uxefoWPFYEOj6V17GX56FeLS5HgYbrraNDZG8LbMH+7GdAUq+o6+UbVt9zzDCfUAZuSD+OH+hF3oZYE3666qlS/0pNMyCmoB5OUhLT6lpWbQ0oSpBe9o X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(83380400001)(7416002)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: zZd8Q1zNASL8UTDW3/iQ+qv7P9P8HzW1+mzfW8JKblJtAKPc46qGHd30ABZq5adVNeO9fhG1CdKLQJcMV9uTcFQroPABqxfFpWOD/1W9neNqrIbZUQ85jLHYytCLzMO9G+wX57hAPWgIFENsQkGe9wml+wRrrbMkzoUu/uOmYwFWtFJc3ScYlcE6DkiQCxt24Va+MeIsZ8udxOGEevbLZiboqi3Cd3EnwYrtin6iAy49baf3qJgb9bJcHNMHxZ3IntyHJU2rVPIjSgMefOUDmBfdM/7qU0a6d707ymcXckBRSttg6bKdDQKztA4iwFERLF9bDBtnTrjb/m55qcgL/qEicw/ZWjdXipOOxohuvS+B9iDMc3Qf/Jho0KOmO572n8ggVLVPKKoTpfQz+pgnqMUVUKtbFrY2EeyukI1LtujcqEr/XfMbRNM0N3M6BX8mfmqufaxOZpqwAGNFuBcd/GzoKU41TcOUPpn+lKSA5CIhPuBxSBYCAEMwYNZj6t72SSxe7q5ipnhWOlcDWRxDx47nkyHmy+lXgHAttxF7P20YV5lBVaDvOJHECdxeiyHhUZ7HRHtVUKgd5rDgboCqstQPCxgkzv+vuzwlIOMkssFoxa/COB2PuqBiH8mV+ySWqy/M/mMiquHKfM2l/u/LWw== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ffa684e-4fd2-4676-1901-08d8484d6f14 X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:47:48.7434 (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: ajUFDDZHRXatKiOSPQdQ9+ZNfTGLLw5Qqp2+qWXtgEoZ4/YofhMrDGRPrcLfaa0tgkgEWQNaz0BAkZ6r3r/E3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_174823_633099_32953613 X-CRM114-Status: GOOD ( 15.20 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.128 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.128 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add ARM64-specific code to allocate memory with HV_HYP_PAGE_SIZE size and alignment. These are for use when pages need to be shared with Hyper-V. Separate functions are needed as the page size used by Hyper-V may not be the same as the guest page size. This code is built only when CONFIG_HYPERV is enabled. Signed-off-by: Michael Kelley --- arch/arm64/hyperv/hv_core.c | 43 ++++++++++++++++++++++++++++++++++++++++++ include/asm-generic/mshyperv.h | 5 +++++ 2 files changed, 48 insertions(+) diff --git a/arch/arm64/hyperv/hv_core.c b/arch/arm64/hyperv/hv_core.c index 9b35011..14e41b7 100644 --- a/arch/arm64/hyperv/hv_core.c +++ b/arch/arm64/hyperv/hv_core.c @@ -24,6 +24,49 @@ /* + * Functions for allocating and freeing memory with size and + * alignment HV_HYP_PAGE_SIZE. These functions are needed because + * the guest page size may not be the same as the Hyper-V page + * size. We depend upon kmalloc() aligning power-of-two size + * allocations to the allocation size boundary, so that the + * allocated memory appears to Hyper-V as a page of the size + * it expects. + * + * These functions are used by arm64 specific code as well as + * arch independent Hyper-V drivers. + */ + +void *hv_alloc_hyperv_page(void) +{ + BUILD_BUG_ON(PAGE_SIZE < HV_HYP_PAGE_SIZE); + + if (PAGE_SIZE == HV_HYP_PAGE_SIZE) + return (void *)__get_free_page(GFP_KERNEL); + else + return kmalloc(HV_HYP_PAGE_SIZE, GFP_KERNEL); +} +EXPORT_SYMBOL_GPL(hv_alloc_hyperv_page); + +void *hv_alloc_hyperv_zeroed_page(void) +{ + if (PAGE_SIZE == HV_HYP_PAGE_SIZE) + return (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO); + else + return kzalloc(HV_HYP_PAGE_SIZE, GFP_KERNEL); +} +EXPORT_SYMBOL_GPL(hv_alloc_hyperv_zeroed_page); + +void hv_free_hyperv_page(unsigned long addr) +{ + if (PAGE_SIZE == HV_HYP_PAGE_SIZE) + free_page(addr); + else + kfree((void *)addr); +} +EXPORT_SYMBOL_GPL(hv_free_hyperv_page); + + +/* * hv_do_hypercall- Invoke the specified hypercall */ u64 hv_do_hypercall(u64 control, void *input, void *output) diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h index c577996..d345a59 100644 --- a/include/asm-generic/mshyperv.h +++ b/include/asm-generic/mshyperv.h @@ -101,6 +101,11 @@ static inline void vmbus_signal_eom(struct hv_message *msg, u32 old_msg_type) extern int vmbus_interrupt; +void *hv_alloc_hyperv_page(void); +void *hv_alloc_hyperv_zeroed_page(void); +void hv_free_hyperv_page(unsigned long addr); + + #if IS_ENABLED(CONFIG_HYPERV) /* * Hypervisor's notion of virtual processor ID is different from From patchwork Mon Aug 24 16:46:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733799 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 219081751 for ; Mon, 24 Aug 2020 17:11:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 DA4E12063A for ; Mon, 24 Aug 2020 17:11:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yctMZ3FH"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dAM6djML"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="KDNO0gM0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA4E12063A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=G4fWLtvuwRKzNH6AWCxnkai7trLuy6LJv/jnQBIlJwo=; b=yctMZ3FHzO5/VDRc2vj8Hg6L/ l78F0xfVGqkhbuKvF+9cSefTu9ZU3OpyGGxUjFH2rvAQAAxxfzkk0UOAxj/901xWLUxTqK0SVHlYz TWbG/RhAVfQCxJaj7wcPwaTyvuyX82dOMeHpRUqifVlRR2lJupYObUiyQKhsmOjcRA4UHCcjyGHvy bQknp1CLlB17oorPu3Af1K6MRK0W5kwq346Ryqlwg6bdewXdn662EW22SEtK6HU6Cv/qlTLld5gkm 8k/nZ/gF5c/E6BX87dlKPSLOpXWWwG9iuV7zCrdknK9m9BsgCjJeo8QyseDWKPh0RgAwaPVkO5KxY tb1Y9VAIw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzm-0003ig-Pf; Mon, 24 Aug 2020 17:10:58 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzf-0003ex-DU for linux-arm-kernel@merlin.infradead.org; Mon, 24 Aug 2020 17:10:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wnkCAG9yK9xZ/Yk93n2+2+Qd0OZ1cEny3sc3nIpUFJc=; b=dAM6djMLH/yeyODOgeXZbt3NVK OWfbdyo6CZOFonfqOXLQ2nafooDhIkU6MhzZTmnCT7X8FXiaNMBxGLTYq8W8GRKZic6V8d1KRMDN9 Akq0SbAOKhQToh2fsrN16Z0lQ4TR7JJEHt240EZuzdDp+ig9OdT0+wY3ItvLqCg2jbQyy+HDluWq6 /oHsOZfX+NG93Bs0bkrC9uQvsZebG8MkfTaX4snodWm3sKXwkgbB+StLLab4Jb19QFiX/3L4V8KVN EyJrEPZkDYi+oBKBkHRYFqKVO9xopBmSx7+WHVO33RfeaYvS01FcEoKlapVk9yjbItBX2NtRTrvTc J2TxnQrw==; Received: from mail-dm6nam12on2128.outbound.protection.outlook.com ([40.107.243.128] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFdy-0001wk-7D for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SDIywB8TWCyhiASfJY5MpvUQ7H5/A1oF/3asvWv12EP4cfs6rVq+Y1NNz14Pru3rNUOhrHrR74h5HK0EP3r6OkoUpmALdt6oViRncyrVv/clwoj+SgbSME/SOE2Er5Cedi7ififAawFDODx/Adnrzthpw4tQjdMPLKuBfQl/eDf/AELEY19Gb/OnZrZIBNilSS/P79OmifEIlHlfM/iO/eGwi156znm8IDkkC6jr90MsFT43Q5M5IKHOKEy78PLypGyHq10qHuF7YYb9AiMSSZ8+ysD7CqU/i4K94Gphr+26XuXsz8RH5WFYqlGygzDNIHQSFNLoccjPJER3QIQmBQ== 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=wnkCAG9yK9xZ/Yk93n2+2+Qd0OZ1cEny3sc3nIpUFJc=; b=Qcq+2WE0DB0RVl+u1Ke5Dm5VD5qAOQ5r7sa8Z8pzW/Q3S2+v/buR0vz2J2MeHmaqdQKMjHW20D2oSDfLi+/HGbqySGO4EsrrMgugQqNXoYdAQ0rvsSIQ/iLgES3ah5Wsa5a4xVV4zj0DwVXUrjIcQ+UJzn0yL2mt/bJpBUv8gIjWcfyR+zyim7cFLKeuZLn1xXduPjyQc2e1dmjrb4ljy5K8a09W4wfvJx/wfh53vlZCqWgdpFkRBVgKHbORaL5kyKqFjRFjaDWtq6xwNvbHfXM03+AUgID7DctEX13PVv95GGfG2lZ4YMUzMckKZBPAF1dWuhb0391ONhLuecNVEA== 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=wnkCAG9yK9xZ/Yk93n2+2+Qd0OZ1cEny3sc3nIpUFJc=; b=KDNO0gM0Ri6520jRwPRrR/sTLNr5Wl51Fecc+5A0HKKFToJqdj6VD1kRR4J94/DJEfUzLpnW12OYiovkzlgXXSoyxfahTRcKcNsvv19LPlGWYDZdmVJq1ZDhR0skff3OHoebzGpmpmrV3kZyq05/TCq2VLkE7Aam1sN+Izqzq0E= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:47:58 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:47:57 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 05/10] arm64: hyperv: Add interrupt handlers for VMbus and stimer Date: Mon, 24 Aug 2020 09:46:18 -0700 Message-Id: <1598287583-71762-6-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:48 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 456256fd-e167-4fb0-00a0-08d8484d702d X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xaeqHQX8NaKVxqAZt+CmX13YzOLPT1kxmVCCtp7MHJez4AE8YoHZ+lNCvREzWciB0mnvq9q3vO/hcgCy0N2Y+FWiAzdAdDjLy8nlS8CkggN5HDPW9RBaVjuCrXK4TIEik974LG0G+SfbskcNynX2JTPWKBIp+y1LohggjTlvJhcBbMy9PR6oqpH4yQmEgJy9mInxcUAQ4JMGGRy71d83307gDpC6HvYSUcPOBWE2LaClK7TthZp6G8SetOKKhqJTcslJ2ClMMxpZlUKOqb6M66JKns519fDmm0sp4XSUIN33iJ5bdvCbbuvM4uqdTsgv2JxZ94urMdpOdgz4FwShV2quT6GdhT20+R81nTu7cms= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(83380400001)(7416002)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: w96bK3czhU5sSdvdG5vg9rVVpxKB6KwRzitr8nDMSq2KXHlWgNeUxr7BqZL22kC6DHdQce51joXZzj76DzWxtk2Dwr8Y1Yt/kD4Wh6PyVhdS8GhP4I3tnngOOSwd82fMo/+9kKNlxiy2Sj4fLj+hvdi0NK2EBVRxYSar1XEvu3P+T5hRuuqFUJL2IS2EK411fvWLZZ0GeZ+Af3ZbCdSn1gG4XpIruj50KJb6CDqt8qRFTBuKnB8kId8zqsoHKtjjE/lmWbZtYwqVXBZCFvUEPioxlDUkWdjBam6/gEIUHpOAYuWGxx8QZfzKLmjNpQS65Nb0birDFZWkezDxZim474lAUGn1dUsYHumCuKDxdMiRwIcK0IGq8YQ1F1hl0h9s0jduyfKVoRmLkWII4i0mGINuKXZB5Tz1J21KblKaAnoIvhXV8h0uxaSMTnOoE2NXtzdYFSw+IqraPsJVAGXfkBvjBYLpIUWEcQVUXtMrKdyamojBPfNVK6qMvVqLryGEFsiUN3XchSiM8feP1i4vszbOXfbAt9eFMmebN/gAotH5ACIHMdAXEnOnm1YPmXL55IaepJqpST2Q+2kW957rq0GX90plDl26Obc2AguOc6zis74CpqfVO9jB67uLIGymeYtrHxYusM4PagV4dOovtg== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 456256fd-e167-4fb0-00a0-08d8484d702d X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:47:50.5953 (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: j542S6N0qgpMnN5fORxDWunALo1aR3CgUpeiWp7BXWP7MItc+S4CZJbDnGe8y1H+MuYPirt1M2QH+TBytTtEUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_174826_412303_0BD1EBE0 X-CRM114-Status: GOOD ( 24.03 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.128 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.128 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add ARM64-specific code to set up and handle the interrupts generated by Hyper-V for VMbus messages and for stimer expiration. This code is architecture dependent and is mostly driven by architecture independent code in the VMbus driver and the Hyper-V timer clocksource driver. This code is built only when CONFIG_HYPERV is enabled. Signed-off-by: Michael Kelley --- arch/arm64/hyperv/Makefile | 2 +- arch/arm64/hyperv/mshyperv.c | 133 ++++++++++++++++++++++++++++++++++++++ arch/arm64/include/asm/mshyperv.h | 70 ++++++++++++++++++++ 3 files changed, 204 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..be2cd2f --- /dev/null +++ b/arch/arm64/hyperv/mshyperv.c @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * Core routines for interacting with Microsoft's Hyper-V hypervisor, + * including setting up VMbus and STIMER interrupts, and handling + * crashes and kexecs. These interactions are through a set of + * static "handler" variables set by the architecture independent + * VMbus and STIMER drivers. + * + * Copyright (C) 2019, Microsoft, Inc. + * + * Author : Michael Kelley + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static void (*vmbus_handler)(void); +static void (*hv_stimer0_handler)(void); + +static int vmbus_irq; +static long __percpu *vmbus_evt; +static long __percpu *stimer0_evt; + +irqreturn_t hyperv_vector_handler(int irq, void *dev_id) +{ + vmbus_handler(); + return IRQ_HANDLED; +} + +/* Must be done just once */ +int hv_setup_vmbus_irq(int irq, void (*handler)(void)) +{ + int result; + + vmbus_handler = handler; + + vmbus_evt = alloc_percpu(long); + result = request_percpu_irq(irq, hyperv_vector_handler, + "Hyper-V VMbus", vmbus_evt); + if (result) { + pr_err("Can't request Hyper-V VMBus IRQ %d. Error %d", + irq, result); + free_percpu(vmbus_evt); + return result; + } + + vmbus_irq = irq; + return 0; +} +EXPORT_SYMBOL_GPL(hv_setup_vmbus_irq); + +/* Must be done just once */ +void hv_remove_vmbus_irq(void) +{ + if (vmbus_irq) { + free_percpu_irq(vmbus_irq, vmbus_evt); + free_percpu(vmbus_evt); + } +} +EXPORT_SYMBOL_GPL(hv_remove_vmbus_irq); + +/* Must be done by each CPU */ +void hv_enable_vmbus_irq(void) +{ + enable_percpu_irq(vmbus_irq, 0); +} +EXPORT_SYMBOL_GPL(hv_enable_vmbus_irq); + +/* Must be done by each CPU */ +void hv_disable_vmbus_irq(void) +{ + disable_percpu_irq(vmbus_irq); +} +EXPORT_SYMBOL_GPL(hv_disable_vmbus_irq); + +/* Routines to do per-architecture handling of STIMER0 when in Direct Mode */ + +static irqreturn_t hv_stimer0_vector_handler(int irq, void *dev_id) +{ + if (hv_stimer0_handler) + hv_stimer0_handler(); + return IRQ_HANDLED; +} + +int hv_setup_stimer0_irq(int *irq, int *vector, void (*handler)(void)) +{ + int localirq; + int result; + + localirq = acpi_register_gsi(NULL, HV_STIMER0_INTID, + ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH); + if (localirq <= 0) { + pr_err("Can't register Hyper-V stimer0 GSI. Error %d", + localirq); + *irq = 0; + return -1; + } + stimer0_evt = alloc_percpu(long); + result = request_percpu_irq(localirq, hv_stimer0_vector_handler, + "Hyper-V stimer0", stimer0_evt); + if (result) { + pr_err("Can't request Hyper-V stimer0 IRQ %d. Error %d", + localirq, result); + free_percpu(stimer0_evt); + acpi_unregister_gsi(localirq); + *irq = 0; + return result; + } + + hv_stimer0_handler = handler; + *vector = HV_STIMER0_INTID; + *irq = localirq; + return 0; +} +EXPORT_SYMBOL_GPL(hv_setup_stimer0_irq); + +void hv_remove_stimer0_irq(int irq) +{ + hv_stimer0_handler = NULL; + if (irq) { + free_percpu_irq(irq, stimer0_evt); + free_percpu(stimer0_evt); + acpi_unregister_gsi(irq); + } +} +EXPORT_SYMBOL_GPL(hv_remove_stimer0_irq); diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/mshyperv.h index b17d4a1..2ea64e54 100644 --- a/arch/arm64/include/asm/mshyperv.h +++ b/arch/arm64/include/asm/mshyperv.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -80,6 +81,75 @@ static inline void hv_set_synint_state(u32 sint_num, u64 val) (val = hv_get_vpreg(HV_REGISTER_SINT0 + sint_num)) +/* + * Define the INTID used by STIMER0 Direct Mode interrupts. This + * value can't come from ACPI tables because it is needed before + * the Linux ACPI subsystem is initialized. + */ +#define HV_STIMER0_INTID 31 + +/* + * Use the Hyper-V provided stimer0 as the timer that is made + * available to the architecture independent Hyper-V drivers. + */ +static inline void hv_init_timer(u32 timer, u64 tick) +{ + hv_set_vpreg(HV_REGISTER_STIMER0_COUNT + (2*timer), tick); +} + +static inline void hv_init_timer_config(u32 timer, u64 val) +{ + hv_set_vpreg(HV_REGISTER_STIMER0_CONFIG + (2*timer), val); +} + +#define hv_get_time_ref_count(val) \ + (val = hv_get_vpreg(HV_REGISTER_TIME_REFCOUNT)) +#define hv_get_reference_tsc(val) \ + (val = hv_get_vpreg(HV_REGISTER_REFERENCE_TSC)) + +static inline void hv_set_reference_tsc(u64 val) +{ + hv_set_vpreg(HV_REGISTER_REFERENCE_TSC, val); +} + +#define hv_set_clocksource_vdso(val) \ + ((val).vdso_clock_mode = VDSO_CLOCKMODE_NONE) + +static inline void hv_enable_vdso_clocksource(void) {} + +static inline void hv_enable_stimer0_percpu_irq(int irq) +{ + enable_percpu_irq(irq, 0); +} + +static inline void hv_disable_stimer0_percpu_irq(int irq) +{ + disable_percpu_irq(irq); +} + +static inline u64 hv_get_raw_timer(void) +{ + return arch_timer_read_counter(); +} + +static inline void hv_setup_sched_clock(void *sched_clock) +{ + /* + * The Hyper-V sched clock read function returns nanoseconds, + * not the normal 100ns units of the Hyper-V synthetic clock, + * so specify 1 GHz here as the rate. + */ + sched_clock_register(sched_clock, 64, NSEC_PER_SEC); +} + +extern int vmbus_interrupt; + +static inline int hv_get_vector(void) +{ + return vmbus_interrupt; +} + + /* SMCCC hypercall parameters */ #define HV_SMCCC_FUNC_NUMBER 1 #define HV_FUNC_ID ARM_SMCCC_CALL_VAL( \ From patchwork Mon Aug 24 16:46:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733785 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ADDDE14E5 for ; Mon, 24 Aug 2020 16:53:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 730E72067C for ; Mon, 24 Aug 2020 16:53:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="1YSjA0j3"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="hmo+51QF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 730E72067C Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wItonEvHpBC0JLH3hwRmBB0PA8VTNrWQdOeHS3gVC9s=; b=1YSjA0j31QiTEE+qC54Oef4Bo gbvDxJlU9tbUt6Urv4UxXX2ssZ2MG4hRVjjL6dCLbM/rMeEPFAhHbNo+UYJQJCS9Gl8FqCPMfjki4 zoyZ+4TexMu6gLXyur6P8Be8ZLhYjjPwFoA2txXh2Df+/ed0FJuUuMpH0+2J4NqvhwP51BbWv4LNy C/bS4WZsoyXxgWwkoQ8ZsI8nGGCXWeCT1eyKSOm/bjahjQYktXOZd7cqJ8tu58J1TrwR9TyYYecNS yAq34nmB9HKN0bzL7IByMuSiytgVKDKZ2BFI+XsqmUyDF93AJMoqq1dkPIcxoFdCRAMO9f4FZ9crN wEZQpJ1yQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFh9-00083k-Rh; Mon, 24 Aug 2020 16:51:43 +0000 Received: from mail-dm6nam12on2139.outbound.protection.outlook.com ([40.107.243.139] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFdy-000650-HT for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eIc/GZEm0bwpuS3UiNCb5b/izN40EvYsE9mHOo8idVwlPHyrbX6h1aepRZnYwD9pFxBsGDE+u34sxW3fQ/8W5eFNxNS3dp+FgYdiyP9kTzvLBGUXZDtzr73/KkHplWJ+uLF7CpmrzPjfPYzOOrfDP7opOxHEKe1D8PR7d9a5xuEgkZL2eH73vq6yyQMDnZunuFJytFXarCnVuTCgFT1d1hHWKOv/WPnSxyPw7DfTGdaJKcr0/4B6McY/ttLFAwsa7sLeSHHGRRQ+C6c4Ktv6O4f7FVWROUR3qB0mv3GLGBzlQHkpBSF+HynUS/BIPgAUQ3UYBwwhvVJgKKgPGUAC6g== 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=RPH8n0MDHAr0BMdP5ZWvamaCLXQHnKmSR1JTns0c0qA=; b=an8vtdtxV9qFa2G0h3SJT9TSwLG3W907u987aQAQU553Cr8E/d4TIhFCXq1MFzS+BzVOw9TZ/sB1LCt/MAw4RrpfqIssTQMnbiujZAimfjm4jTXSpmkZwU5VN68jWziKaM/lz/mYXn3/+9VuF3m7HZMPI6F9gv4PHTL7GckgwYJsikXoLr+LhqEQyRr4vwfe3nnK2a37BCfMgUfef2LHl9jx0fn0twNgPAzRTfL3s8AuJ7MJrMcAUTVnF/QU3mCYLzIPdtoGET2DBuUOi2wRdNonCeXM31uxhvvy7mqa9fMzRfvjMfEO5T9ex85cqZtriqzgZGRYX1fm5cqrcLatWA== 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=RPH8n0MDHAr0BMdP5ZWvamaCLXQHnKmSR1JTns0c0qA=; b=hmo+51QFBbrb/eTnT/QwwynFiKiVSucF2r1eQk1Pg2wDXgottjKNDdxdEpel/FTQQGFtP209yExTA9uigcvHgPELh/ZCmne9RZEYLGpI+n5KOTDXTuP6W7Li19DqCWwrTeaU5Yo84fHEISJD/QB6ihVK9dbMKAL+RbQVfEFHA1o= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:48:02 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:48:01 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 06/10] arm64: hyperv: Add kexec and panic handlers Date: Mon, 24 Aug 2020 09:46:19 -0700 Message-Id: <1598287583-71762-7-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:50 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a7c824e2-2bc7-4409-479e-08d8484d7147 X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OUeZJ9VM4fnR2dDfQTS5FhCYKaI5vFTS5hEQf52KRFqdHj1X1MEQKHe6thcAIExfi4tUxgeH6KKug0b6PBi8+b9DSycvcUmerWk3NfIRXSbdQzxNFEAMwPowUrMMfkbK9d7wwGZvxvxgJhd6GqwJryeDnmLENJnGoagJkxB1LZhyrNMF+Md2SDFPVyBJcwlUgJTpNAnlQt3XdIkcd2JDyM+/Ke9k0rIARHwBm+OrckI/020wo+TBuK7HSj1RNo49Rms7LPMj46o1R8NVuEaVnY0uOq2YLslzFqWh/rvgtw4UrMKle2DIQ0Li0eBk4PLNlB178K+soCztBLupGCIjdrMS6/js5lWzsNRPMh8dwrGLNA4ayWho/Nv9KtfVirBd X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(83380400001)(7416002)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: cAnz1lYZGeu1vrsU3dHrNXThtW0qooajjk8Zg8Rf9tn5m6Fe/WCLzI65Ia3DAKzaSWh9li0rxXx4yxmgNr8oW45cTvPJPg0jNiRgfYWkGiFr4VSSXfuH9j3HFTv70r9YdD0jqSBJFrLBZFYMoeQeLOzhrt/Zm/mpL3q6RgadDeVszBXhYqyCuHu24P/udcrY34V61tj7dmuQArKk8AytwerQWVJnW+utgMPAnyuFTopT5Z9Dn9Z5nfz4sm0m77f1wN4ImyPy4U/q8E9eDFvB7Hkwab0+fKJdLvU4YiIZ+4IyMi8wD644pEkqBfNWmmGPqdTzlhStSK2HHW63sjZyua/aGTf3XLSara5lgflY1l8JJYZ8JtghaMZNsHsr4YA6uxkz7MGs2vgKWA+ZwXWvSbN3/8U1O4qCYQahkeYm0eZChX5ycfC/w6rwez/mSOEn3BlayySYCZ56rcbWLuuiqXZH0g4k8ImH6VaBxfzn6gSMvKbH1fxhnIvCog70bovjRKy9JV5WUE26GIs3aUvOFu4jGhbNOeCv4Gjxaut5IfuxDSMIKBLgSdGwG1pGkrV3JtXoUjZFjR8s4ODe6ffPY0A6EbC3YZPx8Tca+5gVeIYpuGGZow6lFpyCPsv6UrpD0XS+/qI/ODvZfvpDDbTFrw== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7c824e2-2bc7-4409-479e-08d8484d7147 X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:47:52.5832 (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: QnTbd+5UrGqRPNWgLISULISu8lmPYCkRqSUVVlfWkRYXaoAh4oXMH0xPJaPTz5pnAgrDjEJUUjf5up4YKsdG3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_124826_766104_9F3B5B19 X-CRM114-Status: GOOD ( 23.55 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.139 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.139 listed in list.dnswl.org] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add functions to set up and remove kexec and panic handlers, and to inform Hyper-V about a guest panic. These functions are called from architecture independent code in the VMbus driver. This code is built only when CONFIG_HYPERV is enabled. Signed-off-by: Michael Kelley --- arch/arm64/hyperv/hv_core.c | 80 +++++++++++++++++++++++++++++++++++++++ arch/arm64/hyperv/mshyperv.c | 26 +++++++++++++ arch/arm64/include/asm/mshyperv.h | 2 + 3 files changed, 108 insertions(+) diff --git a/arch/arm64/hyperv/hv_core.c b/arch/arm64/hyperv/hv_core.c index 14e41b7..966d815 100644 --- a/arch/arm64/hyperv/hv_core.c +++ b/arch/arm64/hyperv/hv_core.c @@ -211,3 +211,83 @@ void hv_get_vpreg_128(u32 msr, struct hv_get_vp_registers_output *res) kfree(output); } EXPORT_SYMBOL_GPL(hv_get_vpreg_128); + + +/* + * 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 hyperv_report_panic_msg() 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, and the PC. + * The first two general registers are added arbitrarily. + */ + 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->regs[0]); + hv_set_vpreg(HV_REGISTER_CRASH_P4, regs->regs[1]); + + /* + * 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); + +/* + * hyperv_report_panic_msg - report panic message to Hyper-V + * @pa: physical address of the panic page containing the message + * @size: size of the message in the page + */ +void hyperv_report_panic_msg(phys_addr_t pa, size_t size) +{ + /* + * P3 to contain the physical address of the panic page & P4 to + * contain the size of the panic data in that page. Rest of the + * registers are no-op when the NOTIFY_MSG flag is set. + */ + hv_set_vpreg(HV_REGISTER_CRASH_P0, 0); + hv_set_vpreg(HV_REGISTER_CRASH_P1, 0); + hv_set_vpreg(HV_REGISTER_CRASH_P2, 0); + hv_set_vpreg(HV_REGISTER_CRASH_P3, pa); + hv_set_vpreg(HV_REGISTER_CRASH_P4, size); + + /* + * Let Hyper-V know there is crash data available along with + * the panic message. + */ + hv_set_vpreg(HV_REGISTER_CRASH_CTL, + (HV_CRASH_CTL_CRASH_NOTIFY | HV_CRASH_CTL_CRASH_NOTIFY_MSG)); +} +EXPORT_SYMBOL_GPL(hyperv_report_panic_msg); diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c index be2cd2f..5bd39cb 100644 --- a/arch/arm64/hyperv/mshyperv.c +++ b/arch/arm64/hyperv/mshyperv.c @@ -23,6 +23,8 @@ static void (*vmbus_handler)(void); static void (*hv_stimer0_handler)(void); +static void (*hv_kexec_handler)(void); +static void (*hv_crash_handler)(struct pt_regs *regs); static int vmbus_irq; static long __percpu *vmbus_evt; @@ -131,3 +133,27 @@ void hv_remove_stimer0_irq(int irq) } } EXPORT_SYMBOL_GPL(hv_remove_stimer0_irq); + +void hv_setup_kexec_handler(void (*handler)(void)) +{ + hv_kexec_handler = handler; +} +EXPORT_SYMBOL_GPL(hv_setup_kexec_handler); + +void hv_remove_kexec_handler(void) +{ + hv_kexec_handler = NULL; +} +EXPORT_SYMBOL_GPL(hv_remove_kexec_handler); + +void hv_setup_crash_handler(void (*handler)(struct pt_regs *regs)) +{ + hv_crash_handler = handler; +} +EXPORT_SYMBOL_GPL(hv_setup_crash_handler); + +void hv_remove_crash_handler(void) +{ + hv_crash_handler = NULL; +} +EXPORT_SYMBOL_GPL(hv_remove_crash_handler); diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/mshyperv.h index 2ea64e54..5df96a5 100644 --- a/arch/arm64/include/asm/mshyperv.h +++ b/arch/arm64/include/asm/mshyperv.h @@ -149,6 +149,8 @@ static inline int hv_get_vector(void) return vmbus_interrupt; } +#define hv_get_crash_ctl(val) \ + (val = hv_get_vpreg(HV_REGISTER_CRASH_CTL)) /* SMCCC hypercall parameters */ #define HV_SMCCC_FUNC_NUMBER 1 From patchwork Mon Aug 24 16:46:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733807 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFB69722 for ; Mon, 24 Aug 2020 17:13:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 B78FD2063A for ; Mon, 24 Aug 2020 17:13:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="a0U3lbAm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PQXS/PX4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="QBwwG7IA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B78FD2063A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/okv3p59V0X7cuqMIuVpaTXUvZEP+uw9qePAK+liLiQ=; b=a0U3lbAmXzdiZfXB4IeVy59J3 Wq4mI6YsgezgKwa74lQ64ILcCg4OkCYveYWK9VCMn4jjkxMjasr78VopYegnrC7axGlap8q1ppXZe daoRp4wc09ZP7+HlRw5iMbxecvc8R04N0vbR+BH3FLfwUX/FNFPbNyxJFn+k+8rJPgFsRSQFgWDO8 5RjNMWJgbqTbg1GPq5f+KC5dVJk7Y7hW58FUkgypA9ndf/EzPKN605zmTvh6RevrLv1TaHYSySivC Anpal6TOcB+czTfv6L4lyIKpdwlIVFVxEl1qy/dJuG/IUGORmQBGU2p6y+2VnheQdd5KBOonM043W GjnEz/Q7A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzk-0003iK-Ae; Mon, 24 Aug 2020 17:10:56 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFze-0003ex-1A for linux-arm-kernel@merlin.infradead.org; Mon, 24 Aug 2020 17:10:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LHgTfSh2/H9zYVYFD/dOYfqhNAkUx8fqSOk4VlRqeqA=; b=PQXS/PX4IKN5JWS5dNSEJVf2ZK hJPOaVMs/hlzh32dA2jARrf18IlZOfkLNB5UGJ8PheoxCWoTRznJvWQGoKURswI5qU8JZpanxJiMc EngH75832di/GWSyQy/UkUAM6Ps57cswtiEqmTLK973dm/GTAZ4u+Xcbn5IIOVkOe1a9BZRQ0oeRI 35lpUy4vOk55ACss8TyE+IZKOeTo7X379BaCmcLS4G8wPpOgECOUHfcj0qtsCFtGHyGyqMumOqRrA 2LUDoYTtKI/eCH0fNKKDgRCGbqEJZ0V4VqSabYjM246E59VSh8MW+TvzIBKE7V8IckfM8pyt2wSH+ /XhLDVkg==; Received: from mail-dm6nam12on2128.outbound.protection.outlook.com ([40.107.243.128] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFe2-0001wk-0j for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gdv8x8/WPQTVu+yOQylZtAbV7qsUmK8SHBUbdNioy2kQ7SWyNIlvmNJn7xwDw9g9g1UyxeP0PMQlkFLuYDmyPI3TaxyzJEgw7UPQcOOXf9uFI1OtiSHerpS/F5gU5lsExChDHWiN/xSpwNTmGnkEDgTdwr8tK/A3aJ67bD1dZHHgR0BNMsyKAl522i2IW+RuchL38Ys7lPoP3vsL/JB9nI4CkxkMBWtJyaMK5ux74ubiynJ3AEKkW13ERe0Cw8xCH+QhYWVvCUzI6rmiQGdGr3MFwt72NKDEVOcnPL7r2Rii13ktpAdDz+NdJyVchwHfPjGh12ey3fFNcXwLbYE8PQ== 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=LHgTfSh2/H9zYVYFD/dOYfqhNAkUx8fqSOk4VlRqeqA=; b=lC+vIEMdh8UkxMcASBNuT56M0tQY9c86vbK/+XrfnbSyXok2uvNa9y8d/dPSK30iZqbOPKiRRM3ZsVrOjYY01ZNv6iYfAkkIfMxe4r8HTnv2LpTgGHvxYGzCaohcaZb7hUSdE4EKzqdgUUwpm+VMhxBsPsoxYz3D1NoABTLdDrlFKPLtbg7YiU/HdrNAOOzVK5VfWqAlubqoQuFKUDhSCnU8eN+KyNlFB1XPYLdLh1g3Mblb2Ng29uzBXcq2N8nTqrTU+r3kh1Ie+SkqKjoVEVV5lMX1jLSFXFkM7UdkxRechDjjwN319hLybX4LFXitjuOXOw7NKIiDPlZii7Qy8A== 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=LHgTfSh2/H9zYVYFD/dOYfqhNAkUx8fqSOk4VlRqeqA=; b=QBwwG7IA9giO4yspRudx2yRMLucV2myBefxCypFrs8j8/tykpimNxUHW4RAYQIFlwEWhPlfTHpIB6VPvg0g3qK6zNoE0CF4OoknNJ20pt5UiiDLU00AvvjNe5ADdG0/YDAW+ja2yVAMt5EBMxvoS7FlLzra4K76aGqj9UwI4hjc= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:48:02 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:48:02 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 07/10] arm64: hyperv: Initialize hypervisor on boot Date: Mon, 24 Aug 2020 09:46:20 -0700 Message-Id: <1598287583-71762-8-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:52 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9294b233-cdce-4fe6-afe5-08d8484d7275 X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nrQPtAK7Jsu8sCnVc4NSVYPNXjIsGjwUWeG2l4gznLVHH6Tj6vv+lf9WYN2jRsIdb2eQjOKuMwXVt8VNUY4a3NZFPFjKy6Mntc9+HD/v+STXe8u1tIMjiDB7vXSJh31oFAVkyGpOHxy5HToT5BghxNtI6vRAWMFnQHQi2S87rUXi6fc/YtPIIeHbGAz7+s3ExxJ9gIY7Zj0ndunbZJq+aldrfxskwb3rscIs2ubVnt1Dv7re7xzKi0Cx0/Ky1woiv1/xaqpNoPp3cvN8pPJvcYbrEOOMg/KhY3Ft0A8YWjw0VV48Wqpm/pDlTW6HLOKfaR+7bWwZ50xA5xZmSXXZlgKREQrhP4FJRN0DWC4GPW6RvjYv6OR3YkFv/XOHsQ5h X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(83380400001)(7416002)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: p4lJb7dkjAc8d0RMuPlTCwKQzCLM3zmHvyPzgCZFgYg/UWaW/6trianOYiOMePHrCl1pFjMI+Bu4/K0nJPmTHsMP8Cp0LWj6xHyJv74haahVQ9qkNXGW+dGeGfCdPJeR91QSaAFmVBJ/E6ScdoGNDSszxNQEcRz9yDX8Z+OhVFOqkFq5ftmyDxCojG7gm82VJMV0BRa8/e67w9EV6mDv7MZQR5SoAxYAlqyhAArWT+Vmq0TKijSbqecdxawiRJcr24yXc1FIF+Kik3xRNomAw+y5n+ZQy5JBoUZrObnXNnSDiGMJPTWmTsNQ/43QWbt934q1My6JEBkhShesr4L8DKccydgF/92sRm/e6qvnPWOYA2MUdEC9/kk2srdvyYaFp9ovA9He+TcL71w6Oc7pm5a+nHYVzBuoLdRfoVhLYDz+Psf8Uq0+ZzGwwqJoZpUSBTbhjwER44kiznUsxqTuQKB6/oo+pQkKUX6MFAyJrLlVMw58Lw4/K1aqH/CfmQkq0gjwDajaI17vwGy5sBXpKLaaOpepYtSjI/khSXmrCe8a2ynpYNPUKYO04doPBbN2Rz/1xr197uXSamFNwcbwcYArrcrkAHuF/y8rMswirNX7mnXgMF2S8jarbU/rMzdV5CBsIU9KGwm19hS+9Sl15A== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9294b233-cdce-4fe6-afe5-08d8484d7275 X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:47:54.8169 (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: N7mH9/PkUYdE8WBambmUTI3VJrllwwXNgyce+55+MmYeByFgbhbRNYl4SuUPrf6BihQP69qZ2+KpUl1nHn0TQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_174830_161250_96579D02 X-CRM114-Status: GOOD ( 21.09 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.128 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.128 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add ARM64-specific code to initialize the Hyper-V hypervisor when booting as a guest VM. Provide functions and data structures indicating hypervisor status that are needed by VMbus driver. This code is built only when CONFIG_HYPERV is enabled. Signed-off-by: Michael Kelley --- arch/arm64/hyperv/hv_core.c | 144 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/arch/arm64/hyperv/hv_core.c b/arch/arm64/hyperv/hv_core.c index 966d815..831a69c 100644 --- a/arch/arm64/hyperv/hv_core.c +++ b/arch/arm64/hyperv/hv_core.c @@ -18,10 +18,41 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include +#include +#include +static bool hyperv_initialized; + +struct ms_hyperv_info ms_hyperv __ro_after_init; +EXPORT_SYMBOL_GPL(ms_hyperv); + +u32 *hv_vp_index; +EXPORT_SYMBOL_GPL(hv_vp_index); + +u32 hv_max_vp_index; +EXPORT_SYMBOL_GPL(hv_max_vp_index); + +static int hv_cpu_init(unsigned int cpu) +{ + u64 msr_vp_index; + + msr_vp_index = hv_get_vpreg(HV_REGISTER_VPINDEX); + + hv_vp_index[smp_processor_id()] = msr_vp_index; + + if (msr_vp_index > hv_max_vp_index) + hv_max_vp_index = msr_vp_index; + + return 0; +} /* * Functions for allocating and freeing memory with size and @@ -67,6 +98,107 @@ void hv_free_hyperv_page(unsigned long addr) /* + * This function is invoked via the ACPI clocksource probe mechanism. We + * don't actually use any values from the ACPI GTDT table, but we set up + * the Hyper-V synthetic clocksource and do other initialization for + * interacting with Hyper-V the first time. Using early_initcall to invoke + * this function is too late because interrupts are already enabled at that + * point, and hv_init_clocksource() must run before interrupts are enabled. + * + * 1. Setup the guest ID. + * 2. Get features and hints info from Hyper-V + * 3. Setup per-cpu VP indices. + * 4. Initialize the Hyper-V clocksource. + */ + +static int __init hyperv_init(struct acpi_table_header *table) +{ + struct hv_get_vp_registers_output result; + u32 a, b, c, d; + u64 guest_id; + int i, cpuhp; + + /* + * If we're in a VM on Hyper-V, the ACPI hypervisor_id field will + * have the string "MsHyperV". + */ + if (strncmp((char *)&acpi_gbl_FADT.hypervisor_id, "MsHyperV", 8)) + return -EINVAL; + + /* 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.misc_features = result.as32.c; + + hv_get_vpreg_128(HV_REGISTER_ENLIGHTENMENTS, &result); + ms_hyperv.hints = result.as32.a; + + pr_info("Hyper-V: Features 0x%x, hints 0x%x, misc 0x%x\n", + ms_hyperv.features, ms_hyperv.hints, ms_hyperv.misc_features); + + /* + * If Hyper-V has crash notifications, set crash_kexec_post_notifiers + * so that we will report the panic to Hyper-V before running kdump. + */ + if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) + crash_kexec_post_notifiers = true; + + /* 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); + + /* Allocate and initialize percpu VP index array */ + hv_vp_index = kmalloc_array(num_possible_cpus(), sizeof(*hv_vp_index), + GFP_KERNEL); + if (!hv_vp_index) + return -ENOMEM; + + for (i = 0; i < num_possible_cpus(); i++) + hv_vp_index[i] = VP_INVAL; + + cpuhp = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, + "arm64/hyperv_init:online", hv_cpu_init, NULL); + if (cpuhp < 0) + goto free_vp_index; + + hv_init_clocksource(); + if (hv_stimer_alloc()) + goto remove_cpuhp_state; + + hyperv_initialized = true; + return 0; + +remove_cpuhp_state: + cpuhp_remove_state(cpuhp); +free_vp_index: + kfree(hv_vp_index); + hv_vp_index = NULL; + return -EINVAL; +} +TIMER_ACPI_DECLARE(hyperv, ACPI_SIG_GTDT, hyperv_init); + +/* + * This routine is called before kexec/kdump, it does the required cleanup. + */ +void hyperv_cleanup(void) +{ + /* Reset our OS id */ + hv_set_vpreg(HV_REGISTER_GUEST_OSID, 0); + +} +EXPORT_SYMBOL_GPL(hyperv_cleanup); + + +/* * hv_do_hypercall- Invoke the specified hypercall */ u64 hv_do_hypercall(u64 control, void *input, void *output) @@ -291,3 +423,15 @@ void hyperv_report_panic_msg(phys_addr_t pa, size_t size) (HV_CRASH_CTL_CRASH_NOTIFY | HV_CRASH_CTL_CRASH_NOTIFY_MSG)); } EXPORT_SYMBOL_GPL(hyperv_report_panic_msg); + +bool hv_is_hyperv_initialized(void) +{ + return hyperv_initialized; +} +EXPORT_SYMBOL_GPL(hv_is_hyperv_initialized); + +bool hv_is_hibernation_supported(void) +{ + return false; +} +EXPORT_SYMBOL_GPL(hv_is_hibernation_supported); From patchwork Mon Aug 24 16:46:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733797 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A88C5722 for ; Mon, 24 Aug 2020 17:11:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 8096B2063A for ; Mon, 24 Aug 2020 17:11:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WzBucGed"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="G2kUPH23"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="KxgBBWRB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8096B2063A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3dJoJwqnGbEZhqbKzwbRWAPc5P/+3t0ij2HlUhKU+g4=; b=WzBucGedduhS6Z0K7YJ+6qgCr vRvX1c2RWctOLQ7+mUtpgIWrNR7Ze5mxxWVL2VAUaZtCg/3GegD4pl9FUXZ8z5y4lvjdc5474ECqc 23y5Ejv0yEkUdBoKYogtu2mhKJsi9qqnQEiZvzMaS8ov+tUddm1EU/nqnqHR7x8WWd8VVJomTOdLC H/9USutQZbUIWtyKdBqma07S7tYYKWjli/ac1xUsGEBF0B9Tz/VVwhxcNXZohQRDKXPQDkymgY41P 6i+Ki9RXNLSuH8iEhjCaltpgQVK+jSVQ1zi04LCz4djFh9qXRghzEYSynKPIrB7FXuTeuxUrGtA4Y sl57244Tg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzi-0003i1-9J; Mon, 24 Aug 2020 17:10:54 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzd-0003ex-1y for linux-arm-kernel@merlin.infradead.org; Mon, 24 Aug 2020 17:10:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4tbvHCr+PAkwKsxjK8X5LwxiM17npNhS/8Ql+bo2GO4=; b=G2kUPH23nn+8XYuLQhkodqxje1 ZKji9ZeBhDSumw7sJ0gFzi/kdc3OIVvmIyzELo709DRTp8fwjIxnnVpllcgmOVgY+8pv15Xz0Z2rI 349OYr7UrxxzIUKiaK9JmnIhoKzS1sg5unTNMiLpaOLkkdv2froE8qH9DFKHz+Q5k/8K66NBI4bss AC7atOUv9580vtmkk2znID1AbZbH+3gxPJYt3gkhleWKd1eqZY2ruNapGZ2593eStx3bPuTmuIf6c srrKAqe2sJehBtsuZEEQ6rlOq4q8lm8DgeN+3abGEKX0blpmzKy41vujIzdByg1JgqiUNWcAAi3ho upmEO55w==; Received: from mail-dm6nam12on2128.outbound.protection.outlook.com ([40.107.243.128] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFe4-0001wk-NI for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kCxo/bzpKT91/2jx3+/kQkOPSWfMyWtJaV+/ZapYJ3pp4Hdlr/k1HyVe78j3O0szABfyb4Wrz+lFZlhO/OIcbgUCw5FYNIJLpJw6oqyyuxW8M/mm2jsCRoQi5X3Fie5wo+W8Hy74jZUJ8invYYhzX2XA0lGF2y+20kNpYv/ZEPCFlHB1ja9nJgSNDQqZH2/TyF+5QFsZLWwVtA/3Lrw/jh54x6hvbRnd4VgORMd/zKsXu+86NDRa+bWZyWqIAHrmJNzTJFT3Jr/bnObxeDvGjSseFM+qKb22MRiD8jIlcBAu0JspTPKaQUJUcEI4slBd5VlTBkv+ZwrRcYXlfUGv5g== 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=4tbvHCr+PAkwKsxjK8X5LwxiM17npNhS/8Ql+bo2GO4=; b=OMnulliczjm7xTWzVOnSz5MvvTgwJK8HEtYuHLAZvSsHC0Q7tgy1fbnSyZeudbLMkqrX7v+MCk9+hq6NpAbsh7edmPV2zAPT6RpolZYrong+IHVppoa0i4AxQF/yVHHicj/YE8DncNgZeHnN53+XGLFhHaYS6xmMpw8cPezagsQwIxYOZEvX5Qw5yGufcX1FaQbQu41GuvdzuqzVLUFRL4v9wxUVJ4u3aotKe6sQ+kr2GEnnGcjVMTP1W31lLnm1AeaMcbH7xtULVLI0FTrfzJvAvdSgacnxYL5ShMw7H4cZxr80em2VekjVhP6bN2K7WsLDfNNGYgMdD2x28MQrdQ== 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=4tbvHCr+PAkwKsxjK8X5LwxiM17npNhS/8Ql+bo2GO4=; b=KxgBBWRBFAebvyidGNz7DUXoGHByx7PXRiM2slgp/anB9ojMW4bMIYT1PIvdlIOO3DeYsggaTxWH8c7KR0ISmQOu9r483StcUieYpAfK2vXOKkQyNfZV0yO0MN1rxy6PK4J+gVHBbcALZky7rkNsYCbElGSSh2ei/gggm1ssmVQ= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:48:03 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:48:03 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 08/10] Drivers: hv: vmbus: Add hooks for per-CPU IRQ Date: Mon, 24 Aug 2020 09:46:21 -0700 Message-Id: <1598287583-71762-9-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:55 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e14e6266-aa11-41b3-ec99-08d8484d73e2 X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hOjspxDxFRdsXNAyPUaaVwIdLAEE/ETylCxtVn/iK8JfijR8B5u4O2cNMuzGoOTt8r469W3FtUMJ+elgM5+/PnccG2wQhNISmDKWqc/YebbKrMIRKd8yFo7/j5TFAQ/YPQjE22kCljOtHWznO32tBRUtScEohoc2q3bBqMj7TgxUVO4W7iU/h9Pr1wt1Xvsef6WOpNancEQGZVeXSgW8fSGDPNsVsARPZTJF63+42WD44EVlNPncFRZBSQhmIbsQqxO5RlMz8n+OPMVYQcCmUTRgy/9XZvN9InsCo+hcWUyfhiUtjyEzMViNPYqfTWurPqoLzBbve6D26bnNaDDtJBZt888PLHsDWXAmHINBSnazhM80GOH9qO/7jZ7TgJQq X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(83380400001)(7416002)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 6cgaDNz1sdQaU+LQYgB6hSBciD/nXCPQIUHlV7RIMsi75+/wvTsCC2QAJTPOVWkfs4i8aM9Ad09cgJ+supsDkR6PR9rFiVjUDDlPU+TqVdeoQVmTCqCk/NSiOkkZa21IRs6hrq7njrQ82g/tKO0+AvAWatnp0+Ebiti78w8kxFc+dvuWRMFp4QL32O+PpD7YI0olDmkjsS1IDCN0BFIjVdjJ1zXD5R+RRyPNzaNIFtk39fj6P1RBgQNGoJgyHtmxnVnr+oE1ithzhZ5yx2c7r+uXUxlBAdGpHXzfchk/mo/re2scgo+AbeLiQqzNd9hpc1egfE9jJo6RbMxqM1diEVhgDb93BY4pqu7CjmTsc6ceE5Sl4FGa7wlwWANvguvkHpREJIUNYz85GZzS/q+o5H5diM4ft+f1FBbnE4kGS0eM/JZutIb9VAVfB6P6d4JxHyTh31bT2CSjDOEfH0tNwhxE2e/iLKOML01bw+N9No01jEEpGOaSN/45IuOy2WEXOyAPGoWG7NuqJtxqreoF9rc9oMxjxv7Sc81MmckobtOdXxhl230dABqFEDJTu/gwaPAqs1oCB9l2gsVD5c/9XZnn9HhWygO+0hy+jbK8L3gQCqq0HYLGrC4o3HURG3KwHD3z2OOvCGMzlqAB0CgfYw== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: e14e6266-aa11-41b3-ec99-08d8484d73e2 X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:47:57.0956 (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: T7eQKxiWmlDdNZ348lZpCFOXXLma/0PIvjEa0yMqskPwf5Ew6lCb+FhNGEcW5rdIblB5ZvZsgzBnh0a2qXb7rA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_174832_957831_1BF1BE24 X-CRM114-Status: GOOD ( 13.40 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.128 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.128 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add hooks to enable/disable a per-CPU IRQ for VMbus. These hooks are in the architecture independent setup and shutdown paths for Hyper-V, and are needed by Linux guests on Hyper-V on ARM64. The x86/x64 implementation is null because VMbus interrupts on x86/x64 don't use an IRQ. Signed-off-by: Michael Kelley --- arch/x86/include/asm/mshyperv.h | 4 ++++ drivers/hv/hv.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index ffc2899..dd1365c 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -56,6 +56,10 @@ typedef int (*hyperv_fill_flush_list_func)( #define hv_get_raw_timer() rdtsc_ordered() #define hv_get_vector() HYPERVISOR_CALLBACK_VECTOR +/* On x86/x64, there isn't a real IRQ to be enabled/disable */ +static inline void hv_enable_vmbus_irq(void) {} +static inline void hv_disable_vmbus_irq(void) {} + /* * Reference to pv_ops must be inline so objtool * detection of noinstr violations can work correctly. diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 2bd44fd..7499079 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -178,6 +178,7 @@ void hv_synic_enable_regs(unsigned int cpu) hv_set_siefp(siefp.as_uint64); /* Setup the shared SINT. */ + hv_enable_vmbus_irq(); hv_get_synint_state(VMBUS_MESSAGE_SINT, shared_sint.as_uint64); shared_sint.vector = hv_get_vector(); @@ -235,6 +236,8 @@ void hv_synic_disable_regs(unsigned int cpu) hv_get_synic_state(sctrl.as_uint64); sctrl.enable = 0; hv_set_synic_state(sctrl.as_uint64); + + hv_disable_vmbus_irq(); } int hv_synic_cleanup(unsigned int cpu) From patchwork Mon Aug 24 16:46:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733805 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45F8514E5 for ; Mon, 24 Aug 2020 17:12:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 1F7392063A for ; Mon, 24 Aug 2020 17:12:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LkBUwIty"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="YfKUJ4F4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="dgxFO3qZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F7392063A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ie0qDxRvWXep0NXlgBkCfB4kZsHUIRA9yxykoj/d5UM=; b=LkBUwItyPPDpJ0++30h/X3MMm eyz5xvA9UkbDRIgPv6RwAOT+x4+K0KNeOBCBVDQKPoAKZhJAHAbPF1kPV6o8qO18BF3nGuwDn0Wq4 IZpr6mr6lpG266sq2U0mhv68D4N9XIuOs3z2SX2Th+RDmkGHHNDpsQd8zWUUshze/y4NvJRqy47Mx mKvZ6DhFrCvSAaEgd3tJ5wmJgnsduMQjodqy0EVUnPgrtpIa6X0HbnSYZLyxj77cEscMi3SFWUh+Q MNvFeZ8v4uotYAuToj4y69LNPSEtU3V8kUWRvj3KPXuhlLkHbFCBkHzCRZCbi8HK36K3rj8Y1QUYy m9cYTqDxg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzg-0003he-AJ; Mon, 24 Aug 2020 17:10:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzc-0003ex-3f for linux-arm-kernel@merlin.infradead.org; Mon, 24 Aug 2020 17:10:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zEGJ2pGVOoA/475BwOAc1zBZDs85myo5tbrBv9fk6gs=; b=YfKUJ4F4AJRxsGdSauh90Yzexs uaHyydmv4u4as5gooyfa4gvEOZcE/haXZg9wVWqgBSLU+i3ys/1iLtObocLe6uIlxe41DFJPXFMiY jKF8wVqnNxMvGiXbrZ+pcDlhNfz4mKio7kER9flA5R+N0JfpWvQHObuFGhfHFYteY0p6j4g7cEl7i 7Kn8Ez6aUKQHm8M8inTRwbnjmPhIDiDaFUSwltp5t+zRYkfWVx6PiYmsYPHH6n4udMLPhuRfA6ekA Q8T7CK8I13YMnGkmH8CFy8j2H+puuG5sXm1ELqNxrSR/RFMNLwJe6HbdjEHB7tUSqIHE5A9FE5wBD XYDWEsFQ==; Received: from mail-dm6nam12on2128.outbound.protection.outlook.com ([40.107.243.128] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFe9-0001wk-QK for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cmh7zPrpkdtYYlbf7EZ2TZykptLuxgUehTkwenJFZGVw/PO8P7lFFjOCpFtXEv4ZY1zO6pTQBoKLT+Z8XcrPgZZhgKJfqIwPL/XoDCtcyChmewoWwaDsBoqSf+ZMpYzmZZA2FVtdngaC9SUAFQS20hZL5V+JZKwWG5UaLxmhKJ4sFHYFnXXd93WFLb2jvnp5aRq1KHxtbk2ooUcHG8sLlIFeMnYN01i7Ke2m+qnMdT5kgxI+VEZA06P6B8qwtQeTGtJH0Gkh0bQq+K9gRy/YP+8rXWw5Kq6JQuEsacScrO7rliRWdpq1VHgTg/E4T0RprTIX7y/juGkexHB+3r1OIw== 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=zEGJ2pGVOoA/475BwOAc1zBZDs85myo5tbrBv9fk6gs=; b=VmYf1PcqSh9FP5C559ZNJVI5gWRxdZIBUt0LxuCVa/1WLVhmYUfjveXaBAKrHPG8u5fnd0dAusInPG9gBltlH8M25rtfdt/MGZh969ZKl5rMVAs22Q7xrmCV/bcRApKbbYTa4qSHEslqvITo2UPwPiIxoSggYUJ2Shyg4scrvqvMIh5TrItTxzcnz0lju7cEeg/I/pA+BZ7p876uGHlvXVq7nXOjLeFPyl0dCMusChfcg5jog7difoBHf+FjJegEOlTWZ60YCS8QH28Hvz7P4nA0BqGRo9uB4C8fPj0KzZCaL0tKlmi27dkxYxdSinj7EMuoknN2do9/Fbyc6Ce1gQ== 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=zEGJ2pGVOoA/475BwOAc1zBZDs85myo5tbrBv9fk6gs=; b=dgxFO3qZBPgZZjoKrqnRciGdmAtMRC05wxJtH9DHVnXdCAcB949fuoFDBrVYRRfIzrt6yaAo1inHz10sxDn0YMKXze0t9qmLbGzFs2TN7SqKzWmUJQCFHbF54a60VDSaMUpiuGjMzyLDqLw4OV4+pkDUgO06TdA7VmepnYDsFEU= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:48:03 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:48:03 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 09/10] arm64: efi: Export screen_info Date: Mon, 24 Aug 2020 09:46:22 -0700 Message-Id: <1598287583-71762-10-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:57 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b944ed7e-ea53-431e-239d-08d8484d7527 X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5eypPP52A/ERruzShY38nJwOGXshoQyh8Jc4vvaZkEItLPdEKiyzPIbzBRK+TO7t4nesnrxq2mlkmY+lKkuZPv5xBqdOPhgsrhvIllh3VBnXRmqm4uEAfmXao7AKbLCnhb4zr3OH+fzTWbton5HZESgoj8TKucWhO0j8+6Pf8LrI+cvh51TWFx3uTzsr2HT6SmicYbbfRb1bnZ0M2Qrz4VWr/CbUKatJ6f2VTbYUtsEOauBfvwbKp46ANTj2tU8djOVkpx0F2p9a/jNjSsk2bwA03aUrH5v+bWdlrjldwb6Re/TVhIqXZnTNJSPwY5dPZpCH8GuxxALBSb7uF6VlJ4gJkdYrex2Hlc5HOvX1Q2WWOrLJs5X4Rv4EgYqEkuDS X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(4744005)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(83380400001)(7416002)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: FjG9xMA2M72cJ656kgx19qu0AmSurrEi3ZkaAVZc+o8Vzdgtd4xWEnNDCmr4nxIvVl5SpipqsCfC0DZLAIoB6EroilhaRRNjzuKG7XZacB6zBu4fW+SIN5wjfUTgvNfY78E6i9op/tW+j9BfOYwmR3OnvHzusnCxMpliWkzu3alXlsiImnWtqnbf7yY1wQw8yG+LVxyGLJLhrtumj1vcp/sU0FOJ21vfJJZXM4ect6+J5p6Nk64shZVPlvdDEIWbxKnSsTDJvr8M1tAjabilr6Odiw9fLjxQiAcr4SqmPjTMeQI7w7HI1iyZDpXNSX9wmZY9S80imUWn2+bw1jumZOsXL5dUa12b186VF2UjlTHGw3m1fRDMt9o1cyE3M6qhMwXm5Z8asPdSnrnFKjsNO4qjl4HjPXLu7tQwg8w9mwGPN1ZZ2TPibSCqaVahc7SrmtNKQGZWsv/fwx/I1At1onwk0WmQ0uBKzQkFBd9CkyOF0BiRIc3tKKxUMvHNleAwuXYF573o+VCuGv8YmULi+kx3aaBV5J4w+4hKJl8tg50Ppri923xAue+8N0nJmYvVKGAjplwyfL7HLylygDHxKIewsW6PobOZBdYN6tV1WzA1Vp9tHITotOcqn2P9zKyNHq+m9YbkTIusv8AzN+BkNQ== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b944ed7e-ea53-431e-239d-08d8484d7527 X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:47:59.0084 (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: svTdflFckd3ap9GnsidBAs11dw5dvVb8g2CuGtZcnn7a5A9Gty0n8stKeESmdxVmiZQ7jcGvY3TaX8y/NjwW2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_174838_028855_DFF1DA2C X-CRM114-Status: GOOD ( 10.54 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.128 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.128 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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 --- 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 d0cf596..8ff557a 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 Mon Aug 24 16:46:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael Kelley (LINUX)" X-Patchwork-Id: 11733803 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B244C14E5 for ; Mon, 24 Aug 2020 17:12:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 8A59C2063A for ; Mon, 24 Aug 2020 17:12:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="aaCmGmGk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ommeNjaT"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microsoft.com header.i=@microsoft.com header.b="MD0V6uU0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A59C2063A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gf9eYWGxlfkcxV2cPqmb19pJcPtS+Z688333+FNRHZE=; b=aaCmGmGknUyzWrr+P3Y55S1uI EkGQmrjXMAEGIhSau86ZNhsybLY5ofIYnWdWrGQC3WQOlNrQNVl1eAOUYinSncDHdOp4Hzxwd53ce SltiljJEcCcbikhIW25KGES7aSMXSbj/tSyRuLj21yoi3eLY4cs75ml0N42PV3GM8dNRMGjITRQeI 6N3fopQIdeLByP9y0uW8NeCn+b6d75EWz9r8Uq74pwQkF7TG0OjbXk1wTa0cyAEeAEvc/4ynsRKxm H08jWXW4FiKW60hDESj6O0vtAiiCnTrE+dqVLrMvYpsAT0ykaaEx6N/YhdxQ3BnmqCFh7ZQdaaXn+ Ae1Jj5i5w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzc-0003gx-To; Mon, 24 Aug 2020 17:10:48 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFzb-0003ex-5T for linux-arm-kernel@merlin.infradead.org; Mon, 24 Aug 2020 17:10:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ewbfHZXjxiR3o31sgRc557/LsbDk01g0KASzcHU7ci4=; b=ommeNjaTyjULHUpEM19qLHsCZF qzZ1J2gOB/kcrUv9NGCoTKMAXYsP0DOGHGdK1fPZd48OSGY4epfyndkeYbEjmGjo5wM7RxUmlA1c9 vlRsxy/znRpiaz7o44bY/E/DPmKjaj+NjECb4JYBICjFlwKAP9jRBkHgwpn2XxkhIrg3CTfkxhB/6 /7RyOI1SmOlMiXnNOFPv9H2SfmiC9UHj+oV/7XAm8zoMTr0FUvD0gvQDbznugNpwxB1FhQuhnM9qP SaKWADIAnOt9cwzsDmm1nRmt/gpbKRa7MJRu9cj2PhEg3f9pNyp9ili2yGbtEG2X6JrAXEoaG/fjW rgqkIZfg==; Received: from mail-dm6nam12on2128.outbound.protection.outlook.com ([40.107.243.128] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAFeC-0001wk-Qz for linux-arm-kernel@lists.infradead.org; Mon, 24 Aug 2020 16:48:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DFc9DhOWZAge5eWytkQnRaxK10Y3535vXV+2FdJDNi5GCl/Ad193ysEifR22z8n3Eqg4kafNvHNcilOHKdLZ1ZO95tdCDXzizMDMSw2kKYUzUoUpkKFrvRWUAzjtHDQBwCxG6tFDvmGkeRWUO0yUAozGPsf+yR7noM0ToKOJ2AhODxv8KH7V5YgAHTfqUSfeDFix4SX47RVoO/yLl4Z9ZnqYkXK0d6hQNE9HaNimvudGnMEr67SdzJwxCrrCVYThhY8oHB6i+LBgQQJElzpzs8ouHsNwBoPlwvi5hgSCMUzWUAKgXq6ZDR4uNCKUuJqStehA47XmHPb4b5ClGDVbGQ== 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=ewbfHZXjxiR3o31sgRc557/LsbDk01g0KASzcHU7ci4=; b=fgxBsot44HESe15u5iVRnwUMLLFkSdDcWfQ0hTMJ+vmr2Dew3VfiRvj0xpnKQm8uXhk4TdjTsriqzLR877jAOkYJ7B4iL/b74UROCeWZdPqSjpSD0vRGAThnx8iXgX3rRmxUFBohjvO7Y5uNuzKYkpvXI+OJ6oeXPQvE8CTlXJAm2WuYaAe599O8QDElA2Pr5Kyuqkjn68pgK8C/3IDk5rbhK7eo3QblBAKmFSJ+NaBkaUR1QOhifks4Pljat9fpG780TrG5EHh/594SByNOkH9h2OueQKfULWDe1ao9AJ+KX2+kDapzdKDGlzpAbpQ+xbe1lmNpeziosv5Mb1zH2w== 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=ewbfHZXjxiR3o31sgRc557/LsbDk01g0KASzcHU7ci4=; b=MD0V6uU0prJJowd7ORCQUZNU0dCvly96h119e/8vwoT6aW7PHF88VZCR53cMl38BrzoQ/xCeenZmq/X8yf0Q8wX+DK0iOw9PoAuaNdXKdxxWzq/jCgglzbl2c5xip9JTBfrKnyxLl/hRnG7N1jh4H1Bi7xDyhmrUNasbhS5deAg= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; Received: from BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) by BN6PR21MB0753.namprd21.prod.outlook.com (2603:10b6:404:9c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.4; Mon, 24 Aug 2020 16:48:03 +0000 Received: from BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615]) by BN8PR21MB1281.namprd21.prod.outlook.com ([fe80::e0c9:2634:6fb1:5615%3]) with mapi id 15.20.3326.012; Mon, 24 Aug 2020 16:48:03 +0000 From: Michael Kelley To: will@kernel.org, ardb@kernel.org, arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, linux-arch@vger.kernel.org, wei.liu@kernel.org, vkuznets@redhat.com, kys@microsoft.com Subject: [PATCH v7 10/10] Drivers: hv: Enable Hyper-V code to be built on ARM64 Date: Mon, 24 Aug 2020 09:46:23 -0700 Message-Id: <1598287583-71762-11-git-send-email-mikelley@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> References: <1598287583-71762-1-git-send-email-mikelley@microsoft.com> X-ClientProxiedBy: CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) To BN8PR21MB1281.namprd21.prod.outlook.com (2603:10b6:408:a2::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from 255.255.255.255 (255.255.255.255) by CO2PR04CA0145.namprd04.prod.outlook.com (2603:10b6:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.25 via Frontend Transport; Mon, 24 Aug 2020 16:47:59 +0000 X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [131.107.159.16] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 54525498-901b-4bfa-6104-08d8484d764e X-MS-TrafficTypeDiagnostic: BN6PR21MB0753: 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:1332; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WLT/fk8AOVtOqqVcpLb3oOkPUt41pvsgkfOX8UAoJKsnYxDyjP7o023SFTwVtoifuCfe6x7mYzXewZf79f2ITJaRTYOT3OaIbXuDDSUzfGOj9zxWtVDYMwRtmxv2nG8RNPaz9l2UnVPriXuTv5MfbVfe6Hbe83nyGbCUtWZE/of/Ni2I7NxfLZieOaM73ZEHujNoEbwfgQntrdMc+xY4s/kuc63MZJMUHIehOwQ1PMQFY43LmqvGLWTGbAH10HkeIHupXz6LVeXhzrs1gFW+epFuTMV/8EIHuII9dZbbV6Oq6ReTiMvQ2VI5O4DulHl73Cs1R3qcTP3yyeWXo1hADjBjfLJ0JUfw6UEKlCnu1AZ4JcRWzo698Tg0YyeRLAM0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR21MB1281.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(8676002)(86362001)(2616005)(956004)(2906002)(6486002)(8936002)(52116002)(10290500003)(5660300002)(66946007)(16576012)(66556008)(4326008)(6636002)(316002)(4744005)(36756003)(186003)(82950400001)(478600001)(26005)(6666004)(66476007)(82960400001)(83380400001)(7416002)(921003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: yD8/VXkbZ4+eOYxTYBfK4nspVKu/06/JoYLC1fGDi9K3Xw09sYxVGy+PojvFuoMcaBobgxwbQM+8atGA7bSth1QpMe/jFxrNQTArmHb2xA5LyKrgObCnC5XTZgtkBHXexYzyiXERkS52dq0Vkt3681PI1O+atjp+skvbX1o6DIHVpiN6dfLx2GQ2HJEgT/JS/v2uigXyqpJTWDT19AGBPwcxcm1heBMy6JT617OsPSrlN2pKDSz2Q9iEUCi5W7Rw1T15SeCMu1Ze6ac1fJMvYngbdFi+UwThx+0xDRU8acyZ/lxTCAcgz9kCOOOG0KsFpxUYxs1CLMtnpApayjNzsJJXBQcgOL4ESMfti7gf89UDfISgBLHWFeV/lMzkxSH9NMpiyM0K3axCVPAHgSRXcTwtbLjIlOfhpsKNu38Rp5YOj23sUSU+vAFQaDkN8v1lLo8FYPm6ydBh1JFV45f9rLDySpBqvim5bJ0eyxpTFCG1XLnEHRWvpx4tiXZjiakiswvSuwPAh/QXnMZ9/wSxkQK4ox0ROOoJklGp4O37Z7ig2CPIvbdGSdCYO5LjnsrkKg9dSjYO8p14u9v9vcBYarqPc6ejh/m6Xo1jlTnWIqKRKuazDlP3xa2K0mEwbUWFDl3nPDxmh8WUiu56CunvWg== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54525498-901b-4bfa-6104-08d8484d764e X-MS-Exchange-CrossTenant-AuthSource: BN8PR21MB1281.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2020 16:48:00.9283 (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: 0lerLPaNRh5aKadjfXOsYptPClQf2ljXeXf+yo0qCPQWUxPdxd4QLqktOADvCxTQM0lIqZa3jvyNXiz+YV80xQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR21MB0753 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200824_174841_119132_B8EB7076 X-CRM114-Status: GOOD ( 11.00 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.128 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.243.128 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 1.3 RCVD_ILLEGAL_IP Received: contains illegal IP address -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sunilmut@microsoft.com, boqun.feng@gmail.com, mikelley@microsoft.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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. Signed-off-by: Michael Kelley --- drivers/hv/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig index 79e5356..1113e49 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) select PARAVIRT select X86_HV_CALLBACK_VECTOR help