Lines Matching full:sregs
77 static void sregs_dump(FILE *stream, struct kvm_sregs *sregs, uint8_t indent) in sregs_dump() argument
82 segment_dump(stream, &sregs->cs, indent + 2); in sregs_dump()
84 segment_dump(stream, &sregs->ds, indent + 2); in sregs_dump()
86 segment_dump(stream, &sregs->es, indent + 2); in sregs_dump()
88 segment_dump(stream, &sregs->fs, indent + 2); in sregs_dump()
90 segment_dump(stream, &sregs->gs, indent + 2); in sregs_dump()
92 segment_dump(stream, &sregs->ss, indent + 2); in sregs_dump()
94 segment_dump(stream, &sregs->tr, indent + 2); in sregs_dump()
96 segment_dump(stream, &sregs->ldt, indent + 2); in sregs_dump()
99 dtable_dump(stream, &sregs->gdt, indent + 2); in sregs_dump()
101 dtable_dump(stream, &sregs->idt, indent + 2); in sregs_dump()
106 sregs->cr0, sregs->cr2, sregs->cr3, sregs->cr4); in sregs_dump()
110 sregs->cr8, sregs->efer, sregs->apic_base); in sregs_dump()
115 sregs->interrupt_bitmap[i]); in sregs_dump()
495 struct kvm_sregs sregs; in vcpu_init_sregs() local
500 vcpu_sregs_get(vcpu, &sregs); in vcpu_init_sregs()
502 sregs.idt.base = vm->arch.idt; in vcpu_init_sregs()
503 sregs.idt.limit = NUM_INTERRUPTS * sizeof(struct idt_entry) - 1; in vcpu_init_sregs()
504 sregs.gdt.base = vm->arch.gdt; in vcpu_init_sregs()
505 sregs.gdt.limit = getpagesize() - 1; in vcpu_init_sregs()
507 sregs.cr0 = X86_CR0_PE | X86_CR0_NE | X86_CR0_PG; in vcpu_init_sregs()
508 sregs.cr4 |= X86_CR4_PAE | X86_CR4_OSFXSR; in vcpu_init_sregs()
509 sregs.efer |= (EFER_LME | EFER_LMA | EFER_NX); in vcpu_init_sregs()
511 kvm_seg_set_unusable(&sregs.ldt); in vcpu_init_sregs()
512 kvm_seg_set_kernel_code_64bit(&sregs.cs); in vcpu_init_sregs()
513 kvm_seg_set_kernel_data_64bit(&sregs.ds); in vcpu_init_sregs()
514 kvm_seg_set_kernel_data_64bit(&sregs.es); in vcpu_init_sregs()
515 kvm_seg_set_kernel_data_64bit(&sregs.gs); in vcpu_init_sregs()
516 kvm_seg_set_tss_64bit(vm->arch.tss, &sregs.tr); in vcpu_init_sregs()
518 sregs.cr3 = vm->pgd; in vcpu_init_sregs()
519 vcpu_sregs_set(vcpu, &sregs); in vcpu_init_sregs()
950 struct kvm_sregs sregs; in vcpu_arch_dump() local
954 fprintf(stream, "%*sregs:\n", indent + 2, ""); in vcpu_arch_dump()
959 vcpu_sregs_get(vcpu, &sregs); in vcpu_arch_dump()
960 sregs_dump(stream, &sregs, indent + 4); in vcpu_arch_dump()
1077 vcpu_sregs_get(vcpu, &state->sregs); in vcpu_save_state()
1102 vcpu_sregs_set(vcpu, &state->sregs); in vcpu_load_state()