aboutsummaryrefslogtreecommitdiffstats
path: root/arch
Commit message (Collapse)AuthorAge
...
| * | | | KVM: PPC: Convert DSISR to shared pageAlexander Graf2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DSISR register contains information about a data page fault. It is fully read/write from inside the guest context and we don't need to worry about interacting based on writes of this register. This patch converts all users of the current field to the shared page. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: PPC: Convert MSR to shared pageAlexander Graf2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the most obvious registers to share with the guest directly is the MSR. The MSR contains the "interrupts enabled" flag which the guest has to toggle in critical sections. So in order to bring the overhead of interrupt en- and disabling down, let's put msr into the shared page. Keep in mind that even though you can fully read its contents, writing to it doesn't always update all state. There are a few safe fields that don't require hypervisor interaction. See the documentation for a list of MSR bits that are safe to be set from inside the guest. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: PPC: Introduce shared pageAlexander Graf2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For transparent variable sharing between the hypervisor and guest, I introduce a shared page. This shared page will contain all the registers the guest can read and write safely without exiting guest context. This patch only implements the stubs required for the basic structure of the shared page. The actual register moving follows. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: Fix nop emulationMohammed Gamal2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a nop instruction is encountered, we jump directly to the done label. This skip updating rip. Break from the switch case instead Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: Decode memory operands directly into a 'struct operand'Avi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since modrm operand can be either register or memory, decoding it into a 'struct operand', which can represent both, is simpler. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: change invlpg emulation to use src.mem.addrAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using modrm_ea, which will soon be gone. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: switch LEA to use SrcMem decodingAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NoAccess flag will prevent memory from being accessed. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: add NoAccess flag for memory instructions that skip accessAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use for INVLPG, which accesses the tlb, not memory. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: use struct operand for mov reg,dr and mov dr,reg for reg opAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an ordinary modrm source or destination; use the standard structure representing it. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: use struct operand for mov reg,cr and mov cr,reg for reg opAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an ordinary modrm source or destination; use the standard structure representing it. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: mark mov cr and mov dr as 64-bit instructions in long modeAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: introduce Op3264 for mov cr and mov dr instructionsAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The operands for these instructions are 32 bits or 64 bits, depending on long mode, and ignoring REX prefixes, or the operand size prefix. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: simplify REX.W checkAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (x && (x & y)) == (x & y) Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: drop use_modrm_eaAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unused (and has never been). Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: put register operand fetch into a functionAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code is repeated three times, put it into fetch_register_operand() Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: use SrcAcc to simplify xchg decodingAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: simplify xchg decode tablesAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use X8() to avoid repetition. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: use correct type for memory address in operandsAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we use a void pointer for memory addresses. That's wrong since these are guest virtual addresses which are not directly dereferencable by the host. Use the correct type, unsigned long. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: push segment override out of decode_modrm()Avi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let it compute modrm_seg instead, and have the caller apply it. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: SVM: Check for asid != 0 on nested vmrunJoerg Roedel2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch lets a nested vmrun fail if the L1 hypervisor left the asid zero. This fixes the asid_zero unit test. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: SVM: Check for nested vmrun intercept before emulating vmrunJoerg Roedel2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch lets the nested vmrun fail if the L1 hypervisor has not intercepted vmrun. This fixes the "vmrun intercept check" unit test. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: MMU: mark page dirty only when page is really writtenXiao Guangrong2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark page dirty only when this page is really written, it's more exacter, and also can fix dirty page marking in speculation path Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: MMU: move bits lost judgement into a separate functionXiao Guangrong2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce spte_has_volatile_bits() function to judge whether spte bits will miss, it's more readable and can help us to cleanup code later Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: MMU: using kvm_set_pfn_accessed() instead of mark_page_accessed()Xiao Guangrong2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a small cleanup that using using kvm_set_pfn_accessed() instead of mark_page_accessed() Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: check io permissions only once for string pioGleb Natapov2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not recheck io permission on every iteration. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: fix LMSW able to clear cr0.peAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LMSW is documented not to be able to clear cr0.pe; make it so. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | | | KVM: x86 emulator: don't update vcpu state if instruction is restartedGleb Natapov2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No need to update vcpu state since instruction is in the middle of the emulation. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: convert some push instructions to direct decodeAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: allow repeat macro arguments to contain commasAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needed for repeating instructions with execution functions. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: move decode tables downwardsAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So they can reference execution functions. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: move x86_decode_insn() downwardsAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No code changes. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: allow storing emulator execution function in decode tablesAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of looking up the opcode twice (once for decode flags, once for the big execution switch) look up both flags and function in the decode tables. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: store x86_emulate_ops in emulation contextAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't ever change, so we don't need to pass it around everywhere. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: move ByteOp and Dst back to bits 0:3Avi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the group index no longer exists, the space is free. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: drop support for old-style groupsAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: convert group 9 to new styleAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: convert group 8 to new styleAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: convert group 7 to new styleAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: convert group 5 to new styleAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: convert group 4 to new styleAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: convert group 3 to new styleAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: convert group 1A to new styleAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: convert group 1 to new styleAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: allow specifying group directly in opcodeAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having a group number, store the group table pointer directly in the opcode. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: reserve group code 0Avi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'll be using that to distinguish between new-style and old-style groups. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: move group tables to topAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No code changes. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: Add wrappers for easily defining opcodesAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once 'struct opcode' grows, its initializer will become more complicated. Wrap the simple initializers in a D() macro, and replace the empty initializers with an even simpler N macro. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: introduce 'struct opcode'Avi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will hold all the information known about the opcode. Currently, this is just the decode flags. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: drop parentheses in repreat macrosAvi Kivity2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parenthese make is impossible to use the macros with initializers that require braces. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * | | | KVM: x86 emulator: Add IRET instructionMohammed Gamal2010-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ths patch adds IRET instruction (opcode 0xcf). Currently, only IRET in real mode is emulated. Protected mode support is to be added later if needed. Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com> Reviewed-by: Avi Kivity <avi@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>