size = sizeof(struct page);
pfn_up = ALIGN(max_pfn * size, PMD_SIZE);
pfn_up = (pfn_up + size - 1) / size; /* round up */
- if (pfn >= pfn_up)
+ if (pfn >= pfn_up) {
+ pr_debug("%s, wrong pfn:%lx, max:%lx, up:%lx\n",
+ __func__, pfn, max_pfn, pfn_up);
return -ERANGE;
+ }
return 0;
}
#endif /* CONFIG_AMLOGIC_MODIFY */
pmd_t *pmd;
#ifdef CONFIG_AMLOGIC_MODIFY
struct page *page;
+ bool in_vmap = false;
page = (struct page *)start;
+ /* avoid check for KASAN */
+ if (start >= VMEMMAP_START)
+ in_vmap = true;
#endif /* CONFIG_AMLOGIC_MODIFY */
do {
next = pmd_addr_end(addr, end);
#ifdef CONFIG_AMLOGIC_MODIFY
/* page address may not just same as next */
- while (((unsigned long)page) < next)
+ while (in_vmap && ((unsigned long)page) < next)
page++;
#endif /* CONFIG_AMLOGIC_MODIFY */
vmemmap_verify((pte_t *)pmd, node, addr, next);
#ifdef CONFIG_AMLOGIC_MODIFY
- if (check_pfn_overflow(page_to_pfn(page)))
+ if (in_vmap && check_pfn_overflow(page_to_pfn(page)))
break;
#endif /* CONFIG_AMLOGIC_MODIFY */
} while (addr = next, addr != end);
## Do not change.
##########################################
+ifndef CONFIG_KASAN
KBUILD_CFLAGS += -Wlarger-than=28792
KBUILD_CFLAGS += -Wstack-usage=1856
+else
+ifeq ($(call cc-ifversion, -lt, 0500, y), y)
+ $(error -----GCC VERSION TOO SMALL FOR KASAN -----)
+endif
+endif
# These 2 marked sentence is just for generate warning messages
#KBUILD_CFLAGS += -Wno-error=larger-than=28792
obj-$(CONFIG_AMLOGIC_DEFENDKEY) += defendkey/
-obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
\ No newline at end of file
+obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
.compatible = "amlogic, aocec-txl",
.data = &cec_txl_data,
},
+ {}
};
#endif
static const struct of_device_id aml_ddr_bandwidth_dt_match[] = {
{
.compatible = "amlogic, ddr-bandwidth",
- }
+ },
+ {}
};
#endif
{
.compatible = "amlogic, ionvideo",
},
+ {}
};
/* general interface for a linux driver .*/
#endif
find_static_common_symbol();
+#ifdef CONFIG_KASAN /* open multi_shot for kasan */
+ kasan_save_enable_multi_shot();
+#endif
#ifdef CONFIG_64BIT
/*
* if this compiler error occurs, that means there are over 32 page
.compatible = "amlogic,meson-gxl-aobus-pinctrl",
.data = &meson_gxl_aobus_pinctrl_data,
},
-
+ {} /* Let KASAN shut up */
};
static struct platform_driver meson_gxl_pinctrl_driver = {
.compatible = "amlogic,meson-txl-aobus-pinctrl",
.data = &meson_txl_aobus_pinctrl_data,
},
-
+ {} /* Make KASAN shut up */
};
static struct platform_driver meson_txl_pinctrl_driver = {
.compatible = "amlogic,meson-txlx-aobus-pinctrl",
.data = &meson_txlx_aobus_pinctrl_data,
},
-
+ {} /* Let KASAN shut up */
};
static struct platform_driver meson_txlx_pinctrl_driver = {
{
.compatible = "amlogic,meson8b-aobus-pinctrl",
.data = &meson8b_aobus_pinctrl_data,
- }
+ },
+ {}
};
static struct platform_driver meson8b_pinctrl_driver = {
static const struct of_device_id amlogic_pm_dt_match[] = {
{.compatible = "amlogic, pm",
- },
+ },
+ {}
};
static struct platform_driver meson_pm_driver = {