From nobody Sun Feb 8 12:38:23 2026 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; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566554983; cv=none; d=zoho.com; s=zohoarc; b=W0Ydvw4f4TvPujae6mFE2t4CuVz19zGVpOjxrJ7bf0uj5D6KhzSB/zWbHYV9DINbWgsLy1l+ULiyTbVr6WfmxIpwa4o4i7OoB8f/ZWl+spO8fs6N1NyA0WGShqKD/rnrMy0OjpQgvCiP6ZT7Uh2mfxpURaNmsGjfo5QDbuKVJJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566554983; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=QF+G5v/gNkiH/OE7FxMOf2TSRKTgFwwiG/ueKZGyLnk=; b=RlY8sZfBqgEBFKb8YSmhtEbw2cxq4oIJs6Gw+aDGul3gU85KS4eDHT4VnUnZMZeNc/cZqLZcqFEGyIW9N00uxS3qy4rJXLoGrm68dbl1cOlcnGmNnaEpOLXKwyvIzRY77p36L8yUs5SOWgeHLFocalBKyXJtbbcbyccF0wVkUPw= ARC-Authentication-Results: i=1; mx.zoho.com; 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 1566554983061581.9894348624514; Fri, 23 Aug 2019 03:09:43 -0700 (PDT) Received: from localhost ([::1]:53670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i16Vp-0007xO-T3 for importer@patchew.org; Fri, 23 Aug 2019 06:09:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58373) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i16UG-0006Tl-6O for qemu-devel@nongnu.org; Fri, 23 Aug 2019 06:08:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i16UF-00085w-2y for qemu-devel@nongnu.org; Fri, 23 Aug 2019 06:08:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39010) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i16UE-00085H-Tn; Fri, 23 Aug 2019 06:08:03 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 28E7A87648; Fri, 23 Aug 2019 10:08:02 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-2.ams2.redhat.com [10.36.117.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7CF55D6B2; Fri, 23 Aug 2019 10:07:59 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 23 Aug 2019 12:07:36 +0200 Message-Id: <20190823100741.9621-5-david@redhat.com> In-Reply-To: <20190823100741.9621-1-david@redhat.com> References: <20190823100741.9621-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 23 Aug 2019 10:08:02 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v1 4/9] tcg: Enforce single page access in probe_write() for !CONFIG_USER_ONLY 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: Thomas Huth , Riku Voipio , Eduardo Habkost , David Hildenbrand , Aleksandar Rikalo , Cornelia Huck , Aleksandar Markovic , qemu-s390x@nongnu.org, Paolo Bonzini , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" While the CONFIG_USER_ONLY variant can handle multiple pages (no MMU), the !CONFIG_USER_ONLY variant can't and won't. We'll want to convert probe_write() to return a host address (similar to tlb_vaddr_to_host()) soon. This only works on page granularity. Signed-off-by: David Hildenbrand Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index bb9897b25a..4b49ccb58a 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1064,6 +1064,8 @@ void probe_write(CPUArchState *env, target_ulong addr= , int size, int mmu_idx, uintptr_t index =3D tlb_index(env, mmu_idx, addr); CPUTLBEntry *entry =3D tlb_entry(env, mmu_idx, addr); =20 + g_assert(-(addr | TARGET_PAGE_MASK) >=3D size); + if (!tlb_hit(tlb_addr_write(entry), addr)) { /* TLB entry is for a different page */ if (!VICTIM_TLB_HIT(addr_write, addr)) { --=20 2.21.0