diff options
author | Wang Zhenyu <zhenyu.z.wang@intel.com> | 2007-04-18 09:35:56 +0800 |
---|---|---|
committer | Wang Zhenyu <zhenyu.z.wang@intel.com> | 2007-04-18 09:35:56 +0800 |
commit | b3d86af10895f30ffb2999c28c5864b2be8681f6 (patch) | |
tree | f3d746bda3bec89cc1c4bf6e86f6a9ca33ccb972 | |
parent | 316e02ab0bd590851c80e3028150f2a6a5a36708 (diff) |
Fix sign extension bug on x86_64 system.
In XF86DGAGetVideoLL(), we pass offset param as 'int' type, but
later we cast it to 'unsigned long' in calling MapPhysAddress().
This causes page table error on x86_64 system like below:
dga: Corrupted page table at address 2b9712b1b000
PGD 702a4067 PUD 6f830067 PMD 6f864067 PTE ffffffff80040027
Bad pagetable: 000f [1] SMP
CPU 0
Modules linked in: i915 drm dm_mirror dm_mod video button battery asus_acpi ac parport_pc parport nvram uhci_hcd ehci_hcd snd_hda_intel snd_hda_codec snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss pcspkr snd_pcm i2c_i801 i2c_core e1000 snd_timer snd soundcore snd_page_alloc
Pid: 2509, comm: dga Not tainted 2.6.21-rc6 #2
RIP: 0033:[<0000003d119754a0>] [<0000003d119754a0>]
RSP: 002b:00007fff98f0d4c8 EFLAGS: 00010202
RAX: 0000000000008000 RBX: 0000000000000001 RCX: 00002b9712b1b000
RDX: 0000000000200000 RSI: 0000000000000071 RDI: 00002b9712b1b000
RBP: 0000000000000000 R08: 7171717171717171 R09: 0000000000000000
R10: 0000000000000000 R11: 0000003d119753e0 R12: 0000000000000000
R13: 00007fff98f0d730 R14: 0000000000503010 R15: 0000000000000000
FS: 00002b9712b19f60(0000) GS:ffffffff8060d000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00002b9712b1b000 CR3: 000000006ffdb000 CR4: 00000000000006e0
Process dga (pid: 2509, threadinfo ffff8100718de000, task ffff81006ffd67a0)
RIP [<0000003d119754a0>]
RSP <00007fff98f0d4c8>
This patch requires latest xf86dgaproto to build.
-rw-r--r-- | src/XF86DGA.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/XF86DGA.c b/src/XF86DGA.c index 95d7596..573a53f 100644 --- a/src/XF86DGA.c +++ b/src/XF86DGA.c @@ -98,7 +98,7 @@ Bool XF86DGAQueryVersion( Bool XF86DGAGetVideoLL( Display* dpy, int screen, - int *offset, + unsigned int *offset, int *width, int *bank_size, int *ram_size @@ -120,7 +120,7 @@ Bool XF86DGAGetVideoLL( return False; } - *offset = /*(char *)*/rep.offset; + *offset = rep.offset; *width = rep.width; *bank_size = rep.bank_size; *ram_size = rep.ram_size; @@ -678,7 +678,7 @@ XF86DGAGetVideo( int *bank, int *ram ){ - /*unsigned long*/ int offset; + unsigned int offset; static int beenHere = 0; ScrPtr sp; MapPtr mp; |