mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
iSCSI/iBFT: use proper address translation
In virtual environments (namely, Xen Dom0) virt <-> phys and virt <-> isa-bus translations cannot be freely interchanged (and even outside such environments it is not really correct to do so). When looking at memory below 1M, the latter translations should always be used. iscsi_ibft_find.c part from: Martin Wilck <martin.wilck@ts.fujitsu.com>. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Konrad Rzeszutek Wilk <ketuzsezs@darnok.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
41cb6654eb
commit
ed3c661448
2 changed files with 3 additions and 3 deletions
|
@ -939,7 +939,7 @@ static int __init ibft_init(void)
|
||||||
|
|
||||||
if (ibft_addr) {
|
if (ibft_addr) {
|
||||||
printk(KERN_INFO "iBFT detected at 0x%llx.\n",
|
printk(KERN_INFO "iBFT detected at 0x%llx.\n",
|
||||||
(u64)virt_to_phys((void *)ibft_addr));
|
(u64)isa_virt_to_bus(ibft_addr));
|
||||||
|
|
||||||
rc = ibft_check_device();
|
rc = ibft_check_device();
|
||||||
if (rc)
|
if (rc)
|
||||||
|
|
|
@ -65,10 +65,10 @@ void __init reserve_ibft_region(void)
|
||||||
* so skip that area */
|
* so skip that area */
|
||||||
if (pos == VGA_MEM)
|
if (pos == VGA_MEM)
|
||||||
pos += VGA_SIZE;
|
pos += VGA_SIZE;
|
||||||
virt = phys_to_virt(pos);
|
virt = isa_bus_to_virt(pos);
|
||||||
if (memcmp(virt, IBFT_SIGN, IBFT_SIGN_LEN) == 0) {
|
if (memcmp(virt, IBFT_SIGN, IBFT_SIGN_LEN) == 0) {
|
||||||
unsigned long *addr =
|
unsigned long *addr =
|
||||||
(unsigned long *)phys_to_virt(pos + 4);
|
(unsigned long *)isa_bus_to_virt(pos + 4);
|
||||||
len = *addr;
|
len = *addr;
|
||||||
/* if the length of the table extends past 1M,
|
/* if the length of the table extends past 1M,
|
||||||
* the table cannot be valid. */
|
* the table cannot be valid. */
|
||||||
|
|
Loading…
Reference in a new issue