Skip to content

Commit

Permalink
tile: fix bug in setting PT_FLAGS_DISABLE_IRQ on kernel entry
Browse files Browse the repository at this point in the history
This flag value is saved in ptregs and used to decide whether
to disable irqs when returning from the kernel.  Commit 1168df528fe4
("tile: don't assume user privilege is zero") performed a bad
merge from some KVM-enabled code that had not yet been upstreamed.

The only issue with the old code is that we will read the interrupt
mask in more conditions than we need to (e.g., coming from user
space when user space has the Interrupt Critical Section bit set, or
coming from a guest kernel), which is a slow multi-cycle operation.
This change saves those few cycles in the common case.

Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
  • Loading branch information
Chris Metcalf committed Jan 18, 2016
1 parent acfb699 commit 9ce815e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/tile/kernel/intvec_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ intvec_\vecname:
*/
mfspr r32, SPR_EX_CONTEXT_K_1
{
IS_KERNEL_EX1(r22, r22)
IS_KERNEL_EX1(r32, r32)
PTREGS_PTR(r21, PTREGS_OFFSET_FLAGS)
}
beqzt r32, 1f /* zero if from user space */
Expand Down

0 comments on commit 9ce815e

Please sign in to comment.