From nobody Mon Apr 13 03:29:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1770830202901757.3957339400002; Wed, 11 Feb 2026 09:16:42 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1228006.1534446 (Exim 4.92) (envelope-from ) id 1vqDp0-0007JR-MD; Wed, 11 Feb 2026 17:16:14 +0000 Received: by outflank-mailman (output) from mailman id 1228006.1534446; Wed, 11 Feb 2026 17:16:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vqDp0-0007J7-I1; Wed, 11 Feb 2026 17:16:14 +0000 Received: by outflank-mailman (input) for mailman id 1228006; Wed, 11 Feb 2026 17:16:13 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vqDoz-0004U4-Au for xen-devel@lists.xenproject.org; Wed, 11 Feb 2026 17:16:13 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id 5c99d597-076d-11f1-9ccf-f158ae23cfc8; Wed, 11 Feb 2026 18:16:11 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 65924497; Wed, 11 Feb 2026 09:16:04 -0800 (PST) Received: from C3HXLD123V.arm.com (unknown [10.57.53.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B11743F63F; Wed, 11 Feb 2026 09:16:09 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 5c99d597-076d-11f1-9ccf-f158ae23cfc8 From: Bertrand Marquis To: xen-devel@lists.xenproject.org Cc: Volodymyr Babchuk , Jens Wiklander , Stefano Stabellini , Julien Grall , Michal Orzel Subject: [PATCH v2 10/12] xen/arm: ffa: Reduce logging noise Date: Wed, 11 Feb 2026 18:15:34 +0100 Message-ID: <95e4051cbf4f3e1ba1a23273521407da5733a174.1770826406.git.bertrand.marquis@arm.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1770830203926158500 Content-Type: text/plain; charset="utf-8" Several FF-A paths log warnings for expected or recoverable conditions, leading to noisy logs during normal operation. Reduce log noise by: - demoting unhandled FID warnings to debug - ratelimiting notification and VM teardown failures - printing the bit-15 convention warning once per boot - adjusting log prefixes for hypervisor-only events - adding debug diagnostics for RX/TX acquire failures, with busy cases ratelimited No functional changes. Reviewed-by: Jens Wiklander Signed-off-by: Bertrand Marquis --- Changes since v1: - Add Jens R-b --- xen/arch/arm/tee/ffa.c | 11 ++++++----- xen/arch/arm/tee/ffa_notif.c | 11 ++++++----- xen/arch/arm/tee/ffa_partinfo.c | 15 ++++++++------- xen/arch/arm/tee/ffa_rxtx.c | 21 +++++++++++++++++++-- 4 files changed, 39 insertions(+), 19 deletions(-) diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c index ab02eafdb376..aa43ae2595d7 100644 --- a/xen/arch/arm/tee/ffa.c +++ b/xen/arch/arm/tee/ffa.c @@ -450,7 +450,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs) break; =20 default: - gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid); + gdprintk(XENLOG_DEBUG, "ffa: unhandled fid 0x%x\n", fid); e =3D FFA_RET_NOT_SUPPORTED; break; } @@ -570,7 +570,8 @@ static void ffa_domain_teardown_continue(struct ffa_ctx= *ctx, bool first_time) =20 if ( retry ) { - printk(XENLOG_G_INFO "%pd: ffa: Remaining cleanup, retrying\n", ct= x->teardown_d); + printk(XENLOG_G_DEBUG "%pd: ffa: Remaining cleanup, retrying\n", + ctx->teardown_d); =20 ctx->teardown_expire =3D NOW() + FFA_CTX_TEARDOWN_DELAY; =20 @@ -611,7 +612,7 @@ static void ffa_teardown_timer_callback(void *arg) if ( ctx ) ffa_domain_teardown_continue(ctx, false /* !first_time */); else - printk(XENLOG_G_ERR "%s: teardown list is empty\n", __func__); + printk(XENLOG_ERR "%s: teardown list is empty\n", __func__); } =20 /* This function is supposed to undo what ffa_domain_init() has done */ @@ -673,7 +674,7 @@ static bool ffa_probe_fw(void) =20 if ( !ffa_get_version(&vers) ) { - gprintk(XENLOG_ERR, "Cannot retrieve the FFA version\n"); + printk(XENLOG_ERR "ffa: Cannot retrieve the FFA version\n"); goto err_no_fw; } =20 @@ -713,7 +714,7 @@ static bool ffa_probe_fw(void) set_bit(FFA_ABI_BITNUM(ffa_fw_abi_needed[i].id), ffa_fw_abi_supported); else - printk(XENLOG_INFO "ARM FF-A Firmware does not support %s\n", + printk(XENLOG_WARNING "ARM FF-A Firmware does not support %s\n= ", ffa_fw_abi_needed[i].name); } =20 diff --git a/xen/arch/arm/tee/ffa_notif.c b/xen/arch/arm/tee/ffa_notif.c index 37b05747cd21..186e72641237 100644 --- a/xen/arch/arm/tee/ffa_notif.c +++ b/xen/arch/arm/tee/ffa_notif.c @@ -292,8 +292,9 @@ static void notif_vm_pend_intr(uint16_t vm_id) break; } } - if ( !v ) - printk(XENLOG_ERR "ffa: can't inject NPI, all vCPUs offline\n"); + if ( !v && printk_ratelimit() ) + printk(XENLOG_G_DEBUG "%pd: ffa: can't inject NPI, all vCPUs offli= ne\n", + d); =20 out_unlock: rcu_unlock_domain(d); @@ -316,9 +317,9 @@ static void notif_sri_action(void *unused) res =3D ffa_get_ret_code(&resp); if ( res ) { - if ( res !=3D FFA_RET_NO_DATA ) - printk(XENLOG_ERR "ffa: notification info get failed: erro= r %d\n", - res); + if ( res !=3D FFA_RET_NO_DATA && printk_ratelimit() ) + printk(XENLOG_WARNING + "ffa: notification info get failed: error %d\n", re= s); return; } =20 diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinf= o.c index 015097bd4d2a..fdb03dae9a0c 100644 --- a/xen/arch/arm/tee/ffa_partinfo.c +++ b/xen/arch/arm/tee/ffa_partinfo.c @@ -461,9 +461,11 @@ static bool init_subscribers(void *buf, uint16_t count= , uint32_t fpi_size) */ if ( !FFA_ID_IS_SECURE(fpi->id) ) { - printk(XENLOG_ERR "ffa: Firmware is not using bit 15 conventio= n for IDs !!\n" - "ffa: Secure partition with id 0x%04x cannot= be used\n", - fpi->id); + printk_once(XENLOG_ERR + "ffa: Firmware is not using bit 15 convention for = IDs !!\n"); + printk(XENLOG_ERR + "ffa: Secure partition with id 0x%04x cannot be used\n", + fpi->id); } else { @@ -632,11 +634,10 @@ bool ffa_partinfo_domain_destroy(struct domain *d) res =3D ffa_direct_req_send_vm(subscr_vm_destroyed[n], ffa_get_vm_= id(d), FFA_MSG_SEND_VM_DESTROYED); =20 - if ( res ) - { - printk(XENLOG_ERR "%pd: ffa: Failed to report destruction of v= m_id %u to %u: res %d\n", + if ( res && printk_ratelimit() ) + printk(XENLOG_WARNING + "%pd: ffa: Failed to report destruction of vm_id %u to = %u: res %d\n", d, ffa_get_vm_id(d), subscr_vm_destroyed[n], res); - } =20 /* * For these two error codes the hypervisor is expected to resend diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c index c4fc4c4934af..26a04f056f7b 100644 --- a/xen/arch/arm/tee/ffa_rxtx.c +++ b/xen/arch/arm/tee/ffa_rxtx.c @@ -4,6 +4,7 @@ */ =20 #include +#include #include #include #include @@ -82,8 +83,9 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_a= ddr, =20 if ( page_count > FFA_MAX_RXTX_PAGE_COUNT || !page_count ) { - printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (limit= %u)\n", - page_count, FFA_MAX_RXTX_PAGE_COUNT); + gdprintk(XENLOG_DEBUG, + "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n", + page_count, FFA_MAX_RXTX_PAGE_COUNT); return FFA_RET_INVALID_PARAMETERS; } =20 @@ -299,12 +301,15 @@ int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **bu= f, size_t *buf_size) if ( !ctx->page_count ) { ret =3D FFA_RET_DENIED; + gdprintk(XENLOG_DEBUG, "ffa: RX acquire denied, no RX/TX mapped\n"= ); goto out; } =20 if ( !ctx->rx_is_free ) { ret =3D FFA_RET_BUSY; + if ( printk_ratelimit() ) + gdprintk(XENLOG_DEBUG, "ffa: RX acquire busy\n"); goto out; } =20 @@ -312,7 +317,10 @@ int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf= , size_t *buf_size) { ret =3D ffa_simple_call(FFA_RX_ACQUIRE, ctx->ffa_id, 0, 0, 0); if ( ret !=3D FFA_RET_OK ) + { + gdprintk(XENLOG_DEBUG, "ffa: RX acquire failed: %d\n", ret); goto out; + } } ctx->rx_is_free =3D false; *buf =3D ctx->rx; @@ -351,13 +359,22 @@ int32_t ffa_tx_acquire(struct ffa_ctx *ctx, const voi= d **buf, size_t *buf_size) int32_t ret =3D FFA_RET_DENIED; =20 if ( !spin_trylock(&ctx->tx_lock) ) + { + gdprintk(XENLOG_DEBUG, "ffa: TX acquire busy\n"); return FFA_RET_BUSY; + } =20 if ( !ctx->page_count ) + { + gdprintk(XENLOG_DEBUG, "ffa: TX acquire denied, no RX/TX mapped\n"= ); goto err_unlock; + } =20 if ( !ctx->tx ) + { + gdprintk(XENLOG_DEBUG, "ffa: TX acquire denied, TX buffer missing\= n"); goto err_unlock; + } =20 *buf =3D ctx->tx; *buf_size =3D ctx->page_count * FFA_PAGE_SIZE; --=20 2.52.0