blob: f43629979a0e59959db7f1732233ad2db538ca5d [file] [log] [blame]
Sanjay Lal50c83082012-11-21 18:34:16 -08001/*
Deng-Cheng Zhud116e812014-06-26 12:11:34 -07002 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * commpage, currently used for Virtual COP0 registers.
James Hogan42aa12e2016-06-15 19:29:57 +01007 * Mapped into the guest kernel @ KVM_GUEST_COMMPAGE_ADDR.
Deng-Cheng Zhud116e812014-06-26 12:11:34 -07008 *
9 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
10 * Authors: Sanjay Lal <sanjayl@kymasys.com>
11 */
Sanjay Lal50c83082012-11-21 18:34:16 -080012
13#include <linux/errno.h>
14#include <linux/err.h>
Sanjay Lal50c83082012-11-21 18:34:16 -080015#include <linux/vmalloc.h>
16#include <linux/fs.h>
17#include <linux/bootmem.h>
18#include <asm/page.h>
19#include <asm/cacheflush.h>
20#include <asm/mmu_context.h>
21
22#include <linux/kvm_host.h>
23
Deng-Cheng Zhud7d5b052014-06-26 12:11:38 -070024#include "commpage.h"
Sanjay Lal50c83082012-11-21 18:34:16 -080025
26void kvm_mips_commpage_init(struct kvm_vcpu *vcpu)
27{
28 struct kvm_mips_commpage *page = vcpu->arch.kseg0_commpage;
Deng-Cheng Zhud116e812014-06-26 12:11:34 -070029
Sanjay Lal50c83082012-11-21 18:34:16 -080030 /* Specific init values for fields */
31 vcpu->arch.cop0 = &page->cop0;
Sanjay Lal50c83082012-11-21 18:34:16 -080032}