@@ -346,6 +346,7 @@ typedef enum X86Seg {
#define PG_MODE_PKE (1 << 17)
#define PG_MODE_PKS (1 << 18)
#define PG_MODE_SMEP (1 << 19)
+#define PG_MODE_PG (1 << 20)
#define MCG_CTL_P (1ULL<<8) /* MCG_CAP register available */
#define MCG_SER_P (1ULL<<24) /* MCA recovery/new status bits */
@@ -94,7 +94,7 @@ static uint32_t popl(StackAccess *sa)
int get_pg_mode(CPUX86State *env)
{
- int pg_mode = 0;
+ int pg_mode = PG_MODE_PG;
if (!(env->cr[0] & CR0_PG_MASK)) {
return 0;
}
@@ -298,7 +298,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in,
/* combine pde and pte nx, user and rw protections */
ptep &= pte ^ PG_NX_MASK;
page_size = 4096;
- } else if (pg_mode) {
+ } else if (pg_mode & PG_MODE_PG) {
/*
* Page table level 2
*/