From: Andrew Cooper Date: Fri, 1 Mar 2024 21:07:13 +0000 (+0000) Subject: test-nmi-ts-priv: Update to avoid using test_wants_user_mappings X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1b8bacb5a67e81835b0196173ea587329e45b4d1;p=xtf.git test-nmi-ts-priv: Update to avoid using test_wants_user_mappings user_inject_nmi() was already __user_text. The only other thing needing fixing is the mapping of the APIC MMIO window, so do that explicitly. No change in test behaviour. Signed-off-by: Andrew Cooper --- diff --git a/tests/nmi-taskswitch-priv/main.c b/tests/nmi-taskswitch-priv/main.c index 1bc2756..b2e43f9 100644 --- a/tests/nmi-taskswitch-priv/main.c +++ b/tests/nmi-taskswitch-priv/main.c @@ -33,8 +33,6 @@ const char test_title[] = "Test nmi-taskswitch-priv"; -bool test_wants_user_mappings = true; - static uint8_t nmi_stack[PAGE_SIZE] __page_aligned_bss; void entry_NMI_task(void); @@ -125,6 +123,12 @@ void test_main(void) if ( rc ) return xtf_error("Error: Unable to set up xapic mode: %d\n", rc); + /* + * Remap the Local APIC MMIO window as USER, so user_inject_nmi() can send + * a self-NMI. No INVLPG, as this is a strict relaxing of permissions. + */ + pae_l2_identmap[APIC_DEFAULT_BASE >> PAE_L2_PT_SHIFT] |= _PAGE_USER; + /* * Set up NMI handling to be a task gate. */