aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/paging.h
Commit message (Collapse)AuthorAgeFilesLines
* x86: add address validity check to guest_map_l1e()Jan Beulich2013-10-111-1/+2
| | | | | | | | | | Just like for guest_get_eff_l1e() this prevents accessing as page tables (and with the wrong memory attribute) internal data inside Xen happening to be mapped with 1Gb pages. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: correct LDT checksJan Beulich2013-10-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | - MMUEXT_SET_LDT should behave as similarly to the LLDT instruction as possible: fail only if the base address is non-canonical - instead LDT descriptor accesses should fault if the descriptor address ends up being non-canonical (by ensuring this we at once avoid reading an entry from the mach-to-phys table and consider it a page table entry) - fault propagation on using LDT selectors must distinguish #PF and #GP (the latter must be raised for a non-canonical descriptor address, which also applies to several other uses of propagate_page_fault(), and hence the problem is being fixed there) - map_ldt_shadow_page() should properly wrap addresses for 32-bit VMs At once remove the odd invokation of map_ldt_shadow_page() from the MMUEXT_SET_LDT handler: There's nothing really telling us that the first LDT page is going to be preferred over others. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: BITS_PER_LONG is now always 64Jan Beulich2013-03-201-4/+0
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* x86/mm: revert 26399:b0e618cb0233 (multiple vram areas)Tim Deegan2013-01-171-5/+10
| | | | | | | | Although this passed my smoke-tests at commit time, I'm now seeing screen corruption on 32-bit WinXP guests. Reverting for now. :( Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* x86/mm: Provide support for multiple frame buffers in HVM guests.Robert Phillips2013-01-171-10/+5
| | | | | | | | | | | | | | | | | | | | | | Support is provided for both shadow and hardware assisted paging (HAP) modes. This code bookkeeps the set of video frame buffers (vram), detects when the guest has modified any of those buffers and, upon request, returns a bitmap of the modified pages. This lets other software components re-paint the portions of the monitor (or monitors) that have changed. Each monitor has a frame buffer of some size at some position in guest physical memory. The set of frame buffers being tracked can change over time as monitors are plugged and unplugged. Signed-off-by: Robert Phillips <robert.phillips@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Removed a stray #include and a few hard tabs. Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* x86/mm/hap: Adjust vram tracking to play nicely with log-dirty.Robert Phillips2012-12-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The previous code assumed the guest would be in one of three mutually exclusive modes for bookkeeping dirty pages: (1) shadow, (2) hap utilizing the log dirty bitmap to support functionality such as live migrate, (3) hap utilizing the log dirty bitmap to track dirty vram pages. Races arose when a guest attempted to track dirty vram while performing live migrate. (The dispatch table managed by paging_log_dirty_init() might change in the middle of a log dirty or a vram tracking function.) This change allows hap log dirty and hap vram tracking to be concurrent. Vram tracking no longer uses the log dirty bitmap. Instead it detects dirty vram pages by examining their p2m type. The log dirty bitmap is only used by the log dirty code. Because the two operations use different mechanisms, they are no longer mutually exclusive. Signed-Off-By: Robert Phillips <robert.phillips@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Minor whitespace changes to conform with coding style Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* xen: replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when appropriateStefano Stabellini2012-10-171-1/+1
| | | | | | | | | | | | Note: these changes don't make any difference on x86. Replace XEN_GUEST_HANDLE with XEN_GUEST_HANDLE_PARAM when it is used as an hypercall argument. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* x86: We can assume CONFIG_PAGING_LEVELS==4.Keir Fraser2012-09-121-10/+0
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* xen: Remove x86_32 build target.Keir Fraser2012-09-121-12/+0
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* x86/mm: adjust paging interface to return superpage sizesTim Deegan2011-09-081-5/+9
| | | | | | | | to the caller of paging_ga_to_gfn_cr3() Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* x86/mm: simplify log-dirty page allocation.Tim Deegan2011-06-021-1/+2
| | | | | | | | Now that the log-dirty code is covered by the same lock as shadow and hap activity, we no longer need to avoid doing allocs and frees with the lock held. Simplify the code accordingly. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* x86/mm/p2m: paging_p2m_ga_to_gfn() doesn't need so many argumentsTim Deegan2011-06-021-13/+6
| | | | | | | | | It has only one caller and is always called with p2m == hostp2m and mode == hostmode. Also, since it's only called from nested HAP code, remove the check of paging_mode_hap(). Then rename it to reflect its new interface. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* Implement Nested-on-Nested.cegger2011-04-051-28/+47
| | | | | | | | This allows the guest to run nested guest with hap enabled. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Tim Deegan <Tim.Deegan@citrix.com> Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
* x86/mm: make paging_map_log_dirty_bitmap() staticKeir Fraser2010-12-151-3/+0
| | | | | | now that its only caller outside paging.c has been removed. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* x86/mm: move mfn_is_dirty along with the rest of the log-dirty codeKeir Fraser2010-12-151-0/+3
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* x86/mm: Allocate log-dirty bitmaps from shadow/HAP memory.Keir Fraser2010-11-191-2/+2
| | | | | | | | | Move the p2m alloc and free functions back into the per-domain paging assistance structure and allow them to be called from the log-dirty code. This makes it less likely that log-dirty code will run out of memory populating the log-dirty bitmap. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* x86 hvm: implement HVMOP_pagetable_dyingKeir Fraser2010-06-211-0/+5
| | | | | | | | | | | | This patch implements HVMOP_pagetable_dying: an hypercall for guests to notify Xen that a pagetable is about to be destroyed so that Xen can use it as a hint to unshadow the pagetable soon and unhook the top-level user-mode shadow entries right away. Gianluca Guida is the original author of this patch. Signed-off-by: Gianluca Guida <glguida@gmail.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* Per-domain switch to disable oos shadow page tablesKeir Fraser2009-10-191-1/+1
| | | | Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
* x86_64: allow more vCPU-s per guestKeir Fraser2009-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the shared info layout is fixed, guests are required to use VCPUOP_register_vcpu_info prior to booting any vCPU beyond the traditional limit of 32. MAX_VIRT_CPUS, being an implemetation detail of the hypervisor, is no longer being exposed in the public headers. The tools changes are clearly incomplete (and done only so things would build again), and the current state of the tools (using scalar variables all over the place to represent vCPU bitmaps) very likely doesn't permit booting DomU-s with more than the traditional number of vCPU-s. Testing of the extended functionality was done with Dom0 (96 vCPU-s, as well as 128 vCPU-s out of which the kernel elected - by way of a simple kernel side patch - to use only some, resulting in a sparse bitmap). ia64 changes only to make things build, and build-tested only (and the tools part only as far as the build would go without encountering unrelated problems in the blktap code). Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: hap dirty vram trackingKeir Fraser2009-06-041-0/+15
| | | | | | | | | | | | | | | | | | | | | | Currently HAP systems suffer a significant performance loss when a vnc client is connect or the sdl interface is used, because HAP is lacking an implementation of track_dirty_vram. As a consequence qemu always tries to update the whole screen because it does not know which areas of the screen have been updated by the guest. This patch implements track_dirty_vram for HAP enabling the logdirty mechanism only in a specific gfn range and adding a paging_log_dirty_range function that returns the log dirty bitmap in a requested range. Paging_log_dirty_range is different from paging_log_dirty_op because operates on a range and also because it does not pause the domain. In order not to lose any update I moved clean_dirty_bitmap at the beginning of the function before evaluating the logdirty bitmap. The bitmap is still safe because it is protected by the logdirty lock. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* x86: Fold page_info lock into type_info.Keir Fraser2009-01-271-4/+3
| | | | | | Fix some racey looking code at the same time. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86_emulate: Support CMPXCHG16B.Keir Fraser2008-04-221-0/+2
| | | | | | | | Also clean up cmpxchg() callback handling so we can get rid of teh specific cmpxchg8b handler. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86, vmx: Enable EPT (Extended PageTable) support on new Intel processors.Keir Fraser2008-04-091-1/+1
| | | | | | | | | | | | | We use the EPT page table as P2M (guest physical to machine mapping), removing the linear page table when EPT is used for the domain (see the new file p2m-ept.c). We did this by adding three operations in the p2m_domain. If VT-d is enabled, the EPT page table will be used as the VT-d page table as well (i.e. shared). Signed-off-by: Xin Li <xin.b.li@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> Signed-off-by: Xiaohui Xin <Xiaohui.xin@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: make dirty logging stop requiring physical pages of order > 0Keir Fraser2007-11-161-0/+22
| | | | | | | | | | | | | | | | This patch re-implements the (x86) hypervisor dirty page log with a simple four-level radix tree whose nodes are all single pages, thus making migration require only order-0 pages (where before it required at least an order-5 page). Unlike the p2m radix tree implementation, the interior nodes of this tree are NOT page table nodes. I chose a lazy-allocation and -mapping approach because most pages are not marked dirty while dirty-logging is enabled. There are doubtless situations (the 'stream' benchmark, for example) where a more complex p2m-like approach is faster, but I'm not sure they're worth the effort. Signed-off-by: Dave Lively <dlively@virtualiron.com>
* [SHADOW] Make the guest PT walker more complete.Tim Deegan2007-11-021-5/+11
| | | | | | | | | | | | We now check access rights and write back the _PAGE_ACCESSED and _PAGE_DIRTY bits into the guest entries as we walk the tables. This makes the shadow fault handler simpler, and the various emulation paths more correct. This patch doesn't add checking and write-back to the HAP pagetable walker; it just fixes up its arguments to match the new shadow one. Signed-off-by: Tim Deegan <Tim.Deegan@eu.citrix.com>
* [HVM] Shadow: don't shadow the p2m table.Tim Deegan2007-08-311-16/+0
| | | | | | | | | | | For HVM vcpus with paging disabled, we used to shadow the p2m table, and skip the p2m lookup to go from gfn to mfn. Instead, we now provide a simple pagetable that gives a one-to-one mapping of 4GB, and shadow that, making the translations from gfn to mfn via the p2m. This removes the paging-disabled special-case code from the shadow fault handler, and allows us to expand the p2m interface, since all HVM translations now go through the same p2m lookups. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [XEN] Fix p2m->shadow callback to pass the mfn being written toTim Deegan2007-07-031-5/+11
| | | | | | | as well as the pointer and contents. This was being calculated but got disconnected from its use when the p2m and shadow functions were separated. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [XEN] Make common log-dirty paging code and add HAP log-dirty support.Tim Deegan2007-06-111-0/+26
| | | | Signed-off-by: Wei Huang <wei.huang2@amd.com>
* [XEN] Shadow: be more explicit in assuming that d->vcpu[0] is validTim Deegan2007-03-091-1/+1
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@xensourc.com>
* [XEN] Get rid of gva_to_gpa translationTim Deegan2007-02-201-12/+3
| | | | | | | | It didn't have any sensible error checking. Make all callers use gva_to_gfn translation and check the result. MMIO and PIO callers inject pagefaults to the guest iof the non-IO address is not mapped. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [XEN] New paging-assistance interface.Tim Deegan2007-02-141-0/+376
Adds paging_* functions, wrapping the existing shadow_* ones, so that later hardware paging assistance can be hooked in at this level. Separates p2m maintenance code into its own files. Adjusts shadow code to comply with the new interfaces. Changes all callers in arch/x86 to use the new interfaces. Signed-off-by: Wei Huang <Wei.Huang2@amd.com> Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>