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>] [day] [month] [year] [list]
Message-ID: <202103140414.Qy3LELcL-lkp@intel.com>
Date:   Sun, 14 Mar 2021 04:17:16 +0800
From:   kernel test robot <lkp@...el.com>
To:     David Brazdil <dbrazdil@...gle.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Marc Zyngier <maz@...nel.org>
Subject: arch/arm64/kvm/arm.c:1726 init_hyp_mode() warn: missing error code
 'err'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f296bfd5cd04cbb49b8fc9585adc280ab2b58624
commit: eeeee7193df015074c8302381356e8e617a5e2b0 KVM: arm64: Bootstrap PSCI SMC handler in nVHE EL2
date:   3 months ago
config: arm64-randconfig-m031-20210312 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0

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

smatch warnings:
arch/arm64/kvm/arm.c:1726 init_hyp_mode() warn: missing error code 'err'

vim +/err +1726 arch/arm64/kvm/arm.c

  1606	
  1607	/**
  1608	 * Inits Hyp-mode on all online CPUs
  1609	 */
  1610	static int init_hyp_mode(void)
  1611	{
  1612		int cpu;
  1613		int err = 0;
  1614	
  1615		/*
  1616		 * Allocate Hyp PGD and setup Hyp identity mapping
  1617		 */
  1618		err = kvm_mmu_init();
  1619		if (err)
  1620			goto out_err;
  1621	
  1622		/*
  1623		 * Allocate stack pages for Hypervisor-mode
  1624		 */
  1625		for_each_possible_cpu(cpu) {
  1626			unsigned long stack_page;
  1627	
  1628			stack_page = __get_free_page(GFP_KERNEL);
  1629			if (!stack_page) {
  1630				err = -ENOMEM;
  1631				goto out_err;
  1632			}
  1633	
  1634			per_cpu(kvm_arm_hyp_stack_page, cpu) = stack_page;
  1635		}
  1636	
  1637		/*
  1638		 * Allocate and initialize pages for Hypervisor-mode percpu regions.
  1639		 */
  1640		for_each_possible_cpu(cpu) {
  1641			struct page *page;
  1642			void *page_addr;
  1643	
  1644			page = alloc_pages(GFP_KERNEL, nvhe_percpu_order());
  1645			if (!page) {
  1646				err = -ENOMEM;
  1647				goto out_err;
  1648			}
  1649	
  1650			page_addr = page_address(page);
  1651			memcpy(page_addr, CHOOSE_NVHE_SYM(__per_cpu_start), nvhe_percpu_size());
  1652			kvm_arm_hyp_percpu_base[cpu] = (unsigned long)page_addr;
  1653		}
  1654	
  1655		/*
  1656		 * Map the Hyp-code called directly from the host
  1657		 */
  1658		err = create_hyp_mappings(kvm_ksym_ref(__hyp_text_start),
  1659					  kvm_ksym_ref(__hyp_text_end), PAGE_HYP_EXEC);
  1660		if (err) {
  1661			kvm_err("Cannot map world-switch code\n");
  1662			goto out_err;
  1663		}
  1664	
  1665		err = create_hyp_mappings(kvm_ksym_ref(__hyp_data_ro_after_init_start),
  1666					  kvm_ksym_ref(__hyp_data_ro_after_init_end),
  1667					  PAGE_HYP_RO);
  1668		if (err) {
  1669			kvm_err("Cannot map .hyp.data..ro_after_init section\n");
  1670			goto out_err;
  1671		}
  1672	
  1673		err = create_hyp_mappings(kvm_ksym_ref(__start_rodata),
  1674					  kvm_ksym_ref(__end_rodata), PAGE_HYP_RO);
  1675		if (err) {
  1676			kvm_err("Cannot map rodata section\n");
  1677			goto out_err;
  1678		}
  1679	
  1680		err = create_hyp_mappings(kvm_ksym_ref(__bss_start),
  1681					  kvm_ksym_ref(__bss_stop), PAGE_HYP_RO);
  1682		if (err) {
  1683			kvm_err("Cannot map bss section\n");
  1684			goto out_err;
  1685		}
  1686	
  1687		err = kvm_map_vectors();
  1688		if (err) {
  1689			kvm_err("Cannot map vectors\n");
  1690			goto out_err;
  1691		}
  1692	
  1693		/*
  1694		 * Map the Hyp stack pages
  1695		 */
  1696		for_each_possible_cpu(cpu) {
  1697			char *stack_page = (char *)per_cpu(kvm_arm_hyp_stack_page, cpu);
  1698			err = create_hyp_mappings(stack_page, stack_page + PAGE_SIZE,
  1699						  PAGE_HYP);
  1700	
  1701			if (err) {
  1702				kvm_err("Cannot map hyp stack\n");
  1703				goto out_err;
  1704			}
  1705		}
  1706	
  1707		/*
  1708		 * Map Hyp percpu pages
  1709		 */
  1710		for_each_possible_cpu(cpu) {
  1711			char *percpu_begin = (char *)kvm_arm_hyp_percpu_base[cpu];
  1712			char *percpu_end = percpu_begin + nvhe_percpu_size();
  1713	
  1714			err = create_hyp_mappings(percpu_begin, percpu_end, PAGE_HYP);
  1715	
  1716			if (err) {
  1717				kvm_err("Cannot map hyp percpu region\n");
  1718				goto out_err;
  1719			}
  1720		}
  1721	
  1722		if (is_protected_kvm_enabled()) {
  1723			init_cpu_logical_map();
  1724	
  1725			if (!init_psci_relay())
> 1726				goto out_err;
  1727		}
  1728	
  1729		return 0;
  1730	
  1731	out_err:
  1732		teardown_hyp_mode();
  1733		kvm_err("error initializing Hyp mode: %d\n", err);
  1734		return err;
  1735	}
  1736	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (30637 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