ia64/xen-unstable

view patches/linux-2.6.16.13/x86-elfnote-as-preprocessor-macro.patch @ 11472:3e31c5e160cf

[HVM] Fix an error when read from APIC registers like IRR, ISR and TMR.
From SDM3 spec, for APIC registers, all 32-bit registers should
be accessed using 128-bit aligned 32bit loads or stores.
And wider registers (64-bit or 256-bit) must be accessed using
multiple 32-bit loads or stores.

In old APIC virtualization code, we use IRR, ISR and TMR which are
256-bit registers as contiguous bit maps other than multiple 32-bit.

So guest always fetch error values.

Original patch was:
* Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
* Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
* Signed-off-by: Eddie Dong <eddie.dong@intel.com>

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Sep 13 15:59:14 2006 +0100 (2006-09-13)
parents 62b7b5f3029f
children
line source
2 diff -r 4b7cd997c08f include/linux/elfnote.h
3 --- a/include/linux/elfnote.h Wed Aug 23 11:48:46 2006 +0100
4 +++ b/include/linux/elfnote.h Wed Aug 23 12:44:27 2006 +0100
5 @@ -31,22 +31,24 @@
6 /*
7 * Generate a structure with the same shape as Elf{32,64}_Nhdr (which
8 * turn out to be the same size and shape), followed by the name and
9 - * desc data with appropriate padding. The 'desc' argument includes
10 - * the assembler pseudo op defining the type of the data: .asciz
11 - * "hello, world"
12 + * desc data with appropriate padding. The 'desctype' argument is the
13 + * assembler pseudo op defining the type of the data e.g. .asciz while
14 + * 'descdata' is the data itself e.g. "hello, world".
15 + *
16 + * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
17 + * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
18 */
19 -.macro ELFNOTE name type desc:vararg
20 -.pushsection ".note.\name"
21 - .align 4
22 - .long 2f - 1f /* namesz */
23 - .long 4f - 3f /* descsz */
24 - .long \type
25 -1:.asciz "\name"
26 -2:.align 4
27 -3:\desc
28 -4:.align 4
29 -.popsection
30 -.endm
31 +#define ELFNOTE(name, type, desctype, descdata) \
32 +.pushsection .note.name ; \
33 + .align 4 ; \
34 + .long 2f - 1f /* namesz */ ; \
35 + .long 4f - 3f /* descsz */ ; \
36 + .long type ; \
37 +1:.asciz "name" ; \
38 +2:.align 4 ; \
39 +3:desctype descdata ; \
40 +4:.align 4 ; \
41 +.popsection ;
42 #else /* !__ASSEMBLER__ */
43 #include <linux/elf.h>
44 /*