<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/amd64/include/vmparam.h, branch release/13.2.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F13.2.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F13.2.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2021-12-03T14:02:02Z</updated>
<entry>
<title>amd64: provide PHYS_IN_DMAP() and VIRT_IN_DMAP()</title>
<updated>2021-12-03T14:02:02Z</updated>
<author>
<name>Mitchell Horne</name>
<email>mhorne@FreeBSD.org</email>
</author>
<published>2021-11-17T15:29:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a6172e6353ee88e331f2287901078f0d2edbb82c'/>
<id>urn:sha1:a6172e6353ee88e331f2287901078f0d2edbb82c</id>
<content type='text'>
It is useful for quickly checking an address against the DMAP region.
These definitions exist already on arm64 and riscv.

Reviewed by:	kib, markj
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32962

(cherry picked from commit 90d4da62259299a8d91fed1121be97ac5b7b6b3c)
</content>
</entry>
<entry>
<title>amd64: Define KVA regions for KMSAN shadow maps</title>
<updated>2021-11-02T22:17:58Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2021-08-10T20:25:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=36ca4b79b84870cd7da2fe59a359d2c299b54032'/>
<id>urn:sha1:36ca4b79b84870cd7da2fe59a359d2c299b54032</id>
<content type='text'>
KMSAN requires two shadow maps, each one-to-one with the kernel map.
Allocate regions of the kernels PML4 page for them.  Add functions to
create mappings in the shadow map regions, these will be used by the
KMSAN runtime.

Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f95f780ea4e163ce9a0295a699f41f0a7e1591d4)
</content>
</entry>
<entry>
<title>amd64: Implement a KASAN shadow map</title>
<updated>2021-11-01T13:57:30Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2021-04-13T20:30:05Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a3d4c8e21d645bc8022af53232c12e236285de25'/>
<id>urn:sha1:a3d4c8e21d645bc8022af53232c12e236285de25</id>
<content type='text'>
The idea behind KASAN is to use a region of memory to track the validity
of buffers in the kernel map.  This region is the shadow map.  The
compiler inserts calls to the KASAN runtime for every emitted load
and store, and the runtime uses the shadow map to decide whether the
access is valid.  Various kernel allocators call kasan_mark() to update
the shadow map.

Since the shadow map tracks only accesses to the kernel map, accesses to
other kernel maps are not validated by KASAN.  UMA_MD_SMALL_ALLOC is
disabled when KASAN is configured to reduce usage of the direct map.
Currently we have no mechanism to completely eliminate uses of the
direct map, so KASAN's coverage is not comprehensive.

The shadow map uses one byte per eight bytes in the kernel map.  In
pmap_bootstrap() we create an initial set of page tables for the kernel
and preloaded data.

When pmap_growkernel() is called, we call kasan_shadow_map() to extend
the shadow map.  kasan_shadow_map() uses pmap_kasan_enter() to allocate
memory for the shadow region and map it.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29417

(cherry picked from commit 6faf45b34b14da5f138774b43ec14fb5567ac584)
</content>
</entry>
<entry>
<title>amd64: do not assume that kernel is loaded at 2M physical</title>
<updated>2021-08-23T23:21:13Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2021-07-10T19:48:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8ca493ffb44691e70ae92300b8de1c1d30134ef4'/>
<id>urn:sha1:8ca493ffb44691e70ae92300b8de1c1d30134ef4</id>
<content type='text'>
(cherry picked from commit e18380e341410ce70d97560a22827591f4b2d373)
</content>
</entry>
<entry>
<title>Unobfuscate "KERNLOAD" parameter on amd64. This change lines-up amd64 with the</title>
<updated>2020-11-25T23:19:01Z</updated>
<author>
<name>Maxim Sobolev</name>
<email>sobomax@FreeBSD.org</email>
</author>
<published>2020-11-25T23:19:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fd2ef8ef5a054d9f26b6b36ea56a5414c7683e39'/>
<id>urn:sha1:fd2ef8ef5a054d9f26b6b36ea56a5414c7683e39</id>
<content type='text'>
i386 and the rest of supported architectures by defining KERNLOAD in the
vmparam.h and getting rid of magic constant in the linker script, which albeit
documented via comment but isn't programmatically accessible at a compile time.

Use KERNLOAD to eliminate another (matching) magic constant 100 lines down
inside unremarkable TU "copy.c" 3 levels deep in the EFI loader tree.

