From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 5C2845E7F1; Thu, 8 Sep 2022 11:12:51 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id A666B5E7CB; Thu, 8 Sep 2022 11:12:48 +0000 (UTC) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by atuin.qyliss.net (Postfix) with ESMTPS id 9B3605E831 for ; Thu, 8 Sep 2022 11:12:44 +0000 (UTC) Received: by mail-ed1-x52f.google.com with SMTP id z8so23808832edb.6 for ; Thu, 08 Sep 2022 04:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=8q22T2NjYYe2lhGfBFV4BuCG4rQwkDJFzMhaM4RsxBM=; b=jGQnnjq1yxrXouw9rIzOjOsdPRRtSOnEcf2Kpy7H9Ikqb7poKLsVWQrm6o8sXf5m0C ib2YwoI6N2NGqT/wgL9tWdfeFcgQOOnCpp4Oe5dh8tk5T351noPOrlwGpfvVclFVXEdw pi3uzKPkfBEXGm2cQzvPOPQpZ52eAmiHdYLHCVvqQFL0FYdLrj2Jto6v7iRyX6RH/Ain k36SVA1OhcquvgAxcBMta8paaTapR3veVTNmZBW0qkWeHNRrqLtgHMjOgVg9NCmXTWPL z6kULIeEkWHLm1zm048BQunHeaPbcjwaRh6J29FAJQ+yBXWu+b59WLshGWs73wyT/WJv 6owQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=8q22T2NjYYe2lhGfBFV4BuCG4rQwkDJFzMhaM4RsxBM=; b=LaP44SME1coUKsQeVe++6sVNiWnWl4ageJR9SxB+Rhp4B2GA3iUbLIsx0ULcP5CBbP Wx4bKOFsvr8k8vcF2Hg0NmvCcSO1tsRVMIktSPfP0N/Q89DbZpjZ4ll6P62pFYLDddyU LtcYwem4Ob9qtcibQtRCrxbzg685qe0lZQM+TtgCfBctWHK9QBdrc8+ACcrbQAG1iF8r 4K5RALVLr22guIzxBZUCwaTWki6k0mle+BCXBqNIPu1zK64OojVyHHhzScDk/2PCWqiB MxM1SalVrQz8Q7b6sfVWcwgeK+1hzBKD/Tjs6PsD7QljQs9OTCUqJklUvSE0tw594H/1 wcaw== X-Gm-Message-State: ACgBeo0Wy9uViDSw6RDzxs0HELz1BFa2M7E9hVAQ7KLHsEIEmNYnR0oE CFp5IN1kqdnD5LrrBOqFIG6GP9Sv8MLQy/OBE0NSfKEXN4tSO0eaPZBQSQ== X-Google-Smtp-Source: AA6agR4s7tB3faC9PVCWmlcyGLEjlp8oiohAWBI2kb5D/u/Qi9oMZh1ZE5fWb9+WTqBysbD3DEkXJL7c5t6X85lX4b0= X-Received: by 2002:a05:6402:354f:b0:448:2385:b998 with SMTP id f15-20020a056402354f00b004482385b998mr6546554edd.57.1662635562407; Thu, 08 Sep 2022 04:12:42 -0700 (PDT) MIME-Version: 1.0 References: <20220901104629.863380-1-hi@alyssa.is> <87y1uu9lyz.fsf@alyssa.is> In-Reply-To: <87y1uu9lyz.fsf@alyssa.is> From: =?UTF-8?Q?Jos=C3=A9_Pekkarinen?= Date: Thu, 8 Sep 2022 14:12:06 +0300 Message-ID: Subject: Re: [PATCH 1/2] host/rootfs: use initramfs in "make run" To: Alyssa Ross Content-Type: multipart/alternative; boundary="00000000000016b70505e82882ba" Message-ID-Hash: L53LDDBUCNZ5F7A3NU54TS25T25JLYHH X-Message-ID-Hash: L53LDDBUCNZ5F7A3NU54TS25T25JLYHH X-MailFrom: jose.pekkarinen@unikie.com X-Mailman-Rule-Hits: header-match-devel.spectrum-os.org-0 X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1 CC: devel@spectrum-os.org X-Mailman-Version: 3.3.5 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --00000000000016b70505e82882ba Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 8, 2022 at 1:52 PM Alyssa Ross wrote: > Jos=C3=A9 Pekkarinen writes: > > > On Thu, Sep 1, 2022 at 1:47 PM Alyssa Ross 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, > > > > 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=C3=A9. --00000000000016b70505e82882ba Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Sep 8, 2022 at 1:52 PM Alyssa= Ross <hi@alyssa.is> wrote:
Jos=C3=A9 Pekkarinen = <jose.pe= kkarinen@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 in= to
>> the kernel, because it will be loaded by the initramfs.
>>
>> This introduces some duplication between the rootfs and initramfs&= #39;s
>> Makefiles.=C2=A0 I don't think it's worth the effort at th= e moment to try
>> to reduce that, because it would come at the expense of additional=
>> complexity in the Makefiles.=C2=A0 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.=C2=A0 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.=C2=A0 It just contains modules related to block devices, dm-verity, ext4, etc.=C2=A0 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 fai= l
loading any other drivers before the rootfs was ready.=C2=A0 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.=C2=A0 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?=C2=A0 If so, could=
you try with those versions and let me know if that works for you?

Yes, I was living in=C2=A0b01594b2c089ce2434dacddccf= 9a285af7334d24,
right version on nixpkgs. Rebasing on upstr= eam main solved the issue.

Thanks!

=
Jos=C3=A9.
--00000000000016b70505e82882ba--