* ========== Copyright Header Begin ==========================================
* Hypervisor Software File: intr_ontario.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 "@(#)intr_ontario.s 1.43 07/05/03 SMI"
#include <sys/asm_linkage.h>
* cpu_in_error_finish - invoked from a cpu about to enter the error
* state so another cpu can finish cleaning up.
ENTRY(cpu_in_error_finish)
CPU_PUSH(%g7, %g2, %g3, %g4) ! save return address
* Send a resumable erpt to the guest. The fault cpu should have
* left a valid erpt in the current cpu's ce err buf.
add %g1, STRAND_CE_RPT, %g2
! get the error CPUID to do the necessary cleanup
lduh [%g2 + STRAND_SUN4V_ERPT + ESUN4V_G_CPUID], %g1
! get the vcpu and strand for the vcpu that took the error
sllx %g1, GUEST_VCPUS_SHIFT, %g1
add %g1, GUEST_VCPUS, %g1
ldx [%g1], %g1 ! err vcpu struct
ldx [%g1 + CPU_STRAND], %g2 ! err strand struct
! deschedule and stop the vcpu
HVCALL(desched_n_stop_vcpu)
STRAND_STRUCT(%g1) ! this strand
add %g1, STRAND_CE_RPT, %g2
HVCALL(queue_resumable_erpt)
* If the heartbeat is disabled then it was running on the failed
* cpu and needs to be restarted on this cpu.
ldx [%g2 + CONFIG_HEARTBEAT_CPU], %g2
CPU_POP(%g7, %g1, %g2, %g5)
SET_SIZE(cpu_in_error_finish)
* vdev_mondo - deliver a virtual mondo on the current cpu's
* Note: This function is called from the interrupt handler and also
! the mondo starting point.
beq,pt %xcc, hvxcall_mondo
cmp %g2, VECINTR_ERROR_XCALL
beq,pt %xcc, cpu_err_rerouted
cmp %g2, VECINTR_CPUINERR
beq,pt %xcc, cpu_in_error_finish
! XXX unclaimed interrupt
.vecintr_qfull: ! XXX need to do the right thing here