[Crash-utility] [PATCH] Fix x86 initialization for {hard, soft}irq_ctx

OGAWA Hirofumi hirofumi at mail.parknet.co.jp
Wed Feb 8 21:34:34 UTC 2017


Dave Anderson <anderson at redhat.com> writes:

> Hi Ogawa,

Hi,

> Please review the attached update to your patch, which adds support for 
> the irq_ctx-to-irq_stack transition.
> -	if ((hard_sp = per_cpu_symbol_search("per_cpu__hardirq_ctx"))) {
> +	if ((hard_sp = per_cpu_symbol_search("per_cpu__hardirq_ctx")) ||
> +	    (hard_sp = per_cpu_symbol_search("per_cpu__hardirq_stack"))) {
>  		if ((kt->flags & SMP) && (kt->flags & PER_CPU_OFF)) {
>  			for (i = 0; i < NR_CPUS; i++) {
> +				ulong ptr;
> +

[...]

Right, this will work, maybe, several stuffs. However hardirq_tasks[] is
missing, so this will not be fully. For now, I don't have dump of other
than v4.9 (stack format was changed), so I'm not sure which commands are
not working (user of hardirq_tasks[]).

Thanks.

> +	if (MEMBER_EXISTS("irq_ctx", "tinfo")) {
> +		for (i = 0; i < NR_CPUS; i++) {
> +			if (!(tt->hardirq_ctx[i]))
> +				continue;
>  
> -                if (!readmem(tt->hardirq_ctx[i], KVADDR, thread_info_buf, 
> -		    SIZE(irq_ctx), "hardirq thread_union", 
> -		    RETURN_ON_ERROR)) {
> -                	error(INFO, "cannot read hardirq_ctx[%d] at %lx\n",
> -                            	i, tt->hardirq_ctx[i]);
> -                        continue;
> -                }
> +			if (!readmem(tt->hardirq_ctx[i], KVADDR, thread_info_buf, 
> +			    SIZE(irq_ctx), "hardirq thread_union", 
> +			    RETURN_ON_ERROR)) {
> +				error(INFO, "cannot read hardirq_ctx[%d] at %lx\n",
> +					i, tt->hardirq_ctx[i]);
> +				continue;
> +			}
>  
> -                tt->hardirq_tasks[i] = 
> -			ULONG(thread_info_buf+OFFSET(thread_info_task));
> +			tt->hardirq_tasks[i] = 
> +				ULONG(thread_info_buf+OFFSET(thread_info_task));
> +		}
>  	}

-- 
OGAWA Hirofumi <hirofumi at mail.parknet.co.jp>




More information about the Crash-utility mailing list