SAL calling conventions + locking

From: Zoltan Menyhart <Zoltan.Menyhart_at_bull.net>
Date: 2005-12-10 03:42:22
The SAL specification does say that the SAL procedures should be called
with interrupts enabled if we call them in virtual mode.

Here is the simplified CPEI handler control flow:

ia64_mca_cpe_int_handler():

	/* SAL spec states this should run w/ interrupts enabled */
	local_irq_enable();
	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE):

		ia64_log_get():

			IA64_LOG_LOCK():

				spin_lock_irqsave():

			ia64_sal_get_state_info();
			IA64_LOG_UNLOCK()

		salinfo_log_wakeup()
		if (rh->severity == sal_log_severity_corrected)
			ia64_sal_clear_state_info();

Despite the note "SAL spec ... w/ interrupts enabled" the interrupts
are disabled before "ia64_sal_get_state_info()" is invoked.

Can someone please tell me:
- why the spec. requires to call the SAL with interrupts enabled,
- why Linux calls the SAL with interrupts disabled,
- what happens if the SAL is called with interrupts disabled?

The second issue is:
The lock of the log is released before "salinfo_log_wakeup()" could record
the existence of the current log. Two more logs can arrive and overwrite
the current log without even indicting the loss of the information.
(E.g. CPEI-s with interrupt redirection, CMCI-s on multiple CPUs.)
Should not we keep the log lock at least while "salinfo_log_wakeup()"
executes?

Thanks.

Zoltan Menyhart
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Dec 10 03:43:11 2005

This archive was generated by hypermail 2.1.8 : 2005-12-10 03:43:21 EST