Displaying 18 results from an estimated 18 matches for "lgread_u32".
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...;
+ return val;
+}
+
+u16 lgread_u16(struct lguest *lg, u32 addr)
+{
+ u16 val = 0;
+
+ /* Don't let them access lguest binary */
+ if (!lguest_address_ok(lg, addr)
+ || get_user(val, (u32 __user *)addr) != 0)
+ kill_guest(lg, "bad read address %u", addr);
+ return val;
+}
+
u32 lgread_u32(struct lguest *lg, u32 addr)
{
u32 val = 0;
Index: linux-2.6.21-rc5-mm2/drivers/lguest/lg.h
===================================================================
--- linux-2.6.21-rc5-mm2.orig/drivers/lguest/lg.h
+++ linux-2.6.21-rc5-mm2/drivers/lguest/lg.h
@@ -176,6 +176,8 @@ extern struct mutex l...
2007 Apr 18
1
[PATCH] lguest32 kallsyms backtrace of guest.
...;
+ return val;
+}
+
+u16 lgread_u16(struct lguest *lg, u32 addr)
+{
+ u16 val = 0;
+
+ /* Don't let them access lguest binary */
+ if (!lguest_address_ok(lg, addr)
+ || get_user(val, (u32 __user *)addr) != 0)
+ kill_guest(lg, "bad read address %u", addr);
+ return val;
+}
+
u32 lgread_u32(struct lguest *lg, u32 addr)
{
u32 val = 0;
Index: linux-2.6.21-rc5-mm2/drivers/lguest/lg.h
===================================================================
--- linux-2.6.21-rc5-mm2.orig/drivers/lguest/lg.h
+++ linux-2.6.21-rc5-mm2/drivers/lguest/lg.h
@@ -176,6 +176,8 @@ extern struct mutex l...
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...run_lguest and do cast in caller instead (when we add
__user to cast, it runs over another line).
Al Viro pointed out the ugly cast in push_lguest_stack():
3) Stick with unsigned long for arg, removes 4 casts in total.
Most importantly, I now realize that Christoph's incorrect ranting
about lgread_u32 et al was in fact a subtle ploy to make me diagnose
the real issue: sparse 0.3 complains about casting a __user pointer
to/from u32, but not an "unsigned long". They are (currently)
equivalent for lguest, but this is a much better solution than __force.
Kudos, Christoph, for such master...
2007 May 14
5
[PATCH 1/6] lguest: host code tidyups
...run_lguest and do cast in caller instead (when we add
__user to cast, it runs over another line).
Al Viro pointed out the ugly cast in push_lguest_stack():
3) Stick with unsigned long for arg, removes 4 casts in total.
Most importantly, I now realize that Christoph's incorrect ranting
about lgread_u32 et al was in fact a subtle ploy to make me diagnose
the real issue: sparse 0.3 complains about casting a __user pointer
to/from u32, but not an "unsigned long". They are (currently)
equivalent for lguest, but this is a much better solution than __force.
Kudos, Christoph, for such master...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...ables.c
+++ linux-2.6.21-rc5-mm2/drivers/lguest/page_tables.c
@@ -105,6 +105,25 @@ static spte_t gpte_to_spte(struct lguest
return spte;
}
+unsigned long lguest_find_guest_paddr(struct lguest *lg, unsigned long vaddr)
+{
+ gpgd_t gpgd;
+ gpte_t gpte;
+ unsigned long gpte_ptr;
+
+ gpgd = mkgpgd(lgread_u32(lg, gpgd_addr(lg, vaddr)));
+ if (!(gpgd.flags & _PAGE_PRESENT))
+ return -1;
+
+ gpte_ptr = gpte_addr(lg, gpgd, vaddr);
+ gpte = mkgpte(lgread_u32(lg, gpte_ptr));
+
+ if (!(gpte.flags & _PAGE_PRESENT))
+ return -1;
+
+ return (gpte.pfn << PAGE_SHIFT) | (vaddr & (PAGE_SIZE-1));...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...ables.c
+++ linux-2.6.21-rc5-mm2/drivers/lguest/page_tables.c
@@ -105,6 +105,25 @@ static spte_t gpte_to_spte(struct lguest
return spte;
}
+unsigned long lguest_find_guest_paddr(struct lguest *lg, unsigned long vaddr)
+{
+ gpgd_t gpgd;
+ gpte_t gpte;
+ unsigned long gpte_ptr;
+
+ gpgd = mkgpgd(lgread_u32(lg, gpgd_addr(lg, vaddr)));
+ if (!(gpgd.flags & _PAGE_PRESENT))
+ return -1;
+
+ gpte_ptr = gpte_addr(lg, gpgd, vaddr);
+ gpte = mkgpte(lgread_u32(lg, gpte_ptr));
+
+ if (!(gpte.flags & _PAGE_PRESENT))
+ return -1;
+
+ return (gpte.pfn << PAGE_SHIFT) | (vaddr & (PAGE_SIZE-1));...
2007 Apr 18
1
[PATCH] Lguest32 print hex on bad reads and writes
..., u32 ad
/* Don't let them access lguest binary */
if (!lguest_address_ok(lg, addr)
|| get_user(val, (u32 __user *)addr) != 0)
- kill_guest(lg, "bad read address %u", addr);
+ kill_guest(lg, "bad read address %x", addr);
return val;
}
@@ -242,7 +242,7 @@ u32 lgread_u32(struct lguest *lg, u32 ad
/* Don't let them access lguest binary */
if (!lguest_address_ok(lg, addr)
|| get_user(val, (u32 __user *)addr) != 0)
- kill_guest(lg, "bad read address %u", addr);
+ kill_guest(lg, "bad read address %x", addr);
return val;
}
@@ -25...
2007 Apr 18
1
[PATCH] Lguest32 print hex on bad reads and writes
..., u32 ad
/* Don't let them access lguest binary */
if (!lguest_address_ok(lg, addr)
|| get_user(val, (u32 __user *)addr) != 0)
- kill_guest(lg, "bad read address %u", addr);
+ kill_guest(lg, "bad read address %x", addr);
return val;
}
@@ -242,7 +242,7 @@ u32 lgread_u32(struct lguest *lg, u32 ad
/* Don't let them access lguest binary */
if (!lguest_address_ok(lg, addr)
|| get_user(val, (u32 __user *)addr) != 0)
- kill_guest(lg, "bad read address %u", addr);
+ kill_guest(lg, "bad read address %x", addr);
return val;
}
@@ -25...
2007 May 10
4
[PATCH 0/5] lguest feedback tidyups
Hi all,
Gratefully-received recent feedback from CC'd was applied to excellent
effect (and the advice from Matt Mackall about my personal appearance is
best unrequited).
The patch is split in 5 parts to correspond with the 9 parts Andrew
sent out before, but here's the summary:
1) Sparse (thanks Christoph Hellwig):
- lguest_const can be static now
- lguest.c should include
2007 May 10
4
[PATCH 0/5] lguest feedback tidyups
Hi all,
Gratefully-received recent feedback from CC'd was applied to excellent
effect (and the advice from Matt Mackall about my personal appearance is
best unrequited).
The patch is split in 5 parts to correspond with the 9 parts Andrew
sent out before, but here's the summary:
1) Sparse (thanks Christoph Hellwig):
- lguest_const can be static now
- lguest.c should include
2007 May 09
1
[patch 3/9] lguest: the host code
...+= insnlen;
+ return 1;
+}
+
+int lguest_address_ok(const struct lguest *lg,
+ unsigned long addr, unsigned long len)
+{
+ return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr);
+}
+
+/* Just like get_user, but don't let guest access lguest binary. */
+u32 lgread_u32(struct lguest *lg, u32 addr)
+{
+ u32 val = 0;
+
+ /* Don't let them access lguest binary */
+ if (!lguest_address_ok(lg, addr, sizeof(val))
+ || get_user(val, (u32 __user *)addr) != 0)
+ kill_guest(lg, "bad read address %u", addr);
+ return val;
+}
+
+void lgwrite_u32(struct lgu...
2007 May 09
1
[patch 3/9] lguest: the host code
...+= insnlen;
+ return 1;
+}
+
+int lguest_address_ok(const struct lguest *lg,
+ unsigned long addr, unsigned long len)
+{
+ return (addr+len) / PAGE_SIZE < lg->pfn_limit && (addr+len >= addr);
+}
+
+/* Just like get_user, but don't let guest access lguest binary. */
+u32 lgread_u32(struct lguest *lg, u32 addr)
+{
+ u32 val = 0;
+
+ /* Don't let them access lguest binary */
+ if (!lguest_address_ok(lg, addr, sizeof(val))
+ || get_user(val, (u32 __user *)addr) != 0)
+ kill_guest(lg, "bad read address %u", addr);
+ return val;
+}
+
+void lgwrite_u32(struct lgu...
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all,
These are the patches I'm planning to submit for 2.6.24. Comments
gratefully accepted. Along with the usual cleanups and improvements are Jes'
de-i386-ification patches, and a new "virtio" mechanism designed to be shared
with KVM (and hopefully other hypervisors).
Cheers,
Rusty.
Documentation/lguest/Makefile | 30
Documentation/lguest/lguest.c
2007 Sep 25
50
[patch 00/43] lguest: Patches for 2.6.24 (and patchbomb test)
Hi all,
These are the patches I'm planning to submit for 2.6.24. Comments
gratefully accepted. Along with the usual cleanups and improvements are Jes'
de-i386-ification patches, and a new "virtio" mechanism designed to be shared
with KVM (and hopefully other hypervisors).
Cheers,
Rusty.
Documentation/lguest/Makefile | 30
Documentation/lguest/lguest.c
2007 Aug 08
13
[PATCH 0/7] Modify lguest32 to make room for lguest64
Hi all,
I've been working on lguest64 and in order to do this, I had to move
a lot of the i386 specific out of the way. Well, the lguest64 port
is still not ready to display, but before Rusty makes too many changes
I would like this in upstream so I don't have to keep repeating my
changes :-)
So this patch series moves lguest32 out of the way for other archs.
-- Steve
2007 Aug 08
13
[PATCH 0/7] Modify lguest32 to make room for lguest64
Hi all,
I've been working on lguest64 and in order to do this, I had to move
a lot of the i386 specific out of the way. Well, the lguest64 port
is still not ready to display, but before Rusty makes too many changes
I would like this in upstream so I don't have to keep repeating my
changes :-)
So this patch series moves lguest32 out of the way for other archs.
-- Steve
2007 Aug 08
7
[PATCH 0/5 -v2] Modify lguest32 to make room for lguest64 (version 2)
[
Changes since last version.
- Move lg.h to include/asm instead (suggested by Rusty Russel)
- All steps of the series compiles (suggested by Stephen Rothwell)
- Better ifdef header naming (suggested by Stephen Rothwell)
- Added Andi Kleen to CC (forgot to on V1)
]
Hi all,
I've been working on lguest64 and in order to do this, I had to move
a lot of the i386 specific out of the
2007 Aug 08
7
[PATCH 0/5 -v2] Modify lguest32 to make room for lguest64 (version 2)
[
Changes since last version.
- Move lg.h to include/asm instead (suggested by Rusty Russel)
- All steps of the series compiles (suggested by Stephen Rothwell)
- Better ifdef header naming (suggested by Stephen Rothwell)
- Added Andi Kleen to CC (forgot to on V1)
]
Hi all,
I've been working on lguest64 and in order to do this, I had to move
a lot of the i386 specific out of the