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]
Message-ID: <ZA90o0K6fBHe0Q74@sol.localdomain>
Date:   Mon, 13 Mar 2023 12:08:19 -0700
From:   Eric Biggers <ebiggers@...nel.org>
To:     Abel Vesa <abel.vesa@...aro.org>
Cc:     Ulf Hansson <ulf.hansson@...aro.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        Manivannan Sadhasivam <mani@...nel.org>,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Avri Altman <avri.altman@....com>,
        Bart Van Assche <bvanassche@....org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        "James E . J . Bottomley" <jejb@...ux.ibm.com>,
        "Martin K . Petersen" <martin.petersen@...cle.com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        "David S . Miller" <davem@...emloft.net>,
        linux-mmc@...r.kernel.org, devicetree@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arm-msm@...r.kernel.org, linux-crypto@...r.kernel.org,
        linux-scsi@...r.kernel.org
Subject: Re: [RFC PATCH v3 5/7] scsi: ufs: ufs-qcom: Switch to the new ICE API

On Mon, Mar 13, 2023 at 01:52:00PM +0200, Abel Vesa wrote:
> diff --git a/drivers/ufs/host/Makefile b/drivers/ufs/host/Makefile
> index d7c5bf7fa512..081b332fe7ce 100644
> --- a/drivers/ufs/host/Makefile
> +++ b/drivers/ufs/host/Makefile
> @@ -5,7 +5,6 @@ obj-$(CONFIG_SCSI_UFS_DWC_TC_PLATFORM) += tc-dwc-g210-pltfrm.o ufshcd-dwc.o tc-d
>  obj-$(CONFIG_SCSI_UFS_CDNS_PLATFORM) += cdns-pltfrm.o
>  obj-$(CONFIG_SCSI_UFS_QCOM) += ufs_qcom.o
>  ufs_qcom-y += ufs-qcom.o
> -ufs_qcom-$(CONFIG_SCSI_UFS_CRYPTO) += ufs-qcom-ice.o
>  obj-$(CONFIG_SCSI_UFS_EXYNOS) += ufs-exynos.o
>  obj-$(CONFIG_SCSI_UFSHCD_PCI) += ufshcd-pci.o
>  obj-$(CONFIG_SCSI_UFSHCD_PLATFORM) += ufshcd-pltfrm.o

Now that ufs-qcom will be single-file again, maybe this should go back to the
original approach of just:

	obj-$(CONFIG_SCSI_UFS_QCOM) += ufs-qcom.o

(Note the dash instead of underscore)

> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index a02cd866e2f8..8f8581dbe09a 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -15,6 +15,8 @@
>  #include <linux/reset-controller.h>
>  #include <linux/devfreq.h>
>  
> +#include <soc/qcom/ice.h>
> +
>  #include <ufs/ufshcd.h>
>  #include "ufshcd-pltfrm.h"
>  #include <ufs/unipro.h>
> @@ -55,6 +57,85 @@ static struct ufs_qcom_host *rcdev_to_ufs_host(struct reset_controller_dev *rcd)
>  	return container_of(rcd, struct ufs_qcom_host, rcdev);
>  }
>  
> +#ifdef CONFIG_SCSI_UFS_CRYPTO
> +
> +static inline void ufs_qcom_ice_enable(struct ufs_qcom_host *host)
> +{
> +	qcom_ice_enable(host->ice);
> +}
> +
> +static int ufs_qcom_ice_init(struct ufs_qcom_host *host)
> +{
> +	struct ufs_hba *hba = host->hba;
> +	struct device *dev = hba->dev;
> +
> +	host->ice = of_qcom_ice_get(dev);
> +	if (IS_ERR(host->ice))
> +		return PTR_ERR(host->ice);
> +
> +	return 0;
> +}

What happens if ICE is not supported?  I believe we should continue allowing UFS
to work with crypto support, as was the case before.

Note these lines of code in the original version:

	dev_warn(dev, "Disabling inline encryption support\n");
	hba->caps &= ~UFSHCD_CAP_CRYPTO;

It's important to clear UFSHCD_CAP_CRYPTO, otherwise the driver will think that
ICE is supported.

- Eric

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