From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>,
"George Dunlap" <george.dunlap@citrix.com>,
"Tim Deegan" <tim@xen.org>
Subject: [PATCH 6/8] x86/shadow: drop CONFIG_HVM conditionals from sh_update_cr3()
Date: Tue, 26 Jul 2022 18:06:25 +0200 [thread overview]
Message-ID: <03ef104f-91a5-596b-235d-1a0fa47963e4@suse.com> (raw)
In-Reply-To: <3fdfad2a-7891-0b08-5541-3b226e0555e1@suse.com>
Now that we're not building multi.c anymore for 2 and 3 guest levels
when !HVM, there's no point in having these conditionals anymore. (As
somewhat a special case, the last of the removed conditionals really
builds on shadow_mode_external() always returning false when !HVM.) This
way the code becomes a tiny bit more readable.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3228,7 +3228,7 @@ static void cf_check sh_update_cr3(struc
{
struct domain *d = v->domain;
mfn_t gmfn;
-#if GUEST_PAGING_LEVELS == 3 && defined(CONFIG_HVM)
+#if GUEST_PAGING_LEVELS == 3
const guest_l3e_t *gl3e;
unsigned int i, guest_idx;
#endif
@@ -3279,7 +3279,7 @@ static void cf_check sh_update_cr3(struc
#endif
gmfn = pagetable_get_mfn(v->arch.guest_table);
-#if GUEST_PAGING_LEVELS == 3 && defined(CONFIG_HVM)
+#if GUEST_PAGING_LEVELS == 3
/*
* On PAE guests we don't use a mapping of the guest's own top-level
* table. We cache the current state of that table and shadow that,
@@ -3321,8 +3321,6 @@ static void cf_check sh_update_cr3(struc
!VM_ASSIST(d, m2p_strict) )
fill_ro_mpt(smfn);
}
-#elif !defined(CONFIG_HVM)
- ASSERT_UNREACHABLE();
#elif GUEST_PAGING_LEVELS == 3
/* PAE guests have four shadow_table entries, based on the
* current values of the guest's four l3es. */
@@ -3373,8 +3371,6 @@ static void cf_check sh_update_cr3(struc
#error This should never happen
#endif
-
-#ifdef CONFIG_HVM
///
/// v->arch.paging.shadow.l3table
///
@@ -3400,7 +3396,6 @@ static void cf_check sh_update_cr3(struc
}
}
#endif /* SHADOW_PAGING_LEVELS == 3 */
-#endif /* CONFIG_HVM */
///
/// v->arch.cr3
@@ -3419,8 +3414,6 @@ static void cf_check sh_update_cr3(struc
}
#endif
-
-#ifdef CONFIG_HVM
///
/// v->arch.hvm.hw_cr[3]
///
@@ -3437,7 +3430,6 @@ static void cf_check sh_update_cr3(struc
#endif
hvm_update_guest_cr3(v, noflush);
}
-#endif /* CONFIG_HVM */
/* Fix up the linear pagetable mappings */
sh_update_linear_entries(v);
next prev parent reply other threads:[~2022-07-26 16:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-26 15:58 [PATCH 0/8] x86: XSA-40{1,2,8} follow-up Jan Beulich
2022-07-26 16:03 ` [PATCH 1/8] x86/shadow: drop shadow_prepare_page_type_change()'s 3rd parameter Jan Beulich
2022-07-27 9:25 ` Andrew Cooper
2022-07-26 16:04 ` [PATCH 2/8] x86/shadow: properly handle get_page() failing Jan Beulich
2022-07-27 12:46 ` Andrew Cooper
2022-07-27 12:53 ` Jan Beulich
2022-07-27 19:06 ` Andrew Cooper
2022-07-28 6:12 ` Jan Beulich
2022-07-26 16:04 ` [PATCH 3/8] mm: enforce return value checking on get_page() Jan Beulich
2022-07-26 17:32 ` Julien Grall
2022-07-26 16:05 ` [PATCH 4/8] x86/shadow: exclude HVM-only code from sh_remove_shadows() when !HVM Jan Beulich
2022-07-27 12:55 ` Andrew Cooper
2022-07-26 16:05 ` [PATCH 5/8] x86/shadow: don't open-code shadow_remove_all_shadows() Jan Beulich
2022-07-27 12:56 ` Andrew Cooper
2022-07-26 16:06 ` Jan Beulich [this message]
2022-07-27 12:57 ` [PATCH 6/8] x86/shadow: drop CONFIG_HVM conditionals from sh_update_cr3() Andrew Cooper
2022-07-26 16:06 ` [PATCH 7/8] x86/mm: adjust type check around _get_page_type()'s TLB flush Jan Beulich
2022-07-27 18:25 ` Andrew Cooper
2022-07-28 6:16 ` Jan Beulich
2022-08-12 8:51 ` Jan Beulich
2022-07-26 16:07 ` [PATCH 8/8] x86/mm: re-arrange " Jan Beulich
2022-07-27 18:31 ` Andrew Cooper
2022-07-28 6:20 ` Jan Beulich
2022-07-30 20:28 ` [PATCH 0/8] x86: XSA-40{1,2,8} follow-up Tim Deegan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=03ef104f-91a5-596b-235d-1a0fa47963e4@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=roger.pau@citrix.com \
--cc=tim@xen.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.