Message ID | 20210519183050.875453-6-richard.henderson@linaro.org |
---|---|
State | Accepted |
Commit | ca7874c2fa6502c612514024632cd6ae4a46641f |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1582214jac; Wed, 19 May 2021 11:34:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwscE6BB+QirFWVTxleWKeKmy50Y4h0AECKREPSY6EaOkcxqliwyEkmTMQhxGl6aE7LqqCW X-Received: by 2002:a5e:9e4a:: with SMTP id j10mr960373ioq.52.1621449291204; Wed, 19 May 2021 11:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621449291; cv=none; d=google.com; s=arc-20160816; b=l/ishvRhwe9Hu8urIglUEFsCq9GqND01tLqvmeaS/T+ne7KXPb71J4U8TEZLU2mZIh UqkuMKmt19geRtSGbbCue5V7qJFclml+TMuXVac0chlR8zKMgPwxW+I92l2vZnp8b3Ae lrH9OTVBsIr2kV1Gu4UjSH2sVwUvQMT0uAbfcU3zh1aJXv9N0ikRHgK3wgiKJNtrJoaK Sh0uVKDifOYnjfANR7NxCC81YpInbHIDCKYo8Z8ADv60rpnoWxJ/ZPyYqsggoedJ6yJE otpny38kfrSV1Z7zzsVXIIfx9Q4s7rqGiESQqzyzSQTgzmJsQ//wIcRKFd92KYNyvRG0 YvVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=NjWJ8kBHVuAatpMu3NeT86JZz0YPmJ7lsGR0prh67KA=; b=k4FsTZzzB6LutGgKbMe403dt3lCVSSHvUwIfY/74YiELUDYifZnC5/J2qI7kD7WNlQ PVmlM0yxeC+GzfkRn7f6NR4nI8O0xuLz7k9taersaCydemsglzYVTGdX5aBiJE4nwAc0 wOmyjDw44K8FU9vZ6RjS7oZ51r9NeUelBnT7XqA8xfvcsXi0KZJ8oGx9Ezdm1WhQzyWe GMJP21O1hOvLpbQY0pyX8U/JhXCZmjUR46sLfDlQZ5Th8OZNLjE8RvJUVaDOTch/SbTi Idfln3AU4D8VpujdbPttrAKthowe/eNL0hGiAVRP3jlFFwJ2v+NmFih4dpqgAyq0M1En 1hBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gguHWSEW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a5si428718ilj.12.2021.05.19.11.34.51 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 May 2021 11:34:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gguHWSEW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1ljR1u-0000wj-K1 for patch@linaro.org; Wed, 19 May 2021 14:34:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1ljQyE-0003Oj-PX for qemu-devel@nongnu.org; Wed, 19 May 2021 14:31:02 -0400 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]:34735) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1ljQyA-0005Y2-QV for qemu-devel@nongnu.org; Wed, 19 May 2021 14:31:02 -0400 Received: by mail-oi1-x22f.google.com with SMTP id u11so14004068oiv.1 for <qemu-devel@nongnu.org>; Wed, 19 May 2021 11:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NjWJ8kBHVuAatpMu3NeT86JZz0YPmJ7lsGR0prh67KA=; b=gguHWSEWPLvMsxPzchXoJvvFZeYcHUHDqtX9QMtPDdhZpnCFxsd7MzcUyswvmzmtet 1LvrwewOT6fKYG3iFOSY6AjKa2SzcJZLk51pz3d+H1U4ZogH7LPQ9iWc5RnJbrkc4A3Z 2RPt16hCKbBrZ3xLvk0xVDZqEgkJiMNoeX/Of6epNDc8tKJctZyuBSlyzJY8HKbVH8j5 WRig4TI1Z5r4GE4vfjn6uxsLWARivDyG8uAvfofK2/i5RwR16mGZy1GusO+4jEx69fPR enO4MVZ1Zkqxic189S9+k2/Q6bba+fIXz23mHk+3EgnqkR8Yo0qWzNxmlGg+E8fAb2FV /woQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NjWJ8kBHVuAatpMu3NeT86JZz0YPmJ7lsGR0prh67KA=; b=rZgN4hImHyxuj8u5M7XXKih7D6OIBsJhOvmoHCYzzkeWV5uZnlu46EbHqDFR/2YMYB EQRRxTS2EQt6OeeCcNFrQBAIn3rj1VkoA2FSZGvy6SB81DC7BRwt1K5X4LHhrbTeTlo5 uZx91vNb0Hp+5JaG4tm5Scm6bAbRWAb3bH8tB4kd5SdFydety0njFQjx73bF2h+tXm/+ zqiqMwa2NqdIZxkSZZ4mHmBC2cPEo4T7FiC8FTa3Jz7opqip2InnxzOtcZj7i8hufxSD e4I0UTNtPvV1LnNDiW0Yq20f7N+3P5WHVvxwmUNlq9MXKPDPuH0KDKyJl+61IBx8QOTK 6rpw== X-Gm-Message-State: AOAM530CnA/oBpoMBXg8GbXLfSGkwk3RsFWcLT4j8cS4sbb0AXl4cqbj TFjeZYiOMcfq8r/ZQK9aURrBIIMMAyWUmrDd X-Received: by 2002:aca:280a:: with SMTP id 10mr529541oix.13.1621449057779; Wed, 19 May 2021 11:30:57 -0700 (PDT) Received: from localhost.localdomain ([45.235.253.15]) by smtp.gmail.com with ESMTPSA id l9sm28428oou.43.2021.05.19.11.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 11:30:57 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PULL 05/50] target/i386: Split out check_iopl Date: Wed, 19 May 2021 13:30:05 -0500 Message-Id: <20210519183050.875453-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210519183050.875453-1-richard.henderson@linaro.org> References: <20210519183050.875453-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::22f; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: peter.maydell@linaro.org, Paolo Bonzini <pbonzini@redhat.com> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
target/i386 translate cleanups
|
expand
|
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 74f6024f82..873ed00975 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -1302,6 +1302,16 @@ static bool check_vm86_iopl(DisasContext *s) return false; } +/* Check for iopl allowing access; if not, raise #GP and return false. */ +static bool check_iopl(DisasContext *s) +{ + if (s->vm86 ? s->iopl == 3 : s->cpl <= s->iopl) { + return true; + } + gen_exception_gpf(s); + return false; +} + /* if d == OR_TMP0, it means memory operand (address in A0) */ static void gen_op(DisasContext *s1, int op, MemOp ot, int d) { @@ -7095,28 +7105,16 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu) break; #endif case 0xfa: /* cli */ - if (!s->vm86) { - if (s->cpl <= s->iopl) { - gen_helper_cli(cpu_env); - } else { - gen_exception_gpf(s); - } - } else { - if (s->iopl == 3) { - gen_helper_cli(cpu_env); - } else { - gen_exception_gpf(s); - } + if (check_iopl(s)) { + gen_helper_cli(cpu_env); } break; case 0xfb: /* sti */ - if (s->vm86 ? s->iopl == 3 : s->cpl <= s->iopl) { + if (check_iopl(s)) { gen_helper_sti(cpu_env); /* interruptions are enabled only the first insn after sti */ gen_jmp_im(s, s->pc - s->cs_base); gen_eob_inhibit_irq(s, true); - } else { - gen_exception_gpf(s); } break; case 0x62: /* bound */