From patchwork Thu Aug 22 22:43:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Markus X-Patchwork-Id: 269225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F1A0D2C00B9 for ; Fri, 23 Aug 2013 08:43:40 +1000 (EST) Received: from localhost ([::1]:34110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCdbN-0005y0-H3 for incoming@patchwork.ozlabs.org; Thu, 22 Aug 2013 18:43:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCdav-0005mI-VM for qemu-devel@nongnu.org; Thu, 22 Aug 2013 18:43:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCdan-0007el-C5 for qemu-devel@nongnu.org; Thu, 22 Aug 2013 18:43:09 -0400 Received: from mo6-p00-ob.rzone.de ([2a01:238:20a:202:5300::1]:36657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCdan-0007dW-4s for qemu-devel@nongnu.org; Thu, 22 Aug 2013 18:43:01 -0400 X-RZG-AUTH: :OGMGfEG7W/Jia0H4RdpQ6UBM+orSOYYzpexsp56HbPjosKXQJaSMgJFcBBQMZJTpSexUkILviA== X-RZG-CLASS-ID: mo00 Received: from [192.168.124.122] (x2f0a841.dyn.telefonica.de [2.240.168.65]) by smtp.strato.de (RZmta 31.45 DYNA|AUTH) with (DHE-RSA-CAMELLIA256-SHA encrypted) ESMTPA id R04042p7MKCOkD for ; Fri, 23 Aug 2013 00:42:57 +0200 (CEST) Message-ID: <521693F5.1030501@markus-regensburg.de> Date: Fri, 23 Aug 2013 00:43:01 +0200 From: Tobias Markus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130806 Thunderbird/17.0.8 MIME-Version: 1.0 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:238:20a:202:5300::1 Subject: [Qemu-devel] [PATCH] target-i386: Fix segment cache dump X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When in Long Mode, cpu_x86_seg_cache() logs "DS16" because the Default operation size bit (D/B bit) is not set for Long Mode Data Segments since there are only Data Segments in Long Mode and no explicit 16/32/64-bit Descriptors. This patch fixes this by checking the Long Mode Active bit of the hidden flags variable and logging "DS" if it is set, i.e. in Long Mode all Data Segments are logged as "DS". Signed-off-by: Tobias Markus --- Note that alternatively, Data Segments in Long Mode could be logged as "DS64" to avoid confusion about the missing 64 postfix. (But that would be, strictly speaking, wrong because there are only DSs and no DS16/32/64 in Long Mode.) PS: This is my first contribution to an Open Source Project and I would be very happy about constructive feedback, especially about possible wrong word wrapping. target-i386/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (sc->flags & DESC_W_MASK) ? 'W' : '-'); } diff --git a/target-i386/helper.c b/target-i386/helper.c index bf3e2ac..a8facdf 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -147,7 +147,7 @@ cpu_x86_dump_seg_cache(CPUX86State *env, FILE *f, fprintf_function cpu_fprintf, cpu_fprintf(f, " [%c%c", (sc->flags & DESC_C_MASK) ? 'C' : '-', (sc->flags & DESC_R_MASK) ? 'R' : '-'); } else { - cpu_fprintf(f, (sc->flags & DESC_B_MASK) ? "DS " : "DS16"); + cpu_fprintf(f, (sc->flags & DESC_B_MASK || env->hflags & HF_LMA_MASK) ? "DS " : "DS16"); cpu_fprintf(f, " [%c%c", (sc->flags & DESC_E_MASK) ? 'E' : '-',