mbox series

[00/50] i386 cleanup part 3

Message ID 20210228232321.322053-1-richard.henderson@linaro.org
Headers show
Series i386 cleanup part 3 | expand

Message

Richard Henderson Feb. 28, 2021, 11:22 p.m. UTC
Based-on: 20210226175143.22388-1-cfontana@suse.de
("[PATCH v25 00/20] i386 cleanup PART 2")

This started out to address a fixme in Claudio's patch set, then
wandered a bit, with cleanups and bug fixes in the code that I was
touching.  I stopped when I reached my original goal of removing
target/i386/tcg/user/*_stubs.c.

There are a lot of patches, but hopefully they're all small
enough to be obvious.


r~

Richard Henderson (50):
  target/i386: Split out gen_exception_gpf
  target/i386: Split out check_cpl0
  target/i386: Unify code paths for IRET
  target/i386: Split out check_vm86_iopl
  target/i386: Split out check_iopl
  target/i386: Assert PE is set for user-only
  target/i386: Assert CPL is 3 for user-only
  target/i386: Assert IOPL is 0 for user-only
  target/i386: Assert !VM86 for x86_64 user-only
  target/i386: Assert CODE32 for x86_64 user-only
  target/i386: Assert SS32 for x86_64 user-only
  target/i386: Assert CODE64 for x86_64 user-only
  target/i386: Assert LMA for x86_64 user-only
  target/i386: Assert !ADDSEG for x86_64 user-only
  target/i386: Introduce REX_PREFIX
  target/i386: Tidy REX_B, REX_X definition
  target/i386: Move rex_r into DisasContext
  target/i386: Move rex_w into DisasContext
  target/i386: Remove DisasContext.f_st as unused
  target/i386: Reduce DisasContext.flags to uint32_t
  target/i386: Reduce DisasContext.override to int8_t
  target/i386: Reduce DisasContext.prefix to uint8_t
  target/i386: Reduce DisasContext.vex_[lv] to uint8_t
  target/i386: Reduce DisasContext popl_esp_hack and rip_offset to
    uint8_t
  target/i386: Leave TF in DisasContext.flags
  target/i386: Reduce DisasContext jmp_opt, repz_opt to bool
  target/i386: Fix the comment for repz_opt
  target/i386: Reorder DisasContext members
  target/i386: Add stub generator for helper_set_dr
  target/i386: Assert !SVME for user-only
  target/i386: Assert !GUEST for user-only
  target/i386: Implement skinit in translate.c
  target/i386: Eliminate SVM helpers for user-only
  target/i386: Mark some helpers as noreturn
  target/i386: Simplify gen_debug usage
  target/i386: Tidy svm_check_intercept from tcg
  target/i386: Remove pc_start argument to gen_svm_check_intercept
  target/i386: Remove user stub for cpu_vmexit
  target/i386: Cleanup read_crN, write_crN, lmsw
  target/i386: Pass env to do_pause and do_hlt
  target/i386: Move invlpg, hlt, monitor, mwait to sysemu
  target/i386: Unify invlpg, invlpga
  target/i386: Inline user cpu_svm_check_intercept_param
  target/i386: Eliminate user stubs for read/write_crN, rd/wrmsr
  target/i386: Exit tb after wrmsr
  target/i386: Tidy gen_check_io
  target/i386: Pass in port to gen_check_io
  target/i386: Create helper_check_io
  target/i386: Move helper_check_io to sysemu
  target/i386: Remove user-only i/o stubs

 target/i386/cpu.h                    |   8 +
 target/i386/helper.h                 |  43 +-
 target/i386/tcg/helper-tcg.h         |   5 +-
 target/i386/tcg/bpt_helper.c         |   2 +-
 target/i386/tcg/excp_helper.c        |  18 +-
 target/i386/tcg/misc_helper.c        |  79 +--
 target/i386/tcg/seg_helper.c         |  43 --
 target/i386/tcg/sysemu/misc_helper.c |  52 +-
 target/i386/tcg/sysemu/seg_helper.c  |  29 +
 target/i386/tcg/sysemu/svm_helper.c  |  30 +-
 target/i386/tcg/translate.c          | 891 ++++++++++++++-------------
 target/i386/tcg/user/misc_stubs.c    |  75 ---
 target/i386/tcg/user/svm_stubs.c     |  76 ---
 target/i386/tcg/user/meson.build     |   2 -
 14 files changed, 600 insertions(+), 753 deletions(-)
 delete mode 100644 target/i386/tcg/user/misc_stubs.c
 delete mode 100644 target/i386/tcg/user/svm_stubs.c

-- 
2.25.1

Comments

no-reply@patchew.org March 1, 2021, 12:31 a.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20210228232321.322053-1-richard.henderson@linaro.org/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210228232321.322053-1-richard.henderson@linaro.org
Subject: [PATCH 00/50] i386 cleanup part 3

=== 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
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20210228232321.322053-1-richard.henderson@linaro.org -> patchew/20210228232321.322053-1-richard.henderson@linaro.org
Switched to a new branch 'test'
797745d target/i386: Remove user-only i/o stubs
0f9b7df target/i386: Move helper_check_io to sysemu
0e6e2ee target/i386: Create helper_check_io
39f9f44 target/i386: Pass in port to gen_check_io
525360d target/i386: Tidy gen_check_io
b73f019 target/i386: Exit tb after wrmsr
77f4315 target/i386: Eliminate user stubs for read/write_crN, rd/wrmsr
c4f25ef target/i386: Inline user cpu_svm_check_intercept_param
be9d50c target/i386: Unify invlpg, invlpga
f3f94a0 target/i386: Move invlpg, hlt, monitor, mwait to sysemu
7f8853c target/i386: Pass env to do_pause and do_hlt
59992b7 target/i386: Cleanup read_crN, write_crN, lmsw
fbd9bfe target/i386: Remove user stub for cpu_vmexit
cec5742 target/i386: Remove pc_start argument to gen_svm_check_intercept
3e11484 target/i386: Tidy svm_check_intercept from tcg
018250c target/i386: Simplify gen_debug usage
bbe73ae target/i386: Mark some helpers as noreturn
1be7681 target/i386: Eliminate SVM helpers for user-only
37a998e target/i386: Implement skinit in translate.c
da48236 target/i386: Assert !GUEST for user-only
f4e4fe9 target/i386: Assert !SVME for user-only
d1d5637 target/i386: Add stub generator for helper_set_dr
a18d075 target/i386: Reorder DisasContext members
88fdc49 target/i386: Fix the comment for repz_opt
861b00b target/i386: Reduce DisasContext jmp_opt, repz_opt to bool
3783316 target/i386: Leave TF in DisasContext.flags
a6b8724 target/i386: Reduce DisasContext popl_esp_hack and rip_offset to uint8_t
6920aee target/i386: Reduce DisasContext.vex_[lv] to uint8_t
4f6954b target/i386: Reduce DisasContext.prefix to uint8_t
07cc331 target/i386: Reduce DisasContext.override to int8_t
6aba639 target/i386: Reduce DisasContext.flags to uint32_t
d507f0d target/i386: Remove DisasContext.f_st as unused
ac8f26e target/i386: Move rex_w into DisasContext
60f3d0b target/i386: Move rex_r into DisasContext
ca272c1 target/i386: Tidy REX_B, REX_X definition
f573f9b9 target/i386: Introduce REX_PREFIX
3d69364 target/i386: Assert !ADDSEG for x86_64 user-only
b9bc34b target/i386: Assert LMA for x86_64 user-only
543c705 target/i386: Assert CODE64 for x86_64 user-only
e81aa02 target/i386: Assert SS32 for x86_64 user-only
4a3d9a1 target/i386: Assert CODE32 for x86_64 user-only
272ed3d target/i386: Assert !VM86 for x86_64 user-only
3d6b13d target/i386: Assert IOPL is 0 for user-only
d11abdc target/i386: Assert CPL is 3 for user-only
161425f target/i386: Assert PE is set for user-only
1b4f01f target/i386: Split out check_iopl
ab7b71b target/i386: Split out check_vm86_iopl
ffbb88b target/i386: Unify code paths for IRET
245e7e4 target/i386: Split out check_cpl0
41f02f9 target/i386: Split out gen_exception_gpf

=== OUTPUT BEGIN ===
1/50 Checking commit 41f02f906d16 (target/i386: Split out gen_exception_gpf)
2/50 Checking commit 245e7e4367bb (target/i386: Split out check_cpl0)
3/50 Checking commit ffbb88b887c7 (target/i386: Unify code paths for IRET)
4/50 Checking commit ab7b71b2b03e (target/i386: Split out check_vm86_iopl)
5/50 Checking commit 1b4f01f45cb1 (target/i386: Split out check_iopl)
6/50 Checking commit 161425f462f3 (target/i386: Assert PE is set for user-only)
ERROR: braces {} are necessary for all arms of this statement
#129: FILE: target/i386/tcg/translate.c:7304:
+            if (!PE(s) || s->vm86)
[...]

ERROR: braces {} are necessary for all arms of this statement
#147: FILE: target/i386/tcg/translate.c:7323:
+            if (!PE(s) || s->vm86)
[...]

ERROR: braces {} are necessary for all arms of this statement
#165: FILE: target/i386/tcg/translate.c:7343:
+            if (!PE(s) || s->vm86)
[...]

ERROR: braces {} are necessary for all arms of this statement
#237: FILE: target/i386/tcg/translate.c:7714:
+            if (!PE(s) || s->vm86)
[...]

ERROR: braces {} are necessary for all arms of this statement
#246: FILE: target/i386/tcg/translate.c:7762:
+            if (!PE(s) || s->vm86)
[...]

total: 5 errors, 0 warnings, 244 lines checked

Patch 6/50 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/50 Checking commit d11abdcfe8e1 (target/i386: Assert CPL is 3 for user-only)
8/50 Checking commit 3d6b13d94823 (target/i386: Assert IOPL is 0 for user-only)
9/50 Checking commit 272ed3de80a0 (target/i386: Assert !VM86 for x86_64 user-only)
ERROR: braces {} are necessary for all arms of this statement
#131: FILE: target/i386/tcg/translate.c:7316:
+            if (!PE(s) || VM86(s))
[...]

ERROR: braces {} are necessary for all arms of this statement
#149: FILE: target/i386/tcg/translate.c:7335:
+            if (!PE(s) || VM86(s))
[...]

ERROR: braces {} are necessary for all arms of this statement
#167: FILE: target/i386/tcg/translate.c:7355:
+            if (!PE(s) || VM86(s))
[...]

ERROR: braces {} are necessary for all arms of this statement
#176: FILE: target/i386/tcg/translate.c:7726:
+            if (!PE(s) || VM86(s))
[...]

ERROR: braces {} are necessary for all arms of this statement
#185: FILE: target/i386/tcg/translate.c:7774:
+            if (!PE(s) || VM86(s))
[...]

total: 5 errors, 0 warnings, 159 lines checked

Patch 9/50 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

10/50 Checking commit 4a3d9a109c2d (target/i386: Assert CODE32 for x86_64 user-only)
11/50 Checking commit e81aa025ffa7 (target/i386: Assert SS32 for x86_64 user-only)
12/50 Checking commit 543c7050215a (target/i386: Assert CODE64 for x86_64 user-only)
13/50 Checking commit b9bc34b98d14 (target/i386: Assert LMA for x86_64 user-only)
14/50 Checking commit 3d693642125c (target/i386: Assert !ADDSEG for x86_64 user-only)
15/50 Checking commit f573f9b9e62a (target/i386: Introduce REX_PREFIX)
16/50 Checking commit ca272c10ffe4 (target/i386: Tidy REX_B, REX_X definition)
17/50 Checking commit 60f3d0b028ca (target/i386: Move rex_r into DisasContext)
18/50 Checking commit ac8f26efd681 (target/i386: Move rex_w into DisasContext)
19/50 Checking commit d507f0d0a53f (target/i386: Remove DisasContext.f_st as unused)
20/50 Checking commit 6aba639bf660 (target/i386: Reduce DisasContext.flags to uint32_t)
21/50 Checking commit 07cc331be79e (target/i386: Reduce DisasContext.override to int8_t)
22/50 Checking commit 4f6954b61c3a (target/i386: Reduce DisasContext.prefix to uint8_t)
23/50 Checking commit 6920aeec5654 (target/i386: Reduce DisasContext.vex_[lv] to uint8_t)
24/50 Checking commit a6b872456c56 (target/i386: Reduce DisasContext popl_esp_hack and rip_offset to uint8_t)
25/50 Checking commit 37833162f266 (target/i386: Leave TF in DisasContext.flags)
26/50 Checking commit 861b00b369bd (target/i386: Reduce DisasContext jmp_opt, repz_opt to bool)
27/50 Checking commit 88fdc4906e85 (target/i386: Fix the comment for repz_opt)
28/50 Checking commit a18d075d4339 (target/i386: Reorder DisasContext members)
29/50 Checking commit d1d5637307d8 (target/i386: Add stub generator for helper_set_dr)
30/50 Checking commit f4e4fe9e64e5 (target/i386: Assert !SVME for user-only)
31/50 Checking commit da4823620a87 (target/i386: Assert !GUEST for user-only)
32/50 Checking commit 37a998ec18e1 (target/i386: Implement skinit in translate.c)
33/50 Checking commit 1be76815936c (target/i386: Eliminate SVM helpers for user-only)
34/50 Checking commit bbe73aee6785 (target/i386: Mark some helpers as noreturn)
35/50 Checking commit 018250c5210f (target/i386: Simplify gen_debug usage)
36/50 Checking commit 3e11484e66dd (target/i386: Tidy svm_check_intercept from tcg)
37/50 Checking commit cec5742f3094 (target/i386: Remove pc_start argument to gen_svm_check_intercept)
WARNING: line over 80 characters
#179: FILE: target/i386/tcg/translate.c:7712:
+            gen_svm_check_intercept(s, (b & 2) ? SVM_EXIT_INVD : SVM_EXIT_WBINVD);

total: 0 errors, 1 warnings, 176 lines checked

Patch 37/50 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
38/50 Checking commit fbd9bfe4dbae (target/i386: Remove user stub for cpu_vmexit)
39/50 Checking commit 59992b722b59 (target/i386: Cleanup read_crN, write_crN, lmsw)
40/50 Checking commit 7f8853cf211e (target/i386: Pass env to do_pause and do_hlt)
41/50 Checking commit f3f94a0e0d42 (target/i386: Move invlpg, hlt, monitor, mwait to sysemu)
42/50 Checking commit be9d50c065c4 (target/i386: Unify invlpg, invlpga)
43/50 Checking commit c4f25ef4748d (target/i386: Inline user cpu_svm_check_intercept_param)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#52: 
deleted file mode 100644

total: 0 errors, 1 warnings, 22 lines checked

Patch 43/50 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
44/50 Checking commit 77f4315181bf (target/i386: Eliminate user stubs for read/write_crN, rd/wrmsr)
45/50 Checking commit b73f019ebbf1 (target/i386: Exit tb after wrmsr)
46/50 Checking commit 525360d7711f (target/i386: Tidy gen_check_io)
47/50 Checking commit 39f9f445f6c4 (target/i386: Pass in port to gen_check_io)
48/50 Checking commit 0e6e2eee1f5b (target/i386: Create helper_check_io)
49/50 Checking commit 0f9b7dfe694f (target/i386: Move helper_check_io to sysemu)
50/50 Checking commit 797745dca76f (target/i386: Remove user-only i/o stubs)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#71: 
deleted file mode 100644

total: 0 errors, 1 warnings, 35 lines checked

Patch 50/50 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/20210228232321.322053-1-richard.henderson@linaro.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com