All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@tilera.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] arch/tile: stop disabling INTCTRL_1 interrupts during hypervisor downcalls
Date: Mon, 28 Feb 2011 13:24:37 -0500	[thread overview]
Message-ID: <201103011934.p21JYbK7010299@farm-0010.internal.tilera.com> (raw)
In-Reply-To: <201103011931.p21JVtqp010237@farm-0010.internal.tilera.com>

The problem was that this could lead to IPIs being disabled during
the softirq processing after a hypervisor downcall (e.g. for I/O),
since both IPI and device interrupts use the INCTRL_1 downcall mechanism.
When this happened at the wrong time, it could lead to deadlock.

Luckily, we were already maintaining the per-interrupt state we need,
and using it in the proper way in the hypervisor, so all we had to do
was to change Linux to stop blocking downcall interrupts for the entire
length of the downcall.  (Now they're blocked while we're executing the
downcall routine itself, but not while we're executing any subsequent
softirq routines.)  The hypervisor is doing a very small amount of
work it no longer needs to do (masking INTCTRL_1 on entry to the client
interrupt routine), but doing so means that older versions of Tile Linux
will continue to work with a current hypervisor, so that seems reasonable.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
---
 arch/tile/kernel/intvec_32.S |   54 ++++--------------------------------------
 1 files changed, 5 insertions(+), 49 deletions(-)

diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S
index 5eed4a0..abf92f5 100644
--- a/arch/tile/kernel/intvec_32.S
+++ b/arch/tile/kernel/intvec_32.S
@@ -32,10 +32,6 @@
 # error "No support for kernel preemption currently"
 #endif
 
-#if INT_INTCTRL_K < 32 || INT_INTCTRL_K >= 48
-# error INT_INTCTRL_K coded to set high interrupt mask
-#endif
-
 #define PTREGS_PTR(reg, ptreg) addli reg, sp, C_ABI_SAVE_AREA_SIZE + (ptreg)
 
 #define PTREGS_OFFSET_SYSCALL PTREGS_OFFSET_REG(TREG_SYSCALL_NR)
@@ -1199,46 +1195,6 @@ STD_ENTRY(interrupt_return)
 	STD_ENDPROC(interrupt_return)
 
 	/*
-	 * This interrupt variant clears the INT_INTCTRL_K interrupt mask bit
-	 * before returning, so we can properly get more downcalls.
-	 */
-	.pushsection .text.handle_interrupt_downcall,"ax"
-handle_interrupt_downcall:
-	finish_interrupt_save handle_interrupt_downcall
-	check_single_stepping normal, .Ldispatch_downcall
-.Ldispatch_downcall:
-
-	/* Clear INTCTRL_K from the set of interrupts we ever enable. */
-	GET_INTERRUPTS_ENABLED_MASK_PTR(r30)
-	{
-	 addi   r30, r30, 4
-	 movei  r31, INT_MASK(INT_INTCTRL_K)
-	}
-	{
-	 lw     r20, r30
-	 nor    r21, r31, zero
-	}
-	and     r20, r20, r21
-	sw      r30, r20
-
-	{
-	 jalr   r0
-	 PTREGS_PTR(r0, PTREGS_OFFSET_BASE)
-	}
-	FEEDBACK_REENTER(handle_interrupt_downcall)
-
-	/* Allow INTCTRL_K to be enabled next time we enable interrupts. */
-	lw      r20, r30
-	or      r20, r20, r31
-	sw      r30, r20
-
-	{
-	 movei  r30, 0   /* not an NMI */
-	 j      interrupt_return
-	}
-	STD_ENDPROC(handle_interrupt_downcall)
-
-	/*
 	 * Some interrupts don't check for single stepping
 	 */
 	.pushsection .text.handle_interrupt_no_single_step,"ax"
