Takao Indoh 9ee27c7639 [IA64] Save I-resources to ia64_sal_os_state
This is a patch related to this discussion.
http://www.spinics.net/lists/linux-ia64/msg07605.html

When INIT is sent, ip/psr/pfs register is stored to the I-resources
(iip/ipsr/ifs registers), and they are copied in the min-state save
area(pmsa_{iip,ipsr,ifs}).

Therefore, in creating pt_regs at ia64_mca_modify_original_stack(),
cr_{iip,ipsr,ifs} should be derived from pmsa_{iip,ipsr,ifs}. But
current code copies pmsa_{xip,xpsr,xfs} to cr_{iip,ipsr,ifs}
when PSR.ic is 0.

finish_pt_regs(struct pt_regs *regs, const pal_min_state_area_t *ms,
                unsigned long *nat)
{
(snip)
        if (ia64_psr(regs)->ic) {
                regs->cr_iip = ms->pmsa_iip;
                regs->cr_ipsr = ms->pmsa_ipsr;
                regs->cr_ifs = ms->pmsa_ifs;
        } else {
                regs->cr_iip = ms->pmsa_xip;
                regs->cr_ipsr = ms->pmsa_xpsr;
                regs->cr_ifs = ms->pmsa_xfs;
        }

It's ok when PSR.ic is not 0. But when PSR.ic is 0, this could be
a problem when we investigate kernel as the value of regs->cr_iip does
not point to where INIT really interrupted.

At first I tried to change finish_pt_regs() so that it uses always
pmsa_{iip,ipsr,ifs} for cr_{iip,ipsr,ifs}, but Keith Owens pointed out
it could cause another problem if I change it.

>The only problem I can think of is an MCA/INIT
>arriving while code like SAVE_MIN or SAVE_REST is executing.  Back
>tracing at that point using pmsa_iip is going to be a problem, you have
>no idea what state the registers or stack are in.

I confirmed he was right, so I decided to keep it as-is and to
save pmsa_{iip,ipsr,ifs} to ia64_sal_os_state for debugging.

An attached patch is just adding new members into ia64_sal_os_state to
save pmsa_{iip,ipsr,ifs}.

Signed-off-by: Takao Indoh <indou.takao@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2009-12-14 16:37:58 -08:00
..
2009-10-02 13:28:56 +09:00
2007-05-11 05:38:25 -04:00
2005-04-16 15:20:36 -07:00
2009-06-17 09:33:49 -07:00
2009-10-12 23:40:10 -07:00
2006-06-21 11:19:22 -07:00
2005-04-16 15:20:36 -07:00
2009-03-26 11:01:46 -07:00
2008-02-04 15:42:06 -08:00
2008-02-04 15:42:06 -08:00
2009-06-17 09:33:49 -07:00
2008-04-08 13:51:35 -07:00
2009-03-27 11:11:04 -07:00
2009-03-27 11:11:04 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2006-12-07 10:48:19 -08:00
2009-09-14 17:41:42 -07:00
2009-07-12 12:22:34 -07:00
2007-05-08 14:51:59 -07:00
2009-06-17 09:35:24 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00