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.129.124]) by mx.groups.io with SMTP id smtpd.web11.198023.1673966388858416189 for ; Tue, 17 Jan 2023 06:39:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bqsoxTtZ; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673966388; 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=u2Eiq7fFR2oMSFJim9Onn7rgZdYPPPRM29OAKsJjt0U=; b=bqsoxTtZQuczYg1dgbMbvz4KWKZpMtr336I+fUdBpSyCk6H0tFE8+welHvHFvdjvlPMJks jILfJ0LRwJYOfe8phy9Fh4AcfFDdTPebDMzC2bM7Ky7y1LHM5yBTEBzFsCXUJzt6oWj83Z eB4VOzafGa5klD+JwGiRVsmDdb5wzgs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-323-vuBXQJZAOXGyxvxd_3mQyg-1; Tue, 17 Jan 2023 09:39:17 -0500 X-MC-Unique: vuBXQJZAOXGyxvxd_3mQyg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0BB731C0A59D; Tue, 17 Jan 2023 14:38:20 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE770C15BA0; Tue, 17 Jan 2023 14:38:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 62AAB1802C3B; Tue, 17 Jan 2023 15:38:18 +0100 (CET) Date: Tue, 17 Jan 2023 15:38:18 +0100 From: "Gerd Hoffmann" To: "Boeuf, Sebastien" Cc: "Yao, Jiewen" , "Justen, Jordan L" , "devel@edk2.groups.io" , "ardb+tianocore@kernel.org" Subject: Re: [OVMF] What would be the best way to make PcdPciMmio64Size dynamic? Message-ID: <20230117143818.oy5fer3sgt23hljh@sirius.home.kraxel.org> References: <3f999b7791ac4c1ccbd73a65e5c3635d21b6d84d.camel@intel.com> MIME-Version: 1.0 In-Reply-To: <3f999b7791ac4c1ccbd73a65e5c3635d21b6d84d.camel@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 17, 2023 at 02:10:08PM +0000, Boeuf, Sebastien wrote: > Hi, > > Looking at the hardcoded limitation provided by PcdPciMmio64Size > (32GiB), I was wondering what would be the best approach to make this a > bit more dynamic? > > I know that for QEMU, the fw_cfg mechanism can be used to override the > value of PcdPciMmio64Size, but this isn't something Cloud Hypervisor or > other VMMs can implement given they don't support fw_cfg at all. > > Would it be acceptable to dynamically compute PcdPciMmio64Size from the > physical address space? Given the reason why PcdPciMmio64Size can't be > increased is to make sure it can support host with small address space > (such as 36 bits), we could introduce a very simple function that would > determine the available address space and consider PcdPciMmio64Size > being half the size. Sure, check master branch, the code is already there. Should just be a matter of wiring up the function calls for cloundhv, and you can probably call PlatformAddressWidthFromCpuid() with QemuQuirk = false unconditionally. take care, Gerd