From patchwork Wed Dec 18 06:36:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 3367851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BC7639F32E for ; Wed, 18 Dec 2013 06:36:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB5E1203B0 for ; Wed, 18 Dec 2013 06:36:55 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E3C8B203AE for ; Wed, 18 Dec 2013 06:36:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtAkV-0003ph-L7; Wed, 18 Dec 2013 06:36:51 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtAkT-0004Nv-8G; Wed, 18 Dec 2013 06:36:49 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VtAkP-0004NP-6G for linux-arm-kernel@lists.infradead.org; Wed, 18 Dec 2013 06:36:46 +0000 Received: by mail-pb0-f49.google.com with SMTP id jt11so8032766pbb.36 for ; Tue, 17 Dec 2013 22:36:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZpYkigxgmyJ7x8QSL6wAxTATNxoZM7grGxbJxxPgtvw=; b=LQD0/MJ2doBymmYySD/HE1YZ26WLGzkRp01qRdegV6Qq+tYj70A439Rcpxaoowxpzi G2W7yMYIDaBqSmy6bnxbpMiHRA/wVhzt2B06m71wlwqk2livmR1CrGm0mB9RECW7r+F6 SMbVHqsU4eCtxHINdNh9A8ZUYq65/3Sl8JC83aroGzoE5DWYxVGRn4N4tAWyJuyvvruK jEaHBT2SIdja+JWPPRCM5giM4gAM5VZbf6FFHFQkAFf2K2WOTph13vglW8vxyAU+DGbL ofVj7MAUo3skq9xSLdoafkzmdElRtZMrZYgv9OYIaq8X5zOKDpkZMyEaBs0m8U3um4lo SlDw== X-Gm-Message-State: ALoCoQnseiY5jsotuJpiiiPuyE6j//ji1RSoMC8up+Je2zRCPgo+dNTNH5o5t4R39KcW4naKHpmI X-Received: by 10.66.14.41 with SMTP id m9mr32255424pac.123.1387348581467; Tue, 17 Dec 2013 22:36:21 -0800 (PST) Received: from localhost.localdomain (c-67-169-181-221.hsd1.ca.comcast.net. [67.169.181.221]) by mx.google.com with ESMTPSA id ef10sm52172647pac.1.2013.12.17.22.36.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 22:36:20 -0800 (PST) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH] KVM: arm/arm64: Clarify KVM_ARM_VCPU_INIT api Date: Tue, 17 Dec 2013 22:36:12 -0800 Message-Id: <1387348572-3636-1-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 1.8.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131218_013645_331098_F0B935E3 X-CRM114-Status: GOOD ( 10.79 ) X-Spam-Score: -0.1 (/) Cc: Peter Maydell , linaro-kernel@lists.linaro.org, Christoffer Dall , patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,SUSPICIOUS_RECIPS,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is nothing technically or semantically wrong with calling KVM_ARM_VCPU_INIT more than once, and even calling this on a VCPU after the VCPU has been executed. It just happens that user space will need a way to reset the VCPU or put the VCPU back in PSCI power-off mode after the VM has run, for example when driving a system reset from user space. Clarify that it is perfectly fine to use this API for that purpose. Cc: Peter Maydell Signed-off-by: Christoffer Dall --- Documentation/virtual/kvm/api.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index aad3244..d813a61 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2341,6 +2341,11 @@ return ENOEXEC for that vcpu. Note that because some registers reflect machine topology, all vcpus should be created before this ioctl is invoked. +Calling this a second time on a VCPU will reset the cpu registers to +their initial values and can be used with the feature bits to change the +CPU state, for example to put the CPU into power off mode from user +space. + Possible features: - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state. Depends on KVM_CAP_ARM_PSCI.