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: <202210270538.5Vr3oRTE-lkp@intel.com>
Date:   Thu, 27 Oct 2022 05:32:31 +0800
From:   kernel test robot <lkp@...el.com>
To:     Elliot Berman <quic_eberman@...cinc.com>,
        Bjorn Andersson <quic_bjorande@...cinc.com>
Cc:     oe-kbuild-all@...ts.linux.dev,
        Elliot Berman <quic_eberman@...cinc.com>,
        Murali Nalajala <quic_mnalajal@...cinc.com>,
        Trilok Soni <quic_tsoni@...cinc.com>,
        Srivatsa Vaddagiri <quic_svaddagi@...cinc.com>,
        Carl van Schaik <quic_cvanscha@...cinc.com>,
        Prakruthi Deepak Heragu <quic_pheragu@...cinc.com>,
        Andy Gross <agross@...nel.org>,
        Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
        Jassi Brar <jassisinghbrar@...il.com>,
        linux-arm-kernel@...ts.infradead.org,
        Mark Rutland <mark.rutland@....com>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Sudeep Holla <sudeep.holla@....com>,
        Marc Zyngier <maz@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Jonathan Corbet <corbet@....net>,
        Will Deacon <will@...nel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Amol Maheshwari <amahesh@....qualcomm.com>,
        Kalle Valo <kvalo@...nel.org>, devicetree@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 20/21] firmware: qcom_scm: Register Gunyah platform ops

Hi Elliot,

I love your patch! Perhaps something to improve:

[auto build test WARNING on 247f34f7b80357943234f93f247a1ae6b6c3a740]

url:    https://github.com/intel-lab-lkp/linux/commits/Elliot-Berman/Drivers-for-gunyah-hypervisor/20221027-030321
base:   247f34f7b80357943234f93f247a1ae6b6c3a740
patch link:    https://lore.kernel.org/r/20221026185846.3983888-21-quic_eberman%40quicinc.com
patch subject: [PATCH v6 20/21] firmware: qcom_scm: Register Gunyah platform ops
config: powerpc-allyesconfig
compiler: powerpc-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/1e2d3fe903f1c461c594bd312add58369a7475cd
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Elliot-Berman/Drivers-for-gunyah-hypervisor/20221027-030321
        git checkout 1e2d3fe903f1c461c594bd312add58369a7475cd
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/firmware/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/firmware/qcom_scm.c: In function 'qcom_scm_gh_rm_pre_mem_share':
>> drivers/firmware/qcom_scm.c:1330:28: warning: left shift count >= width of type [-Wshift-count-overflow]
    1330 |                 src = (1ul << QCOM_SCM_RM_MANAGED_VMID);
         |                            ^~
   drivers/firmware/qcom_scm.c:1343:53: warning: left shift count >= width of type [-Wshift-count-overflow]
    1343 |                                         src |= (1ul << QCOM_SCM_RM_MANAGED_VMID);
         |                                                     ^~
   drivers/firmware/qcom_scm.c: In function 'qcom_scm_gh_rm_post_mem_reclaim':
   drivers/firmware/qcom_scm.c:1388:37: warning: left shift count >= width of type [-Wshift-count-overflow]
    1388 |                         src |= (1ul << QCOM_SCM_RM_MANAGED_VMID);
         |                                     ^~


vim +1330 drivers/firmware/qcom_scm.c

  1298	
  1299	static int qcom_scm_gh_rm_pre_mem_share(struct gh_rm_mem_parcel *mem_parcel)
  1300	{
  1301		struct qcom_scm_vmperm *new_perms;
  1302		u16 this_vmid;
  1303		u64 src, src_cpy;
  1304		int ret, i, n;
  1305	
  1306		ret = gh_rm_get_vmid(&this_vmid);
  1307		if (ret)
  1308			return ret;
  1309	
  1310		new_perms = kcalloc(mem_parcel->n_acl_entries, sizeof(*new_perms), GFP_KERNEL);
  1311		if (!new_perms)
  1312			return -ENOMEM;
  1313	
  1314		for (n = 0; n < mem_parcel->n_acl_entries; n++) {
  1315			if (mem_parcel->acl_entries[n].vmid <= QCOM_SCM_MAX_MANAGED_VMID)
  1316				new_perms[n].vmid = mem_parcel->acl_entries[n].vmid;
  1317			else
  1318				new_perms[n].vmid = QCOM_SCM_RM_MANAGED_VMID;
  1319			if (mem_parcel->acl_entries[n].perms & GH_RM_ACL_X)
  1320				new_perms[n].perm |= QCOM_SCM_PERM_EXEC;
  1321			if (mem_parcel->acl_entries[n].perms & GH_RM_ACL_W)
  1322				new_perms[n].perm |= QCOM_SCM_PERM_WRITE;
  1323			if (mem_parcel->acl_entries[n].perms & GH_RM_ACL_R)
  1324				new_perms[n].perm |= QCOM_SCM_PERM_READ;
  1325		}
  1326	
  1327		if (this_vmid <= QCOM_SCM_MAX_MANAGED_VMID)
  1328			src = (1ul << this_vmid);
  1329		else
> 1330			src = (1ul << QCOM_SCM_RM_MANAGED_VMID);
  1331	
  1332		for (i = 0; i < mem_parcel->n_mem_entries; i++) {
  1333			src_cpy = src;
  1334			ret = qcom_scm_assign_mem(mem_parcel->mem_entries[i].ipa_base,
  1335							mem_parcel->mem_entries[i].size,
  1336							&src_cpy, new_perms, mem_parcel->n_acl_entries);
  1337			if (ret) {
  1338				src = 0;
  1339				for (n = 0; n < mem_parcel->n_acl_entries; n++) {
  1340					if (mem_parcel->acl_entries[n].vmid <= QCOM_SCM_MAX_MANAGED_VMID)
  1341						src |= (1ul << mem_parcel->acl_entries[n].vmid);
  1342					else
  1343						src |= (1ul << QCOM_SCM_RM_MANAGED_VMID);
  1344				}
  1345	
  1346				if (this_vmid <= QCOM_SCM_MAX_MANAGED_VMID)
  1347					new_perms[0].vmid = this_vmid;
  1348				else
  1349					new_perms[0].vmid = QCOM_SCM_RM_MANAGED_VMID;
  1350	
  1351				for (i--; i >= 0; i--) {
  1352					src_cpy = src;
  1353					ret = qcom_scm_assign_mem(mem_parcel->mem_entries[i].ipa_base,
  1354									mem_parcel->mem_entries[i].size,
  1355									&src_cpy, new_perms, 1);
  1356					WARN_ON_ONCE(ret);
  1357				}
  1358				break;
  1359			}
  1360		}
  1361	
  1362		kfree(new_perms);
  1363		return ret;
  1364	}
  1365	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (329751 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