From patchwork Fri Aug 13 10:40:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jane Malalane X-Patchwork-Id: 12435251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F3B9C4338F for ; Fri, 13 Aug 2021 10:41:00 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F88060FC0 for ; Fri, 13 Aug 2021 10:41:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3F88060FC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.166723.304304 (Exim 4.92) (envelope-from ) id 1mEUcC-0007iE-IQ; Fri, 13 Aug 2021 10:40:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 166723.304304; Fri, 13 Aug 2021 10:40:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mEUcC-0007i7-FW; Fri, 13 Aug 2021 10:40:40 +0000 Received: by outflank-mailman (input) for mailman id 166723; Fri, 13 Aug 2021 10:40:39 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mEUcB-0007i1-60 for xen-devel@lists.xenproject.org; Fri, 13 Aug 2021 10:40:39 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e4ed2ee8-fc22-11eb-a275-12813bfff9fa; Fri, 13 Aug 2021 10:40:37 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e4ed2ee8-fc22-11eb-a275-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1628851237; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=CL3znfpWELLv4litjeLtI8c/M9lffSXcm1hEov0YUxw=; b=bSe65Wzv+NxBHpifTcRlh03zTsmKKeJqB36g3wedL0hIVHbTAPlVFOoc P9d89foetvbHp54ThbW2L3ShB4FCA31D/20yujqfjZWlvnbs3kB10RZ2D nFSNz0grCp4f2cIZO1POC5zs0+zd57Nb/W6CtwwMltSBuwlxEtggYDCUe Y=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: Jdp/9oH666MMhv76DXNHRE93TGnOjwO9Pk92Z9WuDQBlyLmLSUcweu8ocuSwiRuMm0jz0knCNZ AW2dS/lSkBrKk++LIYnwulisQD839IGMiPZ1eWHrOTdbuwjNJ1hzfi/tikrp6ZzFOAaz9ZkPuU ZdiT0JxSDD85y9RbY05vNs0hc9FCR4j/7EWlCl73ZBvaHZGUxtEU/rJKXETENjzlwSy40FTV4R 4mgXfzxFPxl4z8M0qHftvs1hZF3AwtcC8M7V2t7pIUaSLhNP8TtX3dvoFgc/oowziBVcbBQ6AG C5tvwA8Mb2P+kJZXMoErdhFN X-SBRS: 5.1 X-MesageID: 50373501 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:nFboU6j8QM9HRew3ct/Zo5C2pXBQXh4ji2hC6mlwRA09TyX5ra 2TdZUgpHrJYVMqMk3I9uruBEDtex3hHP1OkOss1NWZPDUO0VHARO1fBOPZqAEIcBeOldK1u5 0AT0B/YueAd2STj6zBkXSF+wBL+qj6zEiq792usEuEVWtRGsVdB58SMHfiLqVxLjM2YqYRJd 6nyedsgSGvQngTZtTTPAh/YwCSz+e78q4PeHQ9dmca1DU= X-IronPort-AV: E=Sophos;i="5.84,318,1620705600"; d="scan'208";a="50373501" From: Jane Malalane To: Xen-devel CC: Jane Malalane , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu Subject: [PATCH 1/2] x86/pv: Provide more helpful error when CONFIG_PV32 is absent Date: Fri, 13 Aug 2021 11:40:24 +0100 Message-ID: <20210813104025.2063-1-jane.malalane@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Currently, when booting a 32bit dom0 kernel, the message isn't very helpful: (XEN) Xen kernel: 64-bit, lsb (XEN) Dom0 kernel: 32-bit, PAE, lsb, paddr 0x100000 -> 0x112000 (XEN) Mismatch between Xen and DOM0 kernel (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Could not construct domain 0 (XEN) **************************************** With this adjustment, it now looks like this: (XEN) Xen kernel: 64-bit, lsb (XEN) Found 32-bit PV kernel, but CONFIG_PV32 missing (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Could not construct domain 0 (XEN) **************************************** Suggested-by: Andrew Cooper Signed-off-by: Jane Malalane --- CC: Jan Beulich CC: Andrew Cooper CC: "Roger Pau Monné" CC: Wei Liu --- xen/arch/x86/pv/dom0_build.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index af47615b22..80e6c6e35b 100644 --- a/xen/arch/x86/pv/dom0_build.c +++ b/xen/arch/x86/pv/dom0_build.c @@ -362,9 +362,9 @@ int __init dom0_construct_pv(struct domain *d, compatible = false; machine = elf_uval(&elf, elf.ehdr, e_machine); -#ifdef CONFIG_PV32 if ( elf_32bit(&elf) ) { +#ifdef CONFIG_PV32 if ( parms.pae == XEN_PAE_BIMODAL ) parms.pae = XEN_PAE_EXTCR3; if ( parms.pae && machine == EM_386 ) @@ -377,8 +377,12 @@ int __init dom0_construct_pv(struct domain *d, compatible = true; } - } +#else + printk("Found 32-bit PV kernel, but CONFIG_PV32 missing\n"); + rc = -ENODEV; + goto out; #endif + } compat = is_pv_32bit_domain(d);