patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [PATCH 1/2] host/rootfs: use initramfs in "make run"
@ 2022-09-01 10:46 Alyssa Ross
  2022-09-01 10:46 ` [PATCH 2/2] host/rootfs: remove kernel override Alyssa Ross
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Alyssa Ross @ 2022-09-01 10:46 UTC (permalink / raw)
  To: devel; +Cc: José Pekkarinen

This will allow us to stop compiling e.g. the virtio-blk module into
the kernel, because it will be loaded by the initramfs.

This introduces some duplication between the rootfs and initramfs's
Makefiles.  I don't think it's worth the effort at the moment to try
to reduce that, because it would come at the expense of additional
complexity in the Makefiles.  We can revisit this later if we want to.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
 host/rootfs/Makefile  | 32 ++++++++++++++++++++++++++++----
 host/rootfs/shell.nix | 10 ++++++++--
 2 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile
index 41cf87c..31f76d2 100644
--- a/host/rootfs/Makefile
+++ b/host/rootfs/Makefile
@@ -6,6 +6,9 @@
 # QEMU_KVM = qemu-system-x86_64 -enable-kvm.
 QEMU_KVM = qemu-kvm
 
+SCRIPTS = ../../scripts
+VERITYSETUP = veritysetup
+
 # tar2ext4 will leave half a filesystem behind if it's interrupted
 # half way through.
 build/rootfs.ext4: build/rootfs.tar
@@ -116,16 +119,37 @@ clean:
 	rm -rf build
 .PHONY: clean
 
-run: build/rootfs.ext4 $(EXT_FS)
+# veritysetup format produces two files, but Make only (portably)
+# supports one output per rule, so we combine the two outputs then
+# define two more rules to separate them again.
+build/rootfs.verity: build/rootfs.ext4
+	$(VERITYSETUP) format build/rootfs.ext4 build/rootfs.verity.superblock.tmp \
+	    | awk -F ':[[:blank:]]*' '$$1 == "Root hash" {print $$2; exit}' \
+	    > build/rootfs.verity.roothash.tmp
+	cat build/rootfs.verity.roothash.tmp build/rootfs.verity.superblock.tmp \
+	    > $@
+	rm build/rootfs.verity.roothash.tmp build/rootfs.verity.superblock.tmp
+build/rootfs.verity.roothash: build/rootfs.verity
+	head -n 1 build/rootfs.verity > $@
+build/rootfs.verity.superblock: build/rootfs.verity
+	tail -n +2 build/rootfs.verity > $@
+
+build/live.img: $(SCRIPTS)/format-uuid.sh $(SCRIPTS)/make-gpt.sh build/rootfs.verity.superblock build/rootfs.verity.roothash build/rootfs.ext4
+	$(SCRIPTS)/make-gpt.sh $@.tmp \
+	    build/rootfs.verity.superblock:2c7357ed-ebd2-46d9-aec1-23d437ec2bf5:$$($(SCRIPTS)/format-uuid.sh "$$(dd if=build/rootfs.verity.roothash bs=32 skip=1 count=1 status=none)") \
+	    build/rootfs.ext4:4f68bce3-e8cd-4db1-96e7-fbcaf984b709:$$($(SCRIPTS)/format-uuid.sh "$$(head -c 32 build/rootfs.verity.roothash)")
+	mv $@.tmp $@
+
+run: build/live.img $(EXT_FS) build/rootfs.verity.roothash
 	$(QEMU_KVM) -cpu host -m 2G \
-	    -machine q35,kernel=$(KERNEL),kernel-irqchip=split \
+	    -machine q35,kernel=$(KERNEL),kernel-irqchip=split,initrd=$(INITRAMFS) \
 	    -display gtk,gl=on \
 	    -qmp unix:vmm.sock,server,nowait \
 	    -monitor vc \
 	    -parallel none \
-	    -drive file=build/rootfs.ext4,if=virtio,format=raw,readonly=on \
+	    -drive file=build/live.img,if=virtio,format=raw,readonly=on \
 	    -drive file=$(EXT_FS),if=virtio,format=raw,readonly=on \
-	    -append "console=ttyS0 root=/dev/vda ext=/dev/vdb intel_iommu=on" \
+	    -append "console=ttyS0 roothash=$$(< build/rootfs.verity.roothash) ext=/dev/vdb intel_iommu=on" \
 	    -device intel-iommu,intremap=on \
 	    -device virtio-vga-gl \
 	    -device vhost-vsock-pci,guest-cid=3
diff --git a/host/rootfs/shell.nix b/host/rootfs/shell.nix
index 3b2310f..fe9df1b 100644
--- a/host/rootfs/shell.nix
+++ b/host/rootfs/shell.nix
@@ -1,18 +1,24 @@
 # SPDX-License-Identifier: MIT
 # SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>
+# SPDX-FileCopyrightText: 2022 Unikie
 
 { pkgs ? import <nixpkgs> {} }:
 
+let
+  rootfs = import ./. { inherit pkgs; };
+in
+
 with pkgs;
 
-(import ./. { inherit pkgs; }).overrideAttrs (
+rootfs.overrideAttrs (
 { passthru ? {}, nativeBuildInputs ? [], ... }:
 
 {
   nativeBuildInputs = nativeBuildInputs ++ [
-    jq netcat qemu_kvm reuse util-linux
+    cryptsetup jq netcat qemu_kvm reuse util-linux
   ];
 
   EXT_FS = pkgsStatic.callPackage ../initramfs/extfs.nix { inherit pkgs; };
+  INITRAMFS = import ../initramfs { inherit pkgs rootfs; };
   KERNEL = "${passthru.kernel}/${stdenv.hostPlatform.linux-kernel.target}";
 })
-- 
2.37.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/2] host/rootfs: remove kernel override
  2022-09-01 10:46 [PATCH 1/2] host/rootfs: use initramfs in "make run" Alyssa Ross
@ 2022-09-01 10:46 ` Alyssa Ross
  2022-09-08 11:41   ` José Pekkarinen
  2022-09-08 12:09   ` Alyssa Ross
  2022-09-05  7:49 ` [PATCH 1/2] host/rootfs: use initramfs in "make run" José Pekkarinen
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Alyssa Ross @ 2022-09-01 10:46 UTC (permalink / raw)
  To: devel; +Cc: José Pekkarinen

These drivers should be loaded by the initramfs if required — most
Spectrum installs won't need the virtio drivers on the host, and
overriding the kernel means more stuff we can't reuse from
cache.nixos.org.

We'll probably want to build in the driver for whatever filesystem we
end up using for the root file system eventually, since it will always
be required, but that should be done as part of a more systematic
effort to optimise our kernel configuration.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
 host/rootfs/default.nix | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix
index e5f316f..a651a20 100644
--- a/host/rootfs/default.nix
+++ b/host/rootfs/default.nix
@@ -65,14 +65,7 @@ let
     imports = [ (modulesPath + "/profiles/all-hardware.nix") ];
   });
 
-  kernel = pkgs.linux_latest.override {
-    structuredExtraConfig = with lib.kernel; {
-      VIRTIO = yes;
-      VIRTIO_PCI = yes;
-      VIRTIO_BLK = yes;
-      EXT4_FS = yes;
-    };
-  };
+  kernel = pkgs.linux_latest;
 
   packagesSysroot = runCommand "packages-sysroot" {
     nativeBuildInputs = [ xorg.lndir ];
-- 
2.37.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] host/rootfs: use initramfs in "make run"
  2022-09-01 10:46 [PATCH 1/2] host/rootfs: use initramfs in "make run" Alyssa Ross
  2022-09-01 10:46 ` [PATCH 2/2] host/rootfs: remove kernel override Alyssa Ross
@ 2022-09-05  7:49 ` José Pekkarinen
  2022-09-08 10:52   ` Alyssa Ross
  2022-09-08 11:40 ` José Pekkarinen
  2022-09-08 12:09 ` Alyssa Ross
  3 siblings, 1 reply; 10+ messages in thread
From: José Pekkarinen @ 2022-09-05  7:49 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: devel


[-- Attachment #1.1: Type: text/plain, Size: 5124 bytes --]

On Thu, Sep 1, 2022 at 1:47 PM Alyssa Ross <hi@alyssa.is> wrote:

> This will allow us to stop compiling e.g. the virtio-blk module into
> the kernel, because it will be loaded by the initramfs.
>
> This introduces some duplication between the rootfs and initramfs's
> Makefiles.  I don't think it's worth the effort at the moment to try
> to reduce that, because it would come at the expense of additional
> complexity in the Makefiles.  We can revisit this later if we want to.
>
> Signed-off-by: Alyssa Ross <hi@alyssa.is>
> ---
>  host/rootfs/Makefile  | 32 ++++++++++++++++++++++++++++----
>  host/rootfs/shell.nix | 10 ++++++++--
>  2 files changed, 36 insertions(+), 6 deletions(-)
>
> diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile
> index 41cf87c..31f76d2 100644
> --- a/host/rootfs/Makefile
> +++ b/host/rootfs/Makefile
> @@ -6,6 +6,9 @@
>  # QEMU_KVM = qemu-system-x86_64 -enable-kvm.
>  QEMU_KVM = qemu-kvm
>
> +SCRIPTS = ../../scripts
> +VERITYSETUP = veritysetup
> +
>  # tar2ext4 will leave half a filesystem behind if it's interrupted
>  # half way through.
>  build/rootfs.ext4: build/rootfs.tar
> @@ -116,16 +119,37 @@ clean:
>         rm -rf build
>  .PHONY: clean
>
> -run: build/rootfs.ext4 $(EXT_FS)
> +# veritysetup format produces two files, but Make only (portably)
> +# supports one output per rule, so we combine the two outputs then
> +# define two more rules to separate them again.
> +build/rootfs.verity: build/rootfs.ext4
> +       $(VERITYSETUP) format build/rootfs.ext4
> build/rootfs.verity.superblock.tmp \
> +           | awk -F ':[[:blank:]]*' '$$1 == "Root hash" {print $$2;
> exit}' \
> +           > build/rootfs.verity.roothash.tmp
> +       cat build/rootfs.verity.roothash.tmp
> build/rootfs.verity.superblock.tmp \
> +           > $@
> +       rm build/rootfs.verity.roothash.tmp
> build/rootfs.verity.superblock.tmp
> +build/rootfs.verity.roothash: build/rootfs.verity
> +       head -n 1 build/rootfs.verity > $@
> +build/rootfs.verity.superblock: build/rootfs.verity
> +       tail -n +2 build/rootfs.verity > $@
> +
> +build/live.img: $(SCRIPTS)/format-uuid.sh $(SCRIPTS)/make-gpt.sh
> build/rootfs.verity.superblock build/rootfs.verity.roothash
> build/rootfs.ext4
> +       $(SCRIPTS)/make-gpt.sh $@.tmp \
> +
>  build/rootfs.verity.superblock:2c7357ed-ebd2-46d9-aec1-23d437ec2bf5:$$($(SCRIPTS)/format-uuid.sh
> "$$(dd if=build/rootfs.verity.roothash bs=32 skip=1 count=1 status=none)") \
> +
>  build/rootfs.ext4:4f68bce3-e8cd-4db1-96e7-fbcaf984b709:$$($(SCRIPTS)/format-uuid.sh
> "$$(head -c 32 build/rootfs.verity.roothash)")
> +       mv $@.tmp $@
> +
> +run: build/live.img $(EXT_FS) build/rootfs.verity.roothash
>         $(QEMU_KVM) -cpu host -m 2G \
> -           -machine q35,kernel=$(KERNEL),kernel-irqchip=split \
> +           -machine
> q35,kernel=$(KERNEL),kernel-irqchip=split,initrd=$(INITRAMFS) \
>             -display gtk,gl=on \
>             -qmp unix:vmm.sock,server,nowait \
>             -monitor vc \
>             -parallel none \
> -           -drive file=build/rootfs.ext4,if=virtio,format=raw,readonly=on
> \
> +           -drive file=build/live.img,if=virtio,format=raw,readonly=on \
>             -drive file=$(EXT_FS),if=virtio,format=raw,readonly=on \
> -           -append "console=ttyS0 root=/dev/vda ext=/dev/vdb
> intel_iommu=on" \
> +           -append "console=ttyS0 roothash=$$(<
> build/rootfs.verity.roothash) ext=/dev/vdb intel_iommu=on" \
>             -device intel-iommu,intremap=on \
>             -device virtio-vga-gl \
>             -device vhost-vsock-pci,guest-cid=3
> diff --git a/host/rootfs/shell.nix b/host/rootfs/shell.nix
> index 3b2310f..fe9df1b 100644
> --- a/host/rootfs/shell.nix
> +++ b/host/rootfs/shell.nix
> @@ -1,18 +1,24 @@
>  # SPDX-License-Identifier: MIT
>  # SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>
> +# SPDX-FileCopyrightText: 2022 Unikie
>
>  { pkgs ? import <nixpkgs> {} }:
>
> +let
> +  rootfs = import ./. { inherit pkgs; };
> +in
> +
>  with pkgs;
>
> -(import ./. { inherit pkgs; }).overrideAttrs (
> +rootfs.overrideAttrs (
>  { passthru ? {}, nativeBuildInputs ? [], ... }:
>
>  {
>    nativeBuildInputs = nativeBuildInputs ++ [
> -    jq netcat qemu_kvm reuse util-linux
> +    cryptsetup jq netcat qemu_kvm reuse util-linux
>    ];
>
>    EXT_FS = pkgsStatic.callPackage ../initramfs/extfs.nix { inherit pkgs;
> };
> +  INITRAMFS = import ../initramfs { inherit pkgs rootfs; };
>    KERNEL =
> "${passthru.kernel}/${stdenv.hostPlatform.linux-kernel.target}";
>  })
> --
> 2.37.1
>
>
Hi,

This patchset introduces errors in the default qemu

configuration of spectrum, where it is possible to see in the
console log attempts to load broken aliases like:

modprobe: FATAL: Module acpi:PNP0C0F: not found in directory
/lib/modules/5.18.0

As well as valid modules load failures like:

modprobe: ERROR: could not insert 'vfio_pci': Invalid argument

The full boot log is attached for further perusal.

Best regards.


José.

[-- Attachment #1.2: Type: text/html, Size: 6673 bytes --]

[-- Attachment #2: boot.txt --]
[-- Type: text/plain, Size: 39505 bytes --]

[    0.000000] Linux version 5.18.0 (pekkari@Unikie-T14-Gen-2i) (gcc (GCC) 11.3.0, GNU ld (GNU Binutils) 2.38) #1-NixOS SMP PREEMPT_DYNAMIC Sun May 22 19:52:31 UTC 2022
[    0.000000] Command line: console=ttyS0 roothash=bdf6e95b1a9464ec97d667e222f02f05fd29c0c7099e9116413e894501e7f3ca ext=/dev/vdb intel_iommu=on
[    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x020: 'AVX-512 opmask'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x040: 'AVX-512 Hi256'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x080: 'AVX-512 ZMM_Hi256'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x200: 'Protection Keys User registers'
[    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[    0.000000] x86/fpu: xstate_offset[5]:  832, xstate_sizes[5]:   64
[    0.000000] x86/fpu: xstate_offset[6]:  896, xstate_sizes[6]:  512
[    0.000000] x86/fpu: xstate_offset[7]: 1408, xstate_sizes[7]: 1024
[    0.000000] x86/fpu: xstate_offset[9]: 2432, xstate_sizes[9]:    8
[    0.000000] x86/fpu: Enabled xstate features 0x2e7, context size is 2440 bytes, using 'compacted' format.
[    0.000000] signal: max sigframe size: 3632
[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007ffd8fff] usable
[    0.000000] BIOS-e820: [mem 0x000000007ffd9000-0x000000007fffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000b0000000-0x00000000bfffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fed1c000-0x00000000fed1ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] SMBIOS 2.8 present.
[    0.000000] DMI: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014
[    0.000000] Hypervisor detected: KVM
[    0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
[    0.000000] kvm-clock: using sched offset of 224901354 cycles
[    0.000002] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
[    0.000004] tsc: Detected 2803.200 MHz processor
[    0.000333] last_pfn = 0x7ffd9 max_arch_pfn = 0x400000000
[    0.000367] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT  
[    0.004042] found SMP MP-table at [mem 0x000f5c80-0x000f5c8f]
[    0.004074] Using GB pages for direct mapping
[    0.004134] RAMDISK: [mem 0x7e284000-0x7ffcffff]
[    0.004145] ACPI: Early table checksum verification disabled
[    0.004150] ACPI: RSDP 0x00000000000F5AC0 000014 (v00 BOCHS )
[    0.004154] ACPI: RSDT 0x000000007FFE2349 00003C (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.004159] ACPI: FACP 0x000000007FFE20B1 0000F4 (v03 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.004163] ACPI: DSDT 0x000000007FFE0040 002071 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.004166] ACPI: FACS 0x000000007FFE0000 000040
[    0.004168] ACPI: APIC 0x000000007FFE21A5 000078 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.004170] ACPI: HPET 0x000000007FFE221D 000038 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.004172] ACPI: MCFG 0x000000007FFE2255 00003C (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.004174] ACPI: DMAR 0x000000007FFE2291 000090 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.004176] ACPI: WAET 0x000000007FFE2321 000028 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.004178] ACPI: Reserving FACP table memory at [mem 0x7ffe20b1-0x7ffe21a4]
[    0.004179] ACPI: Reserving DSDT table memory at [mem 0x7ffe0040-0x7ffe20b0]
[    0.004180] ACPI: Reserving FACS table memory at [mem 0x7ffe0000-0x7ffe003f]
[    0.004180] ACPI: Reserving APIC table memory at [mem 0x7ffe21a5-0x7ffe221c]
[    0.004181] ACPI: Reserving HPET table memory at [mem 0x7ffe221d-0x7ffe2254]
[    0.004182] ACPI: Reserving MCFG table memory at [mem 0x7ffe2255-0x7ffe2290]
[    0.004183] ACPI: Reserving DMAR table memory at [mem 0x7ffe2291-0x7ffe2320]
[    0.004183] ACPI: Reserving WAET table memory at [mem 0x7ffe2321-0x7ffe2348]
[    0.004331] No NUMA configuration found
[    0.004332] Faking a node at [mem 0x0000000000000000-0x000000007ffd8fff]
[    0.004334] NODE_DATA(0) allocated [mem 0x7ffd4000-0x7ffd8fff]
[    0.004346] Zone ranges:
[    0.004347]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.004348]   DMA32    [mem 0x0000000001000000-0x000000007ffd8fff]
[    0.004350]   Normal   empty
[    0.004350]   Device   empty
[    0.004351] Movable zone start for each node
[    0.004352] Early memory node ranges
[    0.004352]   node   0: [mem 0x0000000000001000-0x000000000009efff]
[    0.004354]   node   0: [mem 0x0000000000100000-0x000000007ffd8fff]
[    0.004355] Initmem setup node 0 [mem 0x0000000000001000-0x000000007ffd8fff]
[    0.004676] On node 0, zone DMA: 1 pages in unavailable ranges
[    0.004686] On node 0, zone DMA: 97 pages in unavailable ranges
[    0.010498] On node 0, zone DMA32: 39 pages in unavailable ranges
[    0.010735] ACPI: PM-Timer IO Port: 0x608
[    0.010745] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[    0.010829] IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
[    0.010832] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.010834] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
[    0.010835] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.010835] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
[    0.010836] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
[    0.010838] ACPI: Using ACPI (MADT) for SMP configuration information
[    0.010839] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.010843] TSC deadline timer available
[    0.010844] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.010870] PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
[    0.010872] PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[    0.010873] PM: hibernation: Registered nosave memory: [mem 0x000a0000-0x000effff]
[    0.010873] PM: hibernation: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[    0.010875] [mem 0xc0000000-0xfed1bfff] available for PCI devices
[    0.010876] Booting paravirtualized kernel on KVM
[    0.010878] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    0.013584] setup_percpu: NR_CPUS:384 nr_cpumask_bits:384 nr_cpu_ids:1 nr_node_ids:1
[    0.013986] percpu: Embedded 56 pages/cpu s191144 r8192 d30040 u2097152
[    0.014022] kvm-guest: PV spinlocks disabled, single CPU
[    0.014026] Fallback order for Node 0: 0 
[    0.014029] Built 1 zonelists, mobility grouping on.  Total pages: 515801
[    0.014030] Policy zone: DMA32
[    0.014031] Kernel command line: console=ttyS0 roothash=bdf6e95b1a9464ec97d667e222f02f05fd29c0c7099e9116413e894501e7f3ca ext=/dev/vdb intel_iommu=on
[    0.014065] DMAR: IOMMU enabled
[    0.014066] Unknown kernel command line parameters "roothash=bdf6e95b1a9464ec97d667e222f02f05fd29c0c7099e9116413e894501e7f3ca ext=/dev/vdb", will be passed to user space.
[    0.014450] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.014521] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.014554] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.018861] Memory: 1996744K/2096604K available (12294K kernel code, 2292K rwdata, 7460K rodata, 1608K init, 2680K bss, 99600K reserved, 0K cma-reserved)
[    0.018890] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.018899] ftrace: allocating 35765 entries in 140 pages
[    0.024018] ftrace: allocated 140 pages with 3 groups
[    0.024530] Dynamic Preempt: voluntary
[    0.024781] rcu: Preemptible hierarchical RCU implementation.
[    0.024783] rcu: 	RCU event tracing is enabled.
[    0.024784] rcu: 	RCU restricting CPUs from NR_CPUS=384 to nr_cpu_ids=1.
[    0.024785] 	Trampoline variant of Tasks RCU enabled.
[    0.024786] 	Rude variant of Tasks RCU enabled.
[    0.024786] 	Tracing variant of Tasks RCU enabled.
[    0.024787] rcu: RCU calculated value of scheduler-enlistment delay is 100 jiffies.
[    0.024787] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.027025] NR_IRQS: 24832, nr_irqs: 256, preallocated irqs: 16
[    0.027238] random: crng init done (trusting CPU's manufacturer)
[    0.029752] Console: colour VGA+ 80x25
[    0.065971] printk: console [ttyS0] enabled
[    0.066193] ACPI: Core revision 20211217
[    0.066461] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns
[    0.066941] APIC: Switch to symmetric I/O mode setup
[    0.067184] DMAR: Host address width 39
[    0.067358] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[    0.067608] DMAR: dmar0: reg_base_addr fed90000 ver 1:0 cap d2008c22260206 ecap f00f5a
[    0.067998] DMAR-IR: IOAPIC id 0 under DRHD base  0xfed90000 IOMMU 0
[    0.068282] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[    0.069621] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    0.069849] x2apic enabled
[    0.069993] Switched APIC routing to cluster x2apic.
[    0.073720] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.074062] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x28680fa287f, max_idle_ns: 440795281151 ns
[    0.074497] Calibrating delay loop (skipped) preset value.. 5606.40 BogoMIPS (lpj=2803200)
[    0.074825] pid_max: default: 32768 minimum: 301
[    0.075505] LSM: Security Framework initializing
[    0.075714] landlock: Up and running.
[    0.075880] Yama: becoming mindful.
[    0.076043] SELinux:  Initializing.
[    0.076211] LSM support for eBPF active
[    0.076508] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.076834] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.077372] x86/cpu: User Mode Instruction Prevention (UMIP) activated
[    0.077629] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.077842] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
[    0.078081] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.078497] Spectre V2 : Mitigation: Enhanced IBRS
[    0.078675] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.078955] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[    0.079235] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl
[    0.084575] Freeing SMP alternatives memory: 32K
[    0.084830] smpboot: CPU0: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (family: 0x6, model: 0x8c, stepping: 0x1)
[    0.085283] cblist_init_generic: Setting adjustable number of callback queues.
[    0.085494] cblist_init_generic: Setting shift to 0 and lim to 1.
[    0.085499] cblist_init_generic: Setting shift to 0 and lim to 1.
[    0.085715] cblist_init_generic: Setting shift to 0 and lim to 1.
[    0.085926] Performance Events: Icelake events, full-width counters, Intel PMU driver.
[    0.086408] ... version:                2
[    0.086495] ... bit width:              48
[    0.086635] ... generic registers:      8
[    0.086772] ... value mask:             0000ffffffffffff
[    0.086952] ... max period:             00007fffffffffff
[    0.087131] ... fixed-purpose events:   3
[    0.087267] ... event mask:             00000007000000ff
[    0.087542] rcu: Hierarchical SRCU implementation.
[    0.087956] smp: Bringing up secondary CPUs ...
[    0.088506] smp: Brought up 1 node, 1 CPU
[    0.088677] smpboot: Max logical packages: 1
[    0.088866] smpboot: Total of 1 processors activated (5606.40 BogoMIPS)
[    0.089467] devtmpfs: initialized
[    0.089529] x86/mm: Memory block size: 128MB
[    0.089865] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[    0.090235] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.090525] pinctrl core: initialized pinctrl subsystem
[    0.091105] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.091377] audit: initializing netlink subsys (disabled)
[    0.091555] thermal_sys: Registered thermal governor 'bang_bang'
[    0.091556] thermal_sys: Registered thermal governor 'step_wise'
[    0.091791] thermal_sys: Registered thermal governor 'user_space'
[    0.092029] audit: type=2000 audit(1662115541.732:1): state=initialized audit_enabled=0 res=1
[    0.092501] cpuidle: using governor menu
[    0.092676] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.092973] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xb0000000-0xbfffffff] (base 0xb0000000)
[    0.093326] PCI: MMCONFIG at [mem 0xb0000000-0xbfffffff] reserved in E820
[    0.093502] PCI: Using configuration type 1 for base access
[    0.094086] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible.
[    0.094483] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages
[    0.094496] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.094813] ACPI: Added _OSI(Module Device)
[    0.094957] ACPI: Added _OSI(Processor Device)
[    0.095108] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.095279] ACPI: Added _OSI(Processor Aggregator Device)
[    0.095461] ACPI: Added _OSI(Linux-Dell-Video)
[    0.095496] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[    0.096000] ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
[    0.096624] ACPI: 1 ACPI AML tables successfully acquired and loaded
[    0.097580] ACPI: Interpreter enabled
[    0.097718] ACPI: PM: (supports S0 S3 S4 S5)
[    0.097864] ACPI: Using IOAPIC for interrupt routing
[    0.098047] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.098403] ACPI: Enabled 2 GPEs in block 00 to 3F
[    0.099186] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.099398] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI HPX-Type3]
[    0.099514] acpi PNP0A08:00: _OSC: platform does not support [PCIeHotplug LTR]
[    0.099781] acpi PNP0A08:00: _OSC: OS now controls [PME PCIeCapability]
[    0.100074] PCI host bridge to bus 0000:00
[    0.100214] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
[    0.100443] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
[    0.100495] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[    0.100747] pci_bus 0000:00: root bus resource [mem 0x80000000-0xafffffff window]
[    0.100996] pci_bus 0000:00: root bus resource [mem 0xc0000000-0xfebfffff window]
[    0.101246] pci_bus 0000:00: root bus resource [mem 0x100000000-0x8ffffffff window]
[    0.101498] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.101719] pci 0000:00:00.0: [8086:29c0] type 00 class 0x060000
[    0.102110] pci 0000:00:01.0: [8086:10d3] type 00 class 0x020000
[    0.104236] pci 0000:00:01.0: reg 0x10: [mem 0xfeb80000-0xfeb9ffff]
[    0.105199] pci 0000:00:01.0: reg 0x14: [mem 0xfeba0000-0xfebbffff]
[    0.106396] pci 0000:00:01.0: reg 0x18: [io  0xc140-0xc15f]
[    0.107360] pci 0000:00:01.0: reg 0x1c: [mem 0xfebd0000-0xfebd3fff]
[    0.111193] pci 0000:00:01.0: reg 0x30: [mem 0xfeb00000-0xfeb7ffff pref]
[    0.111734] pci 0000:00:02.0: [1af4:1050] type 00 class 0x030000
[    0.113081] pci 0000:00:02.0: reg 0x10: [mem 0xfe000000-0xfe7fffff pref]
[    0.115207] pci 0000:00:02.0: reg 0x18: [mem 0xfe800000-0xfe803fff 64bit pref]
[    0.116368] pci 0000:00:02.0: reg 0x20: [mem 0xfebd4000-0xfebd4fff]
[    0.117899] pci 0000:00:02.0: reg 0x30: [mem 0xfebc0000-0xfebcffff pref]
[    0.118153] pci 0000:00:02.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[    0.118704] pci 0000:00:03.0: [1af4:1053] type 00 class 0x078000
[    0.119731] pci 0000:00:03.0: reg 0x14: [mem 0xfebd5000-0xfebd5fff]
[    0.121297] pci 0000:00:03.0: reg 0x20: [mem 0xfe804000-0xfe807fff 64bit pref]
[    0.122258] pci 0000:00:04.0: [1af4:1001] type 00 class 0x010000
[    0.123131] pci 0000:00:04.0: reg 0x10: [io  0xc000-0xc07f]
[    0.123888] pci 0000:00:04.0: reg 0x14: [mem 0xfebd6000-0xfebd6fff]
[    0.126429] pci 0000:00:04.0: reg 0x20: [mem 0xfe808000-0xfe80bfff 64bit pref]
[    0.127548] pci 0000:00:05.0: [1af4:1001] type 00 class 0x010000
[    0.128425] pci 0000:00:05.0: reg 0x10: [io  0xc080-0xc0ff]
[    0.129135] pci 0000:00:05.0: reg 0x14: [mem 0xfebd7000-0xfebd7fff]
[    0.130852] pci 0000:00:05.0: reg 0x20: [mem 0xfe80c000-0xfe80ffff 64bit pref]
[    0.132364] pci 0000:00:1f.0: [8086:2918] type 00 class 0x060100
[    0.133644] pci 0000:00:1f.0: quirk: [io  0x0600-0x067f] claimed by ICH6 ACPI/GPIO/TCO
[    0.134031] pci 0000:00:1f.2: [8086:2922] type 00 class 0x010601
[    0.136456] pci 0000:00:1f.2: reg 0x20: [io  0xc160-0xc17f]
[    0.136949] pci 0000:00:1f.2: reg 0x24: [mem 0xfebd8000-0xfebd8fff]
[    0.137627] pci 0000:00:1f.3: [8086:2930] type 00 class 0x0c0500
[    0.138821] pci 0000:00:1f.3: reg 0x20: [io  0x0700-0x073f]
[    0.140002] ACPI: PCI: Interrupt link LNKA configured for IRQ 10
[    0.140269] ACPI: PCI: Interrupt link LNKB configured for IRQ 10
[    0.140526] ACPI: PCI: Interrupt link LNKC configured for IRQ 11
[    0.140786] ACPI: PCI: Interrupt link LNKD configured for IRQ 11
[    0.141047] ACPI: PCI: Interrupt link LNKE configured for IRQ 10
[    0.141280] ACPI: PCI: Interrupt link LNKF configured for IRQ 10
[    0.141514] ACPI: PCI: Interrupt link LNKG configured for IRQ 11
[    0.141742] ACPI: PCI: Interrupt link LNKH configured for IRQ 11
[    0.141959] ACPI: PCI: Interrupt link GSIA configured for IRQ 16
[    0.142499] ACPI: PCI: Interrupt link GSIB configured for IRQ 17
[    0.142704] ACPI: PCI: Interrupt link GSIC configured for IRQ 18
[    0.142909] ACPI: PCI: Interrupt link GSID configured for IRQ 19
[    0.143137] ACPI: PCI: Interrupt link GSIE configured for IRQ 20
[    0.143342] ACPI: PCI: Interrupt link GSIF configured for IRQ 21
[    0.143498] ACPI: PCI: Interrupt link GSIG configured for IRQ 22
[    0.143703] ACPI: PCI: Interrupt link GSIH configured for IRQ 23
[    0.143997] iommu: Default domain type: Translated 
[    0.144169] iommu: DMA domain TLB invalidation policy: lazy mode 
[    0.144508] NetLabel: Initializing
[    0.144627] NetLabel:  domain hash size = 128
[    0.144775] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.144975] NetLabel:  unlabeled traffic allowed by default
[    0.145163] PCI: Using ACPI for IRQ routing
[    0.168690] pci 0000:00:02.0: vgaarb: setting as boot VGA device
[    0.168928] pci 0000:00:02.0: vgaarb: bridge control possible
[    0.169155] pci 0000:00:02.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[    0.169485] vgaarb: loaded
[    0.170191] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    0.170382] hpet0: 3 comparators, 64-bit 100.000000 MHz counter
[    0.174517] clocksource: Switched to clocksource kvm-clock
[    0.179424] VFS: Disk quotas dquot_6.6.0
[    0.179579] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.179862] pnp: PnP ACPI init
[    0.180048] system 00:04: [mem 0xb0000000-0xbfffffff window] has been reserved
[    0.180402] pnp: PnP ACPI: found 5 devices
[    0.186767] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    0.189192] NET: Registered PF_INET protocol family
[    0.189392] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.190438] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    0.190737] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.191127] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear)
[    0.191594] TCP: Hash tables configured (established 16384 bind 16384)
[    0.191843] MPTCP token hash table entries: 2048 (order: 3, 49152 bytes, linear)
[    0.192098] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.192325] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    0.192588] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.192782] NET: Registered PF_XDP protocol family
[    0.192952] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7 window]
[    0.193160] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff window]
[    0.193368] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window]
[    0.193600] pci_bus 0000:00: resource 7 [mem 0x80000000-0xafffffff window]
[    0.193831] pci_bus 0000:00: resource 8 [mem 0xc0000000-0xfebfffff window]
[    0.194062] pci_bus 0000:00: resource 9 [mem 0x100000000-0x8ffffffff window]
[    0.194340] PCI: CLS 0 bytes, default 64
[    0.194506] Trying to unpack rootfs image as initramfs...
[    0.197514] DMAR: No RMRR found
[    0.197643] DMAR: No ATSR found
[    0.197754] DMAR: No SATC found
[    0.197865] DMAR: dmar0: Using Queued invalidation
[    0.198079] pci 0000:00:00.0: Adding to iommu group 0
[    0.198256] pci 0000:00:01.0: Adding to iommu group 1
[    0.198433] pci 0000:00:02.0: Adding to iommu group 2
[    0.200629] pci 0000:00:03.0: Adding to iommu group 3
[    0.203549] pci 0000:00:04.0: Adding to iommu group 4
[    0.203755] pci 0000:00:05.0: Adding to iommu group 5
[    0.203950] pci 0000:00:1f.0: Adding to iommu group 6
[    0.204124] pci 0000:00:1f.2: Adding to iommu group 6
[    0.204298] pci 0000:00:1f.3: Adding to iommu group 6
[    0.208858] DMAR: Intel(R) Virtualization Technology for Directed I/O
[    0.213529] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x28680fa287f, max_idle_ns: 440795281151 ns
[    0.214602] Initialise system trusted keyrings
[    0.216608] workingset: timestamp_bits=40 max_order=19 bucket_order=0
[    0.220306] zbud: loaded
[    0.221527] Key type asymmetric registered
[    0.221675] Asymmetric key parser 'x509' registered
[    0.360136] Freeing initrd memory: 30000K
[    0.360720] alg: self-tests for CTR-KDF (hmac(sha256)) passed
[    0.360940] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.361207] io scheduler mq-deadline registered
[    0.361368] io scheduler kyber registered
[    0.361614] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.361886] 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    0.362354] intel_pstate: CPU model not supported
[    0.362556] drop_monitor: Initializing network drop monitor service
[    0.369755] NET: Registered PF_INET6 protocol family
[    0.370434] Segment Routing with IPv6
[    0.370592] In-situ OAM (IOAM) with IPv6
[    0.370834] IPI shorthand broadcast: enabled
[    0.371022] sched_clock: Marking stable (327289725, 43296247)->(390899447, -20313475)
[    0.371601] registered taskstats version 1
[    0.371765] Loading compiled-in X.509 certificates
[    0.371989] zswap: loaded using pool lzo/zbud
[    0.372203] Key type ._fscrypt registered
[    0.372360] Key type .fscrypt registered
[    0.372523] Key type fscrypt-provisioning registered
[    0.375307] Freeing unused kernel image (initmem) memory: 1608K
[    0.377540] Write protecting the kernel read-only data: 22528k
[    0.378039] Freeing unused kernel image (text/rodata gap) memory: 2040K
[    0.378351] Freeing unused kernel image (rodata/data gap) memory: 732K
[    0.378580] Run /init as init process
modprobe: FATAL: Module dmi:bvnSeaBIOS:bvr1.13.0-1ubuntu1.1:bd04/01/2014:br0.0:svnQEMU:pnStandardPC(Q35+ICH9,2009):pvrpc-q35-6.2:cvnQEMU:ct1:cvrpc-q35-6.2:sku: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module platform:reg-dummy not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module platform:platform-framebuffer not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0103: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module platform:serial8250 not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module platform:pcspkr not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:QEMU0002: not found in directory /lib/modules/5.18.0
[    0.431753] SCSI subsystem initialized
[    0.454833] ACPI: \_SB_.GSIA: Enabled at IRQ 16
[    0.455291] ahci 0000:00:1f.2: AHCI 0001.0000 32 slots 6 ports 1.5 Gbps 0x3f impl SATA mode
[    0.455588] ahci 0000:00:1f.2: flags: 64bit ncq only 
[    0.456194] scsi host0: ahci
[    0.456349] scsi host1: ahci
[    0.456485] scsi host2: ahci
[    0.456625] scsi host3: ahci
[    0.456760] scsi host4: ahci
[    0.456898] scsi host5: ahci
[    0.457022] ata1: SATA max UDMA/133 abar m4096@0xfebd8000 port 0xfebd8100 irq 25
[    0.457276] ata2: SATA max UDMA/133 abar m4096@0xfebd8000 port 0xfebd8180 irq 25
[    0.457664] ata3: SATA max UDMA/133 abar m4096@0xfebd8000 port 0xfebd8200 irq 25
[    0.457922] ata4: SATA max UDMA/133 abar m4096@0xfebd8000 port 0xfebd8280 irq 25
[    0.458173] ata5: SATA max UDMA/133 abar m4096@0xfebd8000 port 0xfebd8300 irq 25
[    0.458424] ata6: SATA max UDMA/133 abar m4096@0xfebd8000 port 0xfebd8380 irq 25
[    0.764481] ata6: SATA link down (SStatus 0 SControl 300)
[    0.765643] ata2: SATA link down (SStatus 0 SControl 300)
[    0.766519] ata5: SATA link down (SStatus 0 SControl 300)
[    0.767404] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[    0.768433] ata3.00: ATAPI: QEMU DVD-ROM, 2.5+, max UDMA/100
[    0.769182] ata3.00: applying bridge limits
[    0.770734] ata1: SATA link down (SStatus 0 SControl 300)
[    0.771666] ata4: SATA link down (SStatus 0 SControl 300)
[    0.772508] ata3.00: configured for UDMA/100
[    0.773586] scsi 2:0:0:0: CD-ROM            QEMU     QEMU DVD-ROM     2.5+ PQ: 0 ANSI: 5
modprobe: FATAL: Module pci:v00008086d00002918sv00001AF4sd00001100bc06sc01i00 not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module pci:v00008086d000010D3sv00008086sd00000000bc02sc00i00 not found in directory /lib/modules/5.18.0
[    0.789349] ACPI: \_SB_.GSIG: Enabled at IRQ 22
[    0.790283] ACPI: \_SB_.GSIH: Enabled at IRQ 23
[    0.791286] ACPI: \_SB_.GSIE: Enabled at IRQ 20
[    0.791956] ACPI: \_SB_.GSIF: Enabled at IRQ 21
modprobe: FATAL: Module pci:v00008086d00002930sv00001AF4sd00001100bc0Csc05i00 not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module pci:v00008086d000029C0sv00001AF4sd00001100bc06sc00i00 not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
[    0.799083] rtc_cmos 00:03: RTC can wake from S4
[    0.799545] rtc_cmos 00:03: registered as rtc0
[    0.799707] rtc_cmos 00:03: alarms up to one day, y3k, 242 bytes nvram, hpet irqs
modprobe: FATAL: Module acpi:LNXSYBUS: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:LNXPWRBN: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0A06: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0A06: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:ACPI0010:PNP0A05: not found in directory /lib/modules/5.18.0
[    0.806661] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
[    0.807468] serio: i8042 KBD port at 0x60,0x64 irq 1
[    0.807643] serio: i8042 AUX port at 0x60,0x64 irq 12
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:LNXCPU: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0A08:PNP0A03: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:LNXSYBUS: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0103: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C01: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0501: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0A06: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:LNXSYSTM: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:QEMU0002: not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module acpi:PNP0C0F: not found in directory /lib/modules/5.18.0
[    0.835657] sr 2:0:0:0: [sr0] scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray
[    0.835953] cdrom: Uniform CD-ROM driver Revision: 3.20
modprobe: FATAL: Module virtio:d00000010v00001AF4 not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module virtio:d00000013v00001AF4 not found in directory /lib/modules/5.18.0
[    0.857427] virtio_blk virtio2: [vda] 2562048 512-byte logical blocks (1.31 GB/1.22 GiB)
[    0.858902]  vda: vda1 vda2
[    0.859715] virtio_blk virtio3: [vdb] 5944296 512-byte logical blocks (3.04 GB/2.83 GiB)
modprobe: FATAL: Module platform:alarmtimer not found in directory /lib/modules/5.18.0
modprobe: FATAL: Module platform:i8042 not found in directory /lib/modules/5.18.0
[    0.865122] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[    1.015007] device-mapper: ioctl: 4.46.0-ioctl (2022-02-22) initialised: dm-devel@redhat.com
[    1.019412] device-mapper: verity: sha256 using implementation "sha256-generic"
[    1.020345] /dev/mapper/root-verity: Can't open blockdev
[    1.020898] /dev/mapper/root-verity: Can't open blockdev
[    1.022088] EXT4-fs (dm-0): mounted filesystem without journal. Quota mode: none.

  s6-linux-init version 1.0.7.3


