aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/stdvga.c
Commit message (Collapse)AuthorAgeFilesLines
* x86/HVM: properly handle backward string instruction emulationJan Beulich2013-10-141-23/+11
| | | | | | | | | | | Multiplying a signed 32-bit quantity with an unsigned 32-bit quantity produces an unsigned 32-bit result, yet for emulation of backward string instructions we need the result sign extended before getting added to the base address. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/HVM: add missing assert to stdvga's mmio_move()Jan Beulich2012-12-071-0/+1
| | | | | | | ... to match the IOREQ_READ path. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/hvm: constify static data where possibleJan Beulich2012-09-141-2/+2
| | | | | | | | In a few cases this also extends to making them static in the first place. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/hvm: Use get_page_from_gfn() instead of get_gfn()/put_gfn.Tim Deegan2012-05-171-6/+9
| | | | | Signed-off-by: Tim Deegan <tim@xen.org> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
* x86/mm: clean use of p2m unlocked queriesAndres Lagar-Cavilla2012-01-261-2/+10
| | | | | | | | | | Limit such queries only to p2m_query types. This is more compatible with the name and intended semantics: perform only a lookup, and explicitly in an unlocked way. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* Modify naming of queries into the p2mAndres Lagar-Cavilla2011-11-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | Callers of lookups into the p2m code are now variants of get_gfn. All callers need to call put_gfn. The code behind it is a no-op at the moment, but will change to proper locking in a later patch. This patch does not change functionality. Only naming, and adds put_gfn's. set_p2m_entry retains its name because it is always called with p2m_lock held. This patch is humongous, unfortunately, given the dozens of call sites involved. After this patch, anyone using old style gfn_to_mfn will not succeed in compiling their code. This is on purpose: adapt to the new API. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Keir Fraser <keir@xen.org>
* x86/mm/p2m: Make p2m interfaces take struct domain arguments.Tim Deegan2011-06-021-3/+3
| | | | | | | | | | | | | | | | | As part of the nested HVM patch series, many p2m functions were changed to take pointers to p2m tables rather than to domains. This patch reverses that for almost all of them, which: - gets rid of a lot of "p2m_get_hostp2m(d)" in code which really shouldn't have to know anything about how gfns become mfns. - ties sharing and paging interfaces to a domain, which is what they actually act on, rather than a particular p2m table. In developing this patch it became clear that memory-sharing and nested HVM are unlikely to work well together. I haven't tried to fix that here beyond adding some assertions around suspect paths (as this patch is big enough with just the interface changes) Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* Nested Virtualization: p2m infrastructureKeir Fraser2010-08-091-2/+3
| | | | | | | | Change p2m infrastructure to operate on per-p2m instead of per-domain. This allows us to use multiple p2m tables per-domain. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
* stdvga: avoid bogus warning messageKeir Fraser2010-03-091-2/+3
| | | | | | | | Prevents stdvga to print the 'unsupported mmio request type' warning when the actual request type is 'IOREQ_TYPE_COPY'. This avoids confusion. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* Introduce new flavour of map_domain_page()Keir Fraser2009-09-221-3/+3
| | | | | | | | | | | | | Introduce a variant of map_domain_page() directly getting passed a struct page_info * argument, based on the observation that in many places the argument to this function so far simply was the result of page_to_mfn(). This is meaningful for the x86-64 case where map_domain_page() really just is an invocation of mfn_to_virt(), and hence the combined mfn_to_virt(page_to_mfn()) now represents a needless round trip conversion compressed -> uncompressed -> compressed of the MFN representation. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Mapping grant references into HVM guests, take 2Keir Fraser2009-07-131-4/+4
| | | | | | | | | | | | | After some discussion, here's a second version of the patch I posted a couple of weeks back to map grant references into HVM guests. As before, this is done by modifying the P2M map, but this time there's no new hypercall to do it. Instead, the existing GNTTABOP_map is overloaded to perform a P2M mapping if called from a shadow mode translate guest. This matches the IA64 API. Signed-off-by: Steven Smith <steven.smith@citrix.com> Acked-by: Tim Deegan <tim.deegan@citrix.com> CC: Bhaskar Jayaraman <Bhaskar.Jayaraman@lsi.com>
* hvm: Fix intra-vga-mem mmio in stdvga.cKeir Fraser2008-07-231-4/+30
| | | | | | | | | | | | | | | | | The current stdvga code never checks if the copy_from/to_guest calls fail, and thus silenty fails if both sides of an IOREQ_COPY points into mmio space. This patch fixes this and makes the code correctly handle intra-vga-mem copies, as well as log & turn off caching if some more "exotic" type of mmio (say, copy from vga mem to some other device's iomem), so that such mmio reqs will fall through to regular ioemu where they can hopefully be handled correctly. In practice, this patch fixes a number of graphical glitches for guests running in standard vga mode, including a corrupted OS/2 boot graphic. Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com> Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
* stdvga: handle 64bit io operationsKeir Fraser2008-05-191-6/+28
| | | | | | | | | Handle 64bit operations in stdvga instead of throwing away the upper 32bits. This fixes some noisy xen messages like "invalid io size: 8". Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* x86, hvm: stdvga cache always onKeir Fraser2008-05-061-10/+45
| | | | | | | | | | | | currently the hypervisor vga cache (stdvga.c) enables itself only in graphical mode and in the a0000h-affffh range. However there is no reason for this: it already allocates enought memory to map the whole vram. I am attaching a patch that implements the bank switching mechanism in stdvga.c, allowing the cache to be always enabled when the emulated graphic card is in VGA mode. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86, hvm: I/O emulation handlers return X86EMUL_* return codes.Keir Fraser2008-04-151-11/+11
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* xen: Allow NUMA node to be specific to alloc_domheap_pages() via a newKeir Fraser2008-04-041-1/+3
| | | | | | | MEMF_node() sub-flag type. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86 hvm: Replace old MMIO emulator with x86_emulate()-based harness.Keir Fraser2008-02-201-34/+0
| | | | | Re-factor VMX real-mode emulation to use the same harness. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: Improve in-Xen PIO emulation to better handle string PIOKeir Fraser2008-01-121-15/+10
| | | | | instructions. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm stdvga: Do not emulate PIO reads inside Xen. They should be rareKeir Fraser2007-12-081-164/+28
| | | | | | | | | | | | (PIO write emulation is really for book-keeping to detect when we enter/leave stdvga mode, and to work out what to do with mmio accesses), and we may do the wrong thing depending on emulated SVGA hardware and current mode. This simplifies the code and means that 'stdvga=1' once again works properly and causes the stdvga bios to be loaded by hvmloader. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86, hvm: Allow stdvga acceleration to work with 32-bit x86.Keir Fraser2007-11-161-47/+65
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: Clean up buf_ioreq handling.Keir Fraser2007-11-081-1/+3
| | | | | | Also, disable stdvga caching on hvm save/restore, as the shadow vga state is not preserved. Signed-off-by: Keir Fraser <keir@xensource.com>
* x86, hvm: Fix stdvga and buffered-io code.Keir Fraser2007-11-011-0/+6
| | | | | | | | Corrected a bug in the stdvga code where it did not properly handle 32 bit operations. The buf_ioreq_t can now store 32 bits of data. Signed-off-by: Robert Phillips <rphillips@virtualiron.com> Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
* x86, hvm: Clean up code style in stdvga code and do not compile forKeir Fraser2007-10-291-169/+154
| | | | | 32-bit hypervisor (it doesn't work). Signed-off-by: Keir Fraser <keir@xensource.com>
* x86, hvm: Improve standard VGA performanceKeir Fraser2007-10-261-0/+712
This patch improves the performance of Standard VGA, the mode used during Windows boot and by the Linux splash screen. It does so by buffering all the stdvga programmed output ops and memory mapped ops (both reads and writes) that are sent to QEMU. We maintain locally essential VGA state so we can respond immediately to input and read ops without waiting for QEMU. We snoop output and write ops to keep our state up-to-date. PIO input ops are satisfied from cached state without bothering QEMU. PIO output and mmio ops are passed through to QEMU, including mmio read ops. This is necessary because mmio reads can have side effects. I have changed the format of the buffered_iopage. It used to contain 80 elements of type ioreq_t (48 bytes each). Now it contains 672 elements of type buf_ioreq_t (6 bytes each). Being able to pipeline 8 times as many ops improves VGA performance by a factor of 8. I changed hvm_buffered_io_intercept to use the same registration and callback mechanism as hvm_portio_intercept rather than the hacky hardcoding it used before. In platform.c, I fixed send_timeoffset_req() to sets its ioreq size to 8 (rather than 4), and its count to 1 (which was missing). Signed-off-by: Ben Guthro <bguthro@virtualron.com> Signed-off-by: Robert Phillips <rphillips@virtualiron.com>