Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107478897
D45579.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D45579.diff
View Options
diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c
--- a/sys/riscv/riscv/pmap.c
+++ b/sys/riscv/riscv/pmap.c
@@ -3137,6 +3137,28 @@
return (rv);
}
+/*
+ * Release a page table page reference after a failed attempt to create a
+ * mapping.
+ */
+static void
+pmap_abort_ptp(pmap_t pmap, vm_offset_t va, vm_page_t l2pg)
+{
+ struct spglist free;
+
+ SLIST_INIT(&free);
+ if (pmap_unwire_ptp(pmap, va, l2pg, &free)) {
+ /*
+ * Although "va" is not mapped, paging-structure
+ * caches could nonetheless have entries that
+ * refer to the freed page table pages.
+ * Invalidate those entries.
+ */
+ pmap_invalidate_page(pmap, va);
+ vm_page_free_pages_toq(&free, true);
+ }
+}
+
/*
* Tries to create a read- and/or execute-only 2MB page mapping. Returns
* KERN_SUCCESS if the mapping was created. Otherwise, returns an error
@@ -3285,17 +3307,7 @@
* Abort this mapping if its PV entry could not be created.
*/
if (!pmap_pv_insert_l2(pmap, va, new_l2, flags, lockp)) {
- SLIST_INIT(&free);
- if (pmap_unwire_ptp(pmap, va, l2pg, &free)) {
- /*
- * Although "va" is not mapped, paging-structure
- * caches could nonetheless have entries that
- * refer to the freed page table pages.
- * Invalidate those entries.
- */
- pmap_invalidate_page(pmap, va);
- vm_page_free_pages_toq(&free, true);
- }
+ pmap_abort_ptp(pmap, va, l2pg);
if (uwptpg != NULL) {
mt = pmap_remove_pt_page(pmap, va);
KASSERT(mt == uwptpg,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 15, 6:53 PM (15 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15814132
Default Alt Text
D45579.diff (1 KB)
Attached To
Mode
D45579: riscv pmap: Introduce 'pmap_abort_ptp'
Attached
Detach File
Event Timeline
Log In to Comment