xen/arm: ffa: Reduce logging noise

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.

Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
This commit is contained in:
Bertrand Marquis authored and Michal Orzel committed 2026-02-24 12:54:38 +01:00
1 parent e70117a53f
commit 9d63e7e9ca
4 files changed
+39 -19

No files matched your search

+6 -5
View File
@@ -450,7 +450,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
break;
default:
gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
gdprintk(XENLOG_DEBUG, "ffa: unhandled fid 0x%x\n", fid);
e = FFA_RET_NOT_SUPPORTED;
break;
}
@@ -570,7 +570,8 @@ static void ffa_domain_teardown_continue(struct ffa_ctx *ctx, bool first_time)
if ( retry )
{
printk(XENLOG_G_INFO "%pd: ffa: Remaining cleanup, retrying\n", ctx->teardown_d);
printk(XENLOG_G_DEBUG "%pd: ffa: Remaining cleanup, retrying\n",
ctx->teardown_d);
ctx->teardown_expire = NOW() + FFA_CTX_TEARDOWN_DELAY;
@@ -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__);
}
/* This function is supposed to undo what ffa_domain_init() has done */
@@ -673,7 +674,7 @@ static bool ffa_probe_fw(void)
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;
}
@@ -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);
}
+6 -5
View File
@@ -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 offline\n",
d);
out_unlock:
rcu_unlock_domain(d);
@@ -316,9 +317,9 @@ static void notif_sri_action(void *unused)
res = ffa_get_ret_code(&resp);
if ( res )
{
if ( res != FFA_RET_NO_DATA )
printk(XENLOG_ERR "ffa: notification info get failed: error %d\n",
res);
if ( res != FFA_RET_NO_DATA && printk_ratelimit() )
printk(XENLOG_WARNING
"ffa: notification info get failed: error %d\n", res);
return;
}
+8 -7
View File
@@ -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 convention 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 = ffa_direct_req_send_vm(subscr_vm_destroyed[n], ffa_get_vm_id(d),
FFA_MSG_SEND_VM_DESTROYED);
if ( res )
{
printk(XENLOG_ERR "%pd: ffa: Failed to report destruction of vm_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);
}
/*
* For these two error codes the hypervisor is expected to resend
+19 -2
View File
@@ -4,6 +4,7 @@
*/
#include <xen/const.h>
#include <xen/lib.h>
#include <xen/domain_page.h>
#include <xen/mm.h>
#include <xen/sizes.h>
@@ -82,8 +83,9 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
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;
}
@@ -299,12 +301,15 @@ int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
if ( !ctx->page_count )
{
ret = FFA_RET_DENIED;
gdprintk(XENLOG_DEBUG, "ffa: RX acquire denied, no RX/TX mapped\n");
goto out;
}
if ( !ctx->rx_is_free )
{
ret = FFA_RET_BUSY;
if ( printk_ratelimit() )
gdprintk(XENLOG_DEBUG, "ffa: RX acquire busy\n");
goto out;
}
@@ -312,7 +317,10 @@ int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
{
ret = ffa_simple_call(FFA_RX_ACQUIRE, ctx->ffa_id, 0, 0, 0);
if ( ret != FFA_RET_OK )
{
gdprintk(XENLOG_DEBUG, "ffa: RX acquire failed: %d\n", ret);
goto out;
}
}
ctx->rx_is_free = false;
*buf = ctx->rx;
@@ -351,13 +359,22 @@ int32_t ffa_tx_acquire(struct ffa_ctx *ctx, const void **buf, size_t *buf_size)
int32_t ret = FFA_RET_DENIED;
if ( !spin_trylock(&ctx->tx_lock) )
{
gdprintk(XENLOG_DEBUG, "ffa: TX acquire busy\n");
return FFA_RET_BUSY;
}
if ( !ctx->page_count )
{
gdprintk(XENLOG_DEBUG, "ffa: TX acquire denied, no RX/TX mapped\n");
goto err_unlock;
}
if ( !ctx->tx )
{
gdprintk(XENLOG_DEBUG, "ffa: TX acquire denied, TX buffer missing\n");
goto err_unlock;
}
*buf = ctx->tx;
*buf_size = ctx->page_count * FFA_PAGE_SIZE;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.