18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
38c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
48c2ecf20Sopenharmony_ci * for more details.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * commpage, currently used for Virtual COP0 registers.
78c2ecf20Sopenharmony_ci * Mapped into the guest kernel @ KVM_GUEST_COMMPAGE_ADDR.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Copyright (C) 2012  MIPS Technologies, Inc.  All rights reserved.
108c2ecf20Sopenharmony_ci * Authors: Sanjay Lal <sanjayl@kymasys.com>
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/errno.h>
148c2ecf20Sopenharmony_ci#include <linux/err.h>
158c2ecf20Sopenharmony_ci#include <linux/vmalloc.h>
168c2ecf20Sopenharmony_ci#include <linux/fs.h>
178c2ecf20Sopenharmony_ci#include <linux/memblock.h>
188c2ecf20Sopenharmony_ci#include <asm/page.h>
198c2ecf20Sopenharmony_ci#include <asm/cacheflush.h>
208c2ecf20Sopenharmony_ci#include <asm/mmu_context.h>
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#include <linux/kvm_host.h>
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#include "commpage.h"
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_civoid kvm_mips_commpage_init(struct kvm_vcpu *vcpu)
278c2ecf20Sopenharmony_ci{
288c2ecf20Sopenharmony_ci	struct kvm_mips_commpage *page = vcpu->arch.kseg0_commpage;
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci	/* Specific init values for fields */
318c2ecf20Sopenharmony_ci	vcpu->arch.cop0 = &page->cop0;
328c2ecf20Sopenharmony_ci}
33