[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAOTY_-6d12FUf5XnYco0f0CfeWsb-XjsCESsLixLr_Q=jnc0Q@mail.gmail.com>
Date: Thu, 16 Jul 2020 07:46:39 +0800
From: Chun-Kuang Hu <chunkuang.hu@...nel.org>
To: Neal Liu <neal.liu@...iatek.com>
Cc: Rob Herring <robh+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
devicetree@...r.kernel.org,
wsd_upstream <wsd_upstream@...iatek.com>,
lkml <linux-kernel@...r.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 2/2] soc: mediatek: add mtk-devapc driver
HI, Neal:
Neal Liu <neal.liu@...iatek.com> 於 2020年7月9日 週四 下午5:13寫道:
>
> MediaTek bus fabric provides TrustZone security support and data
> protection to prevent slaves from being accessed by unexpected
> masters.
> The security violation is logged and sent to the processor for
> further analysis or countermeasures.
>
> Any occurrence of security violation would raise an interrupt, and
> it will be handled by mtk-devapc driver. The violation
> information is printed in order to find the murderer.
>
> Signed-off-by: Neal Liu <neal.liu@...iatek.com>
> ---
[snip]
> +
> +/*
> + * mtk_devapc_dump_vio_dbg - shift & dump the violation debug information.
> + */
> +static bool mtk_devapc_dump_vio_dbg(struct mtk_devapc_context *devapc_ctx,
> + int slave_type, int *vio_idx)
> +{
> + const struct mtk_device_info **device_info;
> + u32 shift_bit;
> + int i;
> +
> + device_info = devapc_ctx->device_info;
> +
> + for (i = 0; i < get_vio_slave_num(slave_type); i++) {
> + *vio_idx = device_info[slave_type][i].vio_index;
> +
> + if (check_vio_mask(devapc_ctx, slave_type, *vio_idx))
> + continue;
I guess if one vio_idx is masked, its status would never be true. If
my guess is right, I think you could skip check_vio_mask() and
directly check_vio_status().
> +
> + if (!check_vio_status(devapc_ctx, slave_type, *vio_idx))
> + continue;
> +
> + shift_bit = get_shift_group(devapc_ctx, slave_type, *vio_idx);
> +
> + if (!sync_vio_dbg(devapc_ctx, slave_type, shift_bit))
> + continue;
> +
> + devapc_extract_vio_dbg(devapc_ctx, slave_type);
> +
> + return true;
I think multiple vio_idx would violate at the same time, why just process one?
Regards,
Chun-Kuang.
> + }
> +
> + return false;
> +}
Powered by blists - more mailing lists