[PATCH] kexec ppc64: fix misaligned cmdline

Milton Miller miltonm at bga.com
Mon Jun 4 05:22:33 EDT 2007


On Jun 4, 2007, at 2:23 AM, Michael Neuling wrote:

> If the cmdline changes between boots, we can get misalignment of the
> bootargs entry, which in turn corrupts our device tree blob and hence
> kills our kexec boot.
...
> -		if ((len >= 8) && ((unsigned long)dt & 0x4))
> +		if ((len >= 8) && ((unsigned long)dt & 0x4)){
>  			dt++;
> +			dt_realigned = 1;
> +		}
>
>  		fd = open(pathname, O_RDONLY);
>  		if (fd == -1)
> @@ -283,6 +286,8 @@ static void putprops(char *fn, struct di
>  			strcat(local_cmdline, " ");
>  			cmd_len = strlen(local_cmdline);
>  			cmd_len = cmd_len + 1;
> +			if (dt_realigned && cmd_len < 8)
> +				dt--;
>  	

While this appears to fix the stated problem, did you explore my
suggestion of deleting and creating the property like we do for
the initrd base and size?

Deleting and recreating should also handle the case of no
boot-args in the original /chosen sub-tree (when the bootloader
didn't (need to) supply a command line).

milton




More information about the kexec mailing list