target/ppc: Fix truncation of env->hflags

Use the cs_base field, because it happens to be the same
size as hflags (and MSR, from which hflags is derived).

In translate, extract most bits from a local hflags variable.
Mark several cases where code generation is *not* derived from
data stored within the hashed elements of the TranslationBlock.

Cc: David Gibson <david@gibson.dropbear.id.au>
Reported-by: Ivan Warren <ivan@vmfacility.fr>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by:  Ivan Warren  <ivan@vmfacility.fr>
Message-Id: <20210124032422.2113565-1-richard.henderson@linaro.org>
Signed-off-by: Greg Kurz <groug@kaod.org>
114 jobs for ppc-fix-truncation-env-hflags in 70 minutes and 41 seconds (queued for 9 seconds)
latest
Status Name Job ID Coverage
  Containers
passed amd64-alpine-container #1090772964

00:02:32

passed amd64-centos7-container #1090772970

00:02:40

passed amd64-centos8-container #1090772973

00:02:35

passed amd64-debian10-container #1090772975

00:02:29

passed amd64-debian11-container #1090772977

00:02:20

passed amd64-fedora-container #1090772985

00:03:55

passed amd64-opensuse-leap-container #1090773005

00:02:46

passed amd64-ubuntu-container #1090773003

00:03:16

passed amd64-ubuntu1804-container #1090772996

00:03:07

passed amd64-ubuntu2004-container #1090772998

00:03:12

passed cris-fedora-cross-container #1090772983

00:02:32

passed i386-fedora-cross-container #1090772987

00:02:39

passed win32-fedora-cross-container #1090772990

00:02:39

passed win64-fedora-cross-container #1090772993

00:02:40

passed xtensa-debian-cross-container #1090772980

00:02:28

 
  Containers Layer2
passed alpha-debian-cross-container #1090773010

00:02:37

passed amd64-debian-container #1090773016

00:03:06

passed amd64-debian-cross-container #1090773013

00:02:46

passed amd64-debian-user-cross-container #1090773014

00:03:19

passed arm64-debian-cross-container #1090773017

00:02:54

passed arm64-test-debian-cross-container #1090773018

00:02:34

passed armel-debian-cross-container #1090773019

00:02:51

passed armhf-debian-cross-container #1090773020

00:02:49

passed hppa-debian-cross-container #1090773021

00:02:42

passed m68k-debian-cross-container #1090773022

00:02:39

passed mips-debian-cross-container #1090773025

00:02:52

passed mips64-debian-cross-container #1090773023

00:02:41

passed mips64el-debian-cross-container #1090773024

00:02:52

passed mipsel-debian-cross-container #1090773026

00:02:50

passed powerpc-debian-cross-container #1090773028

00:02:40

passed ppc64-debian-cross-container #1090773030

00:02:40

passed ppc64el-debian-cross-container #1090773036

00:02:55

passed riscv64-debian-cross-container #1090773039

00:02:39

passed s390x-debian-cross-container #1090773041

00:02:46

passed sh4-debian-cross-container #1090773042

00:02:37

passed sparc64-debian-cross-container #1090773044

00:02:38

passed tricore-debian-cross-container #1090773045

00:02:37

 
  Build
passed build-coroutine-sigaltstack #1090773166

00:15:52

passed build-coroutine-ucontext #1090773163

00:16:34

passed build-crypto-old-gcrypt #1090773170

00:12:18

passed build-crypto-old-nettle #1090773168

00:12:21

passed build-crypto-only-gnutls #1090773173

00:11:57

passed build-deprecated #1090773150

00:12:56

passed build-disabled #1090773114

00:42:18

passed build-libvhost-user #1090773199

00:02:56

passed build-oss-fuzz #1090773157

00:49:23

passed build-some-softmmu #1090773129

00:14:25

passed build-some-softmmu-plugins #1090773139

00:25:29

passed build-system-alpine #1090773089

00:38:56

passed build-system-centos #1090773104

00:21:24

passed build-system-debian #1090773096

00:30:48

passed build-system-fedora #1090773101

00:27:22

passed build-system-opensuse #1090773109

00:20:47

passed build-system-ubuntu #1090773091

00:29:02

passed build-tcg-disabled #1090773118

00:20:41

failed build-tci #1090773160

00:38:27

passed build-tools-and-docs-debian #1090773097

00:09:32

passed build-trace-ftrace-system #1090773178

00:15:40

passed build-trace-multi-user #1090773176

00:42:43

passed build-trace-ust-system #1090773180

00:23:25

passed build-user #1090773122

00:39:52

passed build-user-centos7 #1090773136

00:32:24

passed build-user-plugins #1090773132

00:42:09

passed build-user-static #1090773125

00:39:51

passed build-without-default-devices #1090773183

00:49:02

