From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mx.groups.io with SMTP id smtpd.web11.4619.1626766410136471331 for ; Tue, 20 Jul 2021 00:33:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=SkpnfJjr; spf=pass (domain: linux.ibm.com, ip: 148.163.156.1, mailfrom: dovmurik@linux.ibm.com) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16K7DNGh150486; Tue, 20 Jul 2021 03:33:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=TQv/X6Bvqb4ItsoZcVnYP1FTbiDNkQV4LFWial/kv4I=; b=SkpnfJjrWYaU482d0/BrMHBgtptr6IOZuVqN/yA469Aotzy+NicFLqAPj+43R8tnMqtn ZRFyOdhVgafP8eqrfdudYAonSAJAzX9JCfCDnRFWX2Vlc/wJhenbi74zVOz1lCPK4JMI aIiyzfPrAhq0/ew0aZ38hXxQ9r5fAa3DfwtuffhVB1tBV/0vQu088X/W650/Wlusqed8 xhIyAjmH3yoBbnXgaoS6YilCAPN1Ld1DaQBbdsOUS6AdbcKVy7jQCaoblCK9AOUNgFc5 0fFE08d+xwQo3RVH2v79j2uxM/GXkntwQ5vW+pH7IfBJUiiJ2810S6Wvb2Jom2j8xUTM Dg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39wswcrf4f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jul 2021 03:33:28 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 16K7Ehsq153361; Tue, 20 Jul 2021 03:33:27 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 39wswcrf40-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jul 2021 03:33:27 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 16K7WgqE030252; Tue, 20 Jul 2021 07:33:26 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma04dal.us.ibm.com with ESMTP id 39upubn300-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jul 2021 07:33:26 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 16K7XOVv49676672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Jul 2021 07:33:24 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9AD2E124060; Tue, 20 Jul 2021 07:33:24 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C73B3124052; Tue, 20 Jul 2021 07:33:21 +0000 (GMT) Received: from [9.65.195.237] (unknown [9.65.195.237]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 20 Jul 2021 07:33:21 +0000 (GMT) Subject: Re: [PATCH v2 03/11] OvmfPkg: PlatformBootManagerLibGrub: Allow executing kernel via fw_cfg To: Tom Lendacky , devel@edk2.groups.io Cc: Tobin Feldman-Fitzthum , Tobin Feldman-Fitzthum , Jim Cadden , James Bottomley , Hubertus Franke , Laszlo Ersek , Ard Biesheuvel , Jordan Justen , Ashish Kalra , Brijesh Singh , Erdem Aktas , Jiewen Yao , Min Xu , Dov Murik References: <20210706085501.1260662-1-dovmurik@linux.ibm.com> <20210706085501.1260662-4-dovmurik@linux.ibm.com> <869620c9-7eef-2442-282c-447b4e6a3b3b@amd.com> <579f60db-d8bc-dece-f391-6552ff0e0f9f@linux.ibm.com> From: "Dov Murik" Message-ID: Date: Tue, 20 Jul 2021 10:33:19 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <579f60db-d8bc-dece-f391-6552ff0e0f9f@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: vkGOFZfkNJKvS8EcUy6HgPekryVb433d X-Proofpoint-ORIG-GUID: atEILpjsPr6tAxSryazR5mBbLVskT04e X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-20_04:2021-07-19,2021-07-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107200040 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 19/07/2021 22:14, Dov Murik wrote: > > > On 19/07/2021 18:21, Tom Lendacky wrote: >> On 7/6/21 3:54 AM, Dov Murik wrote: >>> From: James Bottomley >>> >>> Support QEMU's -kernel option. >>> >>> OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c is an exact copy >>> of OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c . >> >> Just a nit, but this confused me initially. Maybe it should say something >> along the lines of create a QemuKernel.c for PlatformBootManagerLibGrub >> that is an exact copy of the file from PlatformBootManagerLib. >> > > You're right; I'll write it clearer. > > >> Is there any way that the two libraries can use the same file rather than >> making an exact copy? > > I guess it's possible by extracting the file into its own library? I'll > need to take a deeper look. > With this patch we'll have two identical files: OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c but there's another QemuKernel.c, which is *almost* identical: ArmVirtPkg/Library/PlatformBootManagerLib/QemuKernel.c so a proper fix should consolidate all three into one library used by all three libs. I suggest postponing this to a separate refactoring series. Thanks, -Dov