@@ -2014,17 +1970,17 @@ int_unalign:
 #endif
 	int_hand     INT_INTCTRL_0, INTCTRL_0, bad_intr
 	int_hand     INT_MESSAGE_RCV_DWNCL, MESSAGE_RCV_DWNCL, \
-		     hv_message_intr, handle_interrupt_downcall
+		     hv_message_intr
 	int_hand     INT_DEV_INTR_DWNCL, DEV_INTR_DWNCL, \
-		     tile_dev_intr, handle_interrupt_downcall
+		     tile_dev_intr
 	int_hand     INT_I_ASID, I_ASID, bad_intr
 	int_hand     INT_D_ASID, D_ASID, bad_intr
 	int_hand     INT_DMATLB_MISS_DWNCL, DMATLB_MISS_DWNCL, \
-		     do_page_fault, handle_interrupt_downcall
+		     do_page_fault
 	int_hand     INT_SNITLB_MISS_DWNCL, SNITLB_MISS_DWNCL, \
-		     do_page_fault, handle_interrupt_downcall
+		     do_page_fault
 	int_hand     INT_DMATLB_ACCESS_DWNCL, DMATLB_ACCESS_DWNCL, \
-		     do_page_fault, handle_interrupt_downcall
+		     do_page_fault
 	int_hand     INT_SN_CPL, SN_CPL, bad_intr
 	int_hand     INT_DOUBLE_FAULT, DOUBLE_FAULT, do_trap
 #if CHIP_HAS_AUX_PERF_COUNTERS()
-- 
1.6.5.2


  parent reply	other threads:[~2011-03-01 19:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-27 23:52 arch/tile: various fixes for 2.6.39 Chris Metcalf
2011-02-27 23:52 ` [PATCH] arch/tile: catch up with section naming convention in 2.6.35 Chris Metcalf
2011-03-01 20:52   ` Sam Ravnborg
2011-03-01 21:17     ` Chris Metcalf
2011-02-28 18:08 ` [PATCH] arch/tile: bug fix: exec'ed task thought it was still single-stepping Chris Metcalf
2011-02-28 18:21 ` [PATCH] arch/tile: fix __ndelay etc to work better Chris Metcalf
2011-02-28 18:24 ` Chris Metcalf [this message]
2011-02-28 18:32 ` [PATCH] arch/tile: warn and retry if an IPI is not accepted by the target cpu Chris Metcalf
2011-02-28 18:35 ` [PATCH] arch/tile: export <asm/hardwall.h> to userspace Chris Metcalf
2011-02-28 20:01 ` [PATCH] arch/tile: avoid a simulator warning during bootup Chris Metcalf
2011-02-28 20:14 ` [PATCH] arch/tile: fix reversed test of strict_strtol() return value Chris Metcalf
2011-02-28 20:19 ` [PATCH] arch/tile: sync up with <arch/sim.h> and <arch/sim_def.h> changes Chris Metcalf
2011-02-28 20:22 ` [PATCH] arch/tile: use a cleaner technique to enable interrupt for cpu_idle() Chris Metcalf
2011-02-28 20:28 ` [PATCH] arch/tile: use extended assembly to inline __mb_incoherent() Chris Metcalf
2011-02-28 20:30 ` [PATCH] arch/tile: fix two bugs in the backtracer code Chris Metcalf
2011-02-28 20:48 ` [PATCH] arch/tile: enhance existing finv_buffer_remote() routine Chris Metcalf
2011-02-28 20:51 ` [PATCH] arch/tile: export some additional module symbols Chris Metcalf
2011-02-28 20:58 ` [PATCH] arch/tile: fix some comments and whitespace Chris Metcalf
2011-02-28 21:01 ` [PATCH] arch/tile: add some more VMSPLIT options and use consistent naming Chris Metcalf
2011-02-28 21:37 ` [PATCH] arch/tile: support 4KB page size as well as 64KB Chris Metcalf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201103011934.p21JYbK7010299@farm-0010.internal.tilera.com \
    --to=cmetcalf@tilera.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.