passed build-without-default-features #1090773186

00:45:17

passed check-dco #1090773193

00:01:09

passed check-patch #1090773188

00:01:10

failed clang-system #1090773141

00:44:24

passed clang-user #1090773145

00:42:28

passed cross-amd64-xen-only #1090773085

00:13:09

passed cross-arm64-system #1090773056

00:51:49

passed cross-arm64-user #1090773057

00:45:40

passed cross-arm64-xen-only #1090773087

00:15:52

passed cross-armel-system #1090773050

00:52:13

passed cross-armel-user #1090773051

00:48:11

passed cross-armhf-system #1090773053

00:54:56

passed cross-armhf-user #1090773054

00:45:45

passed cross-i386-system #1090773058

00:55:39

passed cross-i386-user #1090773060

00:41:45

passed cross-mips-system #1090773061

00:53:40

passed cross-mips-user #1090773063

00:45:48

passed cross-mips64el-system #1090773067

00:56:58

passed cross-mips64el-user #1090773069

00:48:48

passed cross-mipsel-system #1090773064

00:52:41

passed cross-mipsel-user #1090773066

00:51:11

passed cross-ppc64el-system #1090773070

00:51:42

passed cross-ppc64el-user #1090773072

00:47:59

passed cross-s390x-kvm-only #1090773078

00:11:08

passed cross-s390x-system #1090773073

00:45:34

passed cross-s390x-user #1090773075

00:40:47

passed cross-win32-system #1090773080

00:51:29

passed cross-win64-system #1090773082

01:07:16

passed gprof-gcov #1090773152

00:50:16

passed tsan-build #1090773147

00:37:10

 
  Test
passed acceptance-system-alpine #1090773203

00:10:53

failed acceptance-system-centos #1090773220

00:21:14

passed acceptance-system-debian #1090773212

00:06:54

passed acceptance-system-fedora #1090773216

00:07:44

passed acceptance-system-opensuse #1090773226

00:19:54

passed acceptance-system-ubuntu #1090773209

00:11:26

passed check-crypto-old-gcrypt #1090773237

00:09:16

passed check-crypto-old-nettle #1090773233

00:09:00

passed check-crypto-only-gnutls #1090773239

00:08:46

failed check-deprecated #1090773229
allowed to fail

00:03:09

passed check-system-alpine #1090773201

00:08:46

passed check-system-centos #1090773218

00:10:40

passed check-system-debian #1090773211

00:18:50

passed check-system-fedora #1090773214

00:10:20

passed check-system-opensuse #1090773223

00:14:48

passed check-system-ubuntu #1090773205

00:13:49

passed pages #1090773242

00:08:55

 
  External
failed Travis CI build status

 
  Deploy
passed pages:deploy

00:16:07

 
Name Stage Failure
failed
build-tci Build
/m68k/boot-serial/mcf5208evb: OK
/m68k/boot-serial/next-cube: OK
/microblaze/boot-serial/petalogix-s3adsp1800: OK
/moxie/boot-serial/moxiesim: OK
/ppc64/boot-serial/ppce500:
** (./tests/qtest/boot-serial-test:21447): ERROR **: 17:34:15.009: Failed to find expected string. Please check '/tmp/qtest-boot-serial-seOCr0p'
/bin/bash: line 130: 21447 Trace/breakpoint trap (core dumped) ./tests/qtest/boot-serial-test
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
check-deprecated Test
  TEST    threadcount on ppc64abi32
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
timeout: the monitored command dumped core
Segmentation fault
make[2]: *** [../Makefile.target:152: run-threadcount] Error 139
make[1]: *** [/builds/gkurz/qemu/tests/tcg/Makefile.qemu:85: run-guest-tests] Error 2
make: *** [/builds/gkurz/qemu/tests/Makefile.include:63: run-tcg-tests-ppc64abi32-linux-user] Error 2
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
clang-system Build
Running test qtest-ppc/prom-env-test
../target/ppc/translate.c:4506:21: runtime error: load of value 24, which is not a valid value for type 'bool'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../target/ppc/translate.c:4506:21 in
Broken pipe
ERROR qtest-ppc/prom-env-test - too few tests run (expected 2, got 0)
make: *** [Makefile.mtest:192: run-test-22] Error 1
make: *** Waiting for unfinished jobs....
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
acceptance-system-centos Test
Uploading artifacts...
build/tests/results/latest/results.xml: found 1 matching files and directories

build/tests/results/latest/test-results: found 377 matching files and directories

Uploading artifacts as "archive" to coordinator... ok
id=1090773220 responseStatus=201 Created token=fbfHG-kW
Uploading artifacts...
build/tests/results/latest/results.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=1090773220 responseStatus=201 Created token=fbfHG-kW
Cleaning up file based variables
ERROR: Job failed: exit code 1