PERFORCE change 111707 for review
John Baldwin
jhb at FreeBSD.org
Thu Dec 14 10:52:11 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=111707
Change 111707 by jhb at jhb_mutex on 2006/12/14 18:46:22
IFC @111704.
Affected files ...
.. //depot/projects/smpng/sys/dev/mfi/mfi.c#14 integrate
.. //depot/projects/smpng/sys/dev/mfi/mfi_ioctl.h#4 integrate
.. //depot/projects/smpng/sys/dev/mfi/mfireg.h#6 integrate
.. //depot/projects/smpng/sys/sun4v/sun4v/hcall.S#4 integrate
Differences ...
==== //depot/projects/smpng/sys/dev/mfi/mfi.c#14 (text) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi.c,v 1.23 2006/11/18 07:33:53 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi.c,v 1.24 2006/12/14 18:29:08 ambrisko Exp $");
#include "opt_mfi.h"
@@ -1586,7 +1586,7 @@
mfi_send_frame(struct mfi_softc *sc, struct mfi_command *cm)
{
struct mfi_frame_header *hdr;
- int tm = MFI_POLL_TIMEOUT_SECS * 1000000;
+ int tm = MFI_POLL_TIMEOUT_SECS * 1000;
hdr = &cm->cm_frame->header;
@@ -1622,13 +1622,14 @@
/* This is a polled command, so busy-wait for it to complete. */
while (hdr->cmd_status == 0xff) {
DELAY(1000);
- tm -= 1000;
+ tm -= 1;
if (tm <= 0)
break;
}
if (hdr->cmd_status == 0xff) {
- device_printf(sc->mfi_dev, "Frame %p timed out\n", hdr);
+ device_printf(sc->mfi_dev, "Frame %p timed out "
+ "command 0x%X\n", hdr, cm->cm_frame->dcmd.opcode);
return (ETIMEDOUT);
}
@@ -1663,6 +1664,7 @@
{
struct mfi_command *cm;
struct mfi_abort_frame *abort;
+ int i = 0;
mtx_assert(&sc->mfi_io_lock, MA_OWNED);
@@ -1683,8 +1685,9 @@
mfi_mapcmd(sc, cm);
mfi_release_command(cm);
- while (sc->mfi_aen_cm != NULL) {
+ while (i < 5 && sc->mfi_aen_cm != NULL) {
msleep(&sc->mfi_aen_cm, &sc->mfi_io_lock, 0, "mfiabort", 5 * hz);
+ i++;
}
return (0);
@@ -1770,9 +1773,8 @@
struct mfi_ioc_packet *ioc;
struct mfi_ioc_aen *aen;
struct mfi_command *cm = NULL;
- struct mfi_dcmd_frame *dcmd;
uint32_t context;
- uint32_t *sense_ptr;
+ uint8_t *sense_ptr;
uint8_t *data = NULL, *temp;
int i;
int error;
@@ -1812,45 +1814,41 @@
*/
context = cm->cm_frame->header.context;
- bcopy(ioc->mi_frame.raw, cm->cm_frame,
- ioc->mi_sgl_off); /* Linux can do 2 frames ? */
- cm->cm_total_frame_size = ioc->mi_sgl_off;
+ bcopy(ioc->mfi_frame.raw, cm->cm_frame,
+ ioc->mfi_sgl_off); /* Linux can do 2 frames ? */
+ cm->cm_total_frame_size = ioc->mfi_sgl_off;
cm->cm_sg =
- (union mfi_sgl *)&cm->cm_frame->bytes[ioc->mi_sgl_off];
+ (union mfi_sgl *)&cm->cm_frame->bytes[ioc->mfi_sgl_off];
cm->cm_flags = MFI_CMD_DATAIN | MFI_CMD_DATAOUT
| MFI_CMD_POLLED;
cm->cm_len = cm->cm_frame->header.data_len;
cm->cm_data = data = malloc(cm->cm_len, M_MFIBUF,
M_WAITOK | M_ZERO);
+ if (cm->cm_data == NULL) {
+ device_printf(sc->mfi_dev, "Malloc failed\n");
+ goto out;
+ }
/* restore header context */
cm->cm_frame->header.context = context;
- /* ioctl's are dcmd types */
- dcmd = &cm->cm_frame->dcmd;
temp = data;
- for (i = 0; i < ioc->mi_sge_count; i++) {
- error = copyin(ioc->mi_sgl[i].iov_base,
+ for (i = 0; i < ioc->mfi_sge_count; i++) {
+ error = copyin(ioc->mfi_sgl[i].iov_base,
temp,
- ioc->mi_sgl[i].iov_len);
+ ioc->mfi_sgl[i].iov_len);
if (error != 0) {
device_printf(sc->mfi_dev,
- "Copy in failed");
+ "Copy in failed\n");
goto out;
}
- temp = &temp[ioc->mi_sgl[i].iov_len];
- }
-
- if (ioc->mi_sense_len) {
- sense_ptr =
- (void *)&cm->cm_frame->bytes[ioc->mi_sense_off];
- *sense_ptr = cm->cm_sense_busaddr;
+ temp = &temp[ioc->mfi_sgl[i].iov_len];
}
mtx_lock(&sc->mfi_io_lock);
if ((error = mfi_mapcmd(sc, cm)) != 0) {
device_printf(sc->mfi_dev,
- "Controller polled failed");
+ "Controller polled failed\n");
mtx_unlock(&sc->mfi_io_lock);
goto out;
}
@@ -1861,36 +1859,34 @@
mtx_unlock(&sc->mfi_io_lock);
temp = data;
- for (i = 0; i < ioc->mi_sge_count; i++) {
+ for (i = 0; i < ioc->mfi_sge_count; i++) {
error = copyout(temp,
- ioc->mi_sgl[i].iov_base,
- ioc->mi_sgl[i].iov_len);
+ ioc->mfi_sgl[i].iov_base,
+ ioc->mfi_sgl[i].iov_len);
if (error != 0) {
device_printf(sc->mfi_dev,
- "Copy out failed");
+ "Copy out failed\n");
goto out;
}
- temp = &temp[ioc->mi_sgl[i].iov_len];
+ temp = &temp[ioc->mfi_sgl[i].iov_len];
}
- if (ioc->mi_sense_len) {
+ if (ioc->mfi_sense_len) {
/* copy out sense */
- sense_ptr = (void *)
- &ioc->mi_frame.raw[ioc->mi_sense_off];
- temp = 0;
- temp += cm->cm_sense_busaddr;
- error = copyout(temp, sense_ptr,
- ioc->mi_sense_len);
+ sense_ptr = &((struct mfi_ioc_packet*)arg)
+ ->mfi_frame.raw[0];
+ error = copyout(cm->cm_sense, sense_ptr,
+ ioc->mfi_sense_len);
if (error != 0) {
device_printf(sc->mfi_dev,
- "Copy out failed");
+ "Copy out failed\n");
goto out;
}
}
- ioc->mi_frame.hdr.cmd_status = cm->cm_frame->header.cmd_status;
+ ioc->mfi_frame.hdr.cmd_status = cm->cm_frame->header.cmd_status;
if (cm->cm_frame->header.cmd_status == MFI_STAT_OK) {
- switch (dcmd->opcode) {
+ switch (cm->cm_frame->dcmd.opcode) {
case MFI_DCMD_CFG_CLEAR:
case MFI_DCMD_CFG_ADD:
/*
@@ -1974,7 +1970,7 @@
struct mfi_linux_ioc_aen l_aen;
struct mfi_command *cm = NULL;
struct mfi_aen *mfi_aen_entry;
- uint32_t *sense_ptr;
+ uint8_t *sense_ptr;
uint32_t context;
uint8_t *data = NULL, *temp;
void *temp_convert;
@@ -2029,22 +2025,16 @@
l_ioc.lioc_sgl[i].iov_len);
if (error != 0) {
device_printf(sc->mfi_dev,
- "Copy in failed");
+ "Copy in failed\n");
goto out;
}
temp = &temp[l_ioc.lioc_sgl[i].iov_len];
}
- if (l_ioc.lioc_sense_len) {
- sense_ptr =
- (void *)&cm->cm_frame->bytes[l_ioc.lioc_sense_off];
- *sense_ptr = cm->cm_sense_busaddr;
- }
-
mtx_lock(&sc->mfi_io_lock);
if ((error = mfi_mapcmd(sc, cm)) != 0) {
device_printf(sc->mfi_dev,
- "Controller polled failed");
+ "Controller polled failed\n");
mtx_unlock(&sc->mfi_io_lock);
goto out;
}
@@ -2063,7 +2053,7 @@
l_ioc.lioc_sgl[i].iov_len);
if (error != 0) {
device_printf(sc->mfi_dev,
- "Copy out failed");
+ "Copy out failed\n");
goto out;
}
temp = &temp[l_ioc.lioc_sgl[i].iov_len];
@@ -2071,15 +2061,13 @@
if (l_ioc.lioc_sense_len) {
/* copy out sense */
- sense_ptr = (void *)
- &l_ioc.lioc_frame.raw[l_ioc.lioc_sense_off];
- temp = 0;
- temp += cm->cm_sense_busaddr;
- error = copyout(temp, sense_ptr,
+ sense_ptr = &((struct mfi_linux_ioc_packet*)arg)
+ ->lioc_frame.raw[0];
+ error = copyout(cm->cm_sense, sense_ptr,
l_ioc.lioc_sense_len);
if (error != 0) {
device_printf(sc->mfi_dev,
- "Copy out failed");
+ "Copy out failed\n");
goto out;
}
}
@@ -2090,7 +2078,7 @@
1);
if (error != 0) {
device_printf(sc->mfi_dev,
- "Copy out failed");
+ "Copy out failed\n");
goto out;
}
==== //depot/projects/smpng/sys/dev/mfi/mfi_ioctl.h#4 (text) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi_ioctl.h,v 1.3 2006/11/14 16:48:00 ambrisko Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mfi/mfi_ioctl.h,v 1.4 2006/12/14 18:29:08 ambrisko Exp $");
#if defined(__amd64__) /* Assume amd64 wants 32 bit Linux */
struct iovec32 {
@@ -53,18 +53,18 @@
#define MAX_IOCTL_SGE 16
struct mfi_ioc_packet {
- uint16_t mi_adapter_no;
- uint16_t mi_pad1;
- uint32_t mi_sgl_off;
- uint32_t mi_sge_count;
- uint32_t mi_sense_off;
- uint32_t mi_sense_len;
+ uint16_t mfi_adapter_no;
+ uint16_t mfi_pad1;
+ uint32_t mfi_sgl_off;
+ uint32_t mfi_sge_count;
+ uint32_t mfi_sense_off;
+ uint32_t mfi_sense_len;
union {
uint8_t raw[128];
struct mfi_frame_header hdr;
- } mi_frame;
+ } mfi_frame;
- struct iovec mi_sgl[MAX_IOCTL_SGE];
+ struct iovec mfi_sgl[MAX_IOCTL_SGE];
} __packed;
struct mfi_ioc_aen {
==== //depot/projects/smpng/sys/dev/mfi/mfireg.h#6 (text) ====
@@ -28,7 +28,7 @@
#define _MFIREG_H
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mfi/mfireg.h,v 1.6 2006/10/16 04:18:38 scottl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mfi/mfireg.h,v 1.7 2006/12/14 18:29:08 ambrisko Exp $");
/*
* MegaRAID SAS MFI firmware definitions
@@ -279,7 +279,8 @@
#define MFI_FRAME_SIZE 64
#define MFI_MBOX_SIZE 12
-#define MFI_POLL_TIMEOUT_SECS 10
+/* Firmware flashing can take 40s */
+#define MFI_POLL_TIMEOUT_SECS 50
/* Allow for speedier math calculations */
#define MFI_SECTOR_LEN 512
==== //depot/projects/smpng/sys/sun4v/sun4v/hcall.S#4 (text+ko) ====
@@ -1,1433 +1,1850 @@
-/*
- * CDDL HEADER START
+/*-
+ * Copyright (c) 2006 Kip Macy <kmacy at FreeBSD.org>
+ * All rights reserved.
*
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
+ * $FreeBSD: src/sys/sun4v/sun4v/hcall.S,v 1.17 2006/11/26 04:37:49 kmacy Exp $
*/
-/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-#pragma ident "@(#)hcall.s 1.10 05/09/28 SMI"
-
-/*
- * Hypervisor calls
- */
-#define _ASM
-
+#include <sys/cdefs.h>
+
#include <machine/asm.h>
-__FBSDID("$FreeBSD: src/sys/sun4v/sun4v/hcall.S,v 1.3 2006/11/08 22:16:05 kmacy Exp $")
-
#include <machine/asi.h>
#include <machine/asmacros.h>
-#include <machine/hypervisor_api.h>
+#include <machine/hypervisorvar.h>
#include <machine/pstate.h>
#include "assym.s"
+/*
+ * Section 9 API Versioning
+ *
+ */
-#if defined(lint)
-#error lint
-#endif
-#if defined(__lint)
-#error __lint
-#endif
-#if defined(lint) || defined(__lint)
+/*
+ * request and check for a version of the hypervisor apis
+ * which may be compatible
+ *
+ * arg0 api_group (%o0)
+ * arg1 major_number (%o1)
+ * arg2 req_minor_number (%o2)
+ *
+ * ret0 status (%o0)
+ * ret1 act_minor_number (%o1)
+ *
+ */
+ENTRY(api_set_version)
+ mov API_SET_VERSION, %o5
+ ta CORE_TRAP
+ retl
+ stx %o1, [%o3]
+END(api_set_version)
-/*ARGSUSED*/
-int64_t
-hv_cnputchar(uint8_t ch)
-{ return (0); }
+/*
+ * retrieve the major and minor number of the most recently
+ * successfully negotiated API
+ *
+ * arg0 api_group (%o0)
+ *
+ * ret0 status (%o0)
+ * ret1 major_number (%o1)
+ * ret2 major_number (%o2)
+ *
+ */
+ENTRY(api_get_version)
+ mov %o2, %o4
+ mov %o1, %o3
+ mov API_GET_VERSION, %o5
+ ta CORE_TRAP
+ retl
+ stx %o1, [%o4]
+
+END(api_get_version)
+
+/*
+ * Section 10 Domain Services
+ *
+ */
-/*ARGSUSED*/
-int64_t
-hv_cngetchar(uint8_t *ch)
-{ return (0); }
+/*
+ * stop all CPUs in the virtual machine domain and place them
+ * in the stopped state
+ *
+ * arg0 exit_code (%o0)
+ *
+ */
+ENTRY(hv_mach_exit)
+ mov MACH_EXIT, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mach_exit)
+
+/*
+ * copy the most current machine description into buffer
+ * upon success or EINVAL the service returns the actual
+ * size of the machine description
+ *
+ * arg0 buffer (%o0)
+ * arg1 length (%o1)
+ *
+ * ret0 status (%o0)
+ * ret1 length (%o1)
+ *
+ */
+ENTRY(hv_mach_desc)
+ mov %o1, %o2
+ ldx [%o1], %o1
+ mov MACH_DESC, %o5
+ ta FAST_TRAP
+ retl
+ stx %o1, [%o2]
+END(hv_mach_desc)
-/*ARGSUSED*/
-uint64_t
-hv_tod_get(uint64_t *seconds)
-{ return (0); }
+/*
+ * execute a software initiated reset of a virtual machine domain
+ *
+ */
+ENTRY(hv_mach_sir)
+ mov MACH_SIR, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mach_sir)
+
+/*
+ * report the guests soft state to the hypervisor
+ *
+ * arg0 soft_state (%o0)
+ * arg1 soft_state_desc_ptr (%o1)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mach_set_soft_state)
+ mov MACH_SET_SOFT_STATE, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mach_set_soft_state)
+
+/*
+ * retrieve the current value of the guest's software state
+ *
+ * arg0 soft_desc_ptr (%o0)
+ *
+ * ret0 status (%o0)
+ * arg1 soft_state (%o1)
+ *
+ */
+ENTRY(hv_mach_get_soft_state)
+ mov %o1, %o2
+ mov MACH_SET_SOFT_STATE, %o5
+ ta FAST_TRAP
+ retl
+ stx %o1, [%o2]
+END(hv_mach_get_soft_state)
+
+/*
+ * set a watchdog timer, 0 disables, upon success
+ * time_remaining contains the time previously remaining
+ *
+ * arg0 timeout (%o0)
+ *
+ * ret0 status (%o0)
+ * ret1 time_remaining (%o1)
+ *
+ */
+ENTRY(hv_mach_watchdog)
+ mov %o1, %o2
+ mov MACH_WATCHDOG, %o5
+ ta FAST_TRAP
+ brnz,pn %o0, 1f
+ nop
+ stx %o1, [%o2]
+1: retl
+ nop
+END(hv_mach_watchdog)
+
+/*
+ * Section 11 CPU Services
+ *
+ */
-/*ARGSUSED*/
-uint64_t
-hv_tod_set(uint64_t seconds)
-{ return (0);}
+/*
+ * start CPU with id cpuid with pc in %pc and real trap base address
+ * of rtba
+ *
+ * arg0 cpuid (%o0)
+ * arg1 pc (%o1)
+ * arg2 rtba (%o2)
+ * arg3 target_arg0 (%o3)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_cpu_start)
+ mov CPU_START, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_cpu_start)
-/*ARGSUSED*/
-uint64_t
-hv_mmu_map_perm_addr(void *vaddr, int ctx, uint64_t tte, int flags)
-{ return (0); }
+/*
+ * stop CPU with id cpuid
+ *
+ * arg0 cpuid (%o0)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_cpu_stop)
+ mov CPU_STOP, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_cpu_stop)
-/*ARGSUSED*/
-uint64_t
-hv_mmu_unmap_perm_addr(void *vaddr, int ctx, int flags)
-{ return (0); }
+/*
+ * set the real trap base address of the local cpu to rtba
+ * upon success the previous_rtba contains the address of the
+ * old rtba
+ *
+ * arg0 rtba (%o0)
+ *
+ * ret0 status (%o0)
+ * ret1 previous_rtba(%o1)
+ *
+ */
+ENTRY(hv_cpu_set_rtba)
+ mov %o1, %o2
+ mov CPU_SET_RTBA, %o5
+ ta FAST_TRAP
+ retl
+ stx %o1, [%o2]
+
+END(hv_cpu_set_rtba)
-/*ARGSUSED*/
-uint64_t
-hv_set_ctx0(uint64_t ntsb_descriptor, uint64_t desc_ra)
-{ return (0); }
+/*
+ * return the current real trap base address
+ *
+ * ret0 status (%o0)
+ * ret1 rtba (%o1)
+ *
+ */
+ENTRY(hv_cpu_get_rtba)
+ mov CPU_GET_RTBA, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_cpu_get_rtba)
+
+/*
+ * suspend execution on current cpu
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_cpu_yield)
+ mov CPU_YIELD, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_cpu_yield)
-/*ARGSUSED*/
-uint64_t
-hv_set_ctxnon0(uint64_t ntsb_descriptor, uint64_t desc_ra)
-{ return (0); }
+/*
+ * configure queue of size nentries to be placed at base raddr
+ *
+ * arg0 queue (%o0)
+ * arg1 base raddr (%o1)
+ * arg2 nentries (%o2)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_cpu_qconf)
+ mov CPU_QCONF, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_cpu_qconf)
+
+/*
+ * return configuration of queue queue
+ *
+ * arg0 queue (%o0)
+ *
+ * ret0 status (%o0)
+ * ret1 base raddr (%o1)
+ * ret2 nentries (%o2)
+ *
+ */
+ENTRY(hv_cpu_qinfo)
+END(hv_cpu_qinfo)
+
+/*
+ * send cpu mondo interrupt to cpulist
+ *
+ * arg0 ncpus (%o0)
+ * arg1 cpu list ra (%o1)
+ * arg2 mondo data ra(%o2)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_cpu_mondo_send)
+ ldx [PCPU(MONDO_DATA_RA)], %o2
+ mov CPU_MONDO_SEND, %o5
+ ta FAST_TRAP
+ retl
+ membar #Sync
+END(hv_cpu_mondo_send)
-#ifdef SET_MMU_STATS
-/*ARGSUSED*/
-uint64_t
-hv_mmu_set_stat_area(uint64_t rstatarea, uint64_t size)
-{ return (0); }
-#endif /* SET_MMU_STATS */
+/*
+ * return the hypervisor id for the current cpu
+ *
+ * ret0 status (%o0)
+ * ret1 cpuid (%o1)
+ *
+ */
+ENTRY(hv_cpu_myid)
+ mov %o0, %o2
+ mov CPU_MYID, %o5
+ ta FAST_TRAP
+ stx %o1, [%o2]
+ retl
+ nop
+END(hv_cpu_myid)
-/*ARGSUSED*/
-uint64_t
-hv_cpu_qconf(int queue, uint64_t paddr, int size)
-{ return (0); }
+/*
+ * retrieve the current state of cpu cpuid
+ *
+ * arg0 cpuid (%o0)
+ *
+ * ret0 status (%o0)
+ * ret1 state (%o1)
+ *
+ */
+ENTRY(hv_cpu_state)
+ mov %o1, %o2
+ mov CPU_STATE, %o5
+ ta FAST_TRAP
+ stx %o1, [%o2]
+ retl
+ nop
+END(hv_cpu_state)
+
+/*
+ * Section 12 MMU Services
+ *
+ */
+
+/*
+ * set the tsb(s) for the current cpu for context 0
+ *
+ * arg0 ntsb (%o0)
+ * arg1 tsbdptr (%o1)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_tsb_ctx0)
+ mov MMU_TSB_CTX0, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_tsb_ctx0)
-/*ARGSUSED*/
-uint64_t
-hvio_config_get(devhandle_t dev_hdl, pci_device_t bdf,
- pci_config_offset_t off, pci_config_size_t size, pci_cfg_data_t *data_p)
-{ return (0); }
+/*
+ * set the tsb(s) for the current cpu for non-zero contexts
+ *
+ * arg0 ntsb (%o0)
+ * arg1 tsbptr (%o1)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_tsb_ctxnon0)
+ mov MMU_TSB_CTXNON0, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_tsb_ctxnon0)
-/*ARGSUSED*/
-uint64_t
-hvio_config_put(devhandle_t dev_hdl, pci_device_t bdf,
- pci_config_offset_t off, pci_config_size_t size, pci_cfg_data_t data)
-{ return (0); }
+/*
+ * demap any page mapping of virtual address vaddr in context ctx
+ *
+ * arg0 reserved (%o0)
+ * arg1 reserved (%o1)
+ * arg2 vaddr (%o2)
+ * arg3 ctx (%o3)
+ * arg4 flags (%o4)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_demap_page)
+ mov MMU_DEMAP_PAGE, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_demap_page)
-/*ARGSUSED*/
-uint64_t
-hvio_intr_devino_to_sysino(uint64_t dev_hdl, uint32_t devino, uint64_t *sysino)
-{ return (0); }
+/*
+ * demap all non-permanent virtual address mappings in context ctx
+ *
+ * arg0 reserved (%o0)
+ * arg1 reserved (%o1)
+ * arg2 ctx (%o2)
+ * arg3 flags (%o3)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_demap_ctx)
+ mov MMU_DEMAP_CTX, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_demap_ctx)
-/*ARGSUSED*/
-uint64_t
-hvio_intr_getvalid(uint64_t sysino, int *intr_valid_state)
-{ return (0); }
+/*
+ * demap all non-permanent virtual address mappings for the current
+ * virtual cpu
+ *
+ * arg0 reserved (%o0)
+ * arg1 reserved (%o1)
+ * arg2 flags (%o2)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_demap_all)
+ mov MMU_DEMAP_ALL, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_demap_all)
-/*ARGSUSED*/
-uint64_t
-hvio_intr_setvalid(uint64_t sysino, int intr_valid_state)
-{ return (0); }
+/*
+ * create a non-permanent mapping for the calling virtual cpu
+ *
+ * arg0 vaddr (%o0)
+ * arg1 context (%o1)
+ * arg2 TTE (%o2)
+ * arg3 flags (%o3)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_map_addr)
+ mov MMU_MAP_ADDR, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_map_addr)
-/*ARGSUSED*/
-uint64_t
-hvio_intr_getstate(uint64_t sysino, int *intr_state)
-{ return (0); }
+/*
+ * create a permanent mapping for the calling virtual cpu
+ *
+ * arg0 vaddr (%o0)
+ * arg1 reserved (%o1)
+ * arg2 TTE (%o2)
+ * arg3 flags (%o3)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_map_perm_addr)
+ mov MMU_MAP_PERM_ADDR, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_map_perm_addr)
-/*ARGSUSED*/
-uint64_t
-hvio_intr_setstate(uint64_t sysino, int intr_state)
-{ return (0); }
+/*
+ * demap virtual address vaddr in context ctx on current virtual cpu
+ *
+ * arg0 vaddr (%o0)
+ * arg1 ctx (%o1)
+ * arg2 flags (%o2)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_unmap_addr)
+ mov MMU_UNMAP_ADDR, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_unmap_addr)
-/*ARGSUSED*/
-uint64_t
-hvio_intr_gettarget(uint64_t sysino, uint32_t *cpuid)
-{ return (0); }
+/*
+ * demap any permanent mapping at virtual address vaddr on current virtual cpu
+ *
+ * arg0 vaddr (%o0)
+ * arg1 reserved (%o1)
+ * arg2 flags (%o2)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_unmap_perm_addr)
+ mov MMU_UNMAP_PERM_ADDR, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_unmap_perm_addr)
-/*ARGSUSED*/
-uint64_t
-hvio_intr_settarget(uint64_t sysino, uint32_t cpuid)
-{ return (0); }
+/*
+ * configure the MMU fault status area for the current virtual cpu
+ *
+ * arg0 raddr (%o0)
+ *
+ * ret0 status (%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)
-/*ARGSUSED*/
-uint64_t
-hvio_iommu_map(devhandle_t dev_hdl, tsbid_t tsbid,
- pages_t pages, io_attributes_t io_attributes,
- io_page_list_t *io_page_list_p, pages_t *pages_mapped)
-{ return (0); }
+/*
+ * enable or disable virtual address translation for the current virtual cpu
+ *
+ * arg0 enable_flag (%o0)
+ * arg1 return_target (%o1)
+ *
+ * ret0 status (%o0)
+ *
+ */
+ENTRY(hv_mmu_enable)
+ mov MMU_ENABLE, %o5
+ ta FAST_TRAP
+ retl
+ nop
+END(hv_mmu_enable)
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list