From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 96A709417FE for ; Wed, 20 Nov 2024 11:27:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=fS8jG38Hy2DzFz85jD92xVseW5+UiTWAGEesu5XQ8po=; c=relaxed/simple; d=groups.io; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20240830; t=1732102024; v=1; x=1732361222; b=oG+ICu2EHb1x0M+xzOCGMt7qDefTkSlQDdqikjA3EO/hbEAyMERxe0lj7/2UK1wd9bsXZXLN /u0+r4t9lMrlhbdwRhj4Ii05tB0AUL1ZtFS7e0xvUIWTvC9IEiKTfxegAzxIUyXDBpg/erSa5SH T1z4b9Ilxrox5dMqSqw9lR5T6PIjL7tmtyiQIzBjCrHXBYQN80TmUsvkoqbtn7rR7Y5HzlNTwVL 9GglBHu8oCKodSRgz9Yv8n7ayWYP63hhwsnTearpzSxJ9PBeYZJ4rvUxbywIfPZJMQXJZ2pKwjs yN9s37zGRJzmLfXxWkj1dihNwxu6Ds7wvpGHOuNV0wJmg== X-Received: by 127.0.0.2 with SMTP id b9GyYY7687511xr2AvBEKCa8; Wed, 20 Nov 2024 03:27:02 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.11151.1732102021786022904 for ; Wed, 20 Nov 2024 03:27:02 -0800 X-Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-583-tcPl-QZDN9Ks0c4-gGEEsQ-1; Wed, 20 Nov 2024 06:26:57 -0500 X-MC-Unique: tcPl-QZDN9Ks0c4-gGEEsQ-1 X-Mimecast-MFC-AGG-ID: tcPl-QZDN9Ks0c4-gGEEsQ X-Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8FC1819560B1; Wed, 20 Nov 2024 11:26:56 +0000 (UTC) X-Received: from dobby.home.kraxel.org (unknown [10.39.193.111]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 306511956086; Wed, 20 Nov 2024 11:26:56 +0000 (UTC) X-Received: by dobby.home.kraxel.org (Postfix, from userid 1000) id 806D823F6D5; Wed, 20 Nov 2024 12:26:53 +0100 (CET) Date: Wed, 20 Nov 2024 12:26:53 +0100 From: "Gerd Hoffmann via groups.io" To: devel@edk2.groups.io, mitchell.augustin@canonical.com Cc: xpahos@gmail.com Subject: Re: [edk2-devel] [BUG] Extremely slow boot times with CPU and GPU passthrough and host phys-bits > 40 Message-ID: References: <6663.1731964487939114666@groups.io> <24085.1732055112128290386@groups.io> MIME-Version: 1.0 In-Reply-To: <24085.1732055112128290386@groups.io> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: RT5gnumJ0DuhxKrhZb4q6IvrYGB99leE8Mr-asJhyKs_1732102016 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 Resent-Date: Wed, 20 Nov 2024 03:27:02 -0800 Resent-From: kraxel@redhat.com Reply-To: devel@edk2.groups.io,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: F4gZTVCvwOZdmIitTRvmTUl1x7686176AA= Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=oG+ICu2E; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io On Tue, Nov 19, 2024 at 02:25:12PM -0800, mitchell.augustin via groups.io wrote: > Hi, > > Thanks for the suggestion. I'm not necessarily saying this patch > itself has an issue, just that it is the point in the git history at > which this slow boot time issue manifests for us. This may be because > the patch does actually fix the other issue I described above related > to BAR assignment not working correctly in versions before that patch, > despite boot being faster back then. (in those earlier versions, the > PCI devices for the GPUs were passed through, but the BAR assignment > was erroneous, so we couldn't actually use them - the Nvidia GPU > driver would just throw errors.) Do you also see the slowdown without the GPU in a otherwise identical guest configuration? While debugging a similar issue I've found that kvm behaves differently in case a PCI-assigned device is present, specifically kvm goes look more closely at memory attributes in guest page tables and mtrr registers and uses them for EPT configuration. See commit ce4c76e46d52 ("OvmfPkg/Sec: Setup MTRR early in the boot process."). So this could be an issue in kvm. It could also be ovmf doing something wrong with page attributes and mtrr settings. > After I initially posted here, we also discovered another kernel issue > that was contributing to the boot times for this config exceeding 5 > minutes - so with that isolated, I can say that my config only takes > about a 5 minutes for a full boot: 1-2 minutes for `virsh start` > (which scales with guest memory allocation), Looks quite high to me. What amount of guest memory we are talking about? > I'm going to attempt to profile ovmf next to see what part of the code > path is taking up the most time, but if you already have an idea of > what that might be (and whether it is actually a bug or expected to > take that long), that insight would be appreciated. More details would be helpful indeed. Is that a general overall slowdown? Is it some specific part which takes alot of time? I'd suggest to also trim down the logging, it's quite excessive in the build (apparently every single memory allocation is logged), that slows down the boot process too. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120804): https://edk2.groups.io/g/devel/message/120804 Mute This Topic: https://groups.io/mt/109651206/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-