Re: [Fastboot] Re: Kexec on 2.5.59 problems ?

Suparna Bhattacharya (suparna@in.ibm.com)
Tue, 11 Feb 2003 12:51:44 +0530


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-19598-1044947837-0001-2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Mon, Feb 10, 2003 at 11:07:06AM -0700, Eric W. Biederman wrote:
> Andy Pfiffer <andyp@osdl.org> writes:
>
> > On Mon, 2003-02-10 at 03:14, Suparna Bhattacharya wrote:
> > > Surprisingly though, when I tried just a simple
> > > kexec -e today (having loaded the kernel earlier on),
> > > I ran into the following Oops, consistently:
> > >
> > > I'm using kexec-tools-1.8, and this has worked for me
> > > earlier. The test system is a 4way SMP machine.
> > >
> > > Has anyone seen this as well ? (I'd already issued init 1
> > > and unmounted filesystems by this point)
>
> Hmm. Would love to know which cpu this is on...
>
> I think the primary candidate if this only occurs in smp is
> the switch_mm. It may be that modifying the init_mm is not safe,
> or it gets zapped somewhere else.
>

The following patch from Anton Blanchard's WIP kexec tree
for ppc64 seems to fix this for me. It just does a use_mm()
(routine from fs/aio.c) instead of switch_mm().

Andy could you try this out and see if it helps ?

The other change in Anton's tree that we should probably
include uses a separate kexec_mm rather than init_mm
for the mapping.

Regards
Suparna

-- 
Suparna Bhattacharya (suparna@in.ibm.com)
Linux Technology Center
IBM Software Labs, India

--=_courier-19598-1044947837-0001-2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kexec-usemm.patch"

diff -u -X ../dontdiff linux-2.5.59/fs/aio.c linux-2.5.59-kexecdump/fs/aio.c --- linux-2.5.59/fs/aio.c Fri Jan 17 07:52:06 2003 +++ linux-2.5.59-kexecdump/fs/aio.c Tue Feb 11 09:14:25 2003 @@ -539,7 +539,7 @@ return ioctx; } -static void use_mm(struct mm_struct *mm) +void use_mm(struct mm_struct *mm) { struct mm_struct *active_mm = current->active_mm; atomic_inc(&mm->mm_count); --- linux-2.5.59/arch/i386/kernel/machine_kexec.c Thu Feb 6 16:31:14 2003 +++ linux-2.5.59-kexecdump/arch/i386/kernel/machine_kexec.c Tue Feb 11 09:14:05 2003 @@ -80,7 +80,8 @@ relocate_new_kernel_t rnk; /* switch to an mm where the reboot_code_buffer is identity mapped */ - switch_mm(current->active_mm, &init_mm, current, smp_processor_id()); + extern void use_mm(struct mm_struct *mm); + use_mm(&init_mm); stop_apics();

--=_courier-19598-1044947837-0001-2--