generalize lgread_u32/lgwrite_u32.
Jes complains that page table code still uses lgread_u32 even though it now uses general kernel pte types. The best thing to do is to generalize lgread_u32 and lgwrite_u32. This means we lose the efficiency of getuser(). We could potentially regain it if we used __copy_from_user instead of copy_from_user, but I'm not certain that our range check is equivalent to access_ok() on all platforms. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Jes Sorensen <jes@sgi.com>
This commit is contained in:
@@ -222,7 +222,7 @@ static int emulate_insn(struct lguest *lg)
|
||||
return 0;
|
||||
|
||||
/* Decoding x86 instructions is icky. */
|
||||
lgread(lg, &insn, physaddr, 1);
|
||||
insn = lgread(lg, physaddr, u8);
|
||||
|
||||
/* 0x66 is an "operand prefix". It means it's using the upper 16 bits
|
||||
of the eax register. */
|
||||
@@ -230,7 +230,7 @@ static int emulate_insn(struct lguest *lg)
|
||||
shift = 16;
|
||||
/* The instruction is 1 byte so far, read the next byte. */
|
||||
insnlen = 1;
|
||||
lgread(lg, &insn, physaddr + insnlen, 1);
|
||||
insn = lgread(lg, physaddr + insnlen, u8);
|
||||
}
|
||||
|
||||
/* We can ignore the lower bit for the moment and decode the 4 opcodes
|
||||
|
Reference in New Issue
Block a user