qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 6bd995: target/i386: Split out gen_exception_


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 6bd995: target/i386: Split out gen_exception_gpf
Date: Thu, 20 May 2021 05:04:52 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 6bd995864567864867513295c02b3050691d30af
      
https://github.com/qemu/qemu/commit/6bd995864567864867513295c02b3050691d30af
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Split out gen_exception_gpf

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-2-richard.henderson@linaro.org>


  Commit: bc19f5052d3929a155f3e8c3aafc1cdb2338e60c
      
https://github.com/qemu/qemu/commit/bc19f5052d3929a155f3e8c3aafc1cdb2338e60c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Split out check_cpl0

Split out the check for CPL != 0 and the raising of #GP.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-3-richard.henderson@linaro.org>


  Commit: e048f3d6b91d88d28b688fa412b8d30d8f4893ce
      
https://github.com/qemu/qemu/commit/e048f3d6b91d88d28b688fa412b8d30d8f4893ce
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Unify code paths for IRET

In vm86 mode, we use the same helper as real-mode, but with
an extra check for IOPL.  All non-exceptional paths set EFLAGS.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-4-richard.henderson@linaro.org>


  Commit: aa9f21b1f0d4149d3e569b673deb1835f1f098d8
      
https://github.com/qemu/qemu/commit/aa9f21b1f0d4149d3e569b673deb1835f1f098d8
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Split out check_vm86_iopl

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-5-richard.henderson@linaro.org>


  Commit: ca7874c2fa6502c612514024632cd6ae4a46641f
      
https://github.com/qemu/qemu/commit/ca7874c2fa6502c612514024632cd6ae4a46641f
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Split out check_iopl

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-6-richard.henderson@linaro.org>


  Commit: d75f912927099574e4ff6d82ba08f2e1a9583c7a
      
https://github.com/qemu/qemu/commit/d75f912927099574e4ff6d82ba08f2e1a9583c7a
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert PE is set for user-only

A user-mode executable is never in real-mode.  Since we're adding
an accessor macro, pull the value directly out of flags for sysemu.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-7-richard.henderson@linaro.org>


  Commit: 01b9d8c1b23b6e5af631cb56b86011466b52789a
      
https://github.com/qemu/qemu/commit/01b9d8c1b23b6e5af631cb56b86011466b52789a
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert CPL is 3 for user-only

A user-mode executable always runs in ring 3.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-8-richard.henderson@linaro.org>


  Commit: 0ab011cca08651349172187d574e2fb1316283ef
      
https://github.com/qemu/qemu/commit/0ab011cca08651349172187d574e2fb1316283ef
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert IOPL is 0 for user-only

On real hardware, the linux kernel has the iopl(2) syscall which
can set IOPL to 3, to allow e.g. the xserver to briefly disable
interrupts while programming the graphics card.

However, QEMU cannot and does not implement this syscall, so the
IOPL is never changed from 0.  Which means that all of the checks
vs CPL <= IOPL are false for user-only.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-9-richard.henderson@linaro.org>


  Commit: f8a35846d5479fb076c12c8c84c010cb479bdc49
      
https://github.com/qemu/qemu/commit/f8a35846d5479fb076c12c8c84c010cb479bdc49
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert !VM86 for x86_64 user-only

For i386-linux-user, we can enter vm86 mode via the vm86(2) syscall.
That syscall explicitly returns to 32-bit mode, and the syscall does
not exist for a 64-bit x86_64 executable.

Since we're adding an accessor macro, pull the value directly out of
flags otherwise.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-10-richard.henderson@linaro.org>


  Commit: 9996dcfd674a66a11983adc33ea09cae92676eaf
      
https://github.com/qemu/qemu/commit/9996dcfd674a66a11983adc33ea09cae92676eaf
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert CODE32 for x86_64 user-only

For user-only, CODE32 == !VM86, because we are never in real-mode.
Since we cannot enter vm86 mode for x86_64 user-only, CODE32 is
always set.

Since we're adding an accessor macro, pull the value directly out
of flags otherwise.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-11-richard.henderson@linaro.org>


  Commit: b40a47a17f9e5ed75287e9f6b6fb1b9d4a3a0c25
      
https://github.com/qemu/qemu/commit/b40a47a17f9e5ed75287e9f6b6fb1b9d4a3a0c25
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert SS32 for x86_64 user-only

For user-only, SS32 == !VM86, because we are never in
real-mode.  Since we cannot enter vm86 mode for x86_64
user-only, SS32 is always set.

Since we're adding an accessor macro, pull the value
directly out of flags otherwise.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-12-richard.henderson@linaro.org>


  Commit: eec7d0f8386b600046843117d86b1189491cc5df
      
https://github.com/qemu/qemu/commit/eec7d0f8386b600046843117d86b1189491cc5df
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert CODE64 for x86_64 user-only

For x86_64 user-only, there is no way to leave 64-bit mode.

Without x86_64, there is no way to enter 64-bit mode.  There is
an existing macro to aid with that; simply place it in the right
place in the ifdef chain.

Since we're adding an accessor macro, pull the value directly out
of flags when we're not assuming a constant.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-13-richard.henderson@linaro.org>


  Commit: 73e90dc458b8f7d5802fc364359c125305ea04fa
      
https://github.com/qemu/qemu/commit/73e90dc458b8f7d5802fc364359c125305ea04fa
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert LMA for x86_64 user-only

LMA is a pre-requisite for CODE64, so there is no way to disable it
for x86_64-linux-user, and there is no way to enable it for i386.

Since we're adding an accessor macro, pull the value directly out
of flags when we're not assuming a constant.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-14-richard.henderson@linaro.org>


  Commit: beedb93c04bd90868d49f640cdf9dbb439c9fa8f
      
https://github.com/qemu/qemu/commit/beedb93c04bd90868d49f640cdf9dbb439c9fa8f
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert !ADDSEG for x86_64 user-only

LMA disables traditional segmentation, exposing a flat address space.
This means that ADDSEG is off.

Since we're adding an accessor macro, pull the value directly out
of flags otherwise.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-15-richard.henderson@linaro.org>


  Commit: 1e92b7275c633cada8f8b6fc919b350bafdfc17c
      
https://github.com/qemu/qemu/commit/1e92b7275c633cada8f8b6fc919b350bafdfc17c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Introduce REX_PREFIX

The existing flag, x86_64_hregs, does not accurately describe
its setting.  It is true if and only if a REX prefix has been
seen.  Yes, that affects the "h" regs, but that's secondary.

Add PREFIX_REX and include this bit in s->prefix.  Add REX_PREFIX
so that the check folds away when x86_64 is compiled out.

Fold away the reg >= 8 check, because bit 3 of the register
number comes from the REX prefix in the first place.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-16-richard.henderson@linaro.org>


  Commit: 915ffe89a555817a08de661612a18e43df244d9c
      
https://github.com/qemu/qemu/commit/915ffe89a555817a08de661612a18e43df244d9c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Tidy REX_B, REX_X definition

Change the storage from int to uint8_t since the value is in {0,8}.
For x86_64 add 0 in the macros to (1) promote the type back to int,
and (2) make the macro an rvalue.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-17-richard.henderson@linaro.org>


  Commit: bbdb4237c55ff0423d14dc1833749c8307e178a4
      
https://github.com/qemu/qemu/commit/bbdb4237c55ff0423d14dc1833749c8307e178a4
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Move rex_r into DisasContext

Treat this flag exactly like we treat rex_b and rex_x.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-18-richard.henderson@linaro.org>


  Commit: 8ab1e4860b092b93f6c77ef5ffb22b3affe77d62
      
https://github.com/qemu/qemu/commit/8ab1e4860b092b93f6c77ef5ffb22b3affe77d62
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Move rex_w into DisasContext

Treat this flag exactly like we treat the other rex bits.
The -1 initialization is unused; the two tests are > 0 and == 1,
so the value can be reduced to a bool.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-19-richard.henderson@linaro.org>


  Commit: 0046060e5dc232beb4dc942ec76852841739c109
      
https://github.com/qemu/qemu/commit/0046060e5dc232beb4dc942ec76852841739c109
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Remove DisasContext.f_st as unused

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-20-richard.henderson@linaro.org>


  Commit: c6ad6f44ed970fd5d531b1f030944d35d4fde246
      
https://github.com/qemu/qemu/commit/c6ad6f44ed970fd5d531b1f030944d35d4fde246
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Reduce DisasContext.flags to uint32_t

The value comes from tb->flags, which is uint32_t.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-21-richard.henderson@linaro.org>


  Commit: c651f3a3cbb595841933f2c170974b54152db35e
      
https://github.com/qemu/qemu/commit/c651f3a3cbb595841933f2c170974b54152db35e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Reduce DisasContext.override to int8_t

The range of values is -1 (none) to 5 (R_GS).

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-22-richard.henderson@linaro.org>


  Commit: a8b9b657a0825dda1ce0f61f60543b44261239bf
      
https://github.com/qemu/qemu/commit/a8b9b657a0825dda1ce0f61f60543b44261239bf
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Reduce DisasContext.prefix to uint8_t

The highest bit in this set is 0x40 (PREFIX_REX).

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-23-richard.henderson@linaro.org>


  Commit: a77ca425d741b9806a2d15afdc6ed53c85777f8f
      
https://github.com/qemu/qemu/commit/a77ca425d741b9806a2d15afdc6ed53c85777f8f
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Reduce DisasContext.vex_[lv] to uint8_t

Currently, vex_l is either {0,1}; if in the future we implement
AVX-512, the max value will be 2.  In vex_v we store a register
number.  This is 0-15 for SSE, and 0-31 for AVX-512.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-24-richard.henderson@linaro.org>


  Commit: 5862579473cffed0ced8d8ccd707673c5387a165
      
https://github.com/qemu/qemu/commit/5862579473cffed0ced8d8ccd707673c5387a165
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Reduce DisasContext popl_esp_hack and rip_offset to uint8_t

Both of these fields store the size of a single memory access,
so the range of values is 0-8.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-25-richard.henderson@linaro.org>


  Commit: c1de1a1ace8812119aa3184932db25db60bb27dd
      
https://github.com/qemu/qemu/commit/c1de1a1ace8812119aa3184932db25db60bb27dd
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Leave TF in DisasContext.flags

It's just as easy to clear the flag with AND than assignment.
In two cases the test for the bit can be folded together with
the test for HF_INHIBIT_IRQ_MASK.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-26-richard.henderson@linaro.org>


  Commit: 305d08e51260b7d3a6a20c9399ba49f2235c2d25
      
https://github.com/qemu/qemu/commit/305d08e51260b7d3a6a20c9399ba49f2235c2d25
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Reduce DisasContext jmp_opt, repz_opt to bool

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-27-richard.henderson@linaro.org>


  Commit: 3236c2ade2335d9ff3ea53e60cec024863983d90
      
https://github.com/qemu/qemu/commit/3236c2ade2335d9ff3ea53e60cec024863983d90
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Fix the comment for repz_opt

After fixing a typo in the comment, fixup for CODING_STYLE.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210514151342.384376-28-richard.henderson@linaro.org>


  Commit: a6f62100a8eb0092f613d974142d3789522530f4
      
https://github.com/qemu/qemu/commit/a6f62100a8eb0092f613d974142d3789522530f4
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Reorder DisasContext members

Sort all of the single-byte members to the same area
of the structure, eliminating 8 bytes of padding.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-29-richard.henderson@linaro.org>


  Commit: 9f55e5a947512fdf8f2c4f8ccdfa84efaac8960c
      
https://github.com/qemu/qemu/commit/9f55e5a947512fdf8f2c4f8ccdfa84efaac8960c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Add stub generator for helper_set_dr

This removes an ifdef from the middle of disas_insn,
and ensures that the branch is not reachable.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-30-richard.henderson@linaro.org>


  Commit: 5d2238896af628fc3f01dbe73be06fdd5603dedd
      
https://github.com/qemu/qemu/commit/5d2238896af628fc3f01dbe73be06fdd5603dedd
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert !SVME for user-only

Most of the VMM instructions are already disabled for user-only,
by being usable only from ring 0.

The spec is intentionally loose for VMMCALL, allowing the VMM to
define syscalls for user-only.  However, we're not emulating any
VMM, so VMMCALL can just raise #UD unconditionally.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210514151342.384376-31-richard.henderson@linaro.org>


  Commit: b322b3afc1b18ab0f48a3a3b16a252842689ccda
      
https://github.com/qemu/qemu/commit/b322b3afc1b18ab0f48a3a3b16a252842689ccda
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Assert !GUEST for user-only

For user-only, we do not need to check for VMM intercept.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-32-richard.henderson@linaro.org>


  Commit: e6aeb948bb7f189a9c17081e69ce39df85feae7f
      
https://github.com/qemu/qemu/commit/e6aeb948bb7f189a9c17081e69ce39df85feae7f
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/sysemu/svm_helper.c
    M target/i386/tcg/translate.c
    M target/i386/tcg/user/svm_stubs.c

  Log Message:
  -----------
  target/i386: Implement skinit in translate.c

Our sysemu implementation is a stub.  We can already intercept
instructions for vmexit, and raising #UD is trivial.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-33-richard.henderson@linaro.org>


  Commit: 8d6806c7dd44f8d8423d0cf0fb9de21ef0501cbe
      
https://github.com/qemu/qemu/commit/8d6806c7dd44f8d8423d0cf0fb9de21ef0501cbe
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/translate.c
    M target/i386/tcg/user/svm_stubs.c

  Log Message:
  -----------
  target/i386: Eliminate SVM helpers for user-only

Use STUB_HELPER to ensure that such calls are always eliminated.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-34-richard.henderson@linaro.org>


  Commit: b82055aece019636c8f1c1b0e199066a0270c6c1
      
https://github.com/qemu/qemu/commit/b82055aece019636c8f1c1b0e199066a0270c6c1
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/bpt_helper.c
    M target/i386/tcg/excp_helper.c
    M target/i386/tcg/misc_helper.c
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Mark some helpers as noreturn

Any helper that always raises an exception or interrupt,
or simply exits to the main loop, can be so marked.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-35-richard.henderson@linaro.org>


  Commit: ed3c4739e99569bc9b473c9ca72503502fdf043e
      
https://github.com/qemu/qemu/commit/ed3c4739e99569bc9b473c9ca72503502fdf043e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Simplify gen_debug usage

Both invocations pass the start of the current instruction,
which is available as s->base.pc_next.  The function sets
is_jmp, so we can eliminate a second setting.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-36-richard.henderson@linaro.org>


  Commit: d051ea04d024880475e082e876e497f669bb3e4e
      
https://github.com/qemu/qemu/commit/d051ea04d024880475e082e876e497f669bb3e4e
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/sysemu/svm_helper.c
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Tidy svm_check_intercept from tcg

The param argument to helper_svm_check_intercept_param is always 0;
eliminate it and rename to helper_svm_check_intercept.  Fold
gen_svm_check_intercept_param into gen_svm_check_intercept.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-37-richard.henderson@linaro.org>


  Commit: b53605dbd210c806809d3acb698226ec5de11378
      
https://github.com/qemu/qemu/commit/b53605dbd210c806809d3acb698226ec5de11378
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Remove pc_start argument to gen_svm_check_intercept

When exiting helper_svm_check_intercept via exception, cpu_vmexit
calls cpu_restore_state, which will recover eip and cc_op via unwind.
Therefore we do not need to store eip or cc_op before the call.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-38-richard.henderson@linaro.org>


  Commit: 3d4fce8b8e7f9f8b898b46500d29279e965cb646
      
https://github.com/qemu/qemu/commit/3d4fce8b8e7f9f8b898b46500d29279e965cb646
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/helper-tcg.h
    M target/i386/tcg/user/svm_stubs.c

  Log Message:
  -----------
  target/i386: Remove user stub for cpu_vmexit

This function is only called from tcg/sysemu/.
There is no need for a stub in tcg/user/.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-39-richard.henderson@linaro.org>


  Commit: 7eff2e7c652304157f503f2d406193bb9de10d58
      
https://github.com/qemu/qemu/commit/7eff2e7c652304157f503f2d406193bb9de10d58
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/misc_helper.c
    M target/i386/tcg/sysemu/misc_helper.c
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Cleanup read_crN, write_crN, lmsw

Pull the svm intercept check into the translator.
Pull the entire implementation of lmsw into the translator.
Push the check for CR8LEG into the regno validation switch.
Unify the gen_io_start check between read/write.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210514151342.384376-40-richard.henderson@linaro.org>


  Commit: eb26784fe128d1369056bd708c89c2c327b333e9
      
https://github.com/qemu/qemu/commit/eb26784fe128d1369056bd708c89c2c327b333e9
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/misc_helper.c

  Log Message:
  -----------
  target/i386: Pass env to do_pause and do_hlt

Having the callers upcast to X86CPU is a waste, since we
don't need it.  We even have to recover env in do_hlt.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-41-richard.henderson@linaro.org>


  Commit: 4ea2449b5818a2bb73ea5ac259279e58e4e11a20
      
https://github.com/qemu/qemu/commit/4ea2449b5818a2bb73ea5ac259279e58e4e11a20
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/helper-tcg.h
    M target/i386/tcg/misc_helper.c
    M target/i386/tcg/sysemu/misc_helper.c
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Move invlpg, hlt, monitor, mwait to sysemu

These instructions are all privileged.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-42-richard.henderson@linaro.org>


  Commit: 35e5a5d5cb1096c5ac5df92913df30057978eff7
      
https://github.com/qemu/qemu/commit/35e5a5d5cb1096c5ac5df92913df30057978eff7
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/sysemu/misc_helper.c
    M target/i386/tcg/sysemu/svm_helper.c
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Unify invlpg, invlpga

Use a single helper, flush_page, to do the work.
Use gen_svm_check_intercept.
Perform the zero-extension for invlpga inline.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-43-richard.henderson@linaro.org>


  Commit: 27bd3216a7fda23edff6e60253db36079efc9040
      
https://github.com/qemu/qemu/commit/27bd3216a7fda23edff6e60253db36079efc9040
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/cpu.h
    M target/i386/tcg/user/meson.build
    R target/i386/tcg/user/svm_stubs.c

  Log Message:
  -----------
  target/i386: Inline user cpu_svm_check_intercept_param

The user-version is a no-op.  This lets us completely
remove tcg/user/svm_stubs.c.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-44-richard.henderson@linaro.org>


  Commit: f7803b775919262ccfccba851c0e91a4d34eab08
      
https://github.com/qemu/qemu/commit/f7803b775919262ccfccba851c0e91a4d34eab08
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/translate.c
    M target/i386/tcg/user/misc_stubs.c

  Log Message:
  -----------
  target/i386: Eliminate user stubs for read/write_crN, rd/wrmsr

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-45-richard.henderson@linaro.org>


  Commit: 244843b757220c432e0e9ae8d2210218c034730d
      
https://github.com/qemu/qemu/commit/244843b757220c432e0e9ae8d2210218c034730d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Exit tb after wrmsr

At minimum, wrmsr can change efer, which affects HF_LMA.

Cc: qemu-stable@nongnu.org
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-46-richard.henderson@linaro.org>


  Commit: bc2e436d7c77dda990567e0b308f767ea0f6443d
      
https://github.com/qemu/qemu/commit/bc2e436d7c77dda990567e0b308f767ea0f6443d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Tidy gen_check_io

Get cur_eip from DisasContext.  Do not require the caller
to use svm_is_rep; get prefix from DisasContext.  Use the
proper symbolic constants for SVM_IOIO_*.

While we're touching all call sites, return bool in
preparation for gen_check_io raising #GP.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-47-richard.henderson@linaro.org>


  Commit: 1bca40fe42a97eac3d5c5a5e772ea3ec9e82cc62
      
https://github.com/qemu/qemu/commit/1bca40fe42a97eac3d5c5a5e772ea3ec9e82cc62
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Pass in port to gen_check_io

Pass in a pre-truncated TCGv_i32 value.  We were doing the
truncation of EDX in multiple places, now only once per insn.
While all callers use s->tmp2_i32, for cleanliness of the
subroutine, use a parameter anyway.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-48-richard.henderson@linaro.org>


  Commit: e49780355674a77c174564fd6b34494475876291
      
https://github.com/qemu/qemu/commit/e49780355674a77c174564fd6b34494475876291
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/seg_helper.c
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Create helper_check_io

Drop helper_check_io[bwl] and expose their common
subroutine to tcg directly.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210514151342.384376-49-richard.henderson@linaro.org>


  Commit: d76b9c6f07a2981a44887e1d61d51e016d45417c
      
https://github.com/qemu/qemu/commit/d76b9c6f07a2981a44887e1d61d51e016d45417c
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/seg_helper.c
    M target/i386/tcg/sysemu/seg_helper.c
    M target/i386/tcg/translate.c

  Log Message:
  -----------
  target/i386: Move helper_check_io to sysemu

The we never allow i/o from user-only, and the tss check
that helper_check_io does will always fail.  Use an ifdef
within gen_check_io and return false, indicating that an
exception is known to be raised.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-50-richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 7fb7c42394c032eeaa419c869ff3b50491f6379d
      
https://github.com/qemu/qemu/commit/7fb7c42394c032eeaa419c869ff3b50491f6379d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-05-19 (Wed, 19 May 2021)

  Changed paths:
    M target/i386/helper.h
    M target/i386/tcg/translate.c
    M target/i386/tcg/user/meson.build
    R target/i386/tcg/user/misc_stubs.c

  Log Message:
  -----------
  target/i386: Remove user-only i/o stubs

With the previous patch for check_io, we now have enough for
the compiler to dead-code eliminate all of the i/o helpers.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210514151342.384376-51-richard.henderson@linaro.org>


  Commit: be05216b01d2c8e8441cad2ed350685fff2a509c
      
https://github.com/qemu/qemu/commit/be05216b01d2c8e8441cad2ed350685fff2a509c
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-05-20 (Thu, 20 May 2021)

  Changed paths:
    M target/i386/cpu.h
    M target/i386/helper.h
    M target/i386/tcg/bpt_helper.c
    M target/i386/tcg/excp_helper.c
    M target/i386/tcg/helper-tcg.h
    M target/i386/tcg/misc_helper.c
    M target/i386/tcg/seg_helper.c
    M target/i386/tcg/sysemu/misc_helper.c
    M target/i386/tcg/sysemu/seg_helper.c
    M target/i386/tcg/sysemu/svm_helper.c
    M target/i386/tcg/translate.c
    M target/i386/tcg/user/meson.build
    R target/i386/tcg/user/misc_stubs.c
    R target/i386/tcg/user/svm_stubs.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-x86-20210519' into 
staging

Eliminate user-only helper stubs for privledged insns.

# gpg: Signature made Wed 19 May 2021 19:24:27 BST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" 
[full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth-gitlab/tags/pull-x86-20210519: (50 commits)
  target/i386: Remove user-only i/o stubs
  target/i386: Move helper_check_io to sysemu
  target/i386: Create helper_check_io
  target/i386: Pass in port to gen_check_io
  target/i386: Tidy gen_check_io
  target/i386: Exit tb after wrmsr
  target/i386: Eliminate user stubs for read/write_crN, rd/wrmsr
  target/i386: Inline user cpu_svm_check_intercept_param
  target/i386: Unify invlpg, invlpga
  target/i386: Move invlpg, hlt, monitor, mwait to sysemu
  target/i386: Pass env to do_pause and do_hlt
  target/i386: Cleanup read_crN, write_crN, lmsw
  target/i386: Remove user stub for cpu_vmexit
  target/i386: Remove pc_start argument to gen_svm_check_intercept
  target/i386: Tidy svm_check_intercept from tcg
  target/i386: Simplify gen_debug usage
  target/i386: Mark some helpers as noreturn
  target/i386: Eliminate SVM helpers for user-only
  target/i386: Implement skinit in translate.c
  target/i386: Assert !GUEST for user-only
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/fea2ad71c3e2...be05216b01d2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]