Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932081AbdHYIgv (ORCPT ); Fri, 25 Aug 2017 04:36:51 -0400 Received: from mail-db5eur01on0078.outbound.protection.outlook.com ([104.47.2.78]:58016 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755059AbdHYIcp (ORCPT ); Fri, 25 Aug 2017 04:32:45 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Florent.Revest@arm.com; From: Florent Revest To: linux-arm-kernel@lists.infradead.org Cc: matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org, pbonzini@redhat.com, rkrcmar@redhat.com, christoffer.dall@linaro.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, marc.zyngier@arm.com, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, leif.lindholm@arm.com, revestflo@gmail.com, Florent Revest Subject: [RFC 06/11] KVM, arm64: Expose a VCPU initialization function Date: Fri, 25 Aug 2017 09:31:36 +0100 Message-Id: <1503649901-5834-7-git-send-email-florent.revest@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503649901-5834-1-git-send-email-florent.revest@arm.com> References: <1503649901-5834-1-git-send-email-florent.revest@arm.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: HE1PR09CA0051.eurprd09.prod.outlook.com (2603:10a6:7:3c::19) To HE1PR08MB0812.eurprd08.prod.outlook.com (2a01:111:e400:59b1::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e14c71e1-eb42-4d75-67ab-08d4eb93cf7d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:HE1PR08MB0812; X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0812;3:tYALiLcEO3oPRMcueT9FpmZuIZfJSC46Zv1LaoauT7DL8/P3kz5P55MGifQ4j6SW7qRmjNw/pSm9rlNs4An/1TbZJMmA3ZMEDTnfZwDTXE/WackkDw0pbtRNqicFqUhryMsOb9CUAQnuDSdBEUUu3LIOGZZxLuxtZf+AOdYG+8R7lBxdtMmom8QK01rhzlzacTespUeuHM6rxdyUqkMy4NgRhPa4Beg1cf5kyVUldmf53BJaTTg/Ei2DpKcHe54h;25:xcNLqYwq/klNzVw8lqsPfkn962eIktYXCLv+/ojk6kKyCPu6ZoImZVb3ESWluDPqOnmMtrapsHVpSC/lGECYCrOO3kLKt88jWEj73Va/iORgdjidKvtY0DKHXJnRxPf90EkMVEVdVB0gv/ItNx0vcArA9/lcTPtVqJoARrOH6bnn/9jFQbYpHtvl7gkjk33wsg9Vvc5UHQwCDmuogaHF2qaSpFtm07tDyfTki6KSmBbnlOzEwF259ch70yrgpe2IItCK2E6lYuWsiPexUXrq6+zcddEyWELItSaMkpHXzTItJaGnUPdg2Dh1oS/t4NKZPwXzwHdep1i82kbvW36mcA==;31:xoF6uPW7/pdsUbFWGu4pdFsjsso777QeVASxJk4ODpRiLdZBRnoAt4oq9d7P+wjaLtTX4yq/jkXMDtKT6OAYR7ITB7uAXVuoVTsgyUavulSPgsqiXqQyFkWWBJd1B6QeECUBcFl4Xu7roJHdr/cgrQf9DPSnSu0X9IiMOoUufC+UOOiHZ9ipyGIpJzDC0XszRhUNfHMnUOlsMGyM/VOXFaYrQNz+Mlqw5zupuYWyh3U= X-MS-TrafficTypeDiagnostic: HE1PR08MB0812: X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0812;20:P2l/FHdN4dV7zNAk5T/SY+bwSW3QjrNfYxxOBzFmacHRTn03lbhZd0XuQQuYOWJvzMnXAcc04QYWY/jMVJwYxQbGAu1nxfAoERYa20rrpejWAhftB+X2PRqMv2yVa7vUS2/Q+oaGbUWPL3y4j42lvZDqfLprjue16MDZdfUuEnMeopA9QOywHd7OUlTmS5hBYg4FS7QvZmmN+6W55KCzt4pe99VJRVKG9E5zuwCYNHwOMW21W/hVBMQBYh+CfZZyKyAk9dArAXuFGYWgwJ+HAS0NZpGZlGl4H6ExKq8yQTJt9GacTjLjblJxbB9rEN4Bmw374lpnCbTdRnUqPomrETMG85Q0b+O609ZB5eRq/dou1GVyAPwRrTGpEjm0PXA9/5ux1LZRyDcrYcva5eXutxvsbQmaUrpJGuunHDiXh4F4KMWAA15TT310SAH2yHqs71D423hgYi9h8rpO4NKG/8kaVseoSuJyRTBvvMspCm2+x1XynJARfzMoYmoI82Bx;4:MP7snuOU+8Z2WVSN2gjGIs4OTEhyxDkv263kCKQV3WWbq1As2SsR6Wc0W1OmU4rMP59Am38wjHFpZ2f1yycOFdGOLn4BLfE6pzfmOfo/A9cCN6TrPOCI1CQoPKEfuhbUj6IEoZpnuycB+TpGPz8WCdKMftEPy98CegFVSvrhqC1egHS+ifQEeppLDYX3kmEUx5nU0ERTsl1SXnYVxFvuPO06QJVs0tFwsK6Z9lj/bJeFq4nUitRfjfixi88QyyMIB9VqDF9iRNRIM84cBr9zFZD1FXCEWLdjZ1c9KAyA8jE= X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR08MB0812;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR08MB0812; X-Forefront-PRVS: 041032FF37 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(39860400002)(199003)(40434004)(189002)(478600001)(68736007)(76176999)(25786009)(5660300001)(97736004)(36756003)(6486002)(50226002)(47776003)(50986999)(50466002)(4326008)(48376002)(7350300001)(110136004)(66066001)(7416002)(8676002)(189998001)(305945005)(5890100001)(6916009)(2351001)(105586002)(42186005)(6116002)(2361001)(8746002)(3846002)(86362001)(2906002)(72206003)(81156014)(81166006)(2950100002)(106356001)(6666003)(7736002)(33646002)(101416001)(5003940100001)(53936002);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR08MB0812;H:e106757-lin.cambridge.arm.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR08MB0812;23:Oa8ytUjrVEj+XzyAd4eV7uEgt5HMG0V4O5mvLJtYI?= =?us-ascii?Q?F93jceWgUJgOx27melsBxPJbTPDaNt7Sgq/916cVgwc9RQUiJ9zA5uYJmMO4?= =?us-ascii?Q?LEAQsRgq0xWzIoWLTa8SKLCUNU3x07eEWDvBa3Ura1eCCunn4mpevJMgRk63?= =?us-ascii?Q?YFGJnxZ0lzqLqPPflX+mhyzZbG5RQJ0ZHW1bfDUS6Cg2RO50dZGUk39Cx4Rq?= =?us-ascii?Q?7jL28TivhSbd2IfPbcc0LAJW0GN1pFlffm0puvFulJOiog3D8yoSSdUxoaX9?= =?us-ascii?Q?AZ1LsY9gI+CN87vWzdR0NqcteFxAy574MTANmw00eNQoVyc8zTOKS7eFUTPe?= =?us-ascii?Q?2MDsdkrasqP9GFxzR59z3yhGa7qUJ9xI7xQqnc7gnAjigkpC/cOFn7jbib7t?= =?us-ascii?Q?PPsR6t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96B5tbxUvQDj2lLnT9mEMUVqySUNvo11q+4vA3ZdXCFAoFdUgwSAXQv5wAF16UvXBXwKiUbk2gy0K5pdcAGrN+UosgyXYCHsVN9/mz20mcUpVW0dexiySWvgteKv572pu8vh0+1eGvHqFonMMv63P68Mj2FCaJZ9GPP5xBC1jYZbRYpLMmiSQ9rxGkx8nUcVALBfCXg2GdIEFBB2tWswGWfbyQ7DqvTRILOjFiRpljjyLExfOeoq9TWr6HTa8GX3eSCLUlMvJDQY0Meq5halRjwSE29Vra8myN6JdS81wFqRUZOHm1mL++Edg/YOVx6t4kVQSxTHvvYoRQF7A==;5:WQhf8BqxynTINeFu4JzYKLa03xdEvZzR4efHFZN1fKjig+4ohr3JbMZFmded/v9iMKq0ntcIfYdpa7qTKmMkp6G67lGqU38TK8i00pbPdKaoEquWTgagr4ZM18D77Qtpax0Dt2VZFfRkjPL0Gbyd+Q==;24:8NNGuEEHqIlfpxxrHJPpxzmOxOs8hRIbIYvSE+lHqG8huE145d+42QUeRAELjNSs6PZ09WFl2SJ93icAuJ7mdofC+JPbglRRcJQ9mBgGluc=;7:kblGtAeIdw42hW11w1aaadTMIGRyD+CezTnqCTfRwUtl1qakNdHya73E1v43D6jwK0Q3D1AYEk3J4zwCrgEDsb9sc8TK2eQs68cXZF5YQMzJArITfcMpSUlPGvisAEgVM7USr+gsq1jKiA87696yrBhHAVmj+KO968CCzYbjM2PvhZY1pQHQ/mMuFVFEhu5Uu/MQ2mC8MD3SB8gtoeq2Op7fjcLf0Qr5tQ891DI3nF4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 08:32:22.9279 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB0812 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v7P8aslv010016 Content-Length: 2577 Lines: 58 KVM's core now offers internal virtual machine capabilities, however on ARM the KVM_ARM_VCPU_INIT ioctl also has to be used to initialize a virtual CPU This patch exposes a kvm_arm_vcpu_init() function to the rest of the kernel on arm64 so that it can be used for arm64 internal VM initialization. This function actually used to be named kvm_arch_vcpu_ioctl_vcpu_init() but the "ioctl" part of the name wasn't consistent with the rest of the KVM arm ioctl handlers. Moreover, it wasn't relevant to the usage of internal VMs. Therefore it has been decided to rename the function to make it less misleading. Signed-off-by: Florent Revest --- arch/arm64/include/asm/kvm_host.h | 2 ++ virt/kvm/arm/arm.c | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 65aab35..07b7460 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -372,6 +372,8 @@ static inline void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) {} static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} static inline void kvm_arch_vcpu_block_finish(struct kvm_vcpu *vcpu) {} +int kvm_arm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm_vcpu_init *init); + void kvm_arm_init_debug(void); void kvm_arm_setup_debug(struct kvm_vcpu *vcpu); void kvm_arm_clear_debug(struct kvm_vcpu *vcpu); diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index a39a1e1..aa29a5d 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -888,8 +888,7 @@ static int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, } -static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu, - struct kvm_vcpu_init *init) +int kvm_arm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm_vcpu_init *init) { int ret; @@ -973,7 +972,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, if (copy_from_user(&init, argp, sizeof(init))) return -EFAULT; - return kvm_arch_vcpu_ioctl_vcpu_init(vcpu, &init); + return kvm_arm_vcpu_init(vcpu, &init); } case KVM_SET_ONE_REG: case KVM_GET_ONE_REG: { -- 1.9.1 IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.