Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372093
b: refs/heads/master
c: b4034bd
h: refs/heads/master
i:
  372091: 8220869
v: v3
  • Loading branch information
Marc Zyngier authored and Christoffer Dall committed Mar 6, 2013
1 parent 85a4d6f commit ea181b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06e8c3b0f3210e5e7039fd2b5e3926b68df7f5d7
refs/heads/master: b4034bde5f168f2383a54b4573e1e440dbc169cf
9 changes: 7 additions & 2 deletions trunk/arch/arm/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,13 @@ static int __create_hyp_mappings(void *from, void *to, unsigned long *pfn_base)
unsigned long addr, next;
int err = 0;

BUG_ON(start > end);
if (start < PAGE_OFFSET)
if (start >= end)
return -EINVAL;
/* Check for a valid kernel memory mapping */
if (!pfn_base && (!virt_addr_valid(from) || !virt_addr_valid(to - 1)))
return -EINVAL;
/* Check for a valid kernel IO mapping */
if (pfn_base && (!is_vmalloc_addr(from) || !is_vmalloc_addr(to - 1)))
return -EINVAL;

mutex_lock(&kvm_hyp_pgd_mutex);
Expand Down

0 comments on commit ea181b2

Please sign in to comment.