Unverified Commit b01db796 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9351 Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped."

parents 00316e89 b75db91f
Loading
Loading
Loading
Loading
+5 −18
Original line number Diff line number Diff line
@@ -26,31 +26,18 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
	for (; addr < end; addr = next) {
		pud_t *pud = pud_page + pud_index(addr);
		pmd_t *pmd;
		bool use_gbpage;

		next = (addr & PUD_MASK) + PUD_SIZE;
		if (next > end)
			next = end;

		/* if this is already a gbpage, this portion is already mapped */
		if (pud_large(*pud))
			continue;

		/* Is using a gbpage allowed? */
		use_gbpage = info->direct_gbpages;

		/* Don't use gbpage if it maps more than the requested region. */
		/* at the begining: */
		use_gbpage &= ((addr & ~PUD_MASK) == 0);
		/* ... or at the end: */
		use_gbpage &= ((next & ~PUD_MASK) == 0);

		/* Never overwrite existing mappings */
		use_gbpage &= !pud_present(*pud);

		if (use_gbpage) {
		if (info->direct_gbpages) {
			pud_t pudval;

			if (pud_present(*pud))
				continue;

			addr &= PUD_MASK;
			pudval = __pud((addr - info->offset) | info->page_flag);
			set_pud(pud, pudval);
			continue;