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
F103067611: D33561.diff
Wed, Nov 20, 12:23 PM
Unknown Object (File)
Thu, Nov 14, 2:22 AM
Unknown Object (File)
Fri, Oct 25, 12:40 PM
Unknown Object (File)
Oct 20 2024, 8:03 PM
Unknown Object (File)
Oct 2 2024, 1:09 PM
Unknown Object (File)
Oct 2 2024, 4:30 AM
Unknown Object (File)
Sep 26 2024, 5:47 AM
Unknown Object (File)
Sep 24 2024, 8:47 AM

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);
}