lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 24 Jun 2021 23:47:34 +0100
From:   Suzuki K Poulose <suzuki.poulose@....com>
To:     Qi Liu <liuqi115@...wei.com>, alexander.shishkin@...ux.intel.com,
        mathieu.poirier@...aro.org, jonathan.zhouwen@...wei.com,
        f.fangjian@...wei.com
Cc:     linux-kernel@...r.kernel.org, coresight@...ts.linaro.org,
        linuxarm@...wei.com
Subject: Re: [RFC PATCH 4/4] ultrasoc: Add System Memory Buffer driver

Hi Qi

On 15/06/2021 10:34, Qi Liu wrote:
> This patch adds driver for System Memory Buffer. It includes
> a platform driver for the SMB device.
> 
> Signed-off-by: Jonathan Zhou <jonathan.zhouwen@...wei.com>
> Signed-off-by: Qi Liu <liuqi115@...wei.com>
> ---
>   drivers/hwtracing/ultrasoc/Kconfig        |   9 +
>   drivers/hwtracing/ultrasoc/Makefile       |   3 +
>   drivers/hwtracing/ultrasoc/ultrasoc-smb.c | 663 ++++++++++++++++++++++++++++++
>   drivers/hwtracing/ultrasoc/ultrasoc-smb.h | 182 ++++++++
>   4 files changed, 857 insertions(+)
>   create mode 100644 drivers/hwtracing/ultrasoc/ultrasoc-smb.c
>   create mode 100644 drivers/hwtracing/ultrasoc/ultrasoc-smb.h
> 

> +/*
> + * Coresight doesn't export the following
> + * structures(cs_mode,cs_buffers,etm_event_data),
> + * so we redefine a copy here.
> + */

Please do not duplicate them. This indicates, either :

  - You need to place your driver under coresight

  OR

  - Export the required definitions.

> +enum cs_mode {
> +	CS_MODE_DISABLED,
> +	CS_MODE_SYSFS,
> +	CS_MODE_PERF,
> +};
> +

> +struct cs_buffers {
> +	unsigned int		cur;
> +	unsigned int		nr_pages;
> +	unsigned long		offset;
> +	local_t			data_size;
> +	bool			snapshot;
> +	void			**data_pages;
> +};
> +

Why does this need to be replicated ?

> +struct etm_event_data {
> +	struct work_struct work;
> +	cpumask_t mask;
> +	void *snk_config;
> +	struct list_head * __percpu *path;
> +};
> +
> +#if IS_ENABLED(CONFIG_CORESIGHT)
> +int etm_perf_symlink(struct coresight_device *csdev, bool link);
> +int etm_perf_add_symlink_sink(struct coresight_device *csdev);
> +void etm_perf_del_symlink_sink(struct coresight_device *csdev);
> +static inline void *etm_perf_sink_config(struct perf_output_handle *handle)
> +{
> +	struct etm_event_data *data = perf_get_aux(handle);
> +
> +	if (data)
> +		return data->snk_config;
> +	return NULL;
> +}
> +#else
> +static inline int etm_perf_symlink(struct coresight_device *csdev, bool link)
> +{ return -EINVAL; }
> +int etm_perf_add_symlink_sink(struct coresight_device *csdev)
> +{ return -EINVAL; }
> +void etm_perf_del_symlink_sink(struct coresight_device *csdev) {}
> +static inline void *etm_perf_sink_config(struct perf_output_handle *handle)
> +{
> +	return NULL;
> +}
> +
> +#endif /* CONFIG_CORESIGHT */
> +
> +#endif
> 

Suzuki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