Sanjay Lal | 50c8308 | 2012-11-21 18:34:16 -0800 | [diff] [blame] | 1 | /* |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 2 | * 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. |
| 7 | * Mapped into the guest kernel @ 0x0. |
| 8 | * |
| 9 | * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. |
| 10 | * Authors: Sanjay Lal <sanjayl@kymasys.com> |
| 11 | */ |
Sanjay Lal | 50c8308 | 2012-11-21 18:34:16 -0800 | [diff] [blame] | 12 | |
| 13 | #include <linux/errno.h> |
| 14 | #include <linux/err.h> |
| 15 | #include <linux/module.h> |
| 16 | #include <linux/vmalloc.h> |
| 17 | #include <linux/fs.h> |
| 18 | #include <linux/bootmem.h> |
| 19 | #include <asm/page.h> |
| 20 | #include <asm/cacheflush.h> |
| 21 | #include <asm/mmu_context.h> |
| 22 | |
| 23 | #include <linux/kvm_host.h> |
| 24 | |
Deng-Cheng Zhu | d7d5b05 | 2014-06-26 12:11:38 -0700 | [diff] [blame] | 25 | #include "commpage.h" |
Sanjay Lal | 50c8308 | 2012-11-21 18:34:16 -0800 | [diff] [blame] | 26 | |
| 27 | void kvm_mips_commpage_init(struct kvm_vcpu *vcpu) |
| 28 | { |
| 29 | struct kvm_mips_commpage *page = vcpu->arch.kseg0_commpage; |
Deng-Cheng Zhu | d116e81 | 2014-06-26 12:11:34 -0700 | [diff] [blame] | 30 | |
Sanjay Lal | 50c8308 | 2012-11-21 18:34:16 -0800 | [diff] [blame] | 31 | /* Specific init values for fields */ |
| 32 | vcpu->arch.cop0 = &page->cop0; |
Sanjay Lal | 50c8308 | 2012-11-21 18:34:16 -0800 | [diff] [blame] | 33 | } |