19

Reading and Writing Assignments, Discussion Topics
COS/ELE 375

for class on Monday Dec. 3, 2012


Please re-read Section 4.9 of the text, pp. 510-516 of Section 5.4, and read pages B-33 through B-38.

Please turn in a written response to this question:

1. For exceptions from which a return is expected (e.g., TLB miss), the text's scheme for exception handling will have a problem if the instruction causing the exception is in a branch delay slot (you may want to revisit the Elaborations on pages 343 and 381-2). What is the problem, and how might you fix it? (We're not looking for a completely worked-out design here--just a sketch of a solution to the problem you identified.)


Then, be prepared to discuss the following in class:


2. The MIPS subset we've been studying can cause only a small number of exceptions: integer overflow and undefined instruction appeared in chapter 4, TLB miss and page fault in chapter 5. In the full architecture--like any other--there are a lot more:

Exceptions can usefully be classified in a number of ways, which we will discuss. Here are some: Did the program cause the exception (and hence "deserve" the consequences), or did it happen for a reason outside the program? In the former case, can the exception-causing instruction be allowed to finish before the exception is handled? Should the program or process be resumed or should it be terminated? And what, if anything, should be done about the exception, perhaps partly by the operating system? Please think about, and be prepared to discuss, how the exceptions from the above list (and any others you care to bring up) yield different answers to these classification questions.

3. The x86 architecture includes instructions for moving potentially very large strings. These instructions may cause a TLB miss or a page fault in the middle of the string. If this happens, do you think the instruction should be restarted once the exception is taken care of? What issues do you see in this situation?