This is a note to let you know that I have just added a patch titled

    MIPS: KVM: Fix CACHE immediate offset sign extension

to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree 
which can be found at:

This patch is scheduled to be released in version 3.19.8-ckt12.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.19.y-ckt tree, see



>From bedcce3ca0a4a2032ee93d2b584fb9d7e2742b47 Mon Sep 17 00:00:00 2001
From: James Hogan <>
Date: Wed, 11 Nov 2015 14:21:19 +0000
Subject: MIPS: KVM: Fix CACHE immediate offset sign extension

commit c5c2a3b998f1ff5a586f9d37e154070b8d550d17 upstream.

The immediate field of the CACHE instruction is signed, so ensure that
it gets sign extended by casting it to an int16_t rather than just
masking the low 16 bits.

Fixes: e685c689f3a8 ("KVM/MIPS32: Privileged instruction/target branch 
Signed-off-by: James Hogan <>
Cc: Ralf Baechle <>
Cc: Paolo Bonzini <>
Cc: Gleb Natapov <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kamal Mostafa <>
 arch/mips/kvm/emulate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c
index 838d3a6..3d44b2d 100644
--- a/arch/mips/kvm/emulate.c
+++ b/arch/mips/kvm/emulate.c
@@ -1407,7 +1407,7 @@ enum emulation_result kvm_mips_emulate_cache(uint32_t 
inst, uint32_t *opc,

        base = (inst >> 21) & 0x1f;
        op_inst = (inst >> 16) & 0x1f;
-       offset = inst & 0xffff;
+       offset = (int16_t)inst;
        cache = (inst >> 16) & 0x3;
        op = (inst >> 18) & 0x7;


To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to
More majordomo info at

Reply via email to