From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.19114.1684753928224933995 for ; Mon, 22 May 2023 04:12:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TVUXPjAZ; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684753926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hX6HMADlWUAAymIyBSZbfRY5lbmcaiP06HdVeeNYe50=; b=TVUXPjAZUamQPoQ8/JO0DXS/I1JAY8FlrO60nZaERtdatn/XHU8lmIBnqXr6FCYs0LIlPo 2QWjK4buZPAPBLTzyOjM/iShizFa713hXwKwUwQxdJurGDeUBLL0dFztbU6oZNT4xvlCE/ y/ALg/3AV3Jjb4IjhPeUDQdQGO7swK0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-EShgi33PM0yNRaI1dStnIQ-1; Mon, 22 May 2023 07:12:02 -0400 X-MC-Unique: EShgi33PM0yNRaI1dStnIQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6CB88802A55; Mon, 22 May 2023 11:12:02 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.139]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 080667C2A; Mon, 22 May 2023 11:12:01 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A33EF1800606; Mon, 22 May 2023 13:12:00 +0200 (CEST) Date: Mon, 22 May 2023 13:12:00 +0200 From: "Gerd Hoffmann" To: Fiona Ebner Cc: devel@edk2.groups.io, Jordan Justen , Pawel Polawski , Jiewen Yao , Oliver Steffen , Ard Biesheuvel , Thomas Lamprecht Subject: Re: [edk2-devel] [PATCH v2 3/4] OvmfPkg/PlatformInitLib: dynamic mmio window size Message-ID: References: <20221004134728.55499-1-kraxel@redhat.com> <20221004134728.55499-4-kraxel@redhat.com> <2jjqzc74i2v4q5bwcpcjcsjl3k5yww3chlr2zmtxznizietybu@y6cwtukhhoqn> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > The errors for the virtio devices are: > > virtio_scsi virtio1: virtio: device uses modern interface but does not have VIRTIO_F_VERSION_1 > > virtio_scsi: probe of virtio1 failed with error -22 > > virtio_net virtio2: virtio: device uses modern interface but does not have VIRTIO_F_VERSION_1 > > virtio_net: probe of virtio2 failed with error -22 I guess something goes wrong with accessing the mmio pci bars. Seems to be a linux kernel bug in 4.15, when installing the hwe kernel (5.4) it works fine for me. > In the kern.log, I didn't really see any interesting differences, except > for the errors above. The addresses are different and there is now a > 64-bit bridge window, but I guess that's expected. > > > + pci 0000:00:1e.0: bridge window [mem 0x700000000000-0x700fffffffff 64bit pref] Yes. > Not sure if this is interesting either, but part of the diff between the > lspci outputs (first with the call, second without the call): > > > *************** > > *** 75,88 **** > > 00:05.0 SCSI storage controller: Red Hat, Inc Virtio SCSI > > Subsystem: Red Hat, Inc Virtio SCSI > > Physical Slot: 5 > > ! Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ INTx enabled. > > ! Capabilities: [98] MSI-X: Enable+ Count=7 Masked- MSI-X enabled. That probably comes from the driver exiting early (and not configuring interrupts). The patch below fixes it for me. Can you confirm this? take care, Gerd >>From 05fdf93b17decc42dde2ba89e935616eceb705c4 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 22 May 2023 13:04:35 +0200 Subject: [PATCH 1/1] [testing] older linux kernels seem to have problems with phys-bits > 46 --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c index acf90b4e93fd..0482d8906d5c 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -646,16 +646,19 @@ PlatformAddressWidthFromCpuid ( )); if (Valid) { - if (PhysBits > 47) { + if (PhysBits > 46) { /* * Avoid 5-level paging altogether for now, which limits * PhysBits to 48. Also avoid using address bit 48, due to sign * extension we can't identity-map these addresses (and lots of * places in edk2 assume we have everything identity-mapped). * So the actual limit is 47. + * + * Also some older linux kernels apparently have problems handling + * phys-bits > 46 correctly, so use that as limit. */ - DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 47 (avoid 5-level paging)\n", __func__)); - PhysBits = 47; + DEBUG ((DEBUG_INFO, "%a: limit PhysBits to 46 (avoid 5-level paging)\n", __func__)); + PhysBits = 46; } if (!Page1GSupport && (PhysBits > 40)) { -- 2.40.1