ldt 2404 arch/x86/events/core.c struct ldt_struct *ldt; ldt 2407 arch/x86/events/core.c ldt = READ_ONCE(current->active_mm->context.ldt); ldt 2408 arch/x86/events/core.c if (!ldt || idx >= ldt->nr_entries) ldt 2411 arch/x86/events/core.c desc = &ldt->entries[idx]; ldt 118 arch/x86/include/asm/desc.h #define load_ldt(ldt) asm volatile("lldt %0"::"m" (ldt)) ldt 130 arch/x86/include/asm/desc.h static inline void paravirt_alloc_ldt(struct desc_struct *ldt, unsigned entries) ldt 134 arch/x86/include/asm/desc.h static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries) ldt 139 arch/x86/include/asm/desc.h #define store_ldt(ldt) asm("sldt %0" : "=m"(ldt)) ldt 146 arch/x86/include/asm/desc.h static inline void native_write_ldt_entry(struct desc_struct *ldt, int entry, const void *desc) ldt 148 arch/x86/include/asm/desc.h memcpy(&ldt[entry], desc, 8); ldt 202 arch/x86/include/asm/desc.h ldt_desc ldt; ldt 204 arch/x86/include/asm/desc.h set_tssldt_descriptor(&ldt, (unsigned long)addr, DESC_LDT, ldt 207 arch/x86/include/asm/desc.h &ldt, DESC_LDT); ldt 1479 arch/x86/include/asm/kvm_host.h u16 ldt; ldt 1480 arch/x86/include/asm/kvm_host.h asm("sldt %0" : "=g"(ldt)); ldt 1481 arch/x86/include/asm/kvm_host.h return ldt; ldt 32 arch/x86/include/asm/mmu.h struct ldt_struct *ldt; ldt 83 arch/x86/include/asm/mmu_context.h mm->context.ldt = NULL; ldt 103 arch/x86/include/asm/mmu_context.h struct ldt_struct *ldt; ldt 106 arch/x86/include/asm/mmu_context.h ldt = READ_ONCE(mm->context.ldt); ldt 122 arch/x86/include/asm/mmu_context.h if (unlikely(ldt)) { ldt 124 arch/x86/include/asm/mmu_context.h if (WARN_ON_ONCE((unsigned long)ldt->slot > 1)) { ldt 140 arch/x86/include/asm/mmu_context.h set_ldt(ldt_slot_va(ldt->slot), ldt->nr_entries); ldt 142 arch/x86/include/asm/mmu_context.h set_ldt(ldt->entries, ldt->nr_entries); ldt 172 arch/x86/include/asm/mmu_context.h if (unlikely((unsigned long)prev->context.ldt | ldt 173 arch/x86/include/asm/mmu_context.h (unsigned long)next->context.ldt)) ldt 237 arch/x86/include/asm/paravirt.h static inline void paravirt_alloc_ldt(struct desc_struct *ldt, unsigned entries) ldt 239 arch/x86/include/asm/paravirt.h PVOP_VCALL2(cpu.alloc_ldt, ldt, entries); ldt 242 arch/x86/include/asm/paravirt.h static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries) ldt 244 arch/x86/include/asm/paravirt.h PVOP_VCALL2(cpu.free_ldt, ldt, entries); ldt 132 arch/x86/include/asm/paravirt_types.h void (*write_ldt_entry)(struct desc_struct *ldt, int entrynum, ldt 138 arch/x86/include/asm/paravirt_types.h void (*alloc_ldt)(struct desc_struct *ldt, unsigned entries); ldt 139 arch/x86/include/asm/paravirt_types.h void (*free_ldt)(struct desc_struct *ldt, unsigned entries); ldt 294 arch/x86/include/asm/processor.h unsigned short ldt, __ldth; ldt 28 arch/x86/include/asm/suspend_32.h u16 ldt; ldt 46 arch/x86/include/asm/suspend_64.h u16 ldt; ldt 152 arch/x86/include/uapi/asm/kvm.h struct kvm_segment tr, ldt; ldt 56 arch/x86/kernel/doublefault.c .ldt = 0, ldt 109 arch/x86/kernel/ldt.c if (mm->context.ldt) { ldt 159 arch/x86/kernel/ldt.c if (boot_cpu_has(X86_FEATURE_PTI) && !mm->context.ldt) ldt 184 arch/x86/kernel/ldt.c if (boot_cpu_has(X86_FEATURE_PTI) && !mm->context.ldt) ldt 204 arch/x86/kernel/ldt.c map_ldt_struct(struct mm_struct *mm, struct ldt_struct *ldt, int slot) ldt 218 arch/x86/kernel/ldt.c WARN_ON(ldt->slot != -1); ldt 223 arch/x86/kernel/ldt.c is_vmalloc = is_vmalloc_addr(ldt->entries); ldt 225 arch/x86/kernel/ldt.c nr_pages = DIV_ROUND_UP(ldt->nr_entries * LDT_ENTRY_SIZE, PAGE_SIZE); ldt 229 arch/x86/kernel/ldt.c const void *src = (char *)ldt->entries + offset; ldt 261 arch/x86/kernel/ldt.c ldt->slot = slot; ldt 265 arch/x86/kernel/ldt.c static void unmap_ldt_struct(struct mm_struct *mm, struct ldt_struct *ldt) ldt 270 arch/x86/kernel/ldt.c if (!ldt) ldt 277 arch/x86/kernel/ldt.c nr_pages = DIV_ROUND_UP(ldt->nr_entries * LDT_ENTRY_SIZE, PAGE_SIZE); ldt 284 arch/x86/kernel/ldt.c va = (unsigned long)ldt_slot_va(ldt->slot) + offset; ldt 290 arch/x86/kernel/ldt.c va = (unsigned long)ldt_slot_va(ldt->slot); ldt 297 arch/x86/kernel/ldt.c map_ldt_struct(struct mm_struct *mm, struct ldt_struct *ldt, int slot) ldt 302 arch/x86/kernel/ldt.c static void unmap_ldt_struct(struct mm_struct *mm, struct ldt_struct *ldt) ldt 324 arch/x86/kernel/ldt.c static void finalize_ldt_struct(struct ldt_struct *ldt) ldt 326 arch/x86/kernel/ldt.c paravirt_alloc_ldt(ldt->entries, ldt->nr_entries); ldt 329 arch/x86/kernel/ldt.c static void install_ldt(struct mm_struct *mm, struct ldt_struct *ldt) ldt 334 arch/x86/kernel/ldt.c smp_store_release(&mm->context.ldt, ldt); ldt 342 arch/x86/kernel/ldt.c static void free_ldt_struct(struct ldt_struct *ldt) ldt 344 arch/x86/kernel/ldt.c if (likely(!ldt)) ldt 347 arch/x86/kernel/ldt.c paravirt_free_ldt(ldt->entries, ldt->nr_entries); ldt 348 arch/x86/kernel/ldt.c if (ldt->nr_entries * LDT_ENTRY_SIZE > PAGE_SIZE) ldt 349 arch/x86/kernel/ldt.c vfree_atomic(ldt->entries); ldt 351 arch/x86/kernel/ldt.c free_page((unsigned long)ldt->entries); ldt 352 arch/x86/kernel/ldt.c kfree(ldt); ldt 368 arch/x86/kernel/ldt.c if (!old_mm->context.ldt) ldt 371 arch/x86/kernel/ldt.c new_ldt = alloc_ldt_struct(old_mm->context.ldt->nr_entries); ldt 377 arch/x86/kernel/ldt.c memcpy(new_ldt->entries, old_mm->context.ldt->entries, ldt 387 arch/x86/kernel/ldt.c mm->context.ldt = new_ldt; ldt 401 arch/x86/kernel/ldt.c free_ldt_struct(mm->context.ldt); ldt 402 arch/x86/kernel/ldt.c mm->context.ldt = NULL; ldt 418 arch/x86/kernel/ldt.c if (!mm->context.ldt) { ldt 426 arch/x86/kernel/ldt.c entries_size = mm->context.ldt->nr_entries * LDT_ENTRY_SIZE; ldt 430 arch/x86/kernel/ldt.c if (copy_to_user(ptr, mm->context.ldt->entries, entries_size)) { ldt 470 arch/x86/kernel/ldt.c struct desc_struct ldt; ldt 493 arch/x86/kernel/ldt.c memset(&ldt, 0, sizeof(ldt)); ldt 500 arch/x86/kernel/ldt.c fill_ldt(&ldt, &ldt_info); ldt 502 arch/x86/kernel/ldt.c ldt.avl = 0; ldt 508 arch/x86/kernel/ldt.c old_ldt = mm->context.ldt; ldt 520 arch/x86/kernel/ldt.c new_ldt->entries[ldt_info.entry_number] = ldt; ldt 310 arch/x86/kernel/process_64.c struct ldt_struct *ldt; ldt 318 arch/x86/kernel/process_64.c ldt = task->mm->context.ldt; ldt 319 arch/x86/kernel/process_64.c if (unlikely(idx >= ldt->nr_entries)) ldt 322 arch/x86/kernel/process_64.c base = get_desc_base(ldt->entries + idx); ldt 37 arch/x86/kernel/step.c if (unlikely(!child->mm->context.ldt || ldt 38 arch/x86/kernel/step.c seg >= child->mm->context.ldt->nr_entries)) ldt 41 arch/x86/kernel/step.c desc = &child->mm->context.ldt->entries[seg]; ldt 3068 arch/x86/kvm/emulate.c tss->ldt = get_segment_selector(ctxt, VCPU_SREG_LDTR); ldt 3092 arch/x86/kvm/emulate.c set_segment_selector(ctxt, tss->ldt, VCPU_SREG_LDTR); ldt 3104 arch/x86/kvm/emulate.c ret = __load_segment_descriptor(ctxt, tss->ldt, VCPU_SREG_LDTR, cpl, ldt 205 arch/x86/kvm/svm.c u16 ldt; ldt 2328 arch/x86/kvm/svm.c svm->host.ldt = kvm_read_ldt(); ldt 2359 arch/x86/kvm/svm.c kvm_load_ldt(svm->host.ldt); ldt 57 arch/x86/kvm/tss.h u16 ldt; ldt 8734 arch/x86/kvm/x86.c kvm_get_segment(vcpu, &sregs->ldt, VCPU_SREG_LDTR); ldt 8935 arch/x86/kvm/x86.c kvm_set_segment(vcpu, &sregs->ldt, VCPU_SREG_LDTR); ldt 581 arch/x86/lib/insn-eval.c struct ldt_struct *ldt; ldt 587 arch/x86/lib/insn-eval.c ldt = current->active_mm->context.ldt; ldt 588 arch/x86/lib/insn-eval.c if (ldt && sel < ldt->nr_entries) { ldt 589 arch/x86/lib/insn-eval.c *out = ldt->entries[sel]; ldt 31 arch/x86/math-emu/fpu_system.h if (current->mm->context.ldt && seg < current->mm->context.ldt->nr_entries) ldt 32 arch/x86/math-emu/fpu_system.h ret = current->mm->context.ldt->entries[seg]; ldt 69 arch/x86/um/asm/mm_context.h uml_ldt_t ldt; ldt 58 arch/x86/um/ldt.c uml_ldt_t *ldt = ¤t->mm->context.arch.ldt; ldt 60 arch/x86/um/ldt.c if (!ldt->entry_count) ldt 66 arch/x86/um/ldt.c mutex_lock(&ldt->lock); ldt 67 arch/x86/um/ldt.c if (ldt->entry_count <= LDT_DIRECT_ENTRIES) { ldt 71 arch/x86/um/ldt.c if (copy_to_user(ptr, ldt->u.entries, size)) ldt 77 arch/x86/um/ldt.c for (i=0; i<ldt->entry_count/LDT_ENTRIES_PER_PAGE && bytecount; ldt 82 arch/x86/um/ldt.c if (copy_to_user(ptr, ldt->u.pages[i], size)) { ldt 90 arch/x86/um/ldt.c mutex_unlock(&ldt->lock); ldt 123 arch/x86/um/ldt.c uml_ldt_t *ldt = ¤t->mm->context.arch.ldt; ldt 147 arch/x86/um/ldt.c mutex_lock(&ldt->lock); ldt 153 arch/x86/um/ldt.c if (ldt_info.entry_number >= ldt->entry_count && ldt 155 arch/x86/um/ldt.c for (i=ldt->entry_count/LDT_ENTRIES_PER_PAGE; ldt 159 arch/x86/um/ldt.c memcpy(&entry0, ldt->u.entries, ldt 161 arch/x86/um/ldt.c ldt->u.pages[i] = (struct ldt_entry *) ldt 163 arch/x86/um/ldt.c if (!ldt->u.pages[i]) { ldt 171 arch/x86/um/ldt.c memcpy(ldt->u.pages[0], &entry0, ldt 173 arch/x86/um/ldt.c memcpy(ldt->u.pages[0]+1, ldt->u.entries+1, ldt 176 arch/x86/um/ldt.c ldt->entry_count = (i + 1) * LDT_ENTRIES_PER_PAGE; ldt 179 arch/x86/um/ldt.c if (ldt->entry_count <= ldt_info.entry_number) ldt 180 arch/x86/um/ldt.c ldt->entry_count = ldt_info.entry_number + 1; ldt 182 arch/x86/um/ldt.c if (ldt->entry_count <= LDT_DIRECT_ENTRIES) ldt 183 arch/x86/um/ldt.c ldt_p = ldt->u.entries + ldt_info.entry_number; ldt 185 arch/x86/um/ldt.c ldt_p = ldt->u.pages[ldt_info.entry_number/LDT_ENTRIES_PER_PAGE] + ldt 202 arch/x86/um/ldt.c mutex_unlock(&ldt->lock); ldt 234 arch/x86/um/ldt.c struct ldt_entry * ldt; ldt 251 arch/x86/um/ldt.c ldt = (struct ldt_entry *) ldt 253 arch/x86/um/ldt.c if (ldt == NULL) { ldt 259 arch/x86/um/ldt.c ret = modify_ldt(0, ldt, (1<<order)*PAGE_SIZE); ldt 271 arch/x86/um/ldt.c if (ldt[i].a != 0 || ldt[i].b != 0) ldt 289 arch/x86/um/ldt.c if (ldt[i].a != 0 || ldt[i].b != 0) ldt 295 arch/x86/um/ldt.c free_pages((unsigned long)ldt, order); ldt 307 arch/x86/um/ldt.c mutex_init(&new_mm->arch.ldt.lock); ldt 324 arch/x86/um/ldt.c new_mm->arch.ldt.entry_count = 0; ldt 335 arch/x86/um/ldt.c mutex_lock(&from_mm->arch.ldt.lock); ldt 336 arch/x86/um/ldt.c if (from_mm->arch.ldt.entry_count <= LDT_DIRECT_ENTRIES) ldt 337 arch/x86/um/ldt.c memcpy(new_mm->arch.ldt.u.entries, from_mm->arch.ldt.u.entries, ldt 338 arch/x86/um/ldt.c sizeof(new_mm->arch.ldt.u.entries)); ldt 340 arch/x86/um/ldt.c i = from_mm->arch.ldt.entry_count / LDT_ENTRIES_PER_PAGE; ldt 347 arch/x86/um/ldt.c new_mm->arch.ldt.u.pages[i] = ldt 349 arch/x86/um/ldt.c memcpy(new_mm->arch.ldt.u.pages[i], ldt 350 arch/x86/um/ldt.c from_mm->arch.ldt.u.pages[i], PAGE_SIZE); ldt 353 arch/x86/um/ldt.c new_mm->arch.ldt.entry_count = from_mm->arch.ldt.entry_count; ldt 354 arch/x86/um/ldt.c mutex_unlock(&from_mm->arch.ldt.lock); ldt 365 arch/x86/um/ldt.c if (mm->arch.ldt.entry_count > LDT_DIRECT_ENTRIES) { ldt 366 arch/x86/um/ldt.c i = mm->arch.ldt.entry_count / LDT_ENTRIES_PER_PAGE; ldt 368 arch/x86/um/ldt.c free_page((long) mm->arch.ldt.u.pages[i]); ldt 370 arch/x86/um/ldt.c mm->arch.ldt.entry_count = 0; ldt 404 arch/x86/xen/enlighten_pv.c static void xen_alloc_ldt(struct desc_struct *ldt, unsigned entries) ldt 421 arch/x86/xen/enlighten_pv.c set_aliased_prot(ldt + i, PAGE_KERNEL_RO); ldt 424 arch/x86/xen/enlighten_pv.c static void xen_free_ldt(struct desc_struct *ldt, unsigned entries) ldt 430 arch/x86/xen/enlighten_pv.c set_aliased_prot(ldt + i, PAGE_KERNEL); ldt 152 tools/arch/x86/include/uapi/asm/kvm.h struct kvm_segment tr, ldt; ldt 206 tools/testing/selftests/kvm/lib/x86_64/processor.c segment_dump(stream, &sregs->ldt, indent + 2); ldt 629 tools/testing/selftests/kvm/lib/x86_64/processor.c kvm_seg_set_unusable(&sregs.ldt); ldt 63 tools/testing/selftests/x86/ldt_gdt.c static void check_invalid_segment(uint16_t index, int ldt) ldt 66 tools/testing/selftests/x86/ldt_gdt.c uint32_t selector = (index << 3) | (ldt << 2) | 3; ldt 83 tools/testing/selftests/x86/ldt_gdt.c (ldt ? "LDT" : "GDT"), index); ldt 87 tools/testing/selftests/x86/ldt_gdt.c (ldt ? "LDT" : "GDT"), index); ldt 91 tools/testing/selftests/x86/ldt_gdt.c static void check_valid_segment(uint16_t index, int ldt, ldt 96 tools/testing/selftests/x86/ldt_gdt.c uint32_t selector = (index << 3) | (ldt << 2) | 3; ldt 113 tools/testing/selftests/x86/ldt_gdt.c (ldt ? "LDT" : "GDT"), index); ldt 127 tools/testing/selftests/x86/ldt_gdt.c (ldt ? "LDT" : "GDT"), index, ar, expected_ar); ldt 131 tools/testing/selftests/x86/ldt_gdt.c (ldt ? "LDT" : "GDT"), index, limit, expected_limit); ldt 135 tools/testing/selftests/x86/ldt_gdt.c (ldt ? "LDT" : "GDT"), index, ar, limit); ldt 140 tools/testing/selftests/x86/ldt_gdt.c bool oldmode, bool ldt) ldt 145 tools/testing/selftests/x86/ldt_gdt.c if (!ldt) { ldt 172 tools/testing/selftests/x86/ldt_gdt.c check_valid_segment(desc.entry_number, ldt, ar, limit, true); ldt 177 tools/testing/selftests/x86/ldt_gdt.c ldt ? "modify_ldt" : "set_thread_area", ldt 183 tools/testing/selftests/x86/ldt_gdt.c ldt ? "modify_ldt" : "set_thread_area");