From patchwork Wed Sep 11 12:59:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 2872531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F3FE9F495 for ; Wed, 11 Sep 2013 13:06:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 809AF20165 for ; Wed, 11 Sep 2013 13:06:43 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB75820372 for ; Wed, 11 Sep 2013 13:06:38 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJk7S-0001fq-Nl; Wed, 11 Sep 2013 13:06:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJk2a-00054A-DQ; Wed, 11 Sep 2013 13:01:04 +0000 Received: from mail-pd0-f179.google.com ([209.85.192.179]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJk2Y-00052Q-Hs for linux-arm-kernel@lists.infradead.org; Wed, 11 Sep 2013 13:01:03 +0000 Received: by mail-pd0-f179.google.com with SMTP id v10so9207933pde.10 for ; Wed, 11 Sep 2013 06:00:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7IkL4jGX10RJHP4SJk7V51KM+ynjYWel8G+dlw+Wrm8=; b=JfN8STqOCmBT/Zx8411RddunwSN9odSALryQrelwSuwpA2iqoJ23dqUPh3Q+pxYs0e DhGuylTB3SeeSxABV4BnNL12E1Ci53J4+8ZzVUt6DNUC12IQUrShjN9KMraS7VvY7gSp T8mApZjy0lK03iHnscCdQdN9K//FZymntsvnyWecY82J8HSzXVqJZ12Fyz679FfmY7h8 eKuzeQ4dkIwtsHUPW/mBSSbSb8/Wg0xTTQgIyPyObuJFyPQASmjmYDuOQASWsksKTgA+ BVQRXG08GkfDtgVjTxMrnStOwoORvNqGTZITp26Pp0T8DvGWwSIUve7+IOQz3Yngeb2O kiVg== X-Gm-Message-State: ALoCoQk69H3xFbPOoc7zbyLc27+eXGuM9RTzgaoySQvPUGK0P0W8JovAbYjG4caPUX8eSzBgOlWp X-Received: by 10.67.4.197 with SMTP id cg5mr3533709pad.10.1378904439658; Wed, 11 Sep 2013 06:00:39 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id ef10sm3494780pac.1.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 06:00:38 -0700 (PDT) From: Anup Patel To: kvmarm@lists.cs.columbia.edu Subject: [PATCH 1/2] ARM/ARM64: KVM: Implement KVM_ARM_SUITABLE_TARGET ioctl Date: Wed, 11 Sep 2013 18:29:52 +0530 Message-Id: <1378904393-29101-2-git-send-email-anup.patel@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1378904393-29101-1-git-send-email-anup.patel@linaro.org> References: <1378904393-29101-1-git-send-email-anup.patel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130911_090102_679042_4C070B70 X-CRM114-Status: GOOD ( 10.19 ) X-Spam-Score: -1.9 (-) Cc: linaro-kernel@lists.linaro.org, Anup Patel , patches@linaro.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For implementing CPU=host, we need a mechanism for querying VCPU target type suitable to underlying Host. This patch implements KVM_ARM_SUITABLE_TARGET ioctl which return output of kvm_arm_target() to user space for KVM ARM and KVM ARM64. Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar --- arch/arm/kvm/arm.c | 2 ++ include/uapi/linux/kvm.h | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 9c697db..4bdc2e1 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -715,6 +715,8 @@ long kvm_arch_vcpu_ioctl(struct file *filp, return kvm_vcpu_set_target(vcpu, &init); } + case KVM_ARM_SUITABLE_TARGET: + return kvm_target_cpu(); case KVM_SET_ONE_REG: case KVM_GET_ONE_REG: { struct kvm_one_reg reg; diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 99c2533..8285daa 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -1012,6 +1012,7 @@ struct kvm_s390_ucas_mapping { /* VM is being stopped by host */ #define KVM_KVMCLOCK_CTRL _IO(KVMIO, 0xad) #define KVM_ARM_VCPU_INIT _IOW(KVMIO, 0xae, struct kvm_vcpu_init) +#define KVM_ARM_SUITABLE_TARGET _IO(KVMIO, 0xaf) #define KVM_GET_REG_LIST _IOWR(KVMIO, 0xb0, struct kvm_reg_list) #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)