summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2006-11-24 18:50:56 +0000
committerkmacy <kmacy@FreeBSD.org>2006-11-24 18:50:56 +0000
commit491108697b47fc63a58ef1bb1f4d062f5aa63a76 (patch)
tree6f3830584142dd07dd45aac89f679d5326bfe14b /sys
parentc41b4d1505355d865c63ceb76c8a5d9578a98894 (diff)
downloadFreeBSD-src-491108697b47fc63a58ef1bb1f4d062f5aa63a76.zip
FreeBSD-src-491108697b47fc63a58ef1bb1f4d062f5aa63a76.tar.gz
Implement mmu functions and cpu_mondo_send
fix some more kernel compile fallout
Diffstat (limited to 'sys')
-rw-r--r--sys/sun4v/include/hv_api.h7
-rw-r--r--sys/sun4v/include/hypervisorvar.h5
-rw-r--r--sys/sun4v/sun4v/hcall.S63
-rw-r--r--sys/sun4v/sun4v/hviommu.c4
-rw-r--r--sys/sun4v/sun4v/pmap.c2
-rw-r--r--sys/sun4v/sun4v/trap.c2
6 files changed, 75 insertions, 8 deletions
diff --git a/sys/sun4v/include/hv_api.h b/sys/sun4v/include/hv_api.h
index 846225d..7341411 100644
--- a/sys/sun4v/include/hv_api.h
+++ b/sys/sun4v/include/hv_api.h
@@ -59,6 +59,10 @@ extern uint64_t hv_mach_watchdog(uint64_t timeout, uint64_t *time_remaining);
* Section 11 CPU Services
*/
+extern uint64_t hv_cpu_yield(void);
+extern uint64_t hv_cpu_state(uint64_t cpuid, uint64_t *state);
+extern uint64_t hv_cpu_mondo_send(int ncpu, vm_paddr_t cpulist_ra);
+
/*
* Section 12 MMU Services
*/
@@ -78,11 +82,14 @@ typedef struct hv_tsb_info {
extern uint64_t hv_mmu_tsb_ctx0(uint64_t, uint64_t);
extern uint64_t hv_mmu_tsb_ctxnon0(uint64_t, uint64_t);
+extern uint64_t hv_mmu_map_perm_addr(vm_offset_t va, uint64_t, tte_t tte, uint64_t flags);
/*
* Section 13 Cache and Memory Services
*/
+extern uint64_t hv_mem_scrub(vm_paddr_t ra, uint64_t length, uint64_t *scrubbed);
+
/*
* Section 14 Device Interrupt Services
*/
diff --git a/sys/sun4v/include/hypervisorvar.h b/sys/sun4v/include/hypervisorvar.h
index e54fe9a..ca2cc1f3 100644
--- a/sys/sun4v/include/hypervisorvar.h
+++ b/sys/sun4v/include/hypervisorvar.h
@@ -42,8 +42,7 @@
#define CORE_TRAP 0xff
/*
- * Error returns in %o0.
- * (Additional result is returned in %o1.)
+ * Status returns in %o0.
*/
#define H_EOK 0 /* Successful return */
#define H_ENOCPU 1 /* Invalid CPU id */
@@ -74,7 +73,7 @@
#define HV_SEND_MONDO_ENTRYDONE 0xffff
/*
- * Function numbers for API_TRAP.
+ * Function numbers for CORE_TRAP.
*/
#define API_SET_VERSION 0x00
#define API_PUTCHAR 0x01
diff --git a/sys/sun4v/sun4v/hcall.S b/sys/sun4v/sun4v/hcall.S
index d712f9b..4d45446 100644
--- a/sys/sun4v/sun4v/hcall.S
+++ b/sys/sun4v/sun4v/hcall.S
@@ -53,11 +53,10 @@
*
*/
ENTRY(api_set_version)
- mov %o3, %o4
mov API_SET_VERSION, %o5
ta CORE_TRAP
retl
- stx %o1, [%o4]
+ stx %o1, [%o3]
END(api_set_version)
/*
@@ -313,6 +312,11 @@ END(hv_cpu_qinfo)
*
*/
ENTRY(hv_cpu_mondo_send)
+ ldx [PCPU(MONDO_DATA_RA)], %o2
+ mov HV_INTR_SEND, %o5
+ ta FAST_TRAP
+ retl
+ membar #Sync
END(hv_cpu_mondo_send)
/*
@@ -399,6 +403,10 @@ END(hv_mmu_tsb_ctxnon0)
*
*/
ENTRY(hv_mmu_demap_page)
+ mov MMU_DEMAP_PAGE, %o5
+ ta FAST_TRAP
+ retl
+ nop
END(hv_mmu_demap_page)
/*
@@ -413,6 +421,10 @@ END(hv_mmu_demap_page)
*
*/
ENTRY(hv_mmu_demap_ctx)
+ mov MMU_DEMAP_CTX, %o5
+ ta FAST_TRAP
+ retl
+ nop
END(hv_mmu_demap_ctx)
/*
@@ -427,6 +439,10 @@ END(hv_mmu_demap_ctx)
*
*/
ENTRY(hv_mmu_demap_all)
+ mov MMU_DEMAP_ALL, %o5
+ ta FAST_TRAP
+ retl
+ nop
END(hv_mmu_demap_all)
/*
@@ -441,6 +457,10 @@ END(hv_mmu_demap_all)
*
*/
ENTRY(hv_mmu_map_addr)
+ mov MMU_MAP_ADDR, %o5
+ ta FAST_TRAP
+ retl
+ nop
END(hv_mmu_map_addr)
/*
@@ -455,6 +475,10 @@ END(hv_mmu_map_addr)
*
*/
ENTRY(hv_mmu_map_perm_addr)
+ mov MMU_MAP_PERM_ADDR, %o5
+ ta FAST_TRAP
+ retl
+ nop
END(hv_mmu_map_perm_addr)
/*
@@ -468,6 +492,10 @@ END(hv_mmu_map_perm_addr)
*
*/
ENTRY(hv_mmu_unmap_addr)
+ mov MMU_UNMAP_ADDR, %o5
+ ta FAST_TRAP
+ retl
+ nop
END(hv_mmu_unmap_addr)
/*
@@ -481,6 +509,10 @@ END(hv_mmu_unmap_addr)
*
*/
ENTRY(hv_mmu_unmap_perm_addr)
+ mov MMU_UNMAP_PERM_ADDR, %o5
+ ta FAST_TRAP
+ retl
+ nop
END(hv_mmu_unmap_perm_addr)
/*
@@ -489,10 +521,15 @@ END(hv_mmu_unmap_perm_addr)
* arg0 raddr (%o0)
*
* ret0 status (%o0)
- * ret1 prev_raddr (%o0)
+ * ret1 prev_raddr (%o1)
*
*/
ENTRY(hv_mmu_fault_area_conf)
+ mov %o1, %o2
+ mov MMU_FAULT_AREA_CONF, %o5
+ ta FAST_TRAP
+ retl
+ stx %o1, [%o2]
END(hv_mmu_fault_area_conf)
/*
@@ -505,6 +542,10 @@ END(hv_mmu_fault_area_conf)
*
*/
ENTRY(hv_mmu_enable)
+ mov MMU_ENABLE, %o5
+ ta FAST_TRAP
+ retl
+ nop
END(hv_mmu_enable)
/*
@@ -518,6 +559,11 @@ END(hv_mmu_enable)
*
*/
ENTRY(hv_mmu_tsb_ctx0_info)
+ mov %o1, %o2
+ mov MMU_TSB_CTX0_INFO, %o5
+ ta FAST_TRAP
+ retl
+ stx %o1, [%o2]
END(hv_mmu_tsb_ctx0_info)
/*
@@ -531,6 +577,11 @@ END(hv_mmu_tsb_ctx0_info)
*
*/
ENTRY(hv_mmu_tsb_ctxnon0_info)
+ mov %o1, %o2
+ mov MMU_TSB_CTXNON0_INFO, %o5
+ ta FAST_TRAP
+ retl
+ stx %o1, [%o2]
END(hv_mmu_tsb_ctxnon0_info)
/*
@@ -541,6 +592,12 @@ END(hv_mmu_tsb_ctxnon0_info)
*
*/
ENTRY(hv_mmu_fault_area_info)
+ mov %o0, %o2
+ mov MMU_FAULT_AREA_INFO, %o5
+ ta FAST_TRAP
+ retl
+ stx %o1, [%o2]
+
END(hv_mmu_fault_area_info)
/*
diff --git a/sys/sun4v/sun4v/hviommu.c b/sys/sun4v/sun4v/hviommu.c
index d47d534..4261a24 100644
--- a/sys/sun4v/sun4v/hviommu.c
+++ b/sys/sun4v/sun4v/hviommu.c
@@ -120,6 +120,10 @@
#include <machine/pmap.h>
#include <machine/resource.h>
+#include <machine/hypervisorvar.h>
+#include <machine/hv_api.h>
+
+
#include <sys/rman.h>
/*
diff --git a/sys/sun4v/sun4v/pmap.c b/sys/sun4v/sun4v/pmap.c
index c0e2b33..b1115a8 100644
--- a/sys/sun4v/sun4v/pmap.c
+++ b/sys/sun4v/sun4v/pmap.c
@@ -472,7 +472,7 @@ pmap_bootstrap(vm_offset_t ekva)
translations[i].om_start <= KERNBASE + 3*PAGE_SIZE_4M)) {
KDPRINTF("mapping permanent translation\n");
pa = TTE_GET_PA(translations[i].om_tte);
- error = hv_mmu_map_perm_addr((char *)translations[i].om_start,
+ error = hv_mmu_map_perm_addr(translations[i].om_start,
KCONTEXT, pa | TTE_KERNEL | VTD_4M, MAP_ITLB | MAP_DTLB);
if (error != H_EOK)
panic("map_perm_addr returned error=%ld", error);
diff --git a/sys/sun4v/sun4v/trap.c b/sys/sun4v/sun4v/trap.c
index d660eb3..602410f 100644
--- a/sys/sun4v/sun4v/trap.c
+++ b/sys/sun4v/sun4v/trap.c
@@ -90,7 +90,7 @@
#include <machine/wstate.h>
#include <machine/md_var.h>
-#include <machine/hv_api.h>
+#include <machine/hypervisorvar.h>
#include <security/audit/audit.h>
OpenPOWER on IntegriCloud