/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* 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
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/amd_iommu.h>
#include "amd_iommu_impl.h"
#include "amd_iommu_log.h"
static const char *
{
const char *hwerr;
switch (type) {
case 0:
hwerr = "Reserved";
break;
case 1:
hwerr = "Master Abort";
break;
case 2:
hwerr = "Target Abort";
break;
case 3:
hwerr = "Data Error";
break;
default:
hwerr = "Unknown";
break;
}
return (hwerr);
}
const char *
{
const char *illreq;
switch (type) {
case 0:
"Read or Non-posted Write in INTR Range";
break;
case 1:
"while V=1 && TV=0" :
"Pre-translated transaction from device with I=0 or V=0";
break;
case 2:
"Port-IO transaction for device with IoCtl = 00b";
break;
case 3:
"Posted write to SysMgt with device SysMgt=00b "
"OR SysMgt=10b && message not INTx "
"OR Posted write to addr transaltion range with "
"HtAtsResv=1";
break;
case 4:
"Read request or non-posted write in SysMgt with "
"device SysMgt=10b or 0xb"
"OR Read request or non-posted write in "
"addr translation range with HtAtsResv=1";
break;
case 5:
"for device that has IntCtl=00b";
break;
case 6:
"Posted write to reserved Interrupt Address Range";
break;
case 7:
"transaction to SysMgt when SysMgt=11b OR "
"transaction to Port-IO when IoCtl=10b while "
"while V=1 TV=0";
break;
default:
illreq = "Unknown error";
break;
}
return (illreq);
}
static void
{
uint8_t I;
const char *f = "devtab_illegal_entry";
"deviceid=%u, %s request, %s %s transaction, %s request, "
"virtual address = %p",
I == 1 ? "Interrupt" : "Memory",
}
static void
{
uint8_t I;
const char *f = "io_page_fault";
"deviceid=%u, %s request, %s, %s permissions, %s transaction, "
"%s, %s request, domainid=%u, virtual address = %p",
"Page not present or Interrupt Blocked",
I == 1 ? "Interrupt" : "Memory",
}
static void
{
uint8_t I;
const char *hwerr;
const char *f = "devtab_hw_error";
"deviceid=%u, HW error type: %s, %s request, %s transaction, "
"%s request, physical address = %p",
I == 1 ? "Interrupt" : "Memory",
}
static void
{
uint8_t I;
const char *hwerr;
const char *f = "pgtable_hw_error";
"deviceid=%u, HW error type: %s, %s request, %s transaction, "
"%s request, domainid=%u, physical address = %p",
I == 1 ? "Interrupt" : "Memory",
}
static void
{
const char *f = "cmdbuf_illegal_cmd";
"command physical address = %p",
}
static void
{
const char *hwerr;
const char *f = "cmdbuf_hw_error";
"HW error type = %s, command buffer physical address = %p",
}
static void
{
const char *hwerr;
const char *f = "iotlb_inval_to";
/*
* XXX bug in spec. Is the type field available +04 26:25 or is
* it reserved
*/
"IOTLB invalidation Timeout. "
"HW error type = %s, invalidation command physical address = %p",
}
static void
{
const char *reqerr;
const char *f = "device_illegal_req";
"Illegal Device Request. "
"Illegal Request type = %s, %s request, address accessed = %p",
}
static void
{
int i;
const char *f = "amd_iommu_process_one_event";
for (i = 0; i < 4; i++) {
}
switch (event_type) {
break;
break;
break;
break;
break;
break;
break;
break;
default:
break;
}
}
int
{
/* XXX verify */
if (op == AMD_IOMMU_LOG_DISCARD) {
/*LINTED*/
return (DDI_SUCCESS);
}
/*LINTED*/
while (1) {
break;
(void *)(uintptr_t)evtail_off,
(void *)iommu->aiomt_event_head,
(void *)evtail);
/*
* Update the head pointer in soft state
* and the head pointer register
*/
/* wraparound */
/*LINTED*/
evhead_off = 0;
} else {
/*LINTED*/
- iommu->aiomt_eventlog;
}
}
return (DDI_SUCCESS);
}