Message ID | 1500397144-16232-10-git-send-email-jintack.lim@linaro.org (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 3AF40602A7 for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 18 Jul 2017 17:32:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F208285CB for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 18 Jul 2017 17:32:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 131A8285CD; Tue, 18 Jul 2017 17:32:59 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9BFEF285CB for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 18 Jul 2017 17:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ntEiDKrzWixtSY3SAsjrQJUtV67jF7UI0lukavTOb4s=; b=lciQhJeNCyAUhKCg8ZJ/49qmck C8HLSsZSAObOG01mE/RPuOw5Yt5lznFGYWtzP1tw8M64/0dMZWxfhupXY6ztJef7QYTIprpaMb3HE cR7HCh+BhqAeNqJY7EHiUe7Qv4rncrHKOMUVZM+amEUhmxkDvUw349dM1fIcDyrB+3C07lMVYEzkj doJMELfLDRIIQVMMB1Gxre9LcuqtpBGgRW9FSjhjbju1NeejuEyXH597o4Roa8BIQlHNRyL7NXE5p PRSdcZeQPFhxMy8N4zEV5aM8tH2YcKh95HQGR5geCgp2ua+KBMLjJo0CANHEBbg+s0a4OM6xC3H+u VV5w+yrA==; 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 1dXWMj-0003T4-AI; Tue, 18 Jul 2017 17:32:57 +0000 Received: from mail-io0-x236.google.com ([2607:f8b0:4001:c06::236]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dXVr1-0002d3-1J for linux-arm-kernel@lists.infradead.org; Tue, 18 Jul 2017 17:00:21 +0000 Received: by mail-io0-x236.google.com with SMTP id z62so17066949ioi.3 for <linux-arm-kernel@lists.infradead.org>; Tue, 18 Jul 2017 09:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mHWQkEU3PYjg8LR9+vULRp6NTl/3XN9AtXKMlcly4IQ=; b=NFkG7lmLWwAUmE2PzhvTE6CJ5McM+Z5OnBtVqnnW8R6U6m7oE5HNrwG5vlI3jJpH+1 3oOl/UviiBqPgFvuQz2gVSjNmmv1of0RXWcRkDKwLWmaccwNVjOBgeFDOiyW4KxpNn9T oGZS/NJ+fLPdwTC6COkfKZt2bdAYpKpv0X2fg= 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=mHWQkEU3PYjg8LR9+vULRp6NTl/3XN9AtXKMlcly4IQ=; b=N/z1KJZTZs5PlLdVixi9xp5tVrLazcB/tO0EEybtLYyUx0pxxbSbzLWTusZViyjFvx 5XTr920inQDS6f5PLhpvkart/9uiJlRFAZkKKgEpSnKMNlU627Z+Z/UWTbmetueNXh9m 6GMpNOXoS/AFqVM+3HalbLQXnejURfog8F8D8na/6YHR0SjpYNdgpDECJaRiXdQZ9vHt iPFFD7K5IrCFzxK8FGbokl5ID+i3M/97ZZQwnpHW33uSOzAS/xKlPBrUpt+p/RYhu81l HLnsNOlkGhL2iGHL/YI02h4i2acb6bkCd27kjFhPklKHHqswZ/HTJ15yBl4KqDEbUpN4 DelA== X-Gm-Message-State: AIVw112m4QHXWmOfY87+T4VBzWpoZHwHCs6FuXdTWQgLYVWGT8IqUP/u 8KIkecONxXnCMPAG X-Received: by 10.107.173.220 with SMTP id m89mr2480426ioo.152.1500397189611; Tue, 18 Jul 2017 09:59:49 -0700 (PDT) Received: from node.jintackl-qv26972.kvmarm-pg0.wisc.cloudlab.us (c220g1-030822.wisc.cloudlab.us. [128.104.222.82]) by smtp.gmail.com with ESMTPSA id j96sm1413075ioo.49.2017.07.18.09.59.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Jul 2017 09:59:48 -0700 (PDT) From: Jintack Lim <jintack.lim@linaro.org> To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [RFC PATCH v2 09/38] KVM: arm64: Add the shadow context for virtual EL2 execution Date: Tue, 18 Jul 2017 11:58:35 -0500 Message-Id: <1500397144-16232-10-git-send-email-jintack.lim@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1500397144-16232-1-git-send-email-jintack.lim@linaro.org> References: <1500397144-16232-1-git-send-email-jintack.lim@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170718_100011_889652_74500469 X-CRM114-Status: UNSURE ( 9.65 ) X-CRM114-Notice: Please train this message. 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: mark.rutland@arm.com, rkrcmar@redhat.com, kvm@vger.kernel.org, david.daney@cavium.com, catalin.marinas@arm.com, will.deacon@arm.com, stefan@hello-penguin.com, corbet@lwn.net, daniel.lezcano@linaro.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, andy.gross@linaro.org, vladimir.murzin@arm.com, suzuki.poulose@arm.com, cov@codeaurora.org, wcohen@redhat.com, mchehab@kernel.org, shankerd@codeaurora.org, ard.biesheuvel@linaro.org, Jintack Lim <jintack.lim@linaro.org>, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, james.morse@arm.com, pbonzini@redhat.com, akpm@linux-foundation.org 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/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 57dccde..46880c3 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -229,6 +229,19 @@ struct kvm_cpu_context { }; u64 el2_special_regs[NR_EL2_SPECIAL_REGS]; + + u64 shadow_sys_regs[NR_SYS_REGS]; /* only used for virtual EL2 */ + + /* + * hw_* will be written to the hardware when entering to a VM. + * They have either the virtual EL2 or EL1/EL0 context depending + * on the vcpu mode. + */ + u64 *hw_sys_regs; + u64 hw_sp_el1; + u64 hw_pstate; + u64 hw_elr_el1; + u64 hw_spsr_el1; }; typedef struct kvm_cpu_context kvm_cpu_context_t;
With the nested virtualization support, a hypervisor running inside a VM (i.e. a guest hypervisor) is now deprivilaged and runs in EL1 instead of EL2. So, the host hypervisor manages the shadow context for the virtual EL2 execution. Signed-off-by: Jintack Lim <jintack.lim@linaro.org> --- arch/arm64/include/asm/kvm_host.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)