Bug 153477 - [xen] XEN pmap code abuses vm page queue lock
Summary: [xen] XEN pmap code abuses vm page queue lock
Status: Closed Not Accepted
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-xen mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-28 00:20 UTC by Colin Percival
Modified: 2015-09-09 11:47 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Percival freebsd_committer 2010-12-28 00:20:12 UTC
In the FreeBSD/i386 Xen/PV pmap.c code, the vm page queue lock is abused
to control access to the queue of page remapping hypervisor requests.
This lock is asserted in _xen_queue_pt_update in i386/xen/xen_machdep.c,
and this results in it being locked/unlocked a number of times in
i386/xen/pmap.c.  (Judging by the i386 code, there are times when
holding the vm page queue lock in pmap.c is appropriate; but the locking
in pmap_pte and pmap_pte_release is not such an occasion, for example.)

In addition to being subjectively inappropriate, the current locking
creates a LOR between the vm page queue lock and PMAP2mutex.

Fix: 

We should probably have a new xen_pt_update_mtx spin mutex, lock/unlock
it in i386/xen/pmap.c around the page table update calls, and then audit
the vm_page_lock_queues calls to see which can be ripped out.

I'll probably get around to doing this at some point (this PR is mostly
an aide-memoire) but I'd be overjoyed if someone else wants to look at
this first...
How-To-Repeat: 
Running 'mdconfig -l' results in a LOR warning being printed.
Comment 1 Colin Percival freebsd_committer 2010-12-28 00:22:02 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-xen

Assign xen bug to freebsd-xen list.
Comment 2 Roger Pau Monné freebsd_committer 2015-09-09 11:47:13 UTC
PV pmap code has been removed together with the classic PV i386 port.