Bug 220585

Summary: Kernel panic during suspend to disk
Product: Red Hat Enterprise Linux 4 Reporter: jordan hargrave <jordan_hargrave>
Component: kernelAssignee: Nigel Cunningham <ncunning>
Status: CLOSED DUPLICATE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 4.0CC: ncunning
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-18 22:04:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch __pa macro for kernel source map none

Description jordan hargrave 2006-12-22 10:09:13 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060527 SUSE/1.5.0.4-1.9 Firefox/1.5.0.4

Description of problem:
Performing a suspend to disk (echo -n disk > /sys/power/status) causes a kernel panic.  The mark_swapfiles (kernel/power/swap.c) function is passing an incorrect page address to rw_swap_page_sync.  There are two address spaces in the x86_64 kernel, __PAGE_OFFSET and __START_KERNEL_map; the __pa macro (include/asm-x86_64/page.h) does not properly handle this.

Version-Release number of selected component (if applicable):
kernel-2.6.18-2839.el5

How reproducible:
Always


Steps to Reproduce:
1.Install RHEL5 beta2 x86-64 kernel
2.Perform suspenmd to disk (echo -n disk > /sys/power/state)
3.System will panic

Actual Results:


Expected Results:


Additional info:
The bug exists in include/asm-x86_64/page.h in the __pa macro.  It does not properly handle addresses above __START_KERNEL_map.

From kernel.org source:
112 /* Note: __pa(&symbol_visible_to_c) should be always replaced with __pa_symbol.
113    Otherwise you risk miscompilation. */ 
114 #define __pa(x)                 (((unsigned long)(x)>=__START_KERNEL_map)?(unsigned long)(x) - (unsigned long)__START_KERNEL_map:(unsigned long)(x) - PAGE_OFFSET)
115 /* __pa_symbol should be used for C visible symbols.
116    This seems to be the official gcc blessed way to do such arithmetic. */ 
117 #define __pa_symbol(x)          \
118         ({unsigned long v;  \
119           asm("" : "=r" (v) : "" (x)); \
120           __pa(v); })

Comment 1 jordan hargrave 2006-12-22 10:11:35 UTC
Created attachment 144263 [details]
Patch __pa macro for kernel source map

Comment 3 Nigel Cunningham 2006-12-22 20:59:58 UTC
I've checked with other kernel developers, and we can't apply this patch 
because we've diverged from mainstream in this area in order to provide 
improved kdump support.

A solution is being worked on that should address this issue.

Reassigning to me so I remember to follow this up.

Comment 4 jordan hargrave 2007-02-05 17:50:07 UTC
Any updates on this issue?

Comment 5 Nigel Cunningham 2007-02-06 00:08:05 UTC
Work on finding the cause is in progress. It's just taking a while as it's non-
trivial and I'm only a part-timer.

Regards,

Nigel

Comment 6 Nigel Cunningham 2007-02-20 09:50:49 UTC
Patch now available, in BZ 215954.

Comment 7 Nigel Cunningham 2007-03-18 22:04:16 UTC

*** This bug has been marked as a duplicate of 215954 ***