From nobody Sat Apr 5 01:21:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1567529230; cv=none; d=zoho.com; s=zohoarc; b=EGeaunfZMP26ux5YC1STj0eLwO6wmTdNJx3BmIOOQibj6PUCeKOinN0Id6vLFtQ4oWq1eaULBc59MkJ14x8vIoJJE+9QFc5PJGRzaPdPyRTtjWJs8UxYhPn6VlorecMX1AIMKLSPNQ/idDnzQ9ixm1D0mCbOVdAHawH7K13JhkM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567529230; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ASZrnUVNw1EnObJqzoqrzFIEtS3wN2N/5E4ps5Lqe9o=; b=VYCZqR6XyDIjgni0vOLkyFclEDTJh7QLzx4RO9mnG7Fm4CdQ+mg4GtGaAmPIZhd8npfzDHuahZhRkNpNfstBkyGeHXkXuqdzMKy3sfwmnKDs8mYIb+KzSrOsGdgOlQVUnizxz9UcryfmEbb6eehIaLH7TTlTkDlhyeuHyaMn45Q= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156752923043154.98055060011552; Tue, 3 Sep 2019 09:47:10 -0700 (PDT) Received: from localhost ([::1]:49252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5BxV-0001pC-Cm for importer@patchew.org; Tue, 03 Sep 2019 12:47:09 -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) 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) 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-Google-Smtp-Source: APXvYqwgaae8XFw9JDoSWQY05X7PcNI7q3o+M7CyVk+mhNZRBuNx5Y60/1JEv6gw/iiF/NNu6+8CSw== X-Received: by 2002:a65:62cd:: with SMTP id m13mr30803106pgv.437.1567526979192; Tue, 03 Sep 2019 09:09:39 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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(CPUMIPSSta= te *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 =3D (addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE; - probe_write(env, page_addr, 0, mmu_idx, retaddr); + addr =3D (addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE; + probe_write(env, addr, 0, mmu_idx, retaddr); } -#endif } =20 void helper_msa_st_b(CPUMIPSState *env, uint32_t wd, --=20 2.17.1