From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id B860BD80550 for ; Tue, 13 Feb 2024 17:28:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=FLicl7PC1lIMNrvxFkYqTzKWJLIGVYXbJT2uqttGJzg=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1707845332; v=1; b=U4ea8fRF8/eEQcY9Qx3qfDtbDhZi+xcOt/mb2yT1VwpcE4oP3VWjLJWLHGp2cTL5YOqVVbaz BGvp9wRjHKA3+SXYNbOQCwpjHBw2yL6aZRb+l1/V1UWg8O//+lqZ6xn+xgdcSSu++0a/TOPJRN9 DYMAuag50JSac2UKMRKtiH1s= X-Received: by 127.0.0.2 with SMTP id mOWmYY7687511x8vgSLvNKNN; Tue, 13 Feb 2024 09:28:52 -0800 X-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.web10.17755.1707845331665708401 for ; Tue, 13 Feb 2024 09:28:51 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-70-aTZwq1tuOEigELdjBiAkNg-1; Tue, 13 Feb 2024 12:28:47 -0500 X-MC-Unique: aTZwq1tuOEigELdjBiAkNg-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C63A8185A78B; Tue, 13 Feb 2024 17:28:46 +0000 (UTC) X-Received: from [10.39.192.66] (unknown [10.39.192.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D76CF1C03428; Tue, 13 Feb 2024 17:28:45 +0000 (UTC) Message-ID: <6c6858f2-27fb-60d7-1672-7fa12c5b554f@redhat.com> Date: Tue, 13 Feb 2024 18:28:44 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 1/1] OvmfPkg/QemuVideoDxe: purge VbeShim To: Gerd Hoffmann Cc: devel@edk2.groups.io, Oliver Steffen , Ard Biesheuvel , Jiewen Yao , dun.tan@intel.com References: <20240213085925.687848-1-kraxel@redhat.com> <64005185-3cfd-de56-f086-da301aff13ba@redhat.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: gQuM71xB7usNZI7rZ1W4zieLx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=U4ea8fRF; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) On 2/13/24 15:02, Gerd Hoffmann wrote: > On Tue, Feb 13, 2024 at 11:44:17AM +0100, Laszlo Ersek wrote: >> Hi Gerd, >> >> On 2/13/24 09:59, Gerd Hoffmann wrote: >>> Removing CSM support broke VbeShim. >>> >>> I see ASSERTS being triggered, both in vbeshim code and elsewhere. >>> Didn't investigate in detail, but apparently the real mode address spac= e >>> is not considered being special any more, which invalidates some >>> assumptions of the vbeshim code. >>> >>> The guest os which depends on vbeshim for video support is -- according >>> to the comments -- Windows 2008 R2. Which went EOL in January 2020, >>> more than four years ago. >>> >>> Time to retire VbeShim. RIP. >> >> I don't understand this, and/or disagree. >> >> (1) Please collect more information about the ASSERT()s (the failure mod= e you are seeing). >> Because, (a) in the code that's being removed in this patch, I don't see= any ASSERT() that should fire, and (b) I cannot reproduce the issue. (In f= act my log contains "InstallVbeShim: VBE shim installed".) >=20 > Fair enough. The ASSERT() I see firing is this: >=20 > ASSERT /home/kraxel/projects/edk2/OvmfPkg/QemuVideoDxe/VbeShim.c(142): In= t0x10->Segment =3D=3D 0x0000 Something nasty is going on here; 138 // 139 // We managed to allocate the page at zero. SVN r14218 guarante= es that it 140 // is NUL-filled. 141 // 142 ASSERT (Int0x10->Segment =3D=3D 0x0000); "SVN r14218" is git commit d436d5ca0936 -- "Guarantee that free memory in t= he 4K page starting at address 0 is always cleared to 0". >=20 > It reproduces for me when booting with a bunch of hot-pluggable CPUs (qem= u -smp 2,maxcpus=3D32). >=20 > I bisected this, Thank you! > and it seems indeed totally unrelated to CSM removal: >=20 > 725acd0b9cc047b20a1b9379e46f05d3ebcf485e is the first bad commit > commit 725acd0b9cc047b20a1b9379e46f05d3ebcf485e > Author: Dun Tan > Date: Fri Dec 1 10:53:32 2023 +0800 >=20 > UefiCpuPkg: Avoid assuming only one smmbasehob >=20 > New theory: This is a NULL pointer dereference corrupting the zero page. Interesting; this commit is indeed related to having a multitude of (possib= le?) CPUs. >=20 > I still think it makes sense to retire VbeShim, but of course with a > different commit message and also the leftover function declaration > removed. I agree, although in this case, the VBE shim has unexpectedly caught an ind= ependent bug for us ;) >=20 > Can we unmap the zero page to avoid NULL pointer dereferences going > unnoticed (after removing VbeShim)? IIRC I've seen an config option > for that a while back, but can't find it now in the source tree ... Yes. See "PcdNullPointerDetectionPropertyMask" in "MdeModulePkg/MdeModulePk= g.dec". See NULL_DETECTION_NONSTOP_MODE in CpuDxe (and PiSmmCpuDxeSmm). In CpuDxe, = there's a fault handler that's supposed to dump the context to the serial p= ort. From looking only briefly, I'm not sure where the actual unmapping hap= pens (so that we get a page fault in the first place). Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115400): https://edk2.groups.io/g/devel/message/115400 Mute This Topic: https://groups.io/mt/104329097/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-