diff options
author | Jan Beulich <jbeulich@novell.com> | 2011-04-05 13:01:25 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@novell.com> | 2011-04-05 13:01:25 +0100 |
commit | 9a70856bb28bb8c9b1d37fb8a005447ac77b0619 (patch) | |
tree | e03eabf8a03ef712e5b93a91d4b5e13923b0c4a4 /xen/arch/x86/x86_64/entry.S | |
parent | 4551775df58d42e2dcfd2a8ac4bcc713709e8b81 (diff) | |
download | xen-9a70856bb28bb8c9b1d37fb8a005447ac77b0619.tar.gz xen-9a70856bb28bb8c9b1d37fb8a005447ac77b0619.tar.bz2 xen-9a70856bb28bb8c9b1d37fb8a005447ac77b0619.zip |
x86: split struct vcpu
This is accomplished by splitting the guest_context member, which by
itself is larger than a page on x86-64. Quite a number of fields of
this structure is completely meaningless for HVM guests, and thus a
new struct pv_vcpu gets introduced, which is being overlaid with
struct hvm_vcpu in struct arch_vcpu. The one member that is mostly
responsible for the large size is trap_ctxt, which now gets allocated
separately (unless fitting on the same page as struct arch_vcpu, as is
currently the case for x86-32), and only for non-hvm, non-idle
domains.
This change pointed out a latent problem in arch_set_info_guest(),
which is permitted to be called on already initialized vCPU-s, but
so far copied the new state into struct arch_vcpu without (in this
case) actually going through all the necessary accounting/validation
steps. The logic gets changed so that the pieces that bypass
accounting
will at least be verified to be no different from the currently active
bits, and the whole change will fail in case they are. The logic does
*not* get adjusted here to do full error recovery, that is, partially
modified state continues to not get unrolled in case of failure.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/x86_64/entry.S')
-rw-r--r-- | xen/arch/x86/x86_64/entry.S | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S index a6c68220c8..6cf35f338e 100644 --- a/xen/arch/x86/x86_64/entry.S +++ b/xen/arch/x86/x86_64/entry.S @@ -286,8 +286,9 @@ sysenter_eflags_saved: jnz compat_sysenter call create_bounce_frame jmp test_all_events -2: movl %eax,TRAPBOUNCE_error_code(%rdx) - movq VCPU_gp_fault_addr(%rbx),%rax +2: movq VCPU_trap_ctxt(%rbx),%rcx + movl %eax,TRAPBOUNCE_error_code(%rdx) + movq TRAP_gp_fault * TRAPINFO_sizeof + TRAPINFO_eip(%rcx),%rax movb $(TBF_EXCEPTION|TBF_EXCEPTION_ERRCODE|TBF_INTERRUPT),%cl movl $TRAP_gp_fault,UREGS_entry_vector(%rsp) jmp 1b |