All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] sandbox: fix phys_to_virt()
@ 2018-09-26  5:12 Heinrich Schuchardt
  2018-09-26 21:18 ` Alexander Graf
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2018-09-26  5:12 UTC (permalink / raw)
  To: u-boot

Allow for pointers not created by map_to_sysmem().

This fixes the fit image and vboot test.

Fixes: 8b79c294ec57 ("sandbox: Enhance map_to_sysmem() to handle foreign
pointers")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
Alex, this should fix the issues with the efi-next pull request. Would
you add it to your queue?

https://travis-ci.org/xypron2/u-boot/builds/433278595
---
 arch/sandbox/cpu/cpu.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index 6098945049..4e28d06e43 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -111,12 +111,8 @@ void *phys_to_virt(phys_addr_t paddr)
 		}
 	}
 
-	printf("%s: Cannot map sandbox address %lx (SDRAM from 0 to %lx)\n",
-	       __func__, (ulong)paddr, (ulong)gd->ram_size);
-	os_abort();
-
-	/* Not reached */
-	return NULL;
+	/* Allow for pointers not created by map_to_sysmem() */
+	return (void *)(gd->arch.ram_buf + paddr);
 }
 
 struct sandbox_mapmem_entry *find_tag(const void *ptr)
-- 
2.19.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH 1/1] sandbox: fix phys_to_virt()
  2018-09-26  5:12 [U-Boot] [PATCH 1/1] sandbox: fix phys_to_virt() Heinrich Schuchardt
@ 2018-09-26 21:18 ` Alexander Graf
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2018-09-26 21:18 UTC (permalink / raw)
  To: u-boot



On 26.09.18 07:12, Heinrich Schuchardt wrote:
> Allow for pointers not created by map_to_sysmem().
> 
> This fixes the fit image and vboot test.
> 
> Fixes: 8b79c294ec57 ("sandbox: Enhance map_to_sysmem() to handle foreign
> pointers")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Unfortunately I'm afraid this is the wrong approach; we should fix the
users of the mapping API instead and ensure that "addresses" are either
tokens to host memory or inside the sandbox address range.

I've sent an alternative fix that does this. But thanks for your patch
nevertheless - it definitely helped to filter down on what the problem was!


Alex

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-26 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26  5:12 [U-Boot] [PATCH 1/1] sandbox: fix phys_to_virt() Heinrich Schuchardt
2018-09-26 21:18 ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.