From patchwork Fri May 29 09:30:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 49147 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BDEFE218E7 for ; Fri, 29 May 2015 09:31:17 +0000 (UTC) Received: by wixv7 with SMTP id v7sf4266323wix.0 for ; Fri, 29 May 2015 02:31:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Rl8ifJO+aVaWl3MrDriEqn+AF6L7TB1dY6xLuBqJOd4=; b=Hwj9edLcb0XGuPpuYB1kkmLDe+VaDRcqIjv+8GsQtnIUvIrRMqpa19g64XjqNnxEGw zCM8GIfmzV4Ku1RQwRpB1+WmjE0KQ7jNoJnb0ulpJMwhMdFQnuUNpmc2i1PcHqZOknWQ tbO1pNaW5IgzUidy9QiEFATo0p2fm7/rM/QpIZIOOrXikiwFJWPv/QIiV8vm8Pk5RJns yqFE7GCM1X5Z/zay4/PVS+VpUvvK1xWaOv4A1dw+0175tcAbnAUE5V1UJAbOIWAG2JKc 5hIX4VtQi6UNj7eg6a4J97QLJAKQJ4LTArIgpd4E4epd2iUkxpuU0uy3arEPE7Gwf5Ob UJ6w== X-Gm-Message-State: ALoCoQnakxof7K5jknvOnHhlP+xbiTKDBeun8V7SBhVMFhbak+MNHmy1huxSPNDRpQcRDMSMlJrS X-Received: by 10.180.160.197 with SMTP id xm5mr438490wib.1.1432891877008; Fri, 29 May 2015 02:31:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.8 with SMTP id u8ls331629laj.39.gmail; Fri, 29 May 2015 02:31:16 -0700 (PDT) X-Received: by 10.112.77.103 with SMTP id r7mr6931206lbw.63.1432891876812; Fri, 29 May 2015 02:31:16 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id t10si4254561laa.17.2015.05.29.02.31.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 May 2015 02:31:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbcue7 with SMTP id ue7so44758321lbc.0 for ; Fri, 29 May 2015 02:31:16 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr7240210lbh.56.1432891876715; Fri, 29 May 2015 02:31:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp165139lbb; Fri, 29 May 2015 02:31:15 -0700 (PDT) X-Received: by 10.66.66.33 with SMTP id c1mr13230497pat.63.1432891874847; Fri, 29 May 2015 02:31:14 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pr7si7621111pdb.236.2015.05.29.02.31.13; Fri, 29 May 2015 02:31:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755890AbbE2JbF (ORCPT + 28 others); Fri, 29 May 2015 05:31:05 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:56427 "EHLO socrates.bennee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755748AbbE2Jat (ORCPT ); Fri, 29 May 2015 05:30:49 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaroharston) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1YyHwn-0004KD-5Y; Fri, 29 May 2015 12:55:29 +0200 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, peter.maydell@linaro.org, agraf@suse.de, drjones@redhat.com, pbonzini@redhat.com, zhichao.huang@linaro.org Cc: jan.kiszka@siemens.com, dahi@linux.vnet.ibm.com, r65777@freescale.com, bp@suse.de, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gleb Natapov , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v5 02/12] KVM: arm64: fix misleading comments in save/restore Date: Fri, 29 May 2015 10:30:18 +0100 Message-Id: <1432891828-4816-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1432891828-4816-1-git-send-email-alex.bennee@linaro.org> References: <1432891828-4816-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.bennee@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The elr_el2 and spsr_el2 registers in fact contain the processor state before entry into the hypervisor code. In the case of guest state it could be in either el0 or el1. Signed-off-by: Alex Bennée --- arch/arm64/kvm/hyp.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index 5befd01..cb9bdd8 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S @@ -50,8 +50,8 @@ stp x29, lr, [x3, #80] mrs x19, sp_el0 - mrs x20, elr_el2 // EL1 PC - mrs x21, spsr_el2 // EL1 pstate + mrs x20, elr_el2 // PC before hyp entry + mrs x21, spsr_el2 // pstate before hyp entry stp x19, x20, [x3, #96] str x21, [x3, #112] @@ -82,8 +82,8 @@ ldr x21, [x3, #16] msr sp_el0, x19 - msr elr_el2, x20 // EL1 PC - msr spsr_el2, x21 // EL1 pstate + msr elr_el2, x20 // PC to restore + msr spsr_el2, x21 // pstate to restore add x3, x2, #CPU_XREG_OFFSET(19) ldp x19, x20, [x3]