From nobody Mon Feb 9 23:40:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1486660377869834.1046872492526; Thu, 9 Feb 2017 09:12:57 -0800 (PST) Received: from localhost ([::1]:39151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbsHA-0000tH-J0 for importer@patchew.org; Thu, 09 Feb 2017 12:12:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbsDW-0006NC-6B for qemu-devel@nongnu.org; Thu, 09 Feb 2017 12:09:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbsDT-0002UO-Sb for qemu-devel@nongnu.org; Thu, 09 Feb 2017 12:09:10 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36375) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cbsDT-0002UF-Ld for qemu-devel@nongnu.org; Thu, 09 Feb 2017 12:09:07 -0500 Received: by mail-wm0-x22c.google.com with SMTP id c85so237593514wmi.1 for ; Thu, 09 Feb 2017 09:09:07 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e72sm9784577wma.16.2017.02.09.09.08.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 09:09:02 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id D794C3E2D6D; Thu, 9 Feb 2017 17:09:05 +0000 (GMT) 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=1KXA5KwXZSok3ABWG8NWl4fzC0thcYoHp+qAltY0myc=; b=GT7rpOR4PCLSRRmL+U22YbbU2EIAoX+C7NHysHiSZnQl+3vEAkShfgtt/LtkG8wz2m It4ijxtFmN5JA7JDPmECO4HU2NHqy1O1yod4IbM7+S5mSkFNxl2dIbquWzYZrHRm/nCx ceBrHmXtwPWoPPbFjYlLAWK+YA8p0Ve0467ws= 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=1KXA5KwXZSok3ABWG8NWl4fzC0thcYoHp+qAltY0myc=; b=poWwtN/xIUsJSaam7VTvrYT9TPm8j/MjWgpX4x3ODVhOO9bDfleT5KYmM6sY/y14PI Bbd1uNJllMPo5vPTTJOTbHvX0gp/7TwgutyGWYEY+No8UtCxbFab77lwE/pcjc8EvsLo 3QaKGIFJGwgduFRhzINWnnh3ZjDeiEVfMKaMLJmLSsZHF3J5r6zt/101ZjTdWl+ddA8p p4ar1qM2+AhTfzwEdP5gx7GtpmLzQ2fGxNErU9HgZmzA5X3m19Kq8o+wFiI23q5Ndl54 0b5SyxDtN4uAuDZuQYK4+KoO4U+dPc03j28fpttFxNUg49hnYL2o68QjCrnI7ZM4dUKW HRyQ== X-Gm-Message-State: AMke39mgvgwd3sC48v10HK5FxIxCoogoqFekvdaheE/gZWkPPpIAtGBuSDgbuYIKh2B/ksaV X-Received: by 10.28.64.132 with SMTP id n126mr25177461wma.107.1486660146657; Thu, 09 Feb 2017 09:09:06 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net Date: Thu, 9 Feb 2017 17:08:54 +0000 Message-Id: <20170209170904.5713-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170209170904.5713-1-alex.bennee@linaro.org> References: <20170209170904.5713-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22c Subject: [Qemu-devel] [PATCH v11 14/24] cputlb: tweak qemu_ram_addr_from_host_nofail reporting X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mttcg@listserver.greensocs.com, nikunj@linux.vnet.ibm.com, Peter Crosthwaite , jan.kiszka@siemens.com, mark.burton@greensocs.com, a.rigo@virtualopensystems.com, qemu-devel@nongnu.org, cota@braap.org, serge.fdrv@gmail.com, pbonzini@redhat.com, bobby.prani@gmail.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , bamvor.zhangjian@linaro.org, fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 This moves the helper function closer to where it is called and updates the error message to report via error_report instead of the deprecated fprintf. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- cputlb.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cputlb.c b/cputlb.c index af0e65cd2c..94fa9977c5 100644 --- a/cputlb.c +++ b/cputlb.c @@ -246,18 +246,6 @@ void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry, uin= tptr_t start, } } =20 -static inline ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr) -{ - ram_addr_t ram_addr; - - ram_addr =3D qemu_ram_addr_from_host(ptr); - if (ram_addr =3D=3D RAM_ADDR_INVALID) { - fprintf(stderr, "Bad ram pointer %p\n", ptr); - abort(); - } - return ram_addr; -} - void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length) { CPUArchState *env; @@ -469,6 +457,18 @@ static void report_bad_exec(CPUState *cpu, target_ulon= g addr) log_cpu_state_mask(LOG_GUEST_ERROR, cpu, CPU_DUMP_FPU | CPU_DUMP_CCOP); } =20 +static inline ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr) +{ + ram_addr_t ram_addr; + + ram_addr =3D qemu_ram_addr_from_host(ptr); + if (ram_addr =3D=3D RAM_ADDR_INVALID) { + error_report("Bad ram pointer %p", ptr); + abort(); + } + return ram_addr; +} + /* NOTE: this function can trigger an exception */ /* NOTE2: the returned address is not exactly the physical address: it * is actually a ram_addr_t (in system mode; the user mode emulation --=20 2.11.0