~ # [    1.162687] ext: Can't open blockdev
[    1.162986] ext: Can't open blockdev
mknod: mapper/control: File exists
[    1.168350] EXT4-fs (vdb): mounted filesystem without journal. Quota mode: none.
+ exec modprobe -q input:b0011v0001p0001eAB41-e0,1,4,11,14,k71,72,73,74,75,76,77,79,7A,7B,7C,7D,7E,7F,80,8C,8E,8F,9B,9C,9D,9E,9F,A3,A4,A5,A6,AC,AD,B7,B8,B9,D9,E2,ram4,l0,1,2,sfw
[    1.196388] BPF: 	 type_id=93667 bits_offset=320
[    1.196577] BPF:  
[    1.196650] BPF: Invalid name
[    1.196755] BPF: 
[    1.196834] failed to validate module [mac_hid] BTF: -22
[    1.202949] BPF: [89794] Invalid name_offset:1651532
[    1.203154] failed to validate module [led_class] BTF: -22
[    1.210995] BPF: 	 type_id=18 bits_offset=2376
[    1.211156] BPF:  
[    1.211228] BPF: Invalid name
[    1.211331] BPF: 
[    1.211400] failed to validate module [evdev] BTF: -22
[    1.218624] BPF: 	 type_id=1245 bits_offset=320
[    1.218811] BPF:  
[    1.218892] BPF: Invalid name
[    1.218999] BPF: 
[    1.219070] failed to validate module [evbug] BTF: -22
+ exec modprobe -q 'dmi:bvnSeaBIOS:bvr1.13.0-1ubuntu1.1:bd04/01/2014:br0.0:svnQEMU:pnStandardPC(Q35+ICH9,2009):pvrpc-q35-6.2:cvnQEMU:ct1:cvrpc-q35-6.2:sku:'
+ exec modprobe -q serio:ty06pr00id00ex00
[    1.232645] BPF: 	 type_id=18 bits_offset=2376
[    1.232807] BPF:  
[    1.232889] BPF: Invalid name
[    1.232996] BPF: 
[    1.233066] failed to validate module [serio_raw] BTF: -22
+ exec modprobe -q serio:ty01pr00id00ex00
[    1.246089] BPF: 	 type_id=142 bits_offset=2688
[    1.246252] BPF:  
[    1.246324] BPF: Invalid name
[    1.246428] BPF: 
[    1.246503] failed to validate module [i2c_core] BTF: -22
[    1.253264] BPF: 	 type_id=18 bits_offset=2376
[    1.253428] BPF:  
[    1.253510] BPF: Invalid name
[    1.253619] BPF: 
[    1.253692] failed to validate module [serio_raw] BTF: -22
+ exec modprobe -q platform:alarmtimer
+ exec modprobe -q platform:reg-dummy
+ exec modprobe -q platform:platform-framebuffer
+ exec modprobe -q acpi:PNP0103:
+ exec modprobe -q platform:serial8250
+ exec modprobe -q platform:i8042
+ exec modprobe -q platform:pcspkr
[    1.274006] BPF: 	 type_id=18 bits_offset=2376
[    1.274165] BPF:  
[    1.274237] BPF: Invalid name
[    1.274341] BPF: 
[    1.274410] failed to validate module [pcspkr] BTF: -22
[    1.282512] BPF: 	 type_id=18 bits_offset=2376
[    1.282673] BPF:  
[    1.282746] BPF: Invalid name
[    1.282863] BPF: 
[    1.282939] failed to validate module [soundcore] BTF: -22
+ exec modprobe -q acpi:QEMU0002:
[    1.292452] BPF: 	 type_id=18 bits_offset=2376
[    1.292620] BPF:  
[    1.292693] BPF: Invalid name
[    1.292803] BPF: 
[    1.292882] failed to validate module [qemu_fw_cfg] BTF: -22
+ exec modprobe -q pci:v00008086d00002922sv00001AF4sd00001100bc01sc06i01
+ exec modprobe -q pci:v00008086d00002918sv00001AF4sd00001100bc06sc01i00
[    1.307241] BPF: 	 type_id=18 bits_offset=2376
[    1.307403] BPF:  
[    1.307477] BPF: Invalid name
[    1.307587] BPF: 
[    1.307658] failed to validate module [mfd_core] BTF: -22
+ exec /etc/mdev/net/add
[    1.317366] BPF: [89793] Invalid name_offset:1651532
[    1.318526] failed to validate module [irqbypass] BTF: -22
modprobe: ERROR: could not insert 'vfio_pci': Invalid argument
+ exec modprobe -q pci:v00001AF4d00001001sv00001AF4sd00000002bc01sc00i00
+ exec modprobe -q pci:v00008086d00002930sv00001AF4sd00001100bc0Csc05i00
[    1.340147] BPF: 	 type_id=142 bits_offset=2688
[    1.340449] BPF:  
[    1.340588] BPF: Invalid name
[    1.340739] BPF: 
[    1.340834] failed to validate module [i2c_core] BTF: -22
+ exec modprobe -q pci:v00008086d000029C0sv00001AF4sd00001100bc06sc00i00
[    1.353525] BPF: 	 type_id=18 bits_offset=2376
[    1.353713] BPF:  
[    1.353801] BPF: Invalid name
[    1.353924] BPF: 
[    1.354006] failed to validate module [agpgart] BTF: -22
+ exec modprobe -q pci:v00001AF4d00001053sv00001AF4sd00001100bc07sc80i00
+ exec modprobe -q pci:v00001AF4d00001050sv00001AF4sd00001100bc03sc00i00
+ exec modprobe -q pci:v00001AF4d00001001sv00001AF4sd00000002bc01sc00i00
+ exec modprobe -q 'cpu:type:x86,ven0000fam0006mod008C:feature:,0000,0001,0002,0003,0004,0005,0006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0017,0018,0019,001A,001B,002B,0034,003A,003B,003D,0068,006B,006F,0070,0072,0074,0075,0076,0079,007F,0080,0081,0085,0089,008C,008D,008F,0091,0093,0094,0095,0096,0097,0098,0099,009A,009B,009C,009D,009E,009F,00C0,00C5,00C8,00E1,00E7,00F0,00F1,00F3,00F5,00F9,00FA,00FB,00FE,00FF,0100,0101,0102,0103,0104,0111,0120,0121,0123,0125,0127,0128,0129,012A,0130,0131,0132,0133,0134,0135,0137,0138,013C,013D,013E,013F,0140,0141,0142,0143,0164,0165,01AC,01AE,01AF,01B8,01C2,0201,0202,0203,0204,0206,0208,0209,020A,020B,020C,020E,0216,021B,021C,0244,0248,024A,025A,025B,025D,025F
'
[    1.376118] BPF: 	 type_id=1245 bits_offset=320
[    1.376281] BPF:  
[    1.376353] BPF: Invalid name
[    1.376456] BPF: 
[    1.376530] failed to validate module [intel_uncore] BTF: -22
[    1.383570] BPF: 	 type_id=18 bits_offset=2376
[    1.385032] BPF:  
[    1.385115] BPF: Invalid name
[    1.385232] BPF: 
[    1.385311] failed to validate module [intel_cstate] BTF: -22
[    1.394079] BPF: 	 type_id=18 bits_offset=2376
[    1.394289] BPF:  
[    1.394384] BPF: Invalid name
[    1.394528] BPF: 
[    1.394620] failed to validate module [cryptd] BTF: -22
[    1.402021] BPF: 	 type_id=18 bits_offset=2376
[    1.402227] BPF:  
[    1.402334] BPF: Invalid name
[    1.402509] BPF: 
[    1.402622] failed to validate module [cryptd] BTF: -22
[    1.410199] BPF: [89793] Invalid name_offset:1651532
[    1.410579] failed to validate module [crc32_pclmul] BTF: -22
[    1.417606] BPF: [89793] Invalid name_offset:1651532
[    1.419500] failed to validate module [irqbypass] BTF: -22
[    1.427160] BPF: [89793] Invalid name_offset:1651532
[    1.427690] failed to validate module [intel_tcc_cooling] BTF: -22
[    1.442202] BPF: 	 type_id=18 bits_offset=2376
[    1.442602] BPF:  
[    1.442785] BPF: Invalid name
[    1.443041] BPF: 
[    1.443214] failed to validate module [intel_pmc_core] BTF: -22
[    1.454025] BPF: 	 type_id=18 bits_offset=2376
[    1.454376] BPF:  
[    1.454546] BPF: Invalid name
[    1.454782] BPF: 
[    1.454937] failed to validate module [intel_rapl_common] BTF: -22
+ exec modprobe -q scsi:t-0x05
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0B00:
+ exec modprobe -q acpi:LNXSYBUS:
+ exec modprobe -q acpi:LNXPWRBN:
[    1.488860] BPF: 	 type_id=18 bits_offset=2376
[    1.489019] BPF:  
[    1.489091] BPF: Invalid name
[    1.489193] BPF: 
[    1.489262] failed to validate module [button] BTF: -22
[    1.495097] BPF: [89793] Invalid name_offset:1651532
[    1.495293] failed to validate module [tiny_power_button] BTF: -22
+ exec modprobe -q acpi:PNP0A06:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0A06:
+ exec modprobe -q acpi:ACPI0010:PNP0A05:
+ exec modprobe -q acpi:PNP0303:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:LNXCPU:
[    1.533053] BPF: 	Invalid name_offset:1651532
[    1.533208] failed to validate module [acpi_cpufreq] BTF: -22
[    1.539455] BPF: [89793] Invalid name_offset:1651532
[    1.539678] failed to validate module [pcc_cpufreq] BTF: -22
+ exec modprobe -q acpi:PNP0A08:PNP0A03:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:LNXSYBUS:
+ exec modprobe -q acpi:PNP0103:
+ exec modprobe -q acpi:PNP0C01:
+ exec modprobe -q acpi:PNP0501:
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q acpi:PNP0A06:
+ exec modprobe -q acpi:LNXSYSTM:
+ exec modprobe -q acpi:PNP0F13:
+ exec modprobe -q acpi:QEMU0002:
[    1.571884] BPF: 	 type_id=18 bits_offset=2376
[    1.572063] BPF:  
[    1.572145] BPF: Invalid name
[    1.572262] BPF: 
[    1.572338] failed to validate module [qemu_fw_cfg] BTF: -22
+ exec modprobe -q acpi:PNP0C0F:
+ exec modprobe -q virtio:d00000013v00001AF4
[    1.586330] BPF: [89794] Invalid name_offset:1651532
[    1.586537] failed to validate module [vsock] BTF: -22
+ exec modprobe -q virtio:d00000002v00001AF4
+ exec modprobe -q virtio:d00000010v00001AF4
[    1.601055] BPF: 	 type_id=142 bits_offset=2688
[    1.601884] BPF:  
[    1.601958] BPF: Invalid name
[    1.602058] BPF: 
[    1.602126] failed to validate module [i2c_core] BTF: -22
+ exec modprobe -q virtio:d00000002v00001AF4

