Message ID | 1483943091-1364-54-git-send-email-jintack@cs.columbia.edu (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> 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 0894560710 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 9 Jan 2017 06:47:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC5EF280DE for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 9 Jan 2017 06:47:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF79A2815E; Mon, 9 Jan 2017 06:47:43 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 80538280DE for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 9 Jan 2017 06:47:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cQTk2-00033e-MH; Mon, 09 Jan 2017 06:47:38 +0000 Received: from outprodmail02.cc.columbia.edu ([128.59.72.51]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQTjy-0002v0-EF for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2017 06:47:36 +0000 Received: from hazelnut (hazelnut.cc.columbia.edu [128.59.213.250]) by outprodmail02.cc.columbia.edu (8.14.4/8.14.4) with ESMTP id v096P41G005194 for <linux-arm-kernel@lists.infradead.org>; Mon, 9 Jan 2017 01:26:39 -0500 Received: from hazelnut (localhost.localdomain [127.0.0.1]) by hazelnut (Postfix) with ESMTP id 0E2088E for <linux-arm-kernel@lists.infradead.org>; Mon, 9 Jan 2017 01:26:39 -0500 (EST) Received: from sendprodmail01.cc.columbia.edu (sendprodmail01.cc.columbia.edu [128.59.72.13]) by hazelnut (Postfix) with ESMTP id DD11485 for <linux-arm-kernel@lists.infradead.org>; Mon, 9 Jan 2017 01:26:38 -0500 (EST) Received: from mail-qk0-f199.google.com (mail-qk0-f199.google.com [209.85.220.199]) by sendprodmail01.cc.columbia.edu (8.14.4/8.14.4) with ESMTP id v096Qcto041897 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for <linux-arm-kernel@lists.infradead.org>; Mon, 9 Jan 2017 01:26:38 -0500 Received: by mail-qk0-f199.google.com with SMTP id a16so37639327qkc.6 for <linux-arm-kernel@lists.infradead.org>; Sun, 08 Jan 2017 22:26:38 -0800 (PST) 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=VvtUyNvGUfbA/g6WVdjwo1nkvsO5FTTEo/p1w/2uCa0=; b=RLhMaAuhvr8vCBaQqZpj+if/ULXGmNEiy/RWWv7nEUEaKgxe5d/UjIixAYLTn1+tAm ndsdkawMDqoIah9jmDscuHIb1lbkWY6g2uoE+z8EwO6P4fbmjd5dTvA31HJYVu42Fmo1 OO0QknQmLbB//RTCPcbZMxydrJp3uR37xadGJRP0akftoz8HA0yIxI8TCzUGO+/k62jl yJKNPbCpMutDcVu8gDlsBMcUeS8i3f4re7reXdanP3DvXhbf5eyh/brzMRgyLIO7j0jx txKQHO46ea2KzRSHCE4tJR+vlJRIbd9QJZ7roUo2wNwm7eaRc6SijCE/K2XfSQYby0h7 sYhw== X-Gm-Message-State: AIkVDXIL6rNbyqyEbxiwJ2UZyiAkwyjL7GIXN5xmMnHexcDOvs4YbBthUNOqJVW8IUJkg9GxGvlpA5n2qZ8Sn9lG6NcWnKUZTEEUPgvRSbOvIZyYF3jUmr1uDT1iLlChiImshVOJkHzW/GJrU/TINo3Zjp1x37hp674/Cg== X-Received: by 10.200.33.244 with SMTP id 49mr81161250qtz.70.1483943198204; Sun, 08 Jan 2017 22:26:38 -0800 (PST) X-Received: by 10.200.33.244 with SMTP id 49mr81161229qtz.70.1483943198068; Sun, 08 Jan 2017 22:26:38 -0800 (PST) Received: from jintack.cs.columbia.edu ([2001:18d8:ffff:16:21a:4aff:feaa:f900]) by smtp.gmail.com with ESMTPSA id h3sm8623257qtc.6.2017.01.08.22.26.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Jan 2017 22:26:37 -0800 (PST) From: Jintack Lim <jintack@cs.columbia.edu> To: christoffer.dall@linaro.org, marc.zyngier@arm.com, pbonzini@redhat.com, rkrcmar@redhat.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, vladimir.murzin@arm.com, suzuki.poulose@arm.com, mark.rutland@arm.com, james.morse@arm.com, lorenzo.pieralisi@arm.com, kevin.brodsky@arm.com, wcohen@redhat.com, shankerd@codeaurora.org, geoff@infradead.org, andre.przywara@arm.com, eric.auger@redhat.com, anna-maria@linutronix.de, shihwei@cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 53/55] KVM: arm64: Reflect shadow VMPIDR_EL2 value to MPIDR_EL1 Date: Mon, 9 Jan 2017 01:24:49 -0500 Message-Id: <1483943091-1364-54-git-send-email-jintack@cs.columbia.edu> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1483943091-1364-1-git-send-email-jintack@cs.columbia.edu> References: <1483943091-1364-1-git-send-email-jintack@cs.columbia.edu> X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.78 on 128.59.72.13 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170108_224734_678593_5A364233 X-CRM114-Status: GOOD ( 10.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: jintack@cs.columbia.edu MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/arch/arm64/kvm/context.c b/arch/arm64/kvm/context.c index 9ebc38f..dd79b0e 100644 --- a/arch/arm64/kvm/context.c +++ b/arch/arm64/kvm/context.c @@ -173,6 +173,12 @@ void kvm_arm_setup_shadow_state(struct kvm_vcpu *vcpu) ctxt->hw_pstate = *vcpu_cpsr(vcpu); ctxt->hw_sys_regs = ctxt->sys_regs; ctxt->hw_sp_el1 = ctxt->gp_regs.sp_el1; + + /* + * A non-secure EL0 or EL1 read of MPIDR_EL1 returns + * the value of VMPIDR_EL2. + */ + ctxt->hw_sys_regs[MPIDR_EL1] = ctxt->el2_regs[VMPIDR_EL2]; } vgic_v2_setup_shadow_state(vcpu);
A non-secure EL0 or EL1 read of MPIDR_EL1 should return the value of VMPIDR_EL2. We emulate this by copying the virtual VMPIDR_EL2 value to MPIDR_EL1 when entering VM's EL0 or EL1. Signed-off-by: Jintack Lim <jintack@cs.columbia.edu> --- arch/arm64/kvm/context.c | 6 ++++++ 1 file changed, 6 insertions(+)