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)
Nov 20 2024, 2:35 PM
Unknown Object (File)
Nov 20 2024, 12:23 PM
Unknown Object (File)
Nov 14 2024, 2:22 AM
Unknown Object (File)
Oct 25 2024, 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

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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43471
Build 40359: arc lint + arc unit

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