retagged by
11,823 views
41 votes
41 votes

Which of the following must be true for the RFE (Return From Exception) instruction on a general purpose processor?

  1. It must be a trap instruction

  2. It must be a privileged instruction

  3. An exception cannot be allowed to occur during execution of an RFE instruction

  1. I only
  2. II only
  3. I and II only
  4. I, II and III only
retagged by

3 Answers

Best answer
35 votes
35 votes

RFE (Return From Exception) is a privileged trap instruction that is executed when exception occurs, so an exception is not allowed to execute. (D) is the correct option.

Reference: http://www.cs.rochester.edu/courses/252/spring2014/notes/08_exceptions

edited by
59 votes
59 votes

As already told in other answers, RFE is a privileged trap instruction. The purpose of RFE is to switch from kernel mode to user mode once the system is done with handling an exception (any interrupt, trap or fault).

Now, let us approach this question through the points given.

  1. It must be a trap instruction - Definitely it must be a trap instruction as RFE is an explicit privileged instruction causing a switch from kernel to user mode

  2. It must be a privileged instruction - Yes, because RFE can be executed only in supervisor/kernel mode

  3. An exception cannot be allowed to occur during execution of an RFE instruction - Yes, because as soon as a trap/interrupt starts being processed all other traps/interrupts are disabled until the current instruction execution is complete.

So, all three are true and answer is (D)

edited by
1 votes
1 votes

Trap is something that is requested by the program(syscall).

It is a privilege instruction and also while returning from interrupts we should have other interrupts to interrupt this process. so it must be disabled

so (D)

Answer:

Related questions