mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 11:53:53 -06:00
page-vary: Move and rename qemu_target_page_bits_min
Rename to migration_legacy_page_bits, to make it clear that we cannot change the value without causing a migration break. Move to page-vary.h and page-vary-target.c. Define via TARGET_PAGE_BITS if not TARGET_PAGE_BITS_VARY. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
6effa87475
commit
12eeb04ab4
5 changed files with 21 additions and 9 deletions
|
@ -49,4 +49,13 @@ bool set_preferred_target_page_bits(int bits);
|
||||||
*/
|
*/
|
||||||
void finalize_target_page_bits(void);
|
void finalize_target_page_bits(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* migration_legacy_page_bits
|
||||||
|
*
|
||||||
|
* For migration compatibility with qemu v2.9, prior to the introduction
|
||||||
|
* of the configuration/target-page-bits section, return the value of
|
||||||
|
* TARGET_PAGE_BITS that the target had then.
|
||||||
|
*/
|
||||||
|
int migration_legacy_page_bits(void);
|
||||||
|
|
||||||
#endif /* EXEC_PAGE_VARY_H */
|
#endif /* EXEC_PAGE_VARY_H */
|
||||||
|
|
|
@ -63,7 +63,6 @@ static inline int qemu_target_page_bits(void)
|
||||||
return TARGET_PAGE_BITS;
|
return TARGET_PAGE_BITS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qemu_target_page_bits_min(void);
|
|
||||||
size_t qemu_target_pages_to_MiB(size_t pages);
|
size_t qemu_target_pages_to_MiB(size_t pages);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include "system/cpus.h"
|
#include "system/cpus.h"
|
||||||
#include "system/memory.h"
|
#include "system/memory.h"
|
||||||
#include "exec/target_page.h"
|
#include "exec/target_page.h"
|
||||||
|
#include "exec/page-vary.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
#include "qemu/iov.h"
|
#include "qemu/iov.h"
|
||||||
#include "qemu/job.h"
|
#include "qemu/job.h"
|
||||||
|
@ -339,7 +340,7 @@ static int configuration_pre_load(void *opaque)
|
||||||
* predates the variable-target-page-bits support and is using the
|
* predates the variable-target-page-bits support and is using the
|
||||||
* minimum possible value for this CPU.
|
* minimum possible value for this CPU.
|
||||||
*/
|
*/
|
||||||
state->target_page_bits = qemu_target_page_bits_min();
|
state->target_page_bits = migration_legacy_page_bits();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,8 +463,7 @@ static const VMStateInfo vmstate_info_capability = {
|
||||||
*/
|
*/
|
||||||
static bool vmstate_target_page_bits_needed(void *opaque)
|
static bool vmstate_target_page_bits_needed(void *opaque)
|
||||||
{
|
{
|
||||||
return qemu_target_page_bits()
|
return qemu_target_page_bits() > migration_legacy_page_bits();
|
||||||
> qemu_target_page_bits_min();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const VMStateDescription vmstate_target_page_bits = {
|
static const VMStateDescription vmstate_target_page_bits = {
|
||||||
|
|
|
@ -9,11 +9,6 @@
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "exec/target_page.h"
|
#include "exec/target_page.h"
|
||||||
|
|
||||||
int qemu_target_page_bits_min(void)
|
|
||||||
{
|
|
||||||
return TARGET_PAGE_BITS_MIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Convert target pages to MiB (2**20). */
|
/* Convert target pages to MiB (2**20). */
|
||||||
size_t qemu_target_pages_to_MiB(size_t pages)
|
size_t qemu_target_pages_to_MiB(size_t pages)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,6 +23,15 @@
|
||||||
#include "exec/page-vary.h"
|
#include "exec/page-vary.h"
|
||||||
#include "exec/target_page.h"
|
#include "exec/target_page.h"
|
||||||
|
|
||||||
|
int migration_legacy_page_bits(void)
|
||||||
|
{
|
||||||
|
#ifdef TARGET_PAGE_BITS_VARY
|
||||||
|
return TARGET_PAGE_BITS_MIN;
|
||||||
|
#else
|
||||||
|
return TARGET_PAGE_BITS;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool set_preferred_target_page_bits(int bits)
|
bool set_preferred_target_page_bits(int bits)
|
||||||
{
|
{
|
||||||
#ifdef TARGET_PAGE_BITS_VARY
|
#ifdef TARGET_PAGE_BITS_VARY
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue