From patchwork Mon Aug 16 11:19:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jane Malalane X-Patchwork-Id: 12438285 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 B8207C432BE for ; Mon, 16 Aug 2021 11:20:09 +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 82A5261CF3 for ; Mon, 16 Aug 2021 11:20:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 82A5261CF3 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.167276.305332 (Exim 4.92) (envelope-from ) id 1mFaet-0003fn-CH; Mon, 16 Aug 2021 11:19:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 167276.305332; Mon, 16 Aug 2021 11:19:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mFaet-0003fc-8U; Mon, 16 Aug 2021 11:19:59 +0000 Received: by outflank-mailman (input) for mailman id 167276; Mon, 16 Aug 2021 11:19:58 +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 1mFaes-00035f-Bu for xen-devel@lists.xenproject.org; Mon, 16 Aug 2021 11:19:58 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e0f44f5c-fe83-11eb-a455-12813bfff9fa; Mon, 16 Aug 2021 11:19:53 +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: e0f44f5c-fe83-11eb-a455-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1629112793; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=T9jifUsBPMFYoxfOQRqxjgyngUYneVp/G9jmw1xPbXY=; b=Q9NoCGfocjnpoSJWbOjnudKqoQQM2SQR1QnDlecUl/7NhIhmU1KbVDT3 1oh7vc9+Xd6vWhMInodsgcpBGyjQXfilqPhH+Uwx/JgdOpFZWOXqnOpOa I9decznwK1l9Awr6ee6FMXM14ETY7To1rThuX/+OYL0f3htv1tlpde34Y 8=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: t5DE/kdH4a0O/Lrh5Q5BHnyA2jQKni/xQVWXq/I/jFmvNm+/L7gRSgEP6ARpcIywZRjSZY9TBR gJ3fZ4IxjcYmW/x2hu98e45WoEbKPm3OmD29cgEWbBY8WxuYGa3eeP9nymi8oTucsmjbm/ElNI E5vrcE2f3S5CdrGMS+lT4fzynwVstXhDb9IqFWSSlXg388g7pGezdxEsu9Buw6tIKoVhOOFIqJ q7gnDSj+W4beyMztxOlyRFM2t27f8cfMWZU92Zd2yfX7OGKI8x1doE5xVCrX+vEZBR4Zw/UZKP Qv90XSMRiRn5aRjZAEbfuvr/ X-SBRS: 5.1 X-MesageID: 52241876 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:/ZxsL6Oxu3N8bcBcTvmjsMiBIKoaSvp037Eqv3oedfUzSL3gqy nOpoV86faaslYssR0b9exofZPwJE80lqQFhrX5X43SPzUO0VHAROoJgLcKgQeQfxEWntQtrZ uIGJIeNDSfNzdHZL7BkWuFL+o= X-IronPort-AV: E=Sophos;i="5.84,324,1620705600"; d="scan'208";a="52241876" 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 2/2] x86/pv: Provide more helpful error when CONFIG_PV32 is absent Date: Mon, 16 Aug 2021 12:19:27 +0100 Message-ID: <20210816111927.16913-3-jane.malalane@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210816111927.16913-1-jane.malalane@citrix.com> References: <20210816111927.16913-1-jane.malalane@citrix.com> 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 Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Andrew Cooper CC: "Roger Pau Monné" CC: Wei Liu v2: * switch to EOPNOTSUPP --- xen/arch/x86/pv/dom0_build.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c index 8712baccc1..d5a1a6a4e2 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,11 @@ int __init dom0_construct_pv(struct domain *d, compatible = true; } - } +#else + printk("Found 32-bit PV kernel, but CONFIG_PV32 missing\n"); + return -EOPNOTSUPP; #endif + } compat = is_pv_32bit_domain(d);