Memory map and processor id updates#28
Conversation
* ski-bootloader/fw-emu.c: Configure a single contiguous block of available memory in Ski reaching from 2 to 3172 MiB. Tested to work over longer periods of time (hours) within a cluster of Ski instances building packages for EPIC Slack with distcc. Based on https://user.it.uu.se/~mpe22148/linux/patches/ia64/linux-3.13/linux-3.13-ia64-hpsim-2GB-RAM.patch by Mikael Pettersson <mikpelinux@gmail.com> Signed-off-by: Johnny Mnemonic <jm@machine-hall.org>
src/state.c: Configure own processor type for Ski So far this was configured as McKinley, but the exposed processor features (branchlong, 16-byte atomic ops) are actually on par with a Montecito (family 32) and exceed even those of a Madison (branchlong) which is a family 31/model 2 processor. Hence the naming in recent Linux kernels with Ski/HP-Sim support enabled: MonteSkito for a family 31/model 3 processor. Signed-off-by: Johnny Mnemonic <jm@machine-hall.org>
Update memory map for SkiIn v5.3 (last mainline version before Ski support was removed from Linux) the memory map (which is part of the This is from https://github.com/torvalds/linux/blob/v5.3/arch/ia64/hp/sim/boot/fw-emu.c#L336 and was like that at least since v4.19.y - the last stable kernel which still had Ski support when I started to restore it for later kernels - see https://github.com/torvalds/linux/blob/v4.19/arch/ia64/hp/sim/boot/fw-emu.c#L336 . That would be:
..., making 160 MiB in total, but with a larger than 1 GiB hole between these blocks. Here an example with v4.19.325 and extended memory map of the stock ..., see https://github.com/trofi/ski/blob/master/ski-bootloader/fw-emu.c#L315. Interestingly when running Linux inside Ski with such a memmap it considers this to be one large block: The used kernel is configured with: ...as per the corresponding For later kernels there are changes in regard to flat, discontiguous and sparse mem, e.g. since at least v6.6 we have: ..., from https://github.com/torvalds/linux/blob/v6.6/arch/ia64/Kconfig#L66 and at the same time we have - since at least v4.19.y for kernel sources with Ski support: ..., from https://github.com/torvalds/linux/blob/v4.19/arch/ia64/Kconfig#L392C1-L394C37 . Which means we can effectively only use flat mem for a Ski enabled kernel*. But since v5.11-rc1 (specifically since torvalds/linux@ea34f78) the currently used memory map is no longer allowed with flat mem: ..., see https://github.com/torvalds/linux/blob/v6.6/arch/ia64/mm/contig.c#L177C1-L187C2 . Which is why I deactivated that check in the Ski/HP-Sim restoration patches since v5.15.y. A solution to this problem w/o touching the Linux kernel code is the first commit in this PR. @mikpe in early 2014 extended the upper end of the first diff -rupN linux-3.13/arch/ia64/hp/sim/boot/fw-emu.c linux-3.13.ia64-hpsim-2GB-RAM/arch/ia64/hp/sim/boot/fw-emu.c
--- linux-3.13/arch/ia64/hp/sim/boot/fw-emu.c 2013-09-03 19:06:28.000000000 +0200
+++ linux-3.13.ia64-hpsim-2GB-RAM/arch/ia64/hp/sim/boot/fw-emu.c 2014-01-25 11:24:01.703718921 +0100
@@ -336,7 +336,7 @@ sys_fw_init (const char *args, int argle
/* simulate free memory at physical address zero */
MAKE_MD(EFI_BOOT_SERVICES_DATA, EFI_MEMORY_WB, 0*MB, 1*MB);
MAKE_MD(EFI_PAL_CODE, EFI_MEMORY_WB, 1*MB, 2*MB);
- MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, 2*MB, 130*MB);
+ MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, 2*MB, 2048*MB);
MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, 4096*MB, 4128*MB);
#else
MAKE_MD( 4, 0x9, 0x0000000000000000, 0x0000000000001000);
..., from https://user.it.uu.se/~mpe22148/linux/patches/ia64/linux-3.13/linux-3.13-ia64-hpsim-2GB-RAM.patch . I extended that to 3 GiB (actually 3172 MiB, see below) and also dropped the second We can change that to something more usual of course, but 2 MiB to 3172 MiB can be considered tested and working. *) Unless we would make Ski "support" NUMA, either for real or just pretend it would support it in the kernel config. I can imagine that both would require a considerable effort. IMHO a better use of our efforts would be to implement the missing syscalls to allow userland emulation to work with modern software, either by doing it ourselves or by trying to utilize an AI for that. |
Introduce own processor type for SkiSo far this was configured as McKinley, but the exposed processor features ( ...are actually on par with a Montecito (see e.g. http://epic-linux.org/#!machines/rx2620/index.md#Hardware_details) and exceed even those of a Madison (see http://epic-linux.org/#!machines/rx4640/index.md#Hardware_details). Montecito is actually a family 32 processor and usually a dual-core with two hardware threads per core, though single-core (most likely with one deactivated core) models w/a single hardware thread per core do exist (Itanium 2 9010). As the processor simulated in Ski is a single-core single-thread one, I configured the processor as a - non-existing in reality - family 31/model 3 processor, e.g. close to Montecito but not the same. Also I didn't find any code in Linux that handles Montecito processor family and model, maybe this is directly read from the processor. I carry an extra patch for the Ski/HP-Sim patches for Linux to handle this: As it is not a Montecito - but close - I called it the "MonteSkito". |
No description provided.