From patchwork Mon Sep 30 08:50:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 20702 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 303E425A2B for ; Mon, 30 Sep 2013 08:51:40 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id lf12sf4752736vcb.2 for ; Mon, 30 Sep 2013 01:51:40 -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=JR1463iHDXL5jKLgZ84bouY8qgUNkhTx/Wi6BqUO+58=; b=aEIx7dBpKri9Ok+p3M89Ank29mzqhZ86o/MpHfbDE/l8+qwC/lGwePUmXHuuRlngQb JGo2piG8djYSwTScY6QE4v0OydrxGG3/ZegLMCj0TaxOBsB+p4nEfBpFeQ/tdsYlX0C2 672HbGSpliuFHX0cJGbz+pwnZyfKPYF2RMYs1lJ80SqVMkAW/3D7mX8lZKX9MMscL/Yn eQF6bUYZ4VCIuc8DbYv2GoKAsd6GdSZAnAw9r+CW+e69wqIwxQ/g+Jq6crBDp72wbUNG UQTsb4XkyhR4BZ53vCaPCXwVUWtfDRLI12L9m9UInfYeZyLv+54KuBLBg9MuB/iR+GTs c/pw== X-Received: by 10.236.94.39 with SMTP id m27mr31043yhf.54.1380531099747; Mon, 30 Sep 2013 01:51:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.29.129 with SMTP id k1ls1999026qeh.75.gmail; Mon, 30 Sep 2013 01:51:39 -0700 (PDT) X-Received: by 10.52.103.35 with SMTP id ft3mr18246279vdb.5.1380531099640; Mon, 30 Sep 2013 01:51:39 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id om2si5485114vec.113.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Sep 2013 01:51:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 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.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so3723621veb.40 for ; Mon, 30 Sep 2013 01:51:09 -0700 (PDT) X-Gm-Message-State: ALoCoQlySdGzsW8ZQzmgB6OduEQ8zr4Q5yhWy5vn7c+0D0h+SgvzWjAGFQrPihmFZQPkDl9Q1yLm X-Received: by 10.52.118.73 with SMTP id kk9mr17789768vdb.13.1380531069528; Mon, 30 Sep 2013 01:51:09 -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 u4csp92777vcz; Mon, 30 Sep 2013 01:51:09 -0700 (PDT) X-Received: by 10.66.144.102 with SMTP id sl6mr26594020pab.96.1380531068600; Mon, 30 Sep 2013 01:51:08 -0700 (PDT) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by mx.google.com with ESMTPS id vm1si6772079pbc.16.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Sep 2013 01:51:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.171 is neither permitted nor denied by best guess record for domain of anup.patel@linaro.org) client-ip=209.85.192.171; Received: by mail-pd0-f171.google.com with SMTP id g10so5367237pdj.2 for ; Mon, 30 Sep 2013 01:51:08 -0700 (PDT) X-Received: by 10.66.118.204 with SMTP id ko12mr833990pab.184.1380531068222; Mon, 30 Sep 2013 01:51:08 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id ta10sm31664460pab.5.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Sep 2013 01:51:07 -0700 (PDT) From: Anup Patel To: kvmarm@lists.cs.columbia.edu Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, linux-arm-kernel@lists.infradead.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, pranavkumar@linaro.org, Anup Patel Subject: [PATCH v5 3/4] ARM/ARM64: KVM: Implement KVM_ARM_PREFERRED_TARGET ioctl Date: Mon, 30 Sep 2013 14:20:07 +0530 Message-Id: <1380531008-15901-4-git-send-email-anup.patel@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1380531008-15901-1-git-send-email-anup.patel@linaro.org> References: <1380531008-15901-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.181 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 preferred VCPU target type on underlying Host. This patch implements KVM_ARM_PREFERRED_TARGET vm ioctl which returns struct kvm_vcpu_init instance containing information about preferred VCPU target type and target specific features available for it. Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar --- arch/arm/kvm/arm.c | 13 +++++++++++++ include/uapi/linux/kvm.h | 1 + 2 files changed, 14 insertions(+) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 9c697db..cc5adb9 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -797,6 +797,19 @@ long kvm_arch_vm_ioctl(struct file *filp, return -EFAULT; return kvm_vm_ioctl_set_device_addr(kvm, &dev_addr); } + case KVM_ARM_PREFERRED_TARGET: { + int err; + struct kvm_vcpu_init init; + + err = kvm_vcpu_preferred_target(&init); + if (err) + return err; + + if (copy_to_user(argp, &init, sizeof(init))) + return -EFAULT; + + return 0; + } default: return -EINVAL; } diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 99c2533..e32e776 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_PREFERRED_TARGET _IOR(KVMIO, 0xaf, struct kvm_vcpu_init) #define KVM_GET_REG_LIST _IOWR(KVMIO, 0xb0, struct kvm_reg_list) #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)