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.web10.30052.1641811549218103310 for ; Mon, 10 Jan 2022 02:45:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NC7uc9Qq; 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=1641811548; 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=Zm5VKdbfQ8/InfL3KQklWHwYvd7dcHnVQuAcE3wsnS4=; b=NC7uc9QqvxWYjcLsTTd3i1Hcj/uozj4lJX9Kwegnrt4czTIsNU6cHX8YVq3JKwtM/zD+70 JZFHkNTNu5VuxM4iR4mrHrQTEU9bZtmAb2K5mcIcVHpWDWKr3qw0/IUjVaJm9dN18y9+Eq BwPeVq2uU9AxLkDmRO1zo+QonLJNcn4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-237-71gX7xtQPDO67FRBUaJVIQ-1; Mon, 10 Jan 2022 05:45:45 -0500 X-MC-Unique: 71gX7xtQPDO67FRBUaJVIQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 151441083F73; Mon, 10 Jan 2022 10:45:44 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D12726F9CF; Mon, 10 Jan 2022 10:45:43 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0702C18003A0; Mon, 10 Jan 2022 11:45:42 +0100 (CET) Date: Mon, 10 Jan 2022 11:45:42 +0100 From: "Gerd Hoffmann" To: "Boeuf, Sebastien" Cc: "devel@edk2.groups.io" , "Yao, Jiewen" Subject: Re: Creating new target for Cloud Hypervisor Message-ID: <20220110104542.hrfoi5ndwdeh3lal@sirius.home.kraxel.org> References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 10, 2022 at 09:13:44AM +0000, Boeuf, Sebastien wrote: > Hi all, > > So far I've been able to patch the OvmfPkgX64 target to make it work for both > QEMU and Cloud Hypervisor, but as I try to enable more features (EFI shell for > instance) the gap is getting bigger and harder to keep them working together. > > That's why I'm thinking about creating an OvmfCh target that would be a simple > copy of OvmfX64 at first, and then we could keep improving from there. There are > multiple things that are not needed by Cloud Hypervisor, which might help reduce > the complexity of the firmware, eventually leading to faster boot. > > I'd like some confirmation from the community that it's okay to go down this road > before I proceed and send the patches. Well, depends. A separate target is extra maintainance effort. But having to write code for runtime-switching where compile-time switching would work without additional code is extra maintainance effort too ... For microvm pci support (not yet merged) tipped things towards a separate target. pcie in microvm works completely different when compared to pc/q35. Using mmconfig for pci config space access is mandatory, port 0xcf8 is not supported. So fitting that with a runtime switch into OvmfPkg/Library/DxePciLibI440FxQ35 (and probably some other places) would have been quite messy, with a separate target is is *alot* easier. Quite a few places use a runtime switch nevertheless to avoid code duplication. PlatformPei for example is identical for both OvmfPkgX64 and MicrovmX86 targets, with case: branches for microvm in switch statements. So, what problem you are facing which makes you think a separate target would work better? The timer thing should be a non-issue as we plan to switch over OvmfPkgX64 to use apic timer anyway. take care, Gerd