tcg: Sanitize shift constants on ppc64le so that shift operations with large constants don't generate invalid instructions.
PATCH 1/1 tcg: Sanitize shift constants on ppc64le so that shift operations with large constants don't generate invalid instructions.
From: "Catherine A. Frederick" <[email protected]>
--- tcg/ppc/tcg-target.inc.c | 4 ++++ 1 file changed, 4 insertions(+)
tcg/ppc/tcg-target.inc.c +4 -0
@@ -790,21 +790,25 @@ static inline void tcg_out_ext32u(TCGContext *s, TCGReg dst, TCGReg src)static inline void tcg_out_shli32 (TCGContext *s,TCGReg dst,TCGReg src,int c) { + c = ((unsigned )c >32 ) ?32 : c;tcg_out_rlw (s,RLWINM , dst, src, c,0 ,31 - c); }static inline void tcg_out_shli64 (TCGContext *s,TCGReg dst,TCGReg src,int c) { + c = ((unsigned )c >64 ) ?64 : c;tcg_out_rld (s,RLDICR , dst, src, c,63 - c); }static inline void tcg_out_shri32 (TCGContext *s,TCGReg dst,TCGReg src,int c) { + c = ((unsigned )c >32 ) ?32 : c;tcg_out_rlw (s,RLWINM , dst, src,32 - c, c,31 ); }static inline void tcg_out_shri64 (TCGContext *s,TCGReg dst,TCGReg src,int c) { + c = ((unsigned )c >64 ) ?64 : c;tcg_out_rld (s,RLDICL , dst, src,64 - c, c); }
Signature · 1 line
2.26.2
Oh dear, it appears that git send-email ate the formatting, hang on.
Quoted 40 lines · On Wed, Jun 3, 2020 at 12:47 AM <[email protected]> wrote:
From: "Catherine A. Frederick" <[email protected]>
--- tcg/ppc/tcg-target.inc.c | 4 ++++ 1 file changed, 4 insertions(+)tcg/ppc/tcg-target.inc.c +4
-1@@ -790,21 +790,25 @@ static inline void tcg_out_ext32u(TCGContext *s, TCGReg dst, TCGReg src)static inline void tcg_out_shli32 (TCGContext *s,TCGReg dst,TCGReg src,int c) { + c = ((unsigned )c >32 ) ?32 : c;tcg_out_rlw (s,RLWINM , dst, src, c,0 ,31 - c); }static inline void tcg_out_shli64 (TCGContext *s,TCGReg dst,TCGReg src,int c) { + c = ((unsigned )c >64 ) ?64 : c;tcg_out_rld (s,RLDICR , dst, src, c,63 - c); }static inline void tcg_out_shri32 (TCGContext *s,TCGReg dst,TCGReg src,int c) { + c = ((unsigned )c >32 ) ?32 : c;tcg_out_rlw (s,RLWINM , dst, src,32 - c, c,31 ); }static inline void tcg_out_shri64 (TCGContext *s,TCGReg dst,TCGReg src,int c) { + c = ((unsigned )c >64 ) ?64 : c;tcg_out_rld (s,RLDICL , dst, src,64 - c, c); } --2.26.2
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Message-id: [email protected]
Subject: [PATCH] tcg: Sanitize shift constants on ppc64le so that shift operations with large constants don't generate invalid instructions.
Type: series
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
d097b53 tcg: Sanitize shift constants on ppc64le so that shift operations with large constants don't generate invalid instructions.
=== OUTPUT BEGIN ===
ERROR: Missing Signed-off-by: line(s)
total: 1 errors, 0 warnings, 25 lines checked
Commit d097b531df67 (tcg: Sanitize shift constants on ppc64le so that shift operations with large constants don't generate invalid instructions.) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]