> On Jul 2, 2019, at 9:08 AM, Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote: > > On 28/06/19 22:30, Nadav Amit wrote: >> Enable to run the tests when test-device is not present (e.g., >> bare-metal). Users can provide the number of CPUs and ram size through >> kernel parameters. >> >> On Ubuntu, for example, the tests can be run by copying a test to the >> boot directory (/boot) and adding a menuentry to grub (editing >> /etc/grub.d/40_custom): >> >> menuentry 'idt_test' { >> set root='ROOT' >> multiboot BOOT_RELATIVE/idt_test.flat ignore nb_cpus=48 \ >> ram_size=4294967296 no-test-device >> } >> >> Replace ROOT with `grub-probe --target=bios_hints /boot` and >> BOOT_RELATIVE with `grub-mkrelpath /boot`, and run update-grub. >> >> Note that the first kernel parameter is ignored for compatibility with >> test executions through QEMU. >> >> Remember that the output goes to the serial port. > > RAM size can use the multiboot info (see lib/x86/setup.c). The multiboot info, as provided by the boot-loader is not good enough as far as I remember. The info just defines where to kernel can be loaded, but does not say how big the memory is. For that, e820 decoding is needed, which I was too lazy to do. > For the # of CPUs I'm not sure what you're supposed to do on bare metal > though. :) I know you are not “serious”, but I’ll use this opportunity for a small clarification. You do need to provide the real number of CPUs as otherwise things will fail. I do not use cpuid, as my machine, for example has two sockets. Decoding the ACPI tables is the right way, but I was too lazy to implement it.