Reviewed by:	markj
Approved by:	markj
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D27355
</content>
</entry>
<entry>
<title>Add a vmparam.h constant indicating pmap support for large pages.</title>
<updated>2020-09-23T19:34:21Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2020-09-23T19:34:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=78257765f296ab4158b8afd521a71cbe897f5aaa'/>
<id>urn:sha1:78257765f296ab4158b8afd521a71cbe897f5aaa</id>
<content type='text'>
Enable SHM_LARGEPAGE support on arm64.

Reviewed by:	alc, kib
Sponsored by:	Juniper Networks, Inc., Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26467
</content>
</entry>
<entry>
<title>Move vm_page_dump bitset array definition to MI code</title>
<updated>2020-09-21T22:20:37Z</updated>
<author>
<name>D Scott Phillips</name>
<email>scottph@FreeBSD.org</email>
</author>
<published>2020-09-21T22:20:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ab041f713aeccdf23b4805ffb71815c8d4aa9c88'/>
<id>urn:sha1:ab041f713aeccdf23b4805ffb71815c8d4aa9c88</id>
<content type='text'>
These definitions were repeated by all architectures, with small
variations. Consolidate the common definitons in machine
independent code and use bitset(9) macros for manipulation. Many
opportunities for deduplication remain in the machine dependent
minidump logic. The only intended functional change is increasing
the bit index type to vm_pindex_t, allowing the indexing of pages
with address of 8 TiB and greater.

Reviewed by:	kib, markj
Approved by:	scottl (implicit)
MFC after:	1 week
Sponsored by:	Ampere Computing, Inc.
Differential Revision:	https://reviews.freebsd.org/D26129
</content>
</entry>
<entry>
<title>amd64: clean up empty lines in .c and .h files</title>
<updated>2020-09-01T21:16:54Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-09-01T21:16:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=543769bf83775641c1a7f3d3d86744c7e1f5af4e'/>
<id>urn:sha1:543769bf83775641c1a7f3d3d86744c7e1f5af4e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>amd64 pmap: LA57 AKA 5-level paging</title>
<updated>2020-08-23T20:19:04Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2020-08-23T20:19:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9ce875d9b59dde81bf116d24e6b8649075674303'/>
<id>urn:sha1:9ce875d9b59dde81bf116d24e6b8649075674303</id>
<content type='text'>
Since LA57 was moved to the main SDM document with revision 072, it
seems that we should have a support for it, and silicons are coming.

This patch makes pmap support both LA48 and LA57 hardware.  The
selection of page table level is done at startup, kernel always
receives control from loader with 4-level paging.  It is not clear how
UEFI spec would adapt LA57, for instance it could hand out control in
LA57 mode sometimes.

To switch from LA48 to LA57 requires turning off long mode, requesting
LA57 in CR4, then re-entering long mode.  This is somewhat delicate
and done in pmap_bootstrap_la57().  AP startup in LA57 mode is much
easier, we only need to toggle a bit in CR4 and load right value in CR3.

I decided to not change kernel map for now.  Single PML5 entry is
created that points to the existing kernel_pml4 (KML4Phys) page, and a
pml5 entry to create our recursive mapping for vtopte()/vtopde().
This decision is motivated by the fact that we cannot overcommit for
KVA, so large space there is unusable until machines start providing
wider physical memory addressing.  Another reason is that I do not
want to break our fragile autotuning, so the KVA expansion is not
included into this first step.  Nice side effect is that minidumps are
compatible.

On the other hand, (very) large address space is definitely
immediately useful for some userspace applications.

For userspace, numbering of pte entries (or page table pages) is
always done for 5-level structures even if we operate in 4-level mode.
The pmap_is_la57() function is added to report the mode of the
specified pmap, this is done not to allow simultaneous 4-/5-levels
(which is not allowed by hw), but to accomodate for EPT which has
separate level control and in principle might not allow 5-leve EPT
despite x86 paging supports it. Anyway, it does not seems critical to
have 5-level EPT support now.

Tested by:	pho (LA48 hardware)
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D25273
</content>
</entry>
<entry>
<title>Fix some nits in pmap_page_array_startup().</title>
<updated>2019-09-03T22:26:01Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2019-09-03T22:26:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f97bf6046981f411538d5b6314422ef37d00f4d2'/>
<id>urn:sha1:f97bf6046981f411538d5b6314422ef37d00f4d2</id>
<content type='text'>
- Use ptoa() instead of the archaic ctob().
- Use pagezero() to zero a PDP page.
- Remove PA_MIN_ADDRESS, orphaned by r351742.
- Remove unneeded parens and an unnecessary control flow statement.

Reported by:	alc
Reviewed by:	alc, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D21495
</content>
</entry>
</feed>
