Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e9e5b9ab in mainline


Ignore:
Timestamp:
2010-11-09T23:15:15Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
854bfa5
Parents:
da88a079
Message:

Disable access to I/O ports that are in the last byte of the I/O port access
map, but already outside of the enabled range.

Location:
kernel/arch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/ddi/ddi.c

    rda88a079 re9e5b9ab  
    126126                bitmap_initialize(&iomap, CPU->arch.tss->iomap,
    127127                    TSS_IOMAP_SIZE * 8);
    128                 bitmap_copy(&iomap, &TASK->arch.iomap, TASK->arch.iomap.bits);
     128                bitmap_copy(&iomap, &TASK->arch.iomap, bits);
    129129               
     130                /*
     131                 * Set the trailing bits in the last byte of the map to disable
     132                 * I/O access.
     133                 */
     134                bitmap_set_range(&iomap, bits, ALIGN_UP(bits, 8) - bits);
    130135                /*
    131136                 * It is safe to set the trailing eight bits because of the
    132137                 * extra convenience byte in TSS_IOMAP_SIZE.
    133138                 */
    134                 bitmap_set_range(&iomap, ALIGN_UP(TASK->arch.iomap.bits, 8), 8);
     139                bitmap_set_range(&iomap, ALIGN_UP(bits, 8), 8);
    135140        }
    136141        irq_spinlock_unlock(&TASK->lock, false);
  • kernel/arch/ia32/src/ddi/ddi.c

    rda88a079 re9e5b9ab  
    127127                bitmap_initialize(&iomap, CPU->arch.tss->iomap,
    128128                    TSS_IOMAP_SIZE * 8);
    129                 bitmap_copy(&iomap, &TASK->arch.iomap, TASK->arch.iomap.bits);
     129                bitmap_copy(&iomap, &TASK->arch.iomap, bits);
    130130               
     131                /*
     132                 * Set the trailing bits in the last byte of the map to disable
     133                 * I/O access.
     134                 */
     135                bitmap_set_range(&iomap, bits, ALIGN_UP(bits, 8) - bits);
    131136                /*
    132137                 * It is safe to set the trailing eight bits because of the
    133138                 * extra convenience byte in TSS_IOMAP_SIZE.
    134139                 */
    135                 bitmap_set_range(&iomap, ALIGN_UP(TASK->arch.iomap.bits, 8), 8);
     140                bitmap_set_range(&iomap, ALIGN_UP(bits, 8), 8);
    136141        }
    137142        irq_spinlock_unlock(&TASK->lock, false);
Note: See TracChangeset for help on using the changeset viewer.