Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8C99CCD6E48 for ; Thu, 28 May 2026 00:28:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1320863.1587966 (Exim 4.92) (envelope-from ) id 1wSObc-0007Hz-Vp; Thu, 28 May 2026 00:28:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1320863.1587966; Thu, 28 May 2026 00:28:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wSObc-0007Hr-SV; Thu, 28 May 2026 00:28:12 +0000 Received: by outflank-mailman (input) for mailman id 1320863; Thu, 28 May 2026 00:28:10 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wSOba-0007He-GT for xen-devel@lists.xenproject.org; Thu, 28 May 2026 00:28:10 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wSObZ-00CjPB-St for xen-devel@lists.xenproject.org; Thu, 28 May 2026 02:28:09 +0200 Received: from [10.42.69.1] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a178c07-bab6-0a2a0a5309dd-0a2a450194b6-10 for ; Thu, 28 May 2026 02:28:09 +0200 Received: from [209.85.218.54] (helo=mail-ej1-f54.google.com) by tlsNG-d62444.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.1) (envelope-from ) id 6a178c19-c1f2-0a2a45010019-d155da36b835-3 for ; Thu, 28 May 2026 02:28:09 +0200 Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-bd3d7c29b4dso1773747866b.2 for ; Wed, 27 May 2026 17:28:09 -0700 (PDT) Received: from EPUAKYIW02F7.. ([45.12.25.69]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bddc5ece286sm655205266b.40.2026.05.27.17.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 17:28:08 -0700 (PDT) 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" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779928089; x=1780532889; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=havkcPvmIjUNQ6L52uTakTmu7Gyt5Yv9I1018A5p+IM=; b=C9ikIMdfABwzNxPOqQ4rS/w9HoG1NQPormVueq0HeLWejvEjdFhjbhc5TZwBd8cJno QQW+Fm/DMeUu9w5Ho1cDZFjjRgHu7/G2YfT8ASYYY/F9h8Et0fMeqb6bi/sazo7TZT9l P6dXaNBfSzastNbZNv694YCLMooE82YDv3GKgevOo0DdbM9ALLOkhHgro66k49oUswLM oXGlDU6FQHqKmWUexmyUxmrwp0UQqlDs8O9UDSxaEzSK3vW+ZmJd7241rnPyQg1y4tdE gTwnnKPjIZgcSxXFZHxBJyIv0gytKLhrSSKEno4A6gjG3VTXqrJCLw35s6AK9rjBwg10 O78g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779928089; x=1780532889; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=havkcPvmIjUNQ6L52uTakTmu7Gyt5Yv9I1018A5p+IM=; b=oODYo5lhoIYhVUVjYaZyBUiLfHGfYvEeDwlPnxkGcXX0jqhTKFn4pu1QmR5OdlzBeF 60BAvYsCvUc5Qq8cUD3t+zLRvTWWZwCWVsAwAPaOC7RePi11Jel/zVcaG+R5noWODQQc awwefykv2OBco0EM9VLXa2iaqnOhnLUyzHazKzhpbrnEnsDaevlt01ivY+QRu27veW4j QE+tCfas8CnPAB0o1FAmwKob8TC0adG8DYrnzKzHR5tcjzRESsXseI2bNopAWyUVrf1l 83enrAF57JCVABrFgHmyWQJl7dWL1Fb+07htKu64DNMAwqKFcQTM6CLhLM6FsZJtgnbE crOw== X-Gm-Message-State: AOJu0YzC0IUjDkREO1nS0ROjmIxd+ER9npCrothguvoLuf5SjX4O5UB3 Q6cTAIiMYVRVvuAXPnxqhrunAklTNiKFkpYSdnBvbqTbGDa/Y+BdyTDcHOA3ag== X-Gm-Gg: Acq92OFJHVoP/M7nJkieq+TzKa6rYQU63dpMcOJZfIiaRxqZhGyxuuV2eCWpNaSs5gZ sKPlnpu8U6uR3tCw4fCFQx6GqaLGPM974D/T4vnIjA/ssVLb+o8z9r3Jg0DVPdsC4IiX16/XgfJ poGOiKo4gR7jnPouTLJPxTiAwXtl0cAD8KcDDI/Dbq/ULVlE3ToviOAXMx5YuCET4bnIEy9IRIK VFZCI1HdBZnUksdbta/pIx+xw40JlvfTigcmgDT3h6L/IyDhHXebw+Ld2epWQgUtrcfyVLP1ejA PywDBSmorPXodTKV75RAxSRp0c2yc0TkXCsEVWduQGKSnOUzyBN0NCPoKLBWM4J2a1s3hMHS9Ee F99iq2F9MuviqESAECyS1UkO3rzkns/OytuZkAQvI1kWqV+NsufjyIwxLZfG7fbI84HuqsO7NFQ rtk4pT0Ut1gTVlzoWAEQ/McwP+bxgRioczXvSBMyk+9GDcaQE= X-Received: by 2002:a17:907:9729:b0:bd4:8b66:c374 with SMTP id a640c23a62f3a-bdd22944971mr1442622166b.9.1779928089236; Wed, 27 May 2026 17:28:09 -0700 (PDT) From: Mykola Kvach To: xen-devel@lists.xenproject.org Cc: Mykola Kvach , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Luca Fancellu , Oleksii Kurochko Subject: [PATCH v2 0/4] xen/arm: gicv3: defer host LPI init and split ITS/LPI quirk scopes Date: Thu, 28 May 2026 03:25:48 +0300 Message-ID: X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-d62444/1779928089-B6342FF4-CCBC408E/0/0 X-purgate-type: clean X-purgate-size: 4421 From: Mykola Kvach Hi all, This series fixes the ordering of host LPI state initialization relative to ITS quirk discovery, and then cleans up how ITS-private and host LPI/Redistributor quirk effects are represented. Patch 1 is the release-critical fix. It moves host LPI initialization after gicv3_its_init(), so that the host LPI allocation path observes the ITS quirks discovered during ITS initialization. This patch is intended for 4.22. Patches 2-4 are follow-up cleanup and DT attribute handling. They are included to show the intended direction and to avoid carrying the old global ITS quirk model forward, but they are not required for taking the 4.22 fix if the release freeze makes that preferable. The main change from v1 is that this version no longer tries to pre-initialize ITS quirks before host LPI setup. Instead, the minimal fix is to defer the existing host LPI initialization until after ITS initialization. The follow-up patches then split the quirk state by scope: * per-ITS flags are used for memory/state accessed by a particular ITS, such as GITS_CBASER, GITS_BASER and ITT memory; * host LPI flags are used for shared Redistributor/LPI state, such as GICR_PROPBASER and GICR_PENDBASER. This avoids relying on an implicit global aggregation of per-ITS quirk state. If an ITS-discovered quirk also affects the host LPI/Redistributor path, that effect is now expressed explicitly through the quirk entry's lpi_flags. The series also handles the DT dma-noncoherent property according to the node where it appears. An ITS subnode property affects only the corresponding ITS. A top-level GIC node property affects only the host LPI/Redistributor policy. The property is not inherited implicitly between the parent GIC node and ITS subnodes. The Orange Pi 5 / RK3588-specific quirk patch from v1 has been dropped. The previous version modelled the issue as a 32-bit ITS addressing restriction. This version handles the relevant non-coherent/non-shareable GIC integration through the standard DT dma-noncoherent property on the GIC and ITS nodes instead. --- Changes since v1 * Reordered the series so that the minimal host LPI initialization ordering fix is first. Patch 1 is intended for 4.22. * Dropped the v1 ITS pre-initialization hook. * Moved the existing gicv3_lpi_init_host_lpis() call after gicv3_its_init() instead, so host LPI state is allocated after ITS workaround discovery. * Checked the return value from gicv3_lpi_init_host_lpis() and made failure fatal once the ITS/LPI path is enabled. * Replaced the old single global ITS quirk state with separate per-ITS and host LPI quirk scopes. * Removed the implicit aggregation of all per-ITS quirks into the host LPI policy. Host LPI effects are now expressed explicitly with lpi_flags. * Kept per-ITS flags for ITS-private allocations: - GITS_CBASER; - GITS_BASER; - ITT memory. * Kept host LPI flags for Redistributor/LPI state: - GICR_PROPBASER; - GICR_PENDBASER. * Refactored ITS quirk matching from fixed IIDR/mask fields to a generic match(hw_its, data) callback plus opaque data. * Kept first-match semantics explicit. More specific entries must be listed before broader IIDR-only entries. * Added a reusable IIDR matcher and used it after checking the Renesas machine compatibles for the R-Car Gen4 quirk. * Split dma-noncoherent handling by DT node scope: - ITS subnode dma-noncoherent affects only the matching ITS; - top-level GIC dma-noncoherent affects only the host LPI/Redistributor policy. * Dropped the Orange Pi 5 / RK3588-specific quirk patch from v1. The non-coherent GIC integration is now handled through DT dma-noncoherent properties instead of a Xen-side platform quirk. Mykola Kvach (4): xen/arm: gic: defer host LPI allocation until after ITS init xen/arm: its: separate ITS and host LPI quirk scopes xen/arm: its: refactor ITS quirk matching xen/arm: its: handle dma-noncoherent on GIC and ITS nodes xen/arch/arm/gic-v3-its.c | 171 ++++++++++++++++---------- xen/arch/arm/gic-v3-lpi.c | 66 ++++++++-- xen/arch/arm/gic-v3.c | 14 ++- xen/arch/arm/include/asm/gic_v3_its.h | 19 ++- 4 files changed, 190 insertions(+), 80 deletions(-) -- 2.43.0