Page MenuHomeFreeBSD

LinuxKPI: Import MTRR support functions from drm-kmod
ClosedPublic

Authored by wulf on Dec 19 2021, 11:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 11:31 PM
Unknown Object (File)
Feb 13 2024, 6:07 AM
Unknown Object (File)
Jan 12 2024, 7:47 AM
Unknown Object (File)
Dec 20 2023, 3:42 AM
Unknown Object (File)
Sep 17 2023, 10:08 PM
Unknown Object (File)
Sep 13 2023, 3:16 AM
Unknown Object (File)
Sep 12 2023, 5:20 AM
Unknown Object (File)
Jul 8 2023, 7:42 PM

Details

Summary

They are superseded by PAT and mostly useless nowadays but still can be
used on Pentium III/IV era processors. Unlike drm-kmod version, this one
ignores MTRR if PAT is available that fixes confusing "Failed to add WC
MTRR for [0xXXXX-0xYYYY]: 22; performance may suffer" message often
appearing during drm-kmod initialization process.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wulf requested review of this revision.Dec 19 2021, 11:23 AM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/io.h
491

Add some more ()'s like this to avoid confusion:

(((x) < __MTRR_ID_BASE) ? -1 : ((x) - __MTRR_ID_BASE))
sys/compat/linuxkpi/common/src/linux_page.c
426

I assume there is not race to remove IDR's ?

This revision is now accepted and ready to land.Dec 19 2021, 11:30 AM
sys/compat/linuxkpi/common/include/linux/io.h
491

Ok. I will add them

sys/compat/linuxkpi/common/src/linux_page.c
426

I see no race as idr_remove takes idr lock:

void *
idr_remove(struct idr *idr, int id)
{
 	void *res;

	mtx_lock(&idr->lock);
	res = idr_remove_locked(idr, id);
	mtx_unlock(&idr->lock);

	return (res);
}