title: How does Kernel protect Mode Bits (PSW) from being modified by User Program?
body: <p>I understand that the CPU distinguishes Kernel Mode and User Mode based on the Program Status Word, but suppose that a User Program was attempting to gain unauthorised access to invoke system calls by gain access into kernel code. What kind of defence mechanisms are there in the CPU architecture to prevent such an exploit? </p>