mirror of
https://github.com/qemu/qemu.git
synced 2026-04-05 21:46:25 +00:00
page-vary: Build set_preferred_target_page_bits as common code
Use target_info->page_bits_vary to merge set_preferred_target_page_bits_common into set_preferred_target_page_bits in page-vary-common.c. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260217095106.598486-5-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
bd2ecc733a
commit
79674d07d4
@@ -41,7 +41,6 @@ typedef struct {
|
||||
} TargetPageBits;
|
||||
|
||||
#ifdef IN_PAGE_VARY
|
||||
bool set_preferred_target_page_bits_common(int bits);
|
||||
void finalize_target_page_bits_common(int min);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -20,25 +20,32 @@
|
||||
#define IN_PAGE_VARY 1
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/target-info-impl.h"
|
||||
#include "exec/page-vary.h"
|
||||
|
||||
/* WARNING: This file must *not* be complied with -flto. */
|
||||
|
||||
TargetPageBits target_page;
|
||||
|
||||
bool set_preferred_target_page_bits_common(int bits)
|
||||
bool set_preferred_target_page_bits(int bits)
|
||||
{
|
||||
/*
|
||||
* The target page size is the lowest common denominator for all
|
||||
* the CPUs in the system, so we can only make it smaller, never
|
||||
* larger. And we can't make it smaller once we've committed to
|
||||
* a particular size.
|
||||
*/
|
||||
if (target_page.bits == 0 || target_page.bits > bits) {
|
||||
if (target_page.decided) {
|
||||
return false;
|
||||
const TargetInfo *ti = target_info();
|
||||
|
||||
assert(bits >= TARGET_PAGE_BITS_MIN);
|
||||
if (ti->page_bits_vary) {
|
||||
|
||||
/*
|
||||
* The target page size is the lowest common denominator for all
|
||||
* the CPUs in the system, so we can only make it smaller, never
|
||||
* larger. And we can't make it smaller once we've committed to
|
||||
* a particular size.
|
||||
*/
|
||||
if (target_page.bits == 0 || target_page.bits > bits) {
|
||||
if (target_page.decided) {
|
||||
return false;
|
||||
}
|
||||
target_page.bits = bits;
|
||||
}
|
||||
target_page.bits = bits;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,16 +39,6 @@ int migration_legacy_page_bits(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
bool set_preferred_target_page_bits(int bits)
|
||||
{
|
||||
assert(bits >= TARGET_PAGE_BITS_MIN);
|
||||
#ifdef TARGET_PAGE_BITS_VARY
|
||||
return set_preferred_target_page_bits_common(bits);
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void finalize_target_page_bits(void)
|
||||
{
|
||||
#ifndef TARGET_PAGE_BITS_VARY
|
||||
|
||||
Reference in New Issue
Block a user