Commit a241d7f0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 fixes from Alexander Gordeev:

 - Fix DirectMap accounting in /proc/meminfo file

 - Fix strscpy() return code handling that led to "unsigned 'len' is
   never less than zero" warning

 - Fix the calculation determining whether to use three- or four-level
   paging: account KMSAN modules metadata

* tag 's390-6.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/mm: Consider KMSAN modules metadata for paging levels
  s390/ipl: Fix never less than zero warning
  s390/mm: Fix DirectMap accounting
parents ed90ed56 282da38b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -234,6 +234,8 @@ static unsigned long get_vmem_size(unsigned long identity_size,
	vsize = round_up(SZ_2G + max_mappable, rte_size) +
		round_up(vmemmap_size, rte_size) +
		FIXMAP_SIZE + MODULES_LEN + KASLR_LEN;
	if (IS_ENABLED(CONFIG_KMSAN))
		vsize += MODULES_LEN * 2;
	return size_add(vsize, vmalloc_size);
}

+3 −3
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ static void pgtable_pte_populate(pmd_t *pmd, unsigned long addr, unsigned long e
			pages++;
		}
	}
	if (mode == POPULATE_DIRECT)
	if (mode == POPULATE_IDENTITY)
		update_page_count(PG_DIRECT_MAP_4K, pages);
}

@@ -339,7 +339,7 @@ static void pgtable_pmd_populate(pud_t *pud, unsigned long addr, unsigned long e
		}
		pgtable_pte_populate(pmd, addr, next, mode);
	}
	if (mode == POPULATE_DIRECT)
	if (mode == POPULATE_IDENTITY)
		update_page_count(PG_DIRECT_MAP_1M, pages);
}

@@ -372,7 +372,7 @@ static void pgtable_pud_populate(p4d_t *p4d, unsigned long addr, unsigned long e
		}
		pgtable_pmd_populate(pud, addr, next, mode);
	}
	if (mode == POPULATE_DIRECT)
	if (mode == POPULATE_IDENTITY)
		update_page_count(PG_DIRECT_MAP_2G, pages);
}

+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ static ssize_t sys_##_prefix##_##_name##_store(struct kobject *kobj, \
	if (len >= sizeof(_value))					\
		return -E2BIG;						\
	len = strscpy(_value, buf, sizeof(_value));			\
	if (len < 0)							\
	if ((ssize_t)len < 0)						\
		return len;						\
	strim(_value);							\
	return len;							\