~ # 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] host/rootfs: use initramfs in "make run"
  2022-09-05  7:49 ` [PATCH 1/2] host/rootfs: use initramfs in "make run" José Pekkarinen
@ 2022-09-08 10:52   ` Alyssa Ross
  2022-09-08 11:12     ` José Pekkarinen
  0 siblings, 1 reply; 10+ messages in thread
From: Alyssa Ross @ 2022-09-08 10:52 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 2503 bytes --]

José Pekkarinen <jose.pekkarinen@unikie.com> writes:

> On Thu, Sep 1, 2022 at 1:47 PM Alyssa Ross <hi@alyssa.is> wrote:
>
>> This will allow us to stop compiling e.g. the virtio-blk module into
>> the kernel, because it will be loaded by the initramfs.
>>
>> This introduces some duplication between the rootfs and initramfs's
>> Makefiles.  I don't think it's worth the effort at the moment to try
>> to reduce that, because it would come at the expense of additional
>> complexity in the Makefiles.  We can revisit this later if we want to.
>>
>> Signed-off-by: Alyssa Ross <hi@alyssa.is>
>
> Hi,
>
> This patchset introduces errors in the default qemu
>
> configuration of spectrum, where it is possible to see in the
> console log attempts to load broken aliases like:
>
> modprobe: FATAL: Module acpi:PNP0C0F: not found in directory
> /lib/modules/5.18.0

This is pretty much expected.  The only job of the initramfs is to get
the root filesystem mounted, so most kernel modules are not included in
it to keep the size down.  It just contains modules related to block
devices, dm-verity, ext4, etc.  If a we try to load a driver in
initramfs, and it isn't available, that's fine, because when we get to
the root filesystem, we run mdevd-coldplug again, and the module will be
loaded at that point.

The reason this didn't happen before when testing Spectrum in a VM is
that since all the drivers we needed were built in to the kernel, the
the block device nodes would be available before userspace even started,
meaning that the initramfs simply wouldn't have any time to try and fail
loading any other drivers before the rootfs was ready.  On hardware,
where the appropriate drivers wouldn't have been built in, I assume
these messages would already have been normal without this change,
although I didn't test.

> As well as valid modules load failures like:
>
> modprobe: ERROR: could not insert 'vfio_pci': Invalid argument

I wasn't able to reproduce this, with this series applied on top of
commit c0b9dff8653b59f5d2a24bb539cba6c91d3f7506,
Nixpkgs commit 4d05083dd894b73941e2e7d3b4f428b0ce1c7007, running
Spectrum with `make run' in the host/rootfs directory.  I started netvm
and verified that the QEMU ethernet device was successfully passed
through as well, so vfio-pci was definitely working.

