Commit cfe7f4f6 authored by Stas Sergeev's avatar Stas Sergeev Committed by Linus Torvalds

[PATCH] larger IO bitmaps

The previous discussion was started here:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0211.0/0477.html but in 2.4
times this was kind of problematic.

Now, with the lazy bitmap allocation and per-CPU TSS, this will really not
drain any resources I think.  8K TSS increase and 8K per process *that does
ioperm()* - I think it is not very bad.

The reasons why I need that, are described in the URL above.  Basically this
will allow to use full-screen VESA under dosemu (without LFB though), and this
may be also helpfull for the XFree project and some other projects:

http://www.uwsg.iu.edu/hypermail/linux/kernel/9807.1/1079.htmlSigned-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e2dcfb35
...@@ -44,7 +44,8 @@ __asm__ __volatile__ ("movw %w3,0(%2)\n\t" \ ...@@ -44,7 +44,8 @@ __asm__ __volatile__ ("movw %w3,0(%2)\n\t" \
static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr) static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr)
{ {
_set_tssldt_desc(&cpu_gdt_table[cpu][entry], (int)addr, 235, 0x89); _set_tssldt_desc(&cpu_gdt_table[cpu][entry], (int)addr,
offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89);
} }
#define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr) #define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
......
...@@ -297,9 +297,9 @@ extern unsigned int mca_pentium_flag; ...@@ -297,9 +297,9 @@ extern unsigned int mca_pentium_flag;
#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
/* /*
* Size of io_bitmap, covering ports 0 to 0x3ff. * Size of io_bitmap.
*/ */
#define IO_BITMAP_BITS 1024 #define IO_BITMAP_BITS 65536
#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) #define IO_BITMAP_BYTES (IO_BITMAP_BITS/8)
#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) #define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) #define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap)
...@@ -391,7 +391,7 @@ struct tss_struct { ...@@ -391,7 +391,7 @@ struct tss_struct {
/* /*
* pads the TSS to be cacheline-aligned (size is 0x100) * pads the TSS to be cacheline-aligned (size is 0x100)
*/ */
unsigned long __cacheline_filler[5]; unsigned long __cacheline_filler[37];
/* /*
* .. and then another 0x100 bytes for emergency kernel stack * .. and then another 0x100 bytes for emergency kernel stack
*/ */
......
...@@ -137,9 +137,9 @@ extern unsigned int vced_count, vcei_count; ...@@ -137,9 +137,9 @@ extern unsigned int vced_count, vcei_count;
#endif #endif
/* /*
* Size of io_bitmap in longwords: 32 is ports 0-0x3ff. * Size of io_bitmap in longwords.
*/ */
#define IO_BITMAP_SIZE 32 #define IO_BITMAP_SIZE 2048
#define NUM_FPU_REGS 32 #define NUM_FPU_REGS 32
......
...@@ -178,9 +178,9 @@ static inline void clear_in_cr4 (unsigned long mask) ...@@ -178,9 +178,9 @@ static inline void clear_in_cr4 (unsigned long mask)
(test_thread_flag(TIF_IA32) ? TASK_UNMAPPED_32 : TASK_UNMAPPED_64) (test_thread_flag(TIF_IA32) ? TASK_UNMAPPED_32 : TASK_UNMAPPED_64)
/* /*
* Size of io_bitmap, covering ports 0 to 0x3ff. * Size of io_bitmap.
*/ */
#define IO_BITMAP_BITS 1024 #define IO_BITMAP_BITS 65536
#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) #define IO_BITMAP_BYTES (IO_BITMAP_BITS/8)
#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) #define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) #define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment