From patchwork Tue Feb 27 17:52:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Guo X-Patchwork-Id: 878809 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zrSpG4LgHz9s1d for ; Wed, 28 Feb 2018 06:05:58 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V5qZmrEZ"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zrSpG2dZyzF0mm for ; Wed, 28 Feb 2018 06:05:58 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V5qZmrEZ"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::241; helo=mail-pg0-x241.google.com; envelope-from=wei.guo.simon@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V5qZmrEZ"; dkim-atps=neutral Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zrRNF6HkkzF1XC for ; Wed, 28 Feb 2018 05:01:49 +1100 (AEDT) Received: by mail-pg0-x241.google.com with SMTP id w17so7807955pgv.6 for ; Tue, 27 Feb 2018 10:01:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hSbDVq99bc091ra/UTR+GNKdawBuRiAc5n/NmH9Pq28=; b=V5qZmrEZl5gZDB2kquvE0Xzya2iIersPj3ICL0MX4bi9/msWWrEGDHOLKAXG5NTm+C wqIC6TEIex/+i7JwbGpN/Qe4NCtPqNZKnO8xIrphWZYvIwr9SG0DQa4UJMCjOvs4ziFP 3oi8e50oJRRAOST4WerFGw30tzMUESln1izaq3JByfaQrG/icmokv0/LjIxZsy7dW8FB 2nx6RYOxoZG+zKXycttZpF9XTEYbo29LGTYpokmKXzCNHBcWll6bESgLAmZYBXsWuUuw 9GIhGCySKfzkU5dRcYcdRBUASs0+OTcEnqJhKLdJRVnEKyyA49bF/cnX6e9peAJfMkVn vg/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hSbDVq99bc091ra/UTR+GNKdawBuRiAc5n/NmH9Pq28=; b=TaJuXA6Q+CtMbjZu2JZrgt7Hl7t7utJyaDAx1erQIucYBxZWB4iJ6WC2B9ZjtAwI+e 5nsmFHUfv8/L+mTT2H8knIaOURiulULD6XdEVa+KUOk26FfbPaF75Ph3ComxxkeFlIoj 10vknerEdWUzaKhmJRKazBv/hpSp7DsLtxsn6KsgR0b08hvNliL2KlE972gvdiBVr/FT DHCHMnGAbxYohLNslwHqhhRqBzRltVGwvdKRdbaqH/vB66OOSmA1Ua13V2boyBzZ3XFp HyiufsoiFcoW1IGFJ920vxzBNs9UgXTs02gESs755LtZDPSI+Sygl6mo6tcBJyGzU6XN N4HA== X-Gm-Message-State: APf1xPBvXZsUM8oyRM7xY0GgJUEGqhwBUHMgArkIWCJHzBVQq7deHy9d Ac8s2lio2+sFI9zBCa+NGwLfKQ== X-Google-Smtp-Source: AH8x224Y5X9HEymKf/YLtXTO4u9mfugN+lHjvKmijKZW+fVxdlaYFmfQNVIZFOHc+/alXDHh161b2w== X-Received: by 10.98.19.146 with SMTP id 18mr14999605pft.3.1519754508120; Tue, 27 Feb 2018 10:01:48 -0800 (PST) Received: from simonLocalRHEL7.x64 ([101.80.181.226]) by smtp.gmail.com with ESMTPSA id m83sm24360910pfk.107.2018.02.27.10.01.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 10:01:47 -0800 (PST) From: wei.guo.simon@gmail.com To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 29/30] KVM: PPC: add KVM_SET_ONE_REG/KVM_GET_ONE_REG to async ioctl Date: Wed, 28 Feb 2018 01:52:37 +0800 Message-Id: <1519753958-11756-19-git-send-email-wei.guo.simon@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1519753958-11756-1-git-send-email-wei.guo.simon@gmail.com> References: <1519753958-11756-1-git-send-email-wei.guo.simon@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Simon Guo , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Simon Guo In both HV/PR KVM, the KVM_SET_ONE_REG/KVM_GET_ONE_REG ioctl should be able to perform without load vcpu. This patch adds KVM_SET_ONE_REG/KVM_GET_ONE_REG implementation to async ioctl function. Signed-off-by: Simon Guo --- arch/powerpc/kvm/powerpc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 7987fa3..6afd004 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -1619,6 +1619,19 @@ long kvm_arch_vcpu_async_ioctl(struct file *filp, return -EFAULT; return kvm_vcpu_ioctl_interrupt(vcpu, &irq); } + + if ((ioctl == KVM_SET_ONE_REG) || (ioctl == KVM_GET_ONE_REG)) { + struct kvm_one_reg reg; + + if (copy_from_user(®, argp, sizeof(reg))) + return -EFAULT; + + if (ioctl == KVM_SET_ONE_REG) + return kvm_vcpu_ioctl_set_one_reg(vcpu, ®); + else + return kvm_vcpu_ioctl_get_one_reg(vcpu, ®); + } + return -ENOIOCTLCMD; }