Does that differ to the versions you were using to test?  If so, could
you try with those versions and let me know if that works for you?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] host/rootfs: use initramfs in "make run"
  2022-09-08 10:52   ` Alyssa Ross
@ 2022-09-08 11:12     ` José Pekkarinen
  2022-09-08 11:30       ` Alyssa Ross
  0 siblings, 1 reply; 10+ messages in thread
From: José Pekkarinen @ 2022-09-08 11:12 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 2838 bytes --]

On Thu, Sep 8, 2022 at 1:52 PM Alyssa Ross <hi@alyssa.is> wrote:

> José Pekkarinen <jose.pekkarinen@unikie.com> writes:
>
> > On Thu, Sep 1, 2022 at 1:47 PM Alyssa Ross <hi@alyssa.is> wrote:
> >
> >> This will allow us to stop compiling e.g. the virtio-blk module into
> >> the kernel, because it will be loaded by the initramfs.
> >>
> >> This introduces some duplication between the rootfs and initramfs's
> >> Makefiles.  I don't think it's worth the effort at the moment to try
> >> to reduce that, because it would come at the expense of additional
> >> complexity in the Makefiles.  We can revisit this later if we want to.
> >>
> >> Signed-off-by: Alyssa Ross <hi@alyssa.is>
> >
> > Hi,
> >
> > This patchset introduces errors in the default qemu
> >
> > configuration of spectrum, where it is possible to see in the
> > console log attempts to load broken aliases like:
> >
> > modprobe: FATAL: Module acpi:PNP0C0F: not found in directory
> > /lib/modules/5.18.0
>
> This is pretty much expected.  The only job of the initramfs is to get
> the root filesystem mounted, so most kernel modules are not included in
> it to keep the size down.  It just contains modules related to block
> devices, dm-verity, ext4, etc.  If a we try to load a driver in
> initramfs, and it isn't available, that's fine, because when we get to
> the root filesystem, we run mdevd-coldplug again, and the module will be
> loaded at that point.
>
> The reason this didn't happen before when testing Spectrum in a VM is
> that since all the drivers we needed were built in to the kernel, the
> the block device nodes would be available before userspace even started,
> meaning that the initramfs simply wouldn't have any time to try and fail
> loading any other drivers before the rootfs was ready.  On hardware,
> where the appropriate drivers wouldn't have been built in, I assume
> these messages would already have been normal without this change,
> although I didn't test.
>
> > As well as valid modules load failures like:
> >
> > modprobe: ERROR: could not insert 'vfio_pci': Invalid argument
>
> I wasn't able to reproduce this, with this series applied on top of
> commit c0b9dff8653b59f5d2a24bb539cba6c91d3f7506,
> Nixpkgs commit 4d05083dd894b73941e2e7d3b4f428b0ce1c7007, running
> Spectrum with `make run' in the host/rootfs directory.  I started netvm
> and verified that the QEMU ethernet device was successfully passed
> through as well, so vfio-pci was definitely working.
>
> Does that differ to the versions you were using to test?  If so, could
> you try with those versions and let me know if that works for you?
>

