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 X-Patchwork-Id: 10245927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D40460362 for ; Tue, 27 Feb 2018 18:01:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EF7528A44 for ; Tue, 27 Feb 2018 18:01:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4368528A47; Tue, 27 Feb 2018 18:01:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDAA128A44 for ; Tue, 27 Feb 2018 18:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751801AbeB0SBv (ORCPT ); Tue, 27 Feb 2018 13:01:51 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:40130 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751740AbeB0SBs (ORCPT ); Tue, 27 Feb 2018 13:01:48 -0500 Received: by mail-pg0-f65.google.com with SMTP id g2so7806744pgn.7; Tue, 27 Feb 2018 10:01:48 -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=UL7Pgq4UJv9Ib9lfJw9iCVz8/RD6DPfKTP7+WJfYcEVijzp+CylB5wG3FCc/XjFnDg Jw1hxf4NOCqUCQuyALUbPtUFjJB9UFjFQuM3BhyPnFBXaRB+TDw/hvsZJGuKCa97uQPj F6vhR2xqaMHiiRDpOAaruP+to6NlWlldE5zndkRbWYavrwFh1nAG0r32/FX32FWXsxaf EVvx67MEqjqcEuQMHl2x3IBf+t+6bLIElu98hyY+Rm/T0+1tAJRaXuEY5kd0BlKCWpqd cYq8zFl/dsBhtDvALBN5Mt2YeRz3EmbOPvIjfM5xjnMUPneesEQREyUIdK9kv6Vg0tcT zoKw== X-Gm-Message-State: APf1xPBSv8UwwvEUfMYf9OMenFUzkYa18YxHGlJZaIsHgmmzQb/4wi6J f/R9bkg2tXLyDmWoJY6dAFecFQ== 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 Cc: Paul Mackerras , kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, Simon Guo 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }