On Sun, Feb 13, 2022 at 7:46 PM Peter Maydell <peter.maydell@xxxxxxxxxx> wrote: > > On Sun, 13 Feb 2022 at 10:22, Marc Zyngier <maz@xxxxxxxxxx> wrote: > > > > [+ Alex for HVF] > > > > On Sun, 13 Feb 2022 05:05:33 +0000, > > Akihiko Odaki <akihiko.odaki@xxxxxxxxx> wrote: > > > Hi, > > > This breaks in a case where highmem is disabled but can have more than > > > 4 GiB of RAM. M1 (Apple Silicon) actually can have 36-bit PA with HVF, > > > which is not enough for highmem MMIO but is enough to contain 32 GiB > > > of RAM. > > > > Funny. The whole point of this series is to make it all work correctly > > on M1. > > > > > Where the magic number of 4 GiB / 32-bit came from? > > > > Not exactly a magic number. From QEMU's docs/system/arm/virt.rst: > > > > <quote> > > highmem > > Set ``on``/``off`` to enable/disable placing devices and RAM in physical > > address space above 32 bits. The default is ``on`` for machine types > > later than ``virt-2.12``. > > </quote> > > > > TL;DR: Removing the bogus 'highmem=off' option from your command-line > > should get you going with large memory spaces, up to the IPA limit. > > Yep. I've tested this with hvf, and we now correctly: > * refuse to put RAM above 32-bits if you asked for a 32-bit > IPA space with highmem=off > * use the full 36-bit address space if you don't say highmem=off > on an M1 > > Note that there is a macos bug where if you don't say highmem=off > on an M1 Pro then you'll get a macos kernel panic. M1 non-Pro is fine. > > thanks > -- PMM I found that it actually gets the available PA bit of the emulated CPU when highmem=on. I used "cortex-a72", which can have more than 36 bits. I just simply switched to "host"; hvf didn't support "host" when I set up my VM but now it does. Thanks for your prompt replies. Regards, Akihiko Odaki