From nobody Sat Apr 27 06:13:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1558959189; cv=none; d=zoho.com; s=zohoarc; b=ClDXYyt6/EqGCxjwqyqNbLzREQDhtUv8ZGvrQaPpJGWZmnXEjwPrEI7G4+UDoOAmfSR6nrzsQSw5hVq6elGPNsfwvVLWFz132V8qni6D9H8KQ5YyklLvTq7zfS277V12r375mwR1J1hNmLeltv06difeS/KqPNnYn31n4XR3wLI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558959189; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=1XJkZfaoMZ3kSd1dn5O5R8/4gM/1ZsAG+M6eob7Sr/Y=; b=Py4S2vEhOqQ8sf0Jyyte3cqEDaVGC8/EGGrMQs6AhS4/1SzuP7YOnkthfjFBKzX0anaIM+ZWnLJFwBwVjXKoUWva6MuCDk8DN1N0X204wdQB1n4HWfqSfvs3wMXiLXinVa/lYmy7wYbQ2meYSM/Uoxbb/nEqB5OY4zNoEmHESsw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1558959189502699.1165265228658; Mon, 27 May 2019 05:13:09 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hVETi-0008Kg-Q7; Mon, 27 May 2019 12:11:46 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hVETh-0008Kb-1u for xen-devel@lists.xenproject.org; Mon, 27 May 2019 12:11:45 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 9769f7ff-8078-11e9-8980-bc764e045a96; Mon, 27 May 2019 12:11:43 +0000 (UTC) X-Inumbo-ID: 9769f7ff-8078-11e9-8980-bc764e045a96 Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL01.citrite.net Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:23.29.105.83 ip4:162.221.156.50 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL01.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@MIAPEX02MSOL01.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: Gh2BTVmagKlnF8VKfwPAidsBsJ+V4TbsKvEggIXqipM0pBgr0u2Hy1UGK/AOhjyyW7F0eWEwFS l1NuwauKMCtOsPNepbG2tpqHjN0RKpDD+Rt+g/dI1XwCbflEBwBNljW8MPqj8onsUsv2sQIOJL 6La4M4L8lllQGzYlTg6pfLn/axfSic+lbQNmP1nlqWye/H63rTAsuuZ9hDhbIPCacPevGpgSYa XMnM2B3ZdjvSAf2Z4aWOjJKH8WC38iL7vDrxqv4JNR70rMlGRSSVD+f5MBIt2g4PdNAIIv2iK6 gOY= X-SBRS: 2.7 X-MesageID: 925016 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,519,1549947600"; d="scan'208";a="925016" From: Roger Pau Monne To: Date: Mon, 27 May 2019 14:11:38 +0200 Message-ID: <20190527121138.41800-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Subject: [Xen-devel] [BACKPORT] xen/pvh: correctly setup the PV EFI interface for dom0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Boris Ostrovsky , PGNet Dev , stable@vger.kernel.org, Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" commit 72813bfbf0276a97c82af038efb5f02dcdd9e310 upstream This involves initializing the boot params EFI related fields and the efi global variable. Without this fix a PVH dom0 doesn't detect when booted from EFI, and thus doesn't support accessing any of the EFI related data. Reported-by: PGNet Dev Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky Cc: stable@vger.kernel.org # 4.19+ --- arch/x86/xen/efi.c | 12 ++++++------ arch/x86/xen/enlighten_pv.c | 2 +- arch/x86/xen/enlighten_pvh.c | 4 ++++ arch/x86/xen/xen-ops.h | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/x86/xen/efi.c b/arch/x86/xen/efi.c index 1804b27f9632..30edb9bc58e2 100644 --- a/arch/x86/xen/efi.c +++ b/arch/x86/xen/efi.c @@ -170,7 +170,7 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(= void) return efi_secureboot_mode_unknown; } =20 -void __init xen_efi_init(void) +void __init xen_efi_init(struct boot_params *boot_params) { efi_system_table_t *efi_systab_xen; =20 @@ -179,12 +179,12 @@ void __init xen_efi_init(void) if (efi_systab_xen =3D=3D NULL) return; =20 - strncpy((char *)&boot_params.efi_info.efi_loader_signature, "Xen", - sizeof(boot_params.efi_info.efi_loader_signature)); - boot_params.efi_info.efi_systab =3D (__u32)__pa(efi_systab_xen); - boot_params.efi_info.efi_systab_hi =3D (__u32)(__pa(efi_systab_xen) >> 32= ); + strncpy((char *)&boot_params->efi_info.efi_loader_signature, "Xen", + sizeof(boot_params->efi_info.efi_loader_signature)); + boot_params->efi_info.efi_systab =3D (__u32)__pa(efi_systab_xen); + boot_params->efi_info.efi_systab_hi =3D (__u32)(__pa(efi_systab_xen) >> 3= 2); =20 - boot_params.secure_boot =3D xen_efi_get_secureboot(); + boot_params->secure_boot =3D xen_efi_get_secureboot(); =20 set_bit(EFI_BOOT, &efi.flags); set_bit(EFI_PARAVIRT, &efi.flags); diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c index 782f98b332f0..0f8da4aebe7b 100644 --- a/arch/x86/xen/enlighten_pv.c +++ b/arch/x86/xen/enlighten_pv.c @@ -1399,7 +1399,7 @@ asmlinkage __visible void __init xen_start_kernel(voi= d) /* We need this for printk timestamps */ xen_setup_runstate_info(0); =20 - xen_efi_init(); + xen_efi_init(&boot_params); =20 /* Start the world */ #ifdef CONFIG_X86_32 diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c index dab07827d25e..f04d22bcf08d 100644 --- a/arch/x86/xen/enlighten_pvh.c +++ b/arch/x86/xen/enlighten_pvh.c @@ -14,6 +14,8 @@ #include #include =20 +#include "xen-ops.h" + /* * PVH variables. * @@ -79,6 +81,8 @@ static void __init init_pvh_bootparams(void) pvh_bootparams.hdr.type_of_loader =3D (9 << 4) | 0; /* Xen loader */ =20 x86_init.acpi.get_root_pointer =3D pvh_get_root_pointer; + + xen_efi_init(&pvh_bootparams); } =20 /* diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 0e60bd918695..2f111f47ba98 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h @@ -122,9 +122,9 @@ static inline void __init xen_init_vga(const struct dom= 0_vga_console_info *info, void __init xen_init_apic(void); =20 #ifdef CONFIG_XEN_EFI -extern void xen_efi_init(void); +extern void xen_efi_init(struct boot_params *boot_params); #else -static inline void __init xen_efi_init(void) +static inline void __init xen_efi_init(struct boot_params *boot_params) { } #endif --=20 2.20.1 (Apple Git-117) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel