@@ -16,6 +16,7 @@ struct psw {
};
#define PSW_MASK_DAT 0x0400000000000000UL
+#define PSW_MASK_PSTATE 0x0001000000000000UL
struct lowcore {
uint8_t pad_0x0000[0x0080 - 0x0000]; /* 0x0000 */
@@ -209,4 +210,13 @@ static inline void load_psw_mask(uint64_t mask)
: "+r" (tmp) : "a" (&psw) : "memory", "cc" );
}
+static inline void enter_pstate(void)
+{
+ uint64_t mask;
+
+ mask = extract_psw_mask();
+ mask |= PSW_MASK_PSTATE;
+ load_psw_mask(mask);
+}
+
#endif
@@ -44,6 +44,13 @@ void check_pgm_int_code(uint16_t code)
static void fixup_pgm_int(void)
{
switch (lc->pgm_int_code) {
+ case PGM_INT_CODE_PRIVILEGED_OPERATION:
+ /* Normal operation is in supervisor state, so this exception
+ * was produced intentionally and we should return to the
+ * supervisor state.
+ */
+ lc->pgm_old_psw.mask &= ~PSW_MASK_PSTATE;
+ break;
case PGM_INT_CODE_SEGMENT_TRANSLATION:
case PGM_INT_CODE_PAGE_TRANSLATION:
case PGM_INT_CODE_TRACE_TABLE: