Hi, I'm sending this early to ventana-sw as we hit the issue in today's
slack discussion. I only compile-tested it so far and it will take me a
while to trigger a bug and verify the solution.
---8<--
The smstateen CSRs control which stateful features are enabled in
VU-mode. SU-mode must properly context switch the state of all enabled
features.
Reset the smstateen CSRs, because SU-mode might not know that it must
context switch the state. Reset unconditionally as it is shorter and
safer, and not that much slower.
Fixes: 81f0f314fec9 ("RISCV: KVM: Add sstateen0 context save/restore")
Cc: stable(a)vger.kernel.org
Signed-off-by: Radim Krčmář <rkrcmar(a)ventanamicro.com>
---
arch/riscv/include/asm/kvm_host.h | 3 +++
arch/riscv/kvm/vcpu.c | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h
index cc33e35cd628..1e9fe3cbecd3 100644
--- a/arch/riscv/include/asm/kvm_host.h
+++ b/arch/riscv/include/asm/kvm_host.h
@@ -234,6 +234,9 @@ struct kvm_vcpu_arch {
/* CPU CSR context upon Guest VCPU reset */
struct kvm_vcpu_csr guest_reset_csr;
+ /* CPU smstateen CSR context upon Guest VCPU reset */
+ struct kvm_vcpu_smstateen_csr reset_smstateen_csr;
+
/*
* VCPU interrupts
*
diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c
index 60d684c76c58..b11b4027a859 100644
--- a/arch/riscv/kvm/vcpu.c
+++ b/arch/riscv/kvm/vcpu.c
@@ -57,6 +57,8 @@ static void kvm_riscv_reset_vcpu(struct kvm_vcpu *vcpu)
struct kvm_vcpu_csr *reset_csr = &vcpu->arch.guest_reset_csr;
struct kvm_cpu_context *cntx = &vcpu->arch.guest_context;
struct kvm_cpu_context *reset_cntx = &vcpu->arch.guest_reset_context;
+ struct kvm_vcpu_smstateen_csr *smstateen_csr = &vcpu->arch.smstateen_csr;
+ struct kvm_vcpu_smstateen_csr *reset_smstateen_csr = &vcpu->arch.reset_smstateen_csr;
bool loaded;
/**
@@ -73,6 +75,8 @@ static void kvm_riscv_reset_vcpu(struct kvm_vcpu *vcpu)
memcpy(csr, reset_csr, sizeof(*csr));
+ memcpy(smstateen_csr, reset_smstateen_csr, sizeof(*smstateen_csr));
+
spin_lock(&vcpu->arch.reset_cntx_lock);
memcpy(cntx, reset_cntx, sizeof(*cntx));
spin_unlock(&vcpu->arch.reset_cntx_lock);
--
2.48.1
This patch series contains some missing openvswitch port output fixes
for the stable 5.4 kernel.
Changes in v2:
- use BUILD_BUG_ON_INVALID rather than DEBUG_NET_WARN_ON_ONCE which does
not exist in Linux 5.4
Felix Huettner (1):
net: openvswitch: fix race on port output
Ilya Maximets (1):
openvswitch: fix lockup on tx to unregistering netdev with carrier
net/core/dev.c | 1 +
net/openvswitch/actions.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
--
2.34.1
This patch series contains some missing openvswitch port output fixes
for the stable 5.10 kernel.
Changes in v2:
- use BUILD_BUG_ON_INVALID rather than DEBUG_NET_WARN_ON_ONCE which does
not exist in Linux 5.10
Felix Huettner (1):
net: openvswitch: fix race on port output
Ilya Maximets (1):
openvswitch: fix lockup on tx to unregistering netdev with carrier
net/core/dev.c | 1 +
net/openvswitch/actions.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
--
2.34.1
Hello
I am keen to exchange thoughts on financial opportunities with you. If it
aligns with your preferences, I would appreciate your WhatsApp contact
details for a more fluid dialogue. Should that not suit, please let me know
a convenient time for us to correspond directly.
Thank you for your kind consideration. I eagerly anticipate your reply.
Warm regards,
General Johanne