Yes, I was living in b01594b2c089ce2434dacddccf9a285af7334d24,

right version on nixpkgs. Rebasing on upstream main solved the issue.

Thanks!


José.

[-- Attachment #2: Type: text/html, Size: 3938 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] host/rootfs: use initramfs in "make run"
  2022-09-08 11:12     ` José Pekkarinen
@ 2022-09-08 11:30       ` Alyssa Ross
  0 siblings, 0 replies; 10+ messages in thread
From: Alyssa Ross @ 2022-09-08 11:30 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 3305 bytes --]

José Pekkarinen <jose.pekkarinen@unikie.com> writes:

> On Thu, Sep 8, 2022 at 1:52 PM Alyssa Ross <hi@alyssa.is> wrote:
>
>> José Pekkarinen <jose.pekkarinen@unikie.com> writes:
>>
>> > On Thu, Sep 1, 2022 at 1:47 PM Alyssa Ross <hi@alyssa.is> wrote:
>> >
>> >> This will allow us to stop compiling e.g. the virtio-blk module into
>> >> the kernel, because it will be loaded by the initramfs.
>> >>
>> >> This introduces some duplication between the rootfs and initramfs's
>> >> Makefiles.  I don't think it's worth the effort at the moment to try
>> >> to reduce that, because it would come at the expense of additional
>> >> complexity in the Makefiles.  We can revisit this later if we want to.
>> >>
>> >> Signed-off-by: Alyssa Ross <hi@alyssa.is>
>> >
>> > Hi,
>> >
>> > This patchset introduces errors in the default qemu
>> >
>> > configuration of spectrum, where it is possible to see in the
>> > console log attempts to load broken aliases like:
>> >
>> > modprobe: FATAL: Module acpi:PNP0C0F: not found in directory
>> > /lib/modules/5.18.0
>>
>> This is pretty much expected.  The only job of the initramfs is to get
>> the root filesystem mounted, so most kernel modules are not included in
>> it to keep the size down.  It just contains modules related to block
>> devices, dm-verity, ext4, etc.  If a we try to load a driver in
>> initramfs, and it isn't available, that's fine, because when we get to
>> the root filesystem, we run mdevd-coldplug again, and the module will be
>> loaded at that point.
>>
>> The reason this didn't happen before when testing Spectrum in a VM is
>> that since all the drivers we needed were built in to the kernel, the
>> the block device nodes would be available before userspace even started,
>> meaning that the initramfs simply wouldn't have any time to try and fail
>> loading any other drivers before the rootfs was ready.  On hardware,
>> where the appropriate drivers wouldn't have been built in, I assume
>> these messages would already have been normal without this change,
>> although I didn't test.
>>
>> > As well as valid modules load failures like:
>> >
>> > modprobe: ERROR: could not insert 'vfio_pci': Invalid argument
>>
>> I wasn't able to reproduce this, with this series applied on top of
>> commit c0b9dff8653b59f5d2a24bb539cba6c91d3f7506,
>> Nixpkgs commit 4d05083dd894b73941e2e7d3b4f428b0ce1c7007, running
>> Spectrum with `make run' in the host/rootfs directory.  I started netvm
>> and verified that the QEMU ethernet device was successfully passed
>> through as well, so vfio-pci was definitely working.
>>
>> Does that differ to the versions you were using to test?  If so, could
>> you try with those versions and let me know if that works for you?
>>
>
> Yes, I was living in b01594b2c089ce2434dacddccf9a285af7334d24,
>
> right version on nixpkgs. Rebasing on upstream main solved the issue.
>
> Thanks!

Awesome!  If it's now working for you, want to send me some Tested-by:
lines for the patches you've tested, so they can be recorded in the
commit log?  (Just reply to the patches you've tested with "Tested-by:
José Pekkarinen <jose.pekkarinen@unikie.com>" on a line on its own, and
then it'll be automatically picked up when I apply the patches.)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] host/rootfs: use initramfs in "make run"
  2022-09-01 10:46 [PATCH 1/2] host/rootfs: use initramfs in "make run" Alyssa Ross
  2022-09-01 10:46 ` [PATCH 2/2] host/rootfs: remove kernel override Alyssa Ross
  2022-09-05  7:49 ` [PATCH 1/2] host/rootfs: use initramfs in "make run" José Pekkarinen
@ 2022-09-08 11:40 ` José Pekkarinen
  2022-09-08 12:09 ` Alyssa Ross
  3 siblings, 0 replies; 10+ messages in thread
From: José Pekkarinen @ 2022-09-08 11:40 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 4750 bytes --]

On Thu, Sep 1, 2022 at 1:47 PM Alyssa Ross <hi@alyssa.is> wrote:

> This will allow us to stop compiling e.g. the virtio-blk module into
> the kernel, because it will be loaded by the initramfs.
>
> This introduces some duplication between the rootfs and initramfs's
> Makefiles.  I don't think it's worth the effort at the moment to try
> to reduce that, because it would come at the expense of additional
> complexity in the Makefiles.  We can revisit this later if we want to.
>
> Signed-off-by: Alyssa Ross <hi@alyssa.is>
>

Tested-by: José Pekkarinen <jose.pekkarinen@unikie.com>


> ---
>  host/rootfs/Makefile  | 32 ++++++++++++++++++++++++++++----
>  host/rootfs/shell.nix | 10 ++++++++--
>  2 files changed, 36 insertions(+), 6 deletions(-)
>
> diff --git a/host/rootfs/Makefile b/host/rootfs/Makefile
> index 41cf87c..31f76d2 100644
> --- a/host/rootfs/Makefile
> +++ b/host/rootfs/Makefile
> @@ -6,6 +6,9 @@
>  # QEMU_KVM = qemu-system-x86_64 -enable-kvm.
>  QEMU_KVM = qemu-kvm
>
> +SCRIPTS = ../../scripts
> +VERITYSETUP = veritysetup
> +
>  # tar2ext4 will leave half a filesystem behind if it's interrupted
>  # half way through.
>  build/rootfs.ext4: build/rootfs.tar
> @@ -116,16 +119,37 @@ clean:
>         rm -rf build
>  .PHONY: clean
>
> -run: build/rootfs.ext4 $(EXT_FS)
> +# veritysetup format produces two files, but Make only (portably)
> +# supports one output per rule, so we combine the two outputs then
> +# define two more rules to separate them again.
> +build/rootfs.verity: build/rootfs.ext4
> +       $(VERITYSETUP) format build/rootfs.ext4
> build/rootfs.verity.superblock.tmp \
> +           | awk -F ':[[:blank:]]*' '$$1 == "Root hash" {print $$2;
> exit}' \
> +           > build/rootfs.verity.roothash.tmp
> +       cat build/rootfs.verity.roothash.tmp
> build/rootfs.verity.superblock.tmp \
> +           > $@
> +       rm build/rootfs.verity.roothash.tmp
> build/rootfs.verity.superblock.tmp
> +build/rootfs.verity.roothash: build/rootfs.verity
> +       head -n 1 build/rootfs.verity > $@
> +build/rootfs.verity.superblock: build/rootfs.verity
> +       tail -n +2 build/rootfs.verity > $@
> +
> +build/live.img: $(SCRIPTS)/format-uuid.sh $(SCRIPTS)/make-gpt.sh
> build/rootfs.verity.superblock build/rootfs.verity.roothash
> build/rootfs.ext4
> +       $(SCRIPTS)/make-gpt.sh $@.tmp \
> +
>  build/rootfs.verity.superblock:2c7357ed-ebd2-46d9-aec1-23d437ec2bf5:$$($(SCRIPTS)/format-uuid.sh
> "$$(dd if=build/rootfs.verity.roothash bs=32 skip=1 count=1 status=none)") \
> +
>  build/rootfs.ext4:4f68bce3-e8cd-4db1-96e7-fbcaf984b709:$$($(SCRIPTS)/format-uuid.sh
> "$$(head -c 32 build/rootfs.verity.roothash)")
> +       mv $@.tmp $@
> +
> +run: build/live.img $(EXT_FS) build/rootfs.verity.roothash
>         $(QEMU_KVM) -cpu host -m 2G \
> -           -machine q35,kernel=$(KERNEL),kernel-irqchip=split \
> +           -machine
> q35,kernel=$(KERNEL),kernel-irqchip=split,initrd=$(INITRAMFS) \
>             -display gtk,gl=on \
>             -qmp unix:vmm.sock,server,nowait \
>             -monitor vc \
>             -parallel none \
> -           -drive file=build/rootfs.ext4,if=virtio,format=raw,readonly=on
> \
> +           -drive file=build/live.img,if=virtio,format=raw,readonly=on \
>             -drive file=$(EXT_FS),if=virtio,format=raw,readonly=on \
> -           -append "console=ttyS0 root=/dev/vda ext=/dev/vdb
> intel_iommu=on" \
> +           -append "console=ttyS0 roothash=$$(<
> build/rootfs.verity.roothash) ext=/dev/vdb intel_iommu=on" \
>             -device intel-iommu,intremap=on \
>             -device virtio-vga-gl \
>             -device vhost-vsock-pci,guest-cid=3
> diff --git a/host/rootfs/shell.nix b/host/rootfs/shell.nix
> index 3b2310f..fe9df1b 100644
> --- a/host/rootfs/shell.nix
> +++ b/host/rootfs/shell.nix
> @@ -1,18 +1,24 @@
>  # SPDX-License-Identifier: MIT
>  # SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>
> +# SPDX-FileCopyrightText: 2022 Unikie
>
>  { pkgs ? import <nixpkgs> {} }:
>
> +let
> +  rootfs = import ./. { inherit pkgs; };
> +in
> +
>  with pkgs;
>
> -(import ./. { inherit pkgs; }).overrideAttrs (
> +rootfs.overrideAttrs (
>  { passthru ? {}, nativeBuildInputs ? [], ... }:
>
>  {
>    nativeBuildInputs = nativeBuildInputs ++ [
> -    jq netcat qemu_kvm reuse util-linux
> +    cryptsetup jq netcat qemu_kvm reuse util-linux
>    ];
>
>    EXT_FS = pkgsStatic.callPackage ../initramfs/extfs.nix { inherit pkgs;
> };
> +  INITRAMFS = import ../initramfs { inherit pkgs rootfs; };
>    KERNEL =
> "${passthru.kernel}/${stdenv.hostPlatform.linux-kernel.target}";
>  })
> --
> 2.37.1
>
>

-- 

José.

[-- Attachment #2: Type: text/html, Size: 6068 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] host/rootfs: remove kernel override
  2022-09-01 10:46 ` [PATCH 2/2] host/rootfs: remove kernel override Alyssa Ross
