Skip to content

Commit

Permalink
hwrng: via_rng - Fix asm constraints
Browse files Browse the repository at this point in the history
The inline asm to invoke xstore did not specify the constraints
correctly.  In particular, dx/di should have been marked as output
registers as well as input as they're modified by xstore.

Thanks to Mario Holbe for creating this patch and testing it.

Tested-by: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Herbert Xu committed Jan 7, 2011
1 parent dffa184 commit 0735ac1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/char/hw_random/via-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ static inline u32 xstore(u32 *addr, u32 edx_in)
ts_state = irq_ts_save();

asm(".byte 0x0F,0xA7,0xC0 /* xstore %%edi (addr=%0) */"
:"=m"(*addr), "=a"(eax_out)
:"D"(addr), "d"(edx_in));
: "=m" (*addr), "=a" (eax_out), "+d" (edx_in), "+D" (addr));

irq_ts_restore(ts_state);
return eax_out;
Expand Down

0 comments on commit 0735ac1

Please sign in to comment.