]> xenbits.xensource.com Git - xen.git/commitdiff
x86/HVM: get_pat_flags() is needed only by shadow code
authorJan Beulich <jbeulich@suse.com>
Wed, 31 Jul 2024 10:40:19 +0000 (12:40 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 31 Jul 2024 10:40:19 +0000 (12:40 +0200)
Therefore with SHADOW_PAGING=n this is better compiled out, to avoid
leaving around unreachable/dead code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/hvm/mtrr.c

index 4620ed427cba2e784cb2bf10f5c69a5ad2a826b6..797f2ae7fd3a4ac73e3ed86748cbf1572a07e414 100644 (file)
@@ -271,6 +271,8 @@ int mtrr_get_type(const struct mtrr_state *m, paddr_t pa, unsigned int order)
    return overlap_mtrr_pos;
 }
 
+#ifdef CONFIG_SHADOW_PAGING
+
 /*
  * return the memory type from PAT.
  * NOTE: valid only when paging is enabled.
@@ -359,6 +361,8 @@ uint32_t get_pat_flags(struct vcpu *v,
     return pat_type_2_pte_flags(pat_entry_value);
 }
 
+#endif /* CONFIG_SHADOW_PAGING */
+
 static inline bool valid_mtrr_type(uint8_t type)
 {
     switch ( type )