xm trigger command sometimes causes an unexpected domain panic.
There are several symptoms:
* Guest nested fault (INIT handler runs with vpsr.cpl != 0)
* Interrupt when IC=0
* Unexpected virtual <--> physical mode transition
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
#include <asm/vmx_platform.h>
#include <asm/viosapic.h>
#include <asm/vlsapic.h>
+#include <asm/vmx_phy_mode.h>
#include <asm/linux/jiffies.h>
#include <xen/domain.h>
#include <asm/hvm/support.h>
* To inject INIT to guest, we must set the PAL_INIT entry
* and set psr to switch to physical mode
*/
-#define PAL_INIT_ENTRY 0x80000000ffffffa0
#define PSR_SET_BITS (IA64_PSR_DT | IA64_PSR_IT | IA64_PSR_RT | \
- IA64_PSR_IC | IA64_PSR_RI)
+ IA64_PSR_IC | IA64_PSR_RI | IA64_PSR_I | IA64_PSR_CPL)
static void vmx_inject_guest_pal_init(VCPU *vcpu)
{
switch_mm_mode(VCPU *vcpu, IA64_PSR old_psr, IA64_PSR new_psr)
{
int act;
- act = mm_switch_action(old_psr, new_psr);
+ /* Switch to physical mode when injecting PAL_INIT */
+ if (unlikely(MODE_IND(new_psr) == 0 &&
+ vcpu_regs(vcpu)->cr_iip == PAL_INIT_ENTRY))
+ act = SW_2P_DT;
+ else
+ act = mm_switch_action(old_psr, new_psr);
perfc_incra(vmx_switch_mm_mode, act);
switch (act) {
case SW_2P_DT:
#define VMX_MMU_PHY_D 1 /* Half physical: it=1,dt=0 */
#define VMX_MMU_PHY_DT 3 /* Full physical mode: it=0,dt=0 */
+#define PAL_INIT_ENTRY 0x80000000ffffffa0
+
#endif /* _PHY_MODE_H_ */