Re: [PATCH v11 02/16] KVM: x86: Use a new flag for branch targets

From: Sean Christopherson
Date: Mon Oct 23 2023 - 12:21:03 EST


On Wed, Sep 13, 2023, Binbin Wu wrote:
> Use the new flag X86EMUL_F_BRANCH instead of X86EMUL_F_FETCH in assign_eip()
> to distinguish instruction fetch and branch target computation for features
> that handle differently on them, e.g. Linear Address Space Separation (LASS).

A slightly different shortlog+changelog:

KVM: x86: Add an emulator flag to differntiate branch targets from fetches

Add an emulator flag, X86EMUL_F_BRANCH, and use it instead of
X86EMUL_F_FETCH in assign_eip() to distinguish between instruction fetch
and branch target computation for features that handle them differently,
e.g. Intel's upcoming Linear Address Space Separation (LASS) applies to
code fetches but not branch target calculations.

The shortlog in particular is far too vague.

> As of this patch, X86EMUL_F_BRANCH and X86EMUL_F_FETCH are identical as far
> as KVM is concerned.

This patch looks good, but I'm going to skip it for now as it's not needed until
LASS is supported, since LAM doesn't differentiate between the two. I.e. this
should have been the first patch in the LASS portion of the series. No need to
repost, it's trivially easy to tweak vmx_get_untagged_addr().