From nobody Wed Apr 24 03:32:01 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=1559909318; cv=none; d=zoho.com; s=zohoarc; b=mluZjwrecbyfK+jwU5GIkjIoMN4N6u8W+lSMAOPYDwASSTDdGSLl+g2DdvubLd1oV4fCmX1VrwxLzW2aBvgwWsGcdzRtZieE6+ZQf2S1Fq/FmehxeK+umi6PjFbKdFHqveovqXUc5pc95+MXAm5xE+MCX7A0uj5O08sMVGF9/u0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559909318; 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=LDUCL0toY6tJGyewuDxP7nRzvaOF7RC7pe4jERIJZKE=; b=RIjaaIPk2JUXgb3d4ceg9dQe91N2HsarKrNq8W3OCqhg0jHANuxONFbiBHBtP0eMXLkBOsCWbk0rcYVK905wnpCOeTN6cpDHlYvrXIeN9DWevAxky23XXBbBDGNr9zhmwZ36N/1Zmrq4OaQkBpvVuATz5rxydBe3zylo097MJow= 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 1559909317969398.59321211558097; Fri, 7 Jun 2019 05:08:37 -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 1hZDeR-0000NB-3B; Fri, 07 Jun 2019 12:07:19 +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.89) (envelope-from ) id 1hZDeQ-0000N6-7a for xen-devel@lists.xenproject.org; Fri, 07 Jun 2019 12:07:18 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c85c3eca-891c-11e9-82fa-631995befb48; Fri, 07 Jun 2019 12:07:13 +0000 (UTC) X-Inumbo-ID: c85c3eca-891c-11e9-82fa-631995befb48 Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=SoftFail smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com 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 (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: SoftFail (esa3.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com is inclined to not designate 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 include:spf.citrix.com include:spf2.citrix.com include:ironport.citrix.com exists:%{i}._spf.mta.salesforce.com ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 17GX6J6aerUjZYKTXFETGqo/kyFwrYHdHTCmgnXAthn2hPzQethfsNOhdCr+1nVpo9FFlje2f6 MF1tJ9szE+eDKmxTPTpvj5c7lNuYoToqJiPMkOSPaK11vDVSKivoIS3oa/pxHM90GbkXzJvgM+ hSaU0uvCYkhz9AwFZT5WKO9FkrJsnJEHQOK2/wgpTyKJnqB+o7ubalXecwXr9S9nNjSGbf3WsU vU5vu4NqqpvYgtjxnnsDqcM2jchbxxzxt+24mc4xHh/zy5pl1h1CYITJ0vyfc+/Czz3dXUq403 /Bo= X-SBRS: -0.9 X-MesageID: 1451988 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,563,1557201600"; d="scan'208";a="1451988" From: Andrew Cooper To: Xen-devel Date: Fri, 7 Jun 2019 13:07:04 +0100 Message-ID: <1559909224-26062-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86: Fix boot with CONFIG_XSM enabled following c/s 7177f589ba 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: Andrew Cooper , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Currently, booting staging fails with: (XEN) Using APIC driver default (XEN) ----[ Xen-4.13-unstable x86_64 debug=3Dy Not tainted ]---- (XEN) CPU: 0 (XEN) RIP: e008:[] __x86_indirect_thunk_rax+0xe/0x10 (XEN) RFLAGS: 0000000000010016 CONTEXT: hypervisor (XEN) rax: c2c2c2c2c2c2c2c2 rbx: ffff83003f4cc000 rcx: 00000000000000= 00 (XEN) Xen code around (__x86_indirect_thunk_rax+0xe/0x= 10): (XEN) ae e8 eb fb 48 89 04 24 90 e8 05 00 00 00 0f ae e8 eb fb 48 8= 9 0c 24 (XEN) Xen stack trace from rsp=3Dffff82d080827d28: (XEN) c2c2c2c2c2c2c2c2 ffff82d080207588 ffff82d080827d68 0000000000000= 000 (XEN) Xen call trace: (XEN) [] __x86_indirect_thunk_rax+0xe/0x10 (XEN) [] setup_system_domains+0x18/0xab (XEN) [] __start_xen+0x1ea9/0x2935 (XEN) [] __high_start+0x53/0x55 (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) GENERAL PROTECTION FAULT (XEN) [error_code=3D0000] (XEN) **************************************** UBSAN (which I happened to have active in my build at the time) identifies = the problem explicitly: (XEN) Using APIC driver default (XEN) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D (XEN) UBSAN: Undefined behaviour in /local/xen.git/xen/include/xsm/xsm.h:= 309:19 (XEN) member access within null pointer of type 'struct xsm_operations' (XEN) ----[ Xen-4.13-unstable x86_64 debug=3Dy Not tainted ]---- "adjust system domain creation (and call it earlier on x86)" didn't account for the fact that domain_create() depends on XSM already being set up. The= re is nothing very interesting which xsm_multiboot_init() more than allocating memory, which means it is safe to move earlier during boot. The resulting boot now looks like: (XEN) Using APIC driver default (XEN) XSM Framework v1.0.0 initialized (XEN) Flask: 128 avtab hash slots, 283 rules. (XEN) Flask: 128 avtab hash slots, 283 rules. (XEN) Flask: 4 users, 3 roles, 38 types, 2 bools (XEN) Flask: 13 classes, 283 rules (XEN) Flask: Starting in enforcing mode. (XEN) ACPI: v5 SLEEP INFO: control[0:0], status[0:0] and (XEN) Using APIC driver default (XEN) XSM Framework v1.0.0 initialized (XEN) Initialising XSM SILO mode (XEN) ACPI: v5 SLEEP INFO: control[0:0], status[0:0] Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 6c3a7ed..d201191 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1533,6 +1533,8 @@ void __init noreturn __start_xen(unsigned long mbi_p) mmio_ro_ranges =3D rangeset_new(NULL, "r/o mmio ranges", RANGESETF_prettyprint_hex); =20 + xsm_multiboot_init(module_map, mbi); + setup_system_domains(); =20 acpi_boot_init(); @@ -1583,8 +1585,6 @@ void __init noreturn __start_xen(unsigned long mbi_p) =20 init_IRQ(); =20 - xsm_multiboot_init(module_map, mbi); - microcode_grab_module(module_map, mbi); =20 timer_init(); --=20 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel