OSDN Git Service

mips: Improve segment defs for KVM T&E guests
authorJames Hogan <james.hogan@imgtec.com>
Mon, 31 Jul 2017 13:09:12 +0000 (14:09 +0100)
committerYongbok Kim <yongbok.kim@imgtec.com>
Wed, 2 Aug 2017 16:01:27 +0000 (17:01 +0100)
commit6743334568933199927af4992a04bfb3c30610f5
tree754a77cfc61688ae1902d11c29df6b18a7e8745b
parent9652ef24bfaf59ba179787503fdf7eae6e95475b
mips: Improve segment defs for KVM T&E guests

Improve the segment definitions used by get_physical_address() to yield
target_ulong types, e.g. 0xffffffff80000000 instead of 0x80000000. This
is in preparation for enabling emulation of MIPS KVM T&E segments in TCG
MIPS targets, which unlike KVM could potentially have 64-bit
target_ulong. In such a case the offset guest KSEG0 address ends up at
e.g. 0x000000008xxxxxxx instead of 0xffffffff8xxxxxxx.

This also allows the casts to int32_t that force sign extension to be
removed, which removes any confusion due to relational comparison of
unsigned (target_ulong) and signed (int32_t) types.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Yongbok Kim <yongbok.kim@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
target/mips/helper.c