@ 2022-09-08 11:41   ` José Pekkarinen
  2022-09-08 12:09   ` Alyssa Ross
  1 sibling, 0 replies; 10+ messages in thread
From: José Pekkarinen @ 2022-09-08 11:41 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: devel

[-- Attachment #1: Type: text/plain, Size: 1443 bytes --]

On Thu, Sep 1, 2022 at 1:47 PM Alyssa Ross <hi@alyssa.is> wrote:

> These drivers should be loaded by the initramfs if required — most
> Spectrum installs won't need the virtio drivers on the host, and
> overriding the kernel means more stuff we can't reuse from
> cache.nixos.org.
>
> We'll probably want to build in the driver for whatever filesystem we
> end up using for the root file system eventually, since it will always
> be required, but that should be done as part of a more systematic
> effort to optimise our kernel configuration.
>
> Signed-off-by: Alyssa Ross <hi@alyssa.is>
>

Tested-by: José Pekkarinen <jose.pekkarinen@unikie.com>


> ---
>  host/rootfs/default.nix | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix
> index e5f316f..a651a20 100644
> --- a/host/rootfs/default.nix
> +++ b/host/rootfs/default.nix
> @@ -65,14 +65,7 @@ let
>      imports = [ (modulesPath + "/profiles/all-hardware.nix") ];
>    });
>
> -  kernel = pkgs.linux_latest.override {
> -    structuredExtraConfig = with lib.kernel; {
> -      VIRTIO = yes;
> -      VIRTIO_PCI = yes;
> -      VIRTIO_BLK = yes;
> -      EXT4_FS = yes;
> -    };
> -  };
> +  kernel = pkgs.linux_latest;
>
>    packagesSysroot = runCommand "packages-sysroot" {
>      nativeBuildInputs = [ xorg.lndir ];
> --
> 2.37.1
>
>

-- 

José.

[-- Attachment #2: Type: text/html, Size: 2435 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] host/rootfs: use initramfs in "make run"
  2022-09-01 10:46 [PATCH 1/2] host/rootfs: use initramfs in "make run" Alyssa Ross
                   ` (2 preceding siblings ...)
  2022-09-08 11:40 ` José Pekkarinen
@ 2022-09-08 12:09 ` Alyssa Ross
  3 siblings, 0 replies; 10+ messages in thread
From: Alyssa Ross @ 2022-09-08 12:09 UTC (permalink / raw)
  To: Alyssa Ross, devel; +Cc: José Pekkarinen

This patch has been committed as 6af16d04b71fd4a675e77dd707bc8e36513c8a85,
which can be viewed online at
https://spectrum-os.org/git/spectrum/commit/?id=6af16d04b71fd4a675e77dd707bc8e36513c8a85.

This is an automated message.  Send comments/questions/requests to:
Alyssa Ross <hi@alyssa.is>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] host/rootfs: remove kernel override
  2022-09-01 10:46 ` [PATCH 2/2] host/rootfs: remove kernel override Alyssa Ross
  2022-09-08 11:41   ` José Pekkarinen
@ 2022-09-08 12:09   ` Alyssa Ross
  1 sibling, 0 replies; 10+ messages in thread
From: Alyssa Ross @ 2022-09-08 12:09 UTC (permalink / raw)
  To: Alyssa Ross, devel; +Cc: José Pekkarinen

This patch has been committed as 44d289986b1ef4d7a0c6655b97a487fb61b45534,
which can be viewed online at
https://spectrum-os.org/git/spectrum/commit/?id=44d289986b1ef4d7a0c6655b97a487fb61b45534.

This is an automated message.  Send comments/questions/requests to:
Alyssa Ross <hi@alyssa.is>



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-09-08 12:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01 10:46 [PATCH 1/2] host/rootfs: use initramfs in "make run" Alyssa Ross
2022-09-01 10:46 ` [PATCH 2/2] host/rootfs: remove kernel override Alyssa Ross
2022-09-08 11:41   ` José Pekkarinen
2022-09-08 12:09   ` Alyssa Ross
2022-09-05  7:49 ` [PATCH 1/2] host/rootfs: use initramfs in "make run" José Pekkarinen
2022-09-08 10:52   ` Alyssa Ross
2022-09-08 11:12     ` José Pekkarinen
2022-09-08 11:30       ` Alyssa Ross
2022-09-08 11:40 ` José Pekkarinen
2022-09-08 12:09 ` Alyssa Ross

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).