Received: from eggs.gnu.org ([2001:4830:134:3::10]:33804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTCLd-0007o5-9I for qemu-devel@nongnu.org; Tue, 09 Feb 2016 12:45:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTCLc-0000sU-JZ for qemu-devel@nongnu.org; Tue, 09 Feb 2016 12:45:09 -0500 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:35429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTCLc-0000s7-DZ for qemu-devel@nongnu.org; Tue, 09 Feb 2016 12:45:08 -0500 Received: by mail-pf0-x241.google.com with SMTP id 66so10270528pfe.2 for ; Tue, 09 Feb 2016 09:45:08 -0800 (PST) Sender: Richard Henderson From: Richard Henderson Date: Wed, 10 Feb 2016 04:43:48 +1100 Message-Id: <1455039832-9133-13-git-send-email-rth@twiddle.net> In-Reply-To: <1455039832-9133-1-git-send-email-rth@twiddle.net> References: <1455039832-9133-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 12/16] target-i386: Update BNDSTATUS for exceptions raised by BOUND List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Signed-off-by: Richard Henderson --- target-i386/mem_helper.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target-i386/mem_helper.c b/target-i386/mem_helper.c index 7de7752..85e7516 100644 --- a/target-i386/mem_helper.c +++ b/target-i386/mem_helper.c @@ -112,6 +112,9 @@ void helper_boundw(CPUX86State *env, target_ulong a0, int v) high = cpu_ldsw_data_ra(env, a0 + 2, GETPC()); v = (int16_t)v; if (v < low || v > high) { + if (env->hflags & HF_MPX_EN_MASK) { + env->bndcs_regs.sts = 0; + } raise_exception_ra(env, EXCP05_BOUND, GETPC()); } } @@ -123,6 +126,9 @@ void helper_boundl(CPUX86State *env, target_ulong a0, int v) low = cpu_ldl_data_ra(env, a0, GETPC()); high = cpu_ldl_data_ra(env, a0 + 4, GETPC()); if (v < low || v > high) { + if (env->hflags & HF_MPX_EN_MASK) { + env->bndcs_regs.sts = 0; + } raise_exception_ra(env, EXCP05_BOUND, GETPC()); } } -- 2.5.0