From owner-freebsd-arm@freebsd.org Tue Apr 20 22:02:24 2021 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD7775EB117 for ; Tue, 20 Apr 2021 22:02:24 +0000 (UTC) (envelope-from sdmitry@parallels.com) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-qb1can01on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5c::615]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FPyMz64Vvz3ndB for ; Tue, 20 Apr 2021 22:02:23 +0000 (UTC) (envelope-from sdmitry@parallels.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RUmVyPTA/JaIZVVmax+ytg/p6Yfrf8/E4MBDqeohNx3dUl40D7pnWWEtwV2z3DvPCL2IHn7FcQNJ7Ps8ixWXT0FL+bVeHyqP8DXIiKvP3LcSSrI0wbf51Lq/1JBR7yt02Mwc7xSn/Q0DWzbsGvrqn4MFFQ/EMiwIeEi1cEGNb9Vc5BG2s+LobRm7QXCi5b5ldg+ZVN+aRkVt7DmoJrDC84TDwH733hDVfKOFPi4Kczbr8goUQ60uiDUbjuJZ3a8mrSDkhe2I9rZfdw/sOGL0vQAKtBkGNKYJ3VkPlNCDD9RDqJLrD/75Ivf1Xdq5hOkxBbYeRlmBWkQayKGyj8np0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=X4ju7MM2so/dw7+jW7tNb9sfBLR6raDTAzodEZplCRU=; b=h1LWUDFMi/V5JO5kBz1Qik7qM6iGVD+iPPLr3BkjMkAXrK91Ted8orp3iRqguoVHV/Zoh2znyz6m8hcckU4ua/SMV3RmIfcbldgSSrjUntGMxipeAOENuZh35YCWUT6j4QQQGKh617pcJQMPzuiNuufNXpF8ditBr9PYfCXZVVrTZVsb648PG80DtTT1JCpANLPe14NO0Qiz87wXVjtBNCnvpDhkbxyLe5gvkdCgUY9R3EWTom6TsRoV4aO4urNOoDB9XiUlRVWr6dOfgtkS0XVx/G2hB3EvDI54IopjfGLbRwMo1lnRcf0Sv3tUgEbP/aIEAzklF1Cj3jvlNilxIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=parallels.com; dmarc=pass action=none header.from=parallels.com; dkim=pass header.d=parallels.com; arc=none Received: from YQXPR01MB4691.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:1e::22) by QB1PR01MB3026.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:3b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.20; Tue, 20 Apr 2021 22:02:21 +0000 Received: from YQXPR01MB4691.CANPRD01.PROD.OUTLOOK.COM ([fe80::ad30:b472:ca49:acd1]) by YQXPR01MB4691.CANPRD01.PROD.OUTLOOK.COM ([fe80::ad30:b472:ca49:acd1%4]) with mapi id 15.20.4042.024; Tue, 20 Apr 2021 22:02:21 +0000 From: Dmitry Skorodumov To: "freebsd-arm@freebsd.org" Subject: gic-v2 and SGI interrupts on boot CPU Thread-Topic: gic-v2 and SGI interrupts on boot CPU Thread-Index: AQHXNi4LCeO0ml1xpE67WFQJcTjPYA== Date: Tue, 20 Apr 2021 22:02:21 +0000 Message-ID: Accept-Language: ru-RU, en-US Content-Language: ru-RU X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [176.193.45.64] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e6ddb19c-fb15-41d2-52a2-08d90447f915 x-ms-traffictypediagnostic: QB1PR01MB3026: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RHNJ9nq3YbPMYVS9Rjl0u4lWS7HQypbXENDpBRWtqRSDO7lzee/wz2dXCQR1aIuVi9w4DBP3Bx75uf/taComqV8RL/feaZhUJeX3UA/t51Tcfb7ybxjGltLqoN1DaeddFUS5s5MJNWU3noX2GPIr7hHT4qiT0ZNH04qGbKl/E3rj+JjnNyFsTwJuUeU1Wy/fKmwyCs2KKwFYxiGyBjraF377oZ/UIUPdmhIwQO9XVOe6qEDqJ9NKRqppteo6SIeWAAyZm9HAOR2v/4CrSr4TZw2xGWx1bp5D3/sJaXBlq7wVG8DR13w4Tv+1C5Ma8osnlPmUMe5yzdGF7Jz5DCFM2yhntRYr4ibyyYGk01cj56b3uxm0Cq/MWSXiAt01jhiT/fDZWyA1Dssaco00FcO/l/EnqlE+oRUROVVONdgLLL33WgadfjYVWYuqHzbmgPNcQ7tR+DS5BYUaMniuy2JcwbzObajwPIfy3BDgZmRKpKi34eRmwi1XWVWF5Yiqr9HhuQhL3rX7y7rVStAWg5MFD3WiKhbbmTwWt9qTq38h0WXSVh6PjoOfzvA2Zwet1ChaB0Q4OjiiPU9YkfgNwNsHSuHyhJiKJnhU3vl532UgGmJL46801rBNU4SoMZkb4vGaDkur2pSr2WW9QPiBUHNS52KnszTSE2Fkoij5rvFkw0V/bFDWNTM+LGENgyaou4Hs x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YQXPR01MB4691.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(346002)(39850400004)(136003)(366004)(33656002)(4744005)(26005)(83380400001)(966005)(86362001)(76116006)(166002)(6506007)(8936002)(478600001)(55016002)(6916009)(8676002)(122000001)(19627405001)(91956017)(2906002)(66446008)(66476007)(66556008)(7696005)(66946007)(71200400001)(52536014)(5660300002)(9686003)(186003)(38100700002)(64756008)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?koi8-r?Q?k+FQCyCYtgWK0oKJg160B0yhCZ011TZKU0QuhWVWrwHH5iHeToYm2HZCkFIDrs?= =?koi8-r?Q?VCIe9dkIJMFAR5D92dzlavHf/un9eWukpaN8yKAOGJ1o6cW2BYtrc5Az/aP/Fq?= =?koi8-r?Q?PPAMmaQfpRGjiIfuRdMYt24UdIhSoAdfWdhIrIQRmr9JoLtVKSinnAMprkA9Le?= =?koi8-r?Q?ciXuabPhik/GFdAtBYZL1jLc5d26A2WPIyipdSwUZ6EFwtSbDED3YWBS9E4adz?= =?koi8-r?Q?rVce/lW9LhjUTYzJsLgOWQYjgfba39SYOkHEXPXgNPpjCW5qveRHNNRSa/+tCJ?= =?koi8-r?Q?eCEkbyhpVmmjQGp1VfwqPCfejblLgbRqOuf3kRT5SSarNFFkrRdrz4uKIchvm5?= =?koi8-r?Q?SlmJzmFcYMDbL57bz1/ij1ifWsgu3iajBcyCh1y6E7KD7+ozdMcT1bYj0k+IP2?= =?koi8-r?Q?G0dH7BGR0a6p6cUscuk63jfYpmRv7tZgheEK72+SHwm8QUQgo154fjvm49aVPY?= =?koi8-r?Q?V0Fhuv/U7ySY7d6tGHmFu+X3Qs0TcWKv0hVl9ha2bRihN3QChIjrLnb0k/nw3d?= =?koi8-r?Q?4s2sJZ5Lb08NvZxqyQpV2fGq7peTCwhnO+DosNytFxBjAMGtlHHt1ipsq/OZeb?= =?koi8-r?Q?CAp7/9SpZD1MpRTnQMYjoJfzn9YrhY0Aov4o+jFEgHuIofHeLHUFKbOtOxIgYr?= =?koi8-r?Q?qtEfdvnI455CHcLUxCJaXCL5p4/QCjti3ig4QpsVSbW4sYSgpiYFAuPVE9xUi2?= =?koi8-r?Q?ClqJt8mpYBLoJvU+m9KXe1P051q5gJlsi2ME9990VsUDQ1IzCaxkLwR8QfdGSv?= =?koi8-r?Q?iPD5iFz1YKPYDTIKEUy+T+AcDchGI+IKYmnRnyECXD/sZKuh1wVJ3hvNUKkxoD?= =?koi8-r?Q?UgEMhyNgmPqF7Ir8nb6YJBOIortnj2Yyg7xaCwjuo6I0m65B7ScdmrLZb+trjJ?= =?koi8-r?Q?L7via42sQVYkGgGrTqUYXioJ7fwDyrdi1hJWOhPJ5kBC3WfDXHWSbS9Es7kZpL?= =?koi8-r?Q?dO3GHwu1cT7H81K2We/OqBlvBOWdjUa7JRAg4x8ZMQRwNMbjAbvuSk+pdX8uzD?= =?koi8-r?Q?4wqbGAl1DwyjViihgi6qjtLB3cf8LNTbbG8OY5bZfQCnl7uC7ICbuNTkVrrhxy?= =?koi8-r?Q?IugGmymUliJp6A4XKb8B3EcVy+gBqblEMRkQiByZ1cUHZxIKBw9JNMSn+aLqWy?= =?koi8-r?Q?3j1QZsrZnelHkXwJ4LHuesQDtzAkbBJcTg/r45ZWWsIAbHiE3bBOOAh8BzNm9r?= =?koi8-r?Q?ECMCOOfoeIysIVRqL+Fv0qfjK7RVO7Jx/NtnxiAisTTl5o8voNJFyFda9ArpCL?= =?koi8-r?Q?5ObfHtS+nValCYJHT4NGM=3D?= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: parallels.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YQXPR01MB4691.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: e6ddb19c-fb15-41d2-52a2-08d90447f915 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2021 22:02:21.6564 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 33874721-dd77-4b7e-97b7-863c2cbe7c73 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fh+Ve2x0sWjNqPr/auy5ixwwzdqrSJrJN6yRaT03PJlBoSv21OjnLg5mh0EFveWQfNFtBKxHXBNvd5bPB0nkGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: QB1PR01MB3026 X-Rspamd-Queue-Id: 4FPyMz64Vvz3ndB X-Spamd-Bar: ---- X-Spamd-Result: default: False [-5.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:111:f400:fe5c::615:from]; R_DKIM_ALLOW(-0.20)[parallels.com:s=selector1]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:111:f400::/48]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_ONE(0.00)[1]; URI_COUNT_ODD(1.00)[1]; RCVD_COUNT_THREE(0.00)[3]; SPAMHAUS_ZRD(0.00)[2a01:111:f400:fe5c::615:from:127.0.2.255]; DKIM_TRACE(0.00)[parallels.com:+]; DMARC_POLICY_ALLOW(-0.50)[parallels.com,reject]; DWL_DNSWL_LOW(-1.00)[parallels.com:dkim]; NEURAL_HAM_SHORT(-1.00)[-1.000]; TO_DN_EQ_ADDR_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; MAILMAN_DEST(0.00)[freebsd-arm] Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting FreeBSD to ARM processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2021 22:02:24 -0000 Hi It looks like code for gic-v2 in FreeBSD not quite correctly relies on impl= ementation defined behaviour of GIC. The gic 2.0 spec https://developer.arm.com/documentation/ihi0048/bb ch= apter 3.2.2 "Interrupt controls in the GIC" states the following: "Whether SGIs are permanently enabled, or can be enabled and disabled by wr= ites to the GICD_ISENABLERn and GICD_ICENABLERn, is IMPLEMENTATION DEFINED.= " But code in sys/arm/arm/gic.c assumes that SGI are always enabled and doesn= 't configure them at initialization. They are initialized only for secondar= y CPUs - in arm_gic_init_secondary(). For sure it is a rather minor issue, since all appears to be ok in gic-v3 (= v3 code enables SGIs for all CPUs, including the boot one). And even if pla= tform supports only gic-v2, likely SGIs are always enabled anyway. So, my p= ost is rather pedantic notice without real life case. Dmitry