mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
x86/asm: Define the kernel TSS limit in a macro
Rather than open-coding the kernel TSS limit in set_tss_desc(), make it a real macro near the TSS layout definition. This is purely a cleanup. Cc: Thomas Garnier <thgarnie@google.com> Cc: Jim Mattson <jmattson@google.com> Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
06ce521af9
commit
4f53ab1428
2 changed files with 11 additions and 9 deletions
|
@ -177,16 +177,8 @@ static inline void __set_tss_desc(unsigned cpu, unsigned int entry, void *addr)
|
||||||
struct desc_struct *d = get_cpu_gdt_table(cpu);
|
struct desc_struct *d = get_cpu_gdt_table(cpu);
|
||||||
tss_desc tss;
|
tss_desc tss;
|
||||||
|
|
||||||
/*
|
|
||||||
* sizeof(unsigned long) coming from an extra "long" at the end
|
|
||||||
* of the iobitmap. See tss_struct definition in processor.h
|
|
||||||
*
|
|
||||||
* -1? seg base+limit should be pointing to the address of the
|
|
||||||
* last valid byte
|
|
||||||
*/
|
|
||||||
set_tssldt_descriptor(&tss, (unsigned long)addr, DESC_TSS,
|
set_tssldt_descriptor(&tss, (unsigned long)addr, DESC_TSS,
|
||||||
IO_BITMAP_OFFSET + IO_BITMAP_BYTES +
|
__KERNEL_TSS_LIMIT);
|
||||||
sizeof(unsigned long) - 1);
|
|
||||||
write_gdt_entry(d, entry, &tss, DESC_TSS);
|
write_gdt_entry(d, entry, &tss, DESC_TSS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -341,6 +341,16 @@ struct tss_struct {
|
||||||
|
|
||||||
DECLARE_PER_CPU_SHARED_ALIGNED(struct tss_struct, cpu_tss);
|
DECLARE_PER_CPU_SHARED_ALIGNED(struct tss_struct, cpu_tss);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* sizeof(unsigned long) coming from an extra "long" at the end
|
||||||
|
* of the iobitmap.
|
||||||
|
*
|
||||||
|
* -1? seg base+limit should be pointing to the address of the
|
||||||
|
* last valid byte
|
||||||
|
*/
|
||||||
|
#define __KERNEL_TSS_LIMIT \
|
||||||
|
(IO_BITMAP_OFFSET + IO_BITMAP_BYTES + sizeof(unsigned long) - 1)
|
||||||
|
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
DECLARE_PER_CPU(unsigned long, cpu_current_top_of_stack);
|
DECLARE_PER_CPU(unsigned long, cpu_current_top_of_stack);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue