Received: from eggs.gnu.org ([2001:4830:134:3::10]:60303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZD726-0001bP-BJ for qemu-devel@nongnu.org; Thu, 09 Jul 2015 04:18:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZD724-0002Lj-Rs for qemu-devel@nongnu.org; Thu, 09 Jul 2015 04:18:14 -0400 Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:33362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZD724-0002LT-MP for qemu-devel@nongnu.org; Thu, 09 Jul 2015 04:18:12 -0400 Received: by oiyy130 with SMTP id y130so184364561oiy.0 for ; Thu, 09 Jul 2015 01:18:12 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Thu, 9 Jul 2015 09:17:26 +0100 Message-Id: <1436429849-18052-12-git-send-email-rth@twiddle.net> In-Reply-To: <1436429849-18052-1-git-send-email-rth@twiddle.net> References: <1436429849-18052-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 11/14] 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, ehabkost@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 1aec8a5..c8d5fac 100644 --- a/target-i386/mem_helper.c +++ b/target-i386/mem_helper.c @@ -91,6 +91,9 @@ void helper_boundw(CPUX86State *env, target_ulong a0, int v) high = cpu_ldsw_data(env, a0 + 2); v = (int16_t)v; if (v < low || v > high) { + if (env->hflags & HF_MPX_EN_MASK) { + env->bndcs_regs.sts = 0; + } raise_exception(env, EXCP05_BOUND); } } @@ -102,6 +105,9 @@ void helper_boundl(CPUX86State *env, target_ulong a0, int v) low = cpu_ldl_data(env, a0); high = cpu_ldl_data(env, a0 + 4); if (v < low || v > high) { + if (env->hflags & HF_MPX_EN_MASK) { + env->bndcs_regs.sts = 0; + } raise_exception(env, EXCP05_BOUND); } } -- 2.4.3