From patchwork Tue Feb 27 17:52:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: simon X-Patchwork-Id: 10245929 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 885E760362 for ; Tue, 27 Feb 2018 18:02:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78B6328A44 for ; Tue, 27 Feb 2018 18:02:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D8D428A47; Tue, 27 Feb 2018 18:02:01 +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 1095628A44 for ; Tue, 27 Feb 2018 18:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751723AbeB0SB6 (ORCPT ); Tue, 27 Feb 2018 13:01:58 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:39339 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751885AbeB0SBq (ORCPT ); Tue, 27 Feb 2018 13:01:46 -0500 Received: by mail-pg0-f67.google.com with SMTP id w17so7807908pgv.6; Tue, 27 Feb 2018 10:01:46 -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=XyBgF5lnp64tpM11m31iS9AEAXQce6i8tTqg0s/hPjY=; b=qyhpRTuhYEnvkX1PqNkMKi62LfPK8JuG5RUlego/0F8X0sKHcwgxOfMS+tawxvHBNV O7Ahd4DdhmnwWFO49RdUU+88zGek2vfi/RnF1HDgdBuU15A1Ydt6Zq96SnXKJwmSdE61 Er6Vq2fpPKKjqIzLN+OZwL9RyE/RVgyJhFGmujzdUWrgPJUrJNkjOeYst2QTLWmUthgX siaKcdRsjqRSBXUaJ24XuYjNXvYGvbR5JtWJsS68+ceZPwm0spNPTJOSMhafGfSKcYtV HQXqzW7JCs0DhiBTG6FHV8HIzdDFHC3GRjSW0spgleoM/8RFD4e6be+qhxxbgb2YiSVw ygTQ== 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=XyBgF5lnp64tpM11m31iS9AEAXQce6i8tTqg0s/hPjY=; b=VnrLYFrPViZ6/s9UnExMxmFP7hm7czQi7fssAHw5jcCe/WTNymkOsSxOqTQZy4yMzm vStf4v6nms+VpRyOrP5/FlizZ3XW0rYGiFPvA6RvdkrUk125bLDUrNEMShQAuLvO5Cqj SqyUI8sphwr7byGcGBCaRQCTiPHV6W9PtuWxOktwk/hCmOoWDDXK15wdQ82gDRR3GzhJ BFDNHR5JrJWLlO9oZdkyCkBkvbanUxHV15yuTDR5xd4VN1PnyVOdxQWCq5AT1FsGepCV aIaW5UEsP7h9Qgg6KhWUBOwIF8eDlk1mZGxewtdQZlvMbGd//Mdt8+wDsXbk6lWGKwpG wOiw== X-Gm-Message-State: APf1xPDvvce/XmDQmBC4YQwCZiG1trrlASaicW1qZgJ1odJHk314FNUj OFcTfcvCbZtruwrIsrB55y0= X-Google-Smtp-Source: AH8x224pM0YpopJW6ZsPyuLhh7yyvS3wXbrfB4Cf/I7m2nSVZIfBlcOO62pmnZS5tsrxZ1Qu/lrHyQ== X-Received: by 10.98.174.16 with SMTP id q16mr14755578pff.92.1519754506058; Tue, 27 Feb 2018 10:01:46 -0800 (PST) Received: from simonLocalRHEL7.x64 ([101.80.181.226]) by smtp.gmail.com with ESMTPSA id m83sm24360910pfk.107.2018.02.27.10.01.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 10:01:45 -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 28/30] KVM: PPC: remove load/put vcpu for KVM_GET_REGS/KVM_SET_REGS Date: Wed, 28 Feb 2018 01:52:36 +0800 Message-Id: <1519753958-11756-18-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_REGS/KVM_GET_REGS 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. Due to the vcpu mutex locking/unlock has been moved out of vcpu_load() /vcpu_put(), KVM_SET_REGS/KVM_GET_REGS don't need to do ioctl with loading vcpu anymore. This patch removes vcpu_load()/vcpu_put() from KVM_SET_REGS/KVM_GET_REGS ioctl. Signed-off-by: Simon Guo --- arch/powerpc/kvm/book3s.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 234531d..10b2a21 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c @@ -509,8 +509,6 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) { int i; - vcpu_load(vcpu); - regs->pc = kvmppc_get_pc(vcpu); regs->cr = kvmppc_get_cr(vcpu); regs->ctr = kvmppc_get_ctr(vcpu); @@ -532,7 +530,6 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) for (i = 0; i < ARRAY_SIZE(regs->gpr); i++) regs->gpr[i] = kvmppc_get_gpr(vcpu, i); - vcpu_put(vcpu); return 0; } @@ -540,8 +537,6 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) { int i; - vcpu_load(vcpu); - kvmppc_set_pc(vcpu, regs->pc); kvmppc_set_cr(vcpu, regs->cr); kvmppc_set_ctr(vcpu, regs->ctr); @@ -562,7 +557,6 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) for (i = 0; i < ARRAY_SIZE(regs->gpr); i++) kvmppc_set_gpr(vcpu, i, regs->gpr[i]); - vcpu_put(vcpu); return 0; }