[PATCH v10 2/9] x86/split_lock: Remove bogus case in handle_guest_split_lock()

From: Xiaoyao Li
Date: Wed Aug 19 2020 - 02:49:16 EST


The bogus case can never happen, i.e., when sld_state == sld_off, guest
won't trigger split lock #AC and of course no handle_guest_split_lock()
will be called.

Besides, drop bogus case also makes future patch easier to remove
sld_state if we reach the alignment that it must be sld_warn or
sld_fatal when handle_guest_split_lock() is called.

Signed-off-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>
---
The alternative would be to remove the "SLD enabled" check from KVM so
that a truly unexpected/bogus #AC would generate a warn. It's not clear
whether or not calling handle_guest_split_lock() iff SLD is enabled was
intended in the long term.
---
arch/x86/kernel/cpu/intel.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index c48b3267c141..5dab842ba7e1 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -1104,9 +1104,8 @@ bool handle_guest_split_lock(unsigned long ip)
return true;
}

- pr_warn_once("#AC: %s/%d %s split_lock trap at address: 0x%lx\n",
- current->comm, current->pid,
- sld_state == sld_fatal ? "fatal" : "bogus", ip);
+ pr_warn_once("#AC: %s/%d fatal split_lock trap at address: 0x%lx\n",
+ current->comm, current->pid, ip);

current->thread.error_code = 0;
current->thread.trap_nr = X86_TRAP_AC;
--
2.18.4