Re: [PATCH v1 4/5] util: add qemu_get_host_physmem utility function

2020-07-21 Thread Alex Bennée
Richard Henderson writes: > On 7/17/20 3:51 AM, Alex Bennée wrote: >> +size_t qemu_get_host_physmem(void) >> +{ >> +#ifdef _SC_PHYS_PAGES >> +long pages = sysconf(_SC_PHYS_PAGES); >> +if (pages > 0) { >> +return pages * qemu_real_host_page_size; >> +} >> +#endif >> +retu

Re: [PATCH v1 4/5] util: add qemu_get_host_physmem utility function

2020-07-21 Thread Alex Bennée
Richard Henderson writes: > On 7/17/20 7:24 AM, Christian Ehrhardt wrote: >> > +size_t qemu_get_host_physmem(void) >> > +{ >> > +#ifdef _SC_PHYS_PAGES >> > +long pages = sysconf(_SC_PHYS_PAGES); >> > +if (pages > 0) { >> > +return pages * qemu_real_host_p

Re: [PATCH v1 4/5] util: add qemu_get_host_physmem utility function

2020-07-17 Thread Richard Henderson
On 7/17/20 3:51 AM, Alex Bennée wrote: > +size_t qemu_get_host_physmem(void) > +{ > +#ifdef _SC_PHYS_PAGES > +long pages = sysconf(_SC_PHYS_PAGES); > +if (pages > 0) { > +return pages * qemu_real_host_page_size; > +} > +#endif > +return 0; > +} Is it worth examining our own

Re: [PATCH v1 4/5] util: add qemu_get_host_physmem utility function

2020-07-17 Thread Richard Henderson
On 7/17/20 7:24 AM, Christian Ehrhardt wrote: > > +size_t qemu_get_host_physmem(void) > > +{ > > +#ifdef _SC_PHYS_PAGES > > +    long pages = sysconf(_SC_PHYS_PAGES); > > +    if (pages > 0) { > > +        return pages * qemu_real_host_page_size; > > The Linux man page

Re: [PATCH v1 4/5] util: add qemu_get_host_physmem utility function

2020-07-17 Thread Christian Ehrhardt
On Fri, Jul 17, 2020 at 3:32 PM BALATON Zoltan wrote: > On Fri, 17 Jul 2020, Alex Bennée wrote: > > This will be used in a future patch. For POSIX systems _SC_PHYS_PAGES > > isn't standardised but at least appears in the man pages for > > Open/FreeBSD. The result is advisory so any users of it sh

Re: [PATCH v1 4/5] util: add qemu_get_host_physmem utility function

2020-07-17 Thread BALATON Zoltan
On Fri, 17 Jul 2020, Alex Bennée wrote: This will be used in a future patch. For POSIX systems _SC_PHYS_PAGES isn't standardised but at least appears in the man pages for Open/FreeBSD. The result is advisory so any users of it shouldn't just fail if we can't work it out. The win32 stub currently

[PATCH v1 4/5] util: add qemu_get_host_physmem utility function

2020-07-17 Thread Alex Bennée
This will be used in a future patch. For POSIX systems _SC_PHYS_PAGES isn't standardised but at least appears in the man pages for Open/FreeBSD. The result is advisory so any users of it shouldn't just fail if we can't work it out. The win32 stub currently returns 0 until someone with a Windows sy