microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.23k stars 808 forks source link

Emulate PMEM on WSL 2 #7074

Open chriptus13 opened 3 years ago

chriptus13 commented 3 years ago

I'm following https://pmem.io/2016/02/22/pm-emulation.html in order to emulate persistent memory. When it comes to reserve a memory region for pmem device on GRUB configuration I understand WSL doesn't have control over the RAM but is there any other way I can do to emulate the device?

therealkenc commented 3 years ago

I tried .wslconfig but no dice.

image

Was worth a try anyway. Curiously enough PMEM is compiled into the kernel.

image

OneBlue commented 3 years ago

@therealkenc: Can you share the debugConsole output with the pmem option ? I'm guessing this is causing a boot failure

therealkenc commented 3 years ago

Here is the gist. Executive summary:

[    2.352572] Kernel panic - not syncing: Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce buffer

Full disclosure, that base address of 4G I picked out of thin air, just because that's where memory starts. Whether it is a good or even appropriate address is (at best) questionable. It was just what I tried. That fail above is almost certainly "by design".

The OP question is really "How do I PMEM?" or in the alternative interpretation "Feature request: support PMEM".

Deadpoolmine commented 1 year ago

@therealkenc Hey, you can follow https://kb.pmem.io/howto/100000012-How-To-Emulate-Persistent-Memory-using-the-Linux-memmapKernel-Option/ to determine the memmap args. However, though I boot the system successfully, I still cannot get the pmem under /dev.