* ========== Copyright Header Begin ==========================================
* Hypervisor Software File: traps_common.s
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* - Do no alter or remove copyright notices
* - Redistribution and use of this software in source and binary forms, with
* or without modification, are permitted provided that the following
* - Redistribution of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistribution 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.
* Neither the name of Sun Microsystems, Inc. or the names of contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
* MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
* OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
* FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* You acknowledge that this software is not designed, licensed or
* intended for use in the design, construction, operation or maintenance of
* ========== Copyright Header End ============================================
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
.ident "@(#)traps_common.s 1.2 07/05/24 SMI"
#include <sys/asm_linkage.h>
* nonresumable_error_trap - enter a guest on the non-resumable error
* The processor does not detect nrq head != tail, any places
* that possibly enqueue a nr error queue entry must check head != tail and
ENTRY(nonresumable_error_trap)
! ensure that there is an outbound queue
ldx [%g1 + CPU_ERRQNR_BASE_RA], %g2 ! get q base
brnz %g2, 1f ! if base RA is zero, skip
! The nonresumable error queue is not allocated/initialized
HVABORT(-1, "nonresumable_error_trap: nrq missing\r\n")
REVECTOR(TT_NONRESUMABLE_ERR)
SET_SIZE(nonresumable_error_trap)
* watchdog - enter a guest on the watchdog trap vector
/* XXX hypervisor_fatal */
set (LSUCR_DM | LSUCR_IM), %g2
andn %g1, %g2, %g1 ! disable MMU
! Get real-mode trap table base address
ldx [%g1 + CPU_RTBA], %g1
add %g1, (TT_WDR << TT_OFFSET_SHIFT), %g1
/* XXX for now just go to the guest since that tends
* to be what we are debugging */
* xir - enter the guest on the xir trap vector
* XXX - for now just go to the guest since that tends
* to be what we are debugging
wrhpr %g7, HPSTATE_RED, %hpstate
set (LSUCR_DM | LSUCR_IM), %g2
andn %g1, %g2, %g1 ! disable MMU
! Get real-mode trap table base address
ldx [%g1 + CPU_RTBA], %g1
add %g1, (TT_XIR << TT_OFFSET_SHIFT), %g1
* This gives greater visibility into what's happening on debug