qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: of AVR target page size


From: Dr. David Alan Gilbert
Subject: Re: of AVR target page size
Date: Thu, 18 Mar 2021 10:25:28 +0000
User-agent: Mutt/2.0.5 (2021-01-21)

* Peter Maydell (peter.maydell@linaro.org) wrote:
> On Thu, 18 Mar 2021 at 10:18, Dr. David Alan Gilbert
> <dgilbert@redhat.com> wrote:
> > diff --git a/migration/ram.c b/migration/ram.c
> > index 1ee7ff9c6d..f053d45f3c 100644
> > --- a/migration/ram.c
> > +++ b/migration/ram.c
> > @@ -81,6 +81,8 @@
> >  /* 0x80 is reserved in migration.h start with 0x100 next */
> >  #define RAM_SAVE_FLAG_COMPRESS_PAGE    0x100
> >
> > +#define RAM_SAVE_FLAG__MAX RAM_SAVE_FLAG_COMPRESS_PAGE
> > +
> >  static inline bool is_zero_range(uint8_t *p, uint64_t size)
> >  {
> >      return buffer_is_zero(p, size);
> > @@ -4101,5 +4103,10 @@ static SaveVMHandlers savevm_ram_handlers = {
> >  void ram_mig_init(void)
> >  {
> >      qemu_mutex_init(&XBZRLE.lock);
> > +#ifndef TARGET_PAGE_BITS_VARY
> > +    QEMU_BUILD_BUG_ON(RAM_SAVE_FLAG__MAX >= TARGET_PAGE_SIZE);
> > +#else
> > +    QEMU_BUILD_BUG_ON(RAM_SAVE_FLAG__MAX >= (1 << TARGET_PAGE_BITS_MIN));
> > +#endif
> 
> You should just be able to check against TARGET_PAGE_BITS_MIN;
> we set that for both the TARGET_PAGE_BITS_VARY and the don't-vary
> case.

Oh yes, just:

diff --git a/migration/ram.c b/migration/ram.c
index 52537f14ac..a7269955b5 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -81,6 +81,8 @@
 /* 0x80 is reserved in migration.h start with 0x100 next */
 #define RAM_SAVE_FLAG_COMPRESS_PAGE    0x100
 
+#define RAM_SAVE_FLAG__MAX RAM_SAVE_FLAG_COMPRESS_PAGE
+
 static inline bool is_zero_range(uint8_t *p, uint64_t size)
 {
     return buffer_is_zero(p, size);
@@ -4090,5 +4092,6 @@ static SaveVMHandlers savevm_ram_handlers = {
 void ram_mig_init(void)
 {
     qemu_mutex_init(&XBZRLE.lock);
+    QEMU_BUILD_BUG_ON(RAM_SAVE_FLAG__MAX >= (1 << TARGET_PAGE_BITS_MIN));
     register_savevm_live("ram", 0, 4, &savevm_ram_handlers, &ram_state);
 }


works; lets keep that in mind somewhere after Michael fixes AVR.

Dave

> thanks
> -- PMM
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK




reply via email to

[Prev in Thread] Current Thread [Next in Thread]