{"id":842650,"url":"http://patchwork.ozlabs.org/api/covers/842650/?format=json","web_url":"http://patchwork.ozlabs.org/project/kvm-ppc/cover/20171129164116.16167-1-christoffer.dall@linaro.org/","project":{"id":23,"url":"http://patchwork.ozlabs.org/api/projects/23/?format=json","name":"KVM PowerPC development","link_name":"kvm-ppc","list_id":"kvm-ppc.vger.kernel.org","list_email":"kvm-ppc@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20171129164116.16167-1-christoffer.dall@linaro.org>","list_archive_url":null,"date":"2017-11-29T16:41:00","name":"[v2,00/16] Move vcpu_load and vcpu_put calls to arch code","submitter":{"id":26352,"url":"http://patchwork.ozlabs.org/api/people/26352/?format=json","name":"Christoffer Dall","email":"christoffer.dall@linaro.org"},"mbox":"http://patchwork.ozlabs.org/project/kvm-ppc/cover/20171129164116.16167-1-christoffer.dall@linaro.org/mbox/","series":[{"id":15778,"url":"http://patchwork.ozlabs.org/api/series/15778/?format=json","web_url":"http://patchwork.ozlabs.org/project/kvm-ppc/list/?series=15778","date":"2017-11-29T16:41:00","name":"Move vcpu_load and vcpu_put calls to arch code","version":2,"mbox":"http://patchwork.ozlabs.org/series/15778/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/842650/comments/","headers":{"Return-Path":"<kvm-ppc-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=kvm-ppc-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"dXnO0XvO\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yn5rz2CqDz9t3Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 30 Nov 2017 03:41:23 +1100 (AEDT)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S933712AbdK2QlW (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tWed, 29 Nov 2017 11:41:22 -0500","from mail-wm0-f68.google.com ([74.125.82.68]:42657 \"EHLO\n\tmail-wm0-f68.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S933679AbdK2QlU (ORCPT\n\t<rfc822;kvm-ppc@vger.kernel.org>); Wed, 29 Nov 2017 11:41:20 -0500","by mail-wm0-f68.google.com with SMTP id l141so7613057wmg.1\n\tfor <kvm-ppc@vger.kernel.org>; Wed, 29 Nov 2017 08:41:19 -0800 (PST)","from localhost.localdomain (x50d2404e.cust.hiper.dk.\n\t[80.210.64.78]) by smtp.gmail.com with ESMTPSA id\n\te71sm2080765wma.13.2017.11.29.08.41.17\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 29 Nov 2017 08:41:18 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=from:to:cc:subject:date:message-id;\n\tbh=E4qWHSBw5zi93TV6hbPcQPs7J39Ga5nBDckovdyREQQ=;\n\tb=dXnO0XvOK1yHP/zoK8+/by3CkYVUngza4+qEph7Vp0DUZF5IsWbnUS2v/3LZA8rVzC\n\tnDLOs5vUqJGCutn/Ukpf3TXaS2Q7y0o3VrmUkuX/aZ0UK3krnYtuW1/djKPuN9sM/ERv\n\tMQmFJXwWOxXwk4lCDnes3IMyGPA+8jwqzQMuQ=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=E4qWHSBw5zi93TV6hbPcQPs7J39Ga5nBDckovdyREQQ=;\n\tb=REr8uB4F45leuY6veWznd1H3ENHKlgupJZwt4hWLdYL8TKZ9KbAgvJ7fUlfGOg0i/C\n\tHnYaZvoSvCqGccYg4jXJfHHxlnHnn8J/4/XgrcxoQX+CPOB+Z2JkDmV976R08S1AZL/T\n\tgtETv8eQcZ//z/epAG5zc6fkW0WD6RJa6pD3lnMd2pssa4slR20nF9fwNjlsnLED5uek\n\txB6bjiZ7VYz4KhJrCR0GyQiKv0p4cKEQeCqcjkr+qxcJKTL2QtbTKFQMoHOiHHZe5oQ6\n\tGK2Oqv/uODGYPpNTQzqhYpkEoLl66PLKnuAsA3yJ0DFhVzlvOyvYkSxyU7gh/QV4/4O9\n\tpPgQ==","X-Gm-Message-State":"AJaThX5yTpGDg0MCu5nw5pS1n/by4WksKUHyWxfOO6MxnSTM9M+Q/jX7\n\tdOuR4mJy+3pdgGCQZ/APNSz9+A==","X-Google-Smtp-Source":"AGs4zMbeA1q771wCTAFJlxa0p2plb06mdhLLfPP9mKWfkrMtZa8qAbTf0/kiOt6zHj46+umbOkUxVQ==","X-Received":"by 10.28.1.14 with SMTP id 14mr3093619wmb.51.1511973679034;\n\tWed, 29 Nov 2017 08:41:19 -0800 (PST)","From":"Christoffer Dall <christoffer.dall@linaro.org>","To":"kvm@vger.kernel.org","Cc":"Andrew Jones <drjones@redhat.com>, Christoffer Dall\n\t<christoffer.dall@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>,\n\t=?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= <rkrcmar@redhat.com>,\n\tMarc Zyngier <marc.zyngier@arm.com>, kvmarm@lists.cs.columbia.edu,\n\tlinux-arm-kernel@lists.infradead.org, James Hogan <jhogan@kernel.org>,\n\tlinux-mips@linux-mips.org, Alexander Graf <agraf@suse.com>,\n\tkvm-ppc@vger.kernel.org, \n\tChristian Borntraeger <borntraeger@de.ibm.com>, Cornelia Huck\n\t<cohuck@redhat.com>, linux-s390@vger.kernel.org","Subject":"[PATCH v2 00/16] Move vcpu_load and vcpu_put calls to arch code","Date":"Wed, 29 Nov 2017 17:41:00 +0100","Message-Id":"<20171129164116.16167-1-christoffer.dall@linaro.org>","X-Mailer":"git-send-email 2.14.2","Sender":"kvm-ppc-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<kvm-ppc.vger.kernel.org>","X-Mailing-List":"kvm-ppc@vger.kernel.org"},"content":"Some architectures may decide to do different things during\nkvm_arch_vcpu_load depending on the ioctl being executed.  For example,\narm64 is about to do significant work in vcpu load/put when running a\nvcpu, but it's problematic to do this for any other vcpu ioctl than\nKVM_RUN.\n\nFurther, while it may be possible to call kvm_arch_vcpu_load() for a\nnumber of non-KVM_RUN ioctls, it makes the KVM/ARM code more difficult\nto reason about, especially after my optimization series, because a lot\nof things can now happen, where we have to consider if we're really in\nthe process of running a vcpu or not.\n\nThis series will first move the vcpu_load() and vcpu_put() calls in the\narch generic dispatch function into each case of the switch statement\nand then, one-by-one, pushed the calls down into the architecture\nspecific code making the changes for each ioctl as required.\n\nPatches also available at:\ngit://git.kernel.org/pub/scm/linux/kernel/git/cdall/linux.git vcpu-load-put-v2\n\nChanges since v1:\n - Fix PPC and S390 bugs from v1\n - Take the mutex in the main disaptcher function and make vcpu_load a\n   void, which simplifies the patches overall.\n - Add a patch that moves vcpu_load for arm/arm64 after the first-run\n   init function.\n\nThanks,\n-Christoffer\n\nChristoffer Dall (16):\n  KVM: Take vcpu->mutex outside vcpu_load\n  KVM: Prepare for moving vcpu_load/vcpu_put into arch specific code\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_run\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_get_regs\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_regs\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_get_sregs\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_sregs\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_get_mpstate\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_mpstate\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_translate\n  KVM: Move vcpu_load to arch-specific\n    kvm_arch_vcpu_ioctl_set_guest_debug\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_get_fpu\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_fpu\n  KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl\n  KVM: arm/arm64: Avoid vcpu_load for other vcpu ioctls than KVM_RUN\n  KVM: arm/arm64: Move vcpu_load call after kvm_vcpu_first_run_init\n\n arch/arm64/kvm/guest.c        |  12 +++--\n arch/mips/kvm/mips.c          |  58 +++++++++++++++--------\n arch/powerpc/kvm/book3s.c     |  24 +++++++++-\n arch/powerpc/kvm/booke.c      |  51 +++++++++++++++-----\n arch/powerpc/kvm/powerpc.c    |  19 +++++---\n arch/s390/kvm/kvm-s390.c      |  90 +++++++++++++++++++++++++++--------\n arch/x86/kvm/vmx.c            |   4 +-\n arch/x86/kvm/x86.c            | 107 ++++++++++++++++++++++++++++++------------\n include/linux/kvm_host.h      |   2 +-\n virt/kvm/arm/arch_timer.c     |   4 --\n virt/kvm/arm/arm.c            |  68 ++++++++++++++++++---------\n virt/kvm/arm/vgic/vgic-init.c |  11 -----\n virt/kvm/kvm_main.c           |  17 ++-----\n 13 files changed, 323 insertions(+), 144 deletions(-)"}