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: 19970 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 292F7248D9 for ; Wed, 11 Sep 2013 13:00:43 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id a41sf10961318yho.10 for ; Wed, 11 Sep 2013 06:00:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=7IkL4jGX10RJHP4SJk7V51KM+ynjYWel8G+dlw+Wrm8=; b=VuOXAuXJOnyb5T/ulQnKMtuGlv937Tw3j/qs0oolwQBQbTB4BiYt7yH/X/cX9XJwUH ln1F+s3EYDKgeQbeZ6cMWFfN5hfoQVgcv61zD+DMXgAaShCtHqAhfwMyaX7UUVqjC272 mZPXmMLp+p1r3HsF+YptET8Lb76RIPnFRMvK3cvFJjrAwrEZ33WEIljvB7WXJo/I9Rtq WhP9pXZGsvmb7dGA1INhC95ZkAbi4zTZq3rFpwFFI1lw8I3wMfv+TYeNL+fGK/ovdYZO 8QJgTmjMDcd+GJEKMkhyArGRyyxoz2pnuTZcGXUPuNSwxgsR3p+7ZuvZCn6rFgso1qLQ 2ZKA== X-Received: by 10.236.73.164 with SMTP id v24mr608277yhd.24.1378904442921; Wed, 11 Sep 2013 06:00:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.196 with SMTP id w4ls252327qen.71.gmail; Wed, 11 Sep 2013 06:00:42 -0700 (PDT) X-Received: by 10.52.165.237 with SMTP id zb13mr986493vdb.28.1378904442674; Wed, 11 Sep 2013 06:00:42 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id k10si5957471vca.124.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 06:00:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id c14so5864277vea.29 for ; Wed, 11 Sep 2013 06:00:42 -0700 (PDT) X-Gm-Message-State: ALoCoQlJ7fO0Gip85cdLzY79QmTqRhirKjbJxXtP43w/Mv06EDTQP+R8C+OgG+YlMXIYX4jexn4B X-Received: by 10.220.145.132 with SMTP id d4mr1155186vcv.9.1378904442591; Wed, 11 Sep 2013 06:00:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp54871vcz; Wed, 11 Sep 2013 06:00:41 -0700 (PDT) X-Received: by 10.68.228.230 with SMTP id sl6mr1652496pbc.98.1378904441579; Wed, 11 Sep 2013 06:00:41 -0700 (PDT) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id ar2si21670499pbc.202.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Sep 2013 06:00:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of anup.patel@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id bg4so9207290pad.4 for ; Wed, 11 Sep 2013 06:00:41 -0700 (PDT) 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 Cc: linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, patches@linaro.org, marc.zyngier@arm.com, christoffer.dall@linaro.org, Anup Patel , Pranavkumar Sawargaonkar 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anup.patel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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)