From patchwork Tue Sep 3 16:08:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172879 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp101619ily; Tue, 3 Sep 2019 09:46:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5QQN7EyQWcv5+gllPmIjXXutgRuZcLZY8Ynvuv2uWiUVV8m/cmNkMZEs/FJRmyFa6Xzcg X-Received: by 2002:a50:e70c:: with SMTP id a12mr36784089edn.73.1567529169674; Tue, 03 Sep 2019 09:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567529169; cv=none; d=google.com; s=arc-20160816; b=FLeZrA1uugl3lE4SjCns+eWijYwpIcnOWU675XdioisKMsM1kLbxKp0AbpXvXPfq9S tsWXJ0CafDADiVoGRNt1j5GO6fw7yY4ViYOefTjyVFXrM+g1xdlU3DYLIgX24ClQYQqY wKNDoBtvvZxMiE35Ou5MjWlhAihtwx5dVMr3j144pZjdo+wkcSl5SgFRMOuUA2yvyxC8 0aTNJBBLk6o91Rn0XKnFDgEj0qz/OtFbCA2S10KxfikbckYq2u3/Y/uvoDQw94LJcdAq XUvl1qvArSfEi8OsLbEuY1qb6HutthKyFeD9+4ihFcpIfmuZ5RAU0NCwFpy9rEaiKtJH IBdQ== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=ASZrnUVNw1EnObJqzoqrzFIEtS3wN2N/5E4ps5Lqe9o=; b=0DwVaLndH6qftD8zYUXTpDxmrl2tkaI80/sHhlPNEi9fCpzN4+KYdGHXIsWgW2PZCp GCk7XlNDPtouMwwohOGsoRGX9s1Wx5xc9SN7yM2rQM8HG30ImGAX+P84mTEPdld5uBfz iUWuxn2qLQfQs96O5ZDzfeunwctLR0Dc4v3W5e1i7glgVXbgjzQ7tmfa0ZXxkGkFFdM4 P64Za5vpr7NP5mTxRy0sWSRVKG8c+LWETFu5/iuqUkUI5PN+8S19DVB72k9SwQMz6LBU PZAl5BKGR7QL//mex+Rfj5v2CJ7ZHF9aGThnubkdOvGQ/WYUOCZlGYVVtY/wxklA3Ugs LVSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zvfjo5sY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id uz2si7836765ejb.367.2019.09.03.09.46.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Sep 2019 09:46:09 -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=fail header.i=@linaro.org header.s=google header.b=zvfjo5sY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5BwV-0008RS-Qs for patch@linaro.org; Tue, 03 Sep 2019 12:46:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37477) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5BNG-0001iq-HI for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5BNF-00044q-7x for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:42 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:37703) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5BNF-00043R-28 for qemu-devel@nongnu.org; Tue, 03 Sep 2019 12:09:41 -0400 Received: by mail-pg1-x543.google.com with SMTP id d1so9401959pgp.4 for ; Tue, 03 Sep 2019 09:09:40 -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; bh=ASZrnUVNw1EnObJqzoqrzFIEtS3wN2N/5E4ps5Lqe9o=; b=zvfjo5sYhkdyjbZXsCQqzQI06vNlQLyxCL6wsheClkvO9XYP806S/26y3uC/n6N2yX 7zoxztX0ErHjY20eS+woLGII9ptmmJtjkJIVVQH5tfYc5V/Fs6LUoct1GjVLv0/3vihD M5vNxNvE27nVn2oMj+/UeiYq3iecJ+o9AZ9OU0hB1NgBgmUVQLmvE4GOT/jn1KqsmT0V uhJHe39og0Q+6tBn9FVCLgv7JOMaKQYOVlmumYLraorXFk5Y4eRbLjsN5cu/AZE10wBE y+BFB8isoiEYRmXW4gN+LseS38OmtmQ9yvLVcSao0bFRP08taI6XCFuFHtN23gawcGX7 LLqA== 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; bh=ASZrnUVNw1EnObJqzoqrzFIEtS3wN2N/5E4ps5Lqe9o=; b=KVc9lhYvuu10+GOU4IXvnN5wXHQUOhl+aEaHSxvfuOhIn6Eb8hDEHsUNH3+8xbGOTx r4IAmkcUTzo1/0FVk1osQe80/rXi/2lha+YdqFU35IICIgX8mhYIi8j8wSekdeVv+dVV wc0HXOEyA0G+saioPs64Uhj8KvuY0C/T+ax/8eA2+oI0ubFmCNA1hGVu5uJXdQhWOdes AkVfPmYZsLATt4NWF1tgmTJjJjWfhN2J24VGds8avkHqZWLZhPgJfpSzUdDONaHzrNJJ T3doVZwnnAUMoZNvUpB7t24/ePG5N14rC+TMKUlAnJ5x7DW+AqnDdiIqSoYXeg5xVcHf N0cA== X-Gm-Message-State: APjAAAV5/Ra5NJ2Rxhc0z2tLJiqfJFsFISwWMGsaTzd0Ra1w+IlLSc02 I0FKTArhPQ3JlZawXE3zkuCVEHuF0SU= X-Received: by 2002:a65:62cd:: with SMTP id m13mr30803106pgv.437.1567526979192; Tue, 03 Sep 2019 09:09:39 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id 127sm28089711pfy.56.2019.09.03.09.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2019 09:09:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 3 Sep 2019 09:08:54 -0700 Message-Id: <20190903160858.5296-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190903160858.5296-1-richard.henderson@linaro.org> References: <20190903160858.5296-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH 32/36] mips/tcg: Call probe_write() for CONFIG_USER_ONLY as well X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: David Hildenbrand Let's call it also for CONFIG_USER_ONLY. While at it, add a FIXME and get rid of one local variable. MIPS code probably needs a bigger refactoring in regards of ensure_writable_pages(), similar to s390x, so for example, watchpoints can be handled reliably later. The actually accessed addresses should be probed only, not full pages. Signed-off-by: David Hildenbrand Reviewed-by: Aleksandar Markovic Message-Id: <20190826075112.25637-6-david@redhat.com> Signed-off-by: Richard Henderson --- target/mips/op_helper.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 34bcc8d884..08d9a4f9f1 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -4537,16 +4537,14 @@ static inline void ensure_writable_pages(CPUMIPSState *env, int mmu_idx, uintptr_t retaddr) { -#if !defined(CONFIG_USER_ONLY) - target_ulong page_addr; + /* FIXME: Probe the actual accesses (pass and use a size) */ if (unlikely(MSA_PAGESPAN(addr))) { /* first page */ probe_write(env, addr, 0, mmu_idx, retaddr); /* second page */ - page_addr = (addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE; - probe_write(env, page_addr, 0, mmu_idx, retaddr); + addr = (addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE; + probe_write(env, addr, 0, mmu_idx, retaddr); } -#endif } void helper_msa_st_b(CPUMIPSState *env, uint32_t wd,