* Peter Xu (pet...@redhat.com) wrote: > Returns true for a hugetlbfs mapping, false otherwise. > > Signed-off-by: Peter Xu <pet...@redhat.com>
Yeh OK, it feels a little delecate perhaps if anything else ever allows large mappings. Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > --- > include/exec/cpu-common.h | 1 + > softmmu/physmem.c | 5 +++++ > 2 files changed, 6 insertions(+) > > diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h > index 6feaa40ca7..94452aa17f 100644 > --- a/include/exec/cpu-common.h > +++ b/include/exec/cpu-common.h > @@ -95,6 +95,7 @@ void qemu_ram_unset_migratable(RAMBlock *rb); > int qemu_ram_get_fd(RAMBlock *rb); > > size_t qemu_ram_pagesize(RAMBlock *block); > +bool qemu_ram_is_hugetlb(RAMBlock *rb); > size_t qemu_ram_pagesize_largest(void); > > /** > diff --git a/softmmu/physmem.c b/softmmu/physmem.c > index edec095c7a..a4fb129d8f 100644 > --- a/softmmu/physmem.c > +++ b/softmmu/physmem.c > @@ -1798,6 +1798,11 @@ size_t qemu_ram_pagesize(RAMBlock *rb) > return rb->page_size; > } > > +bool qemu_ram_is_hugetlb(RAMBlock *rb) > +{ > + return rb->page_size > qemu_real_host_page_size(); > +} > + > /* Returns the largest size of page in use */ > size_t qemu_ram_pagesize_largest(void) > { > -- > 2.37.3 > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK