CS473 - HW7

Virtual Memory

Due Monday, November 11, 2002

The following table gives some of the memory contents of a computer using Intel's virtual memory scheme:

The PDBR contains 00061000

AddressData
000610bc002cb023
00061138002be045
000613d000326007
000614680017c025
000615c00031b025
00077a6076741af0
00091c607cb4c217
0017c20000091023
001ea6702b3bd4e5
002be1e8002da045
002cbf5800077003
002d77c03cbbfd39
002da2fc4878eaed
0031b028001ea042
00326004002d7007

Assume this computer has a 32-entry, 4-way set-associative TLB. Here are the complete contents of the TLB:

SetTagValidEntry
01939203f25083a
01a04154477650
00e4015eb4f00e
045d1000663c18
 
1033c804801fc12
10fed0699e1e7b
07a001002d7007
0d349070f2fc54
 
20270f035fe2e26
13286001a8dc45
1514501edfda61
05a0011bcdfe67
 
31d1d0168fafa68
0c35e069906e06
100f6029b4fc04
0fd08053ac1a35
 
411c831294a6e4c
0518403a8ee035
14dd813df5881a
17bff03a770c5a
 
5058c410ab8222d
0342610a9b5204
0340d14458901b
12e750698e1604
 
619d7c02fa3ce34
017fa065f89652
0b5b50283e847b
12502134f1466e
 
7005b7158b9840d
18f5105584f233
09bac15d33b41f
0be5912eeace0a

For each of the following addresses, assume an attempt is made to read four bytes from the given address, in User mode. What happens? In the event of a protection failure or page fault, be sure to tell at what level the failure occurs. If data is successfully returned, tell what the value is. Tell whether there is a TLB hit or miss.

  1. 5c00a670

    Dividing the address up to look in the TLB, we convert the high-order 20 bits to binary to get 0101 1100 0000 0000 1010, regroup as 01011100000000001 010, convert back to hex as tag 0b801, offset 2, which is a miss in the TLB.

    Dividing it up to look in the tables, the offsets are 0101 1100 0000, 0000 0010 1000, or 5c0, 028.

    The address of the directory entry is 000615c0, with entry 0031b025. From the protection bits, the page table is present, and we don't have a protection fault. From the PFA combined with the offset into the page table, we have a page table entry at 0031b028.

    The page table entry is 001ea042. From the least significant bit of the page table entry, we see that we have a page fault (valid bit is 0).

  2. 0bfd6a60

    Dividing the address up to look in the TLB, we convert the high-order 20 bits to binary to get 00001011111111010110; dividing and converting to hexadecimal gives tag 017fa, index 6. The tags match, but the Valid bit is 0, so we have a TLB miss.

    Dividing to look in the tables, the offsets are 0bc, f58. The directory entry is at 000610bc, with contents 002cb023. The U bit is 0, so we have a protection violation.

  3. 46880c60

    Dividing the address up to look in the TLB, we convert the high-order 20 bits to binary to get 01000110100010000000; dividing and converting to hexadecimal gives tag 08d10, index 0. This is a TLB miss.

    Dividing to look in the tables, the offsets are 468 and 200. The directory entry is at 00061468, and contains 0017c025. It's present, and we don't have a protection violation. The page table entry is at 0017c200.

    The PTE contains 00091023. The page is present, but bit 2 tells us that it's not user-accessible. We get a protection violation.

  4. 1387a2fc

    Dividing the address up to look in the TLB, we convert the high-order 20 bits to binary to get 00010011100001111010; dividing and converting to hexadecimal gives tag 0270f, index 2. Once again we have a tag match but an invalid entry, so it's a TLB miss.

    Dividing to look in the tables, the offsets are 138, 1e8. The directory entry is at 00061138, with contents 002be045. The V and u bits are both 1, so we proceed.

    The page table entry is at 002be1e8, with contents 002da045. Again, the U and V bits are both 1, so we finish the translation and read the data at 002da2fc. The data is 4878eaed.

  5. 3d0017c0

    Dividing the address up to look in the TLB, we convert the high-order 20 bits to binary to get 00111101000000000001. Dividing and converting back to hexadecimal gives tag 07a00, index 1. A TLB hit, with a valid translation and the U bit shows the page as user-readable.

    The translation from the TLB entry combined with the page offset from the address shows the data at 002d77c0. A four-byte read from this address returns 3cbbfd39.


Last modified: Tue Dec 3 23:50:57 MST 2002