From patchwork Fri Aug 19 03:26:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 598478 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp1065964mae; Thu, 18 Aug 2022 20:34:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR6weyjh3M2g2Deb9s5kXWoT3egwanuHOJWClpM1rMgvwg6sJQOZbib+FevGARMA1Xmcffov X-Received: by 2002:a05:620a:410b:b0:6bb:ac0e:192b with SMTP id j11-20020a05620a410b00b006bbac0e192bmr4255022qko.264.1660880065063; Thu, 18 Aug 2022 20:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660880065; cv=none; d=google.com; s=arc-20160816; b=E6HD9eNeC/x5bdDuz6F9/yBYSm9lgULZF4X5xrNuezzTUpXPyThnyHKGF4WduUIBz7 iYo+4wq1tiOecgBZAnKtPFfyYvHY8/uRERgZL0HVJ7YDACOAhNoI17b4FIv+CLfINREI 1DFOjOUO9vQMr/nQryD7xxw4D1ucFyw1hWZobnCXjr2j9NCzGoG+5VOUvPIfMmbNOqXM 78O1c8rxZrkK0fuRyx0VNlMFEVsIAbNWTzJAvXMsDDh4fgJG4Vjd/rJIRUXvnF7NIFke pvq+EsexknqN38palG/OCwHd/AVO0KpRRlpxSZjDHpXMFKo26knXc5kqpIdC3l2Rs7j6 w+Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=zDz/TIezAGhDTjjMc0+1pA+Hd7qL30qFYVrbSwswVFk=; b=HQtuq+glkuAsY68rK4VwH4PrdTbWxuE8jBcG0y+oMbR9QECnpj4XV0AbsBGoYYDRz7 sCqpwHCrPxIFOnemOnzr9J/31PBh7Kts2WoDH/f1vo+oFZCtzCXUP4T5+PRDl/idMblH sFJuSgwsPlvg9FmSutaROQC/r2HhR4G+2tBBHkvZvuQXBDq8pilSgzpbArOrmzvkHpLZ MFG+5swTso/RrGTjR69lqttMDw1CzPHLck/HMRmLOXd2VXiaw8a73SE7gD2dvkvTnytH cKWHS9l+pJHHq9TtvA3Cat9PQ15q2eQqO+/G+awcSsHtMass0CHms6uXrlm62P4hV2i3 tbMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U+2p8ax6; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r7-20020ac867c7000000b0034307e77feesi1444361qtp.185.2022.08.18.20.34.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Aug 2022 20:34:25 -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=U+2p8ax6; 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]:54430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOsm6-0004Wi-W3 for patch@linaro.org; Thu, 18 Aug 2022 23:34:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOseX-0001t2-E3 for qemu-devel@nongnu.org; Thu, 18 Aug 2022 23:26:33 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:33344) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oOseV-0002ky-QO for qemu-devel@nongnu.org; Thu, 18 Aug 2022 23:26:33 -0400 Received: by mail-pl1-x62e.google.com with SMTP id 2so3132048pll.0 for ; Thu, 18 Aug 2022 20:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=zDz/TIezAGhDTjjMc0+1pA+Hd7qL30qFYVrbSwswVFk=; b=U+2p8ax6lMUONdaDQ+mL3Ay/Rl4HuoGYrPdClY0w92nsEcMQW8QaqzBJOqrNpLy9/4 SDXxgdGy/+8T79dGElH4fBq9NsD4u7B8HAcqNzv+sg83eD+v+jrrCXK8Xwxk8CGmc4Lg ziWn1wuASavlZM8p2Nyh9nOhF4bA2n+bPJxK4V9/FTbry26J0kHGgm4FNjfPG36TWtyg k9aYpv3J/HYoWgiNvVbxRkusuIQuU4c6A0DYw++HHiPGnAhXDJippSoe11+IhdpbfYe1 qJ3oDVmoOfOy+pDTw/bsZpfv04f6qXd2pHGRAb/lHOWtvX2fXm4WQp4983HfHZrW9EHd rraQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=zDz/TIezAGhDTjjMc0+1pA+Hd7qL30qFYVrbSwswVFk=; b=dtwhg0vKWCPIvO1rf5MJcXcOc3UhwJsTwTIysDv66j6+tq1kP7tKZx7OpI4s9K+qMt 8Pw0WCO+ZxPl+w0UzMeCNwjJdWom4MeBUktbXD52snfv9tiLekqMtAA3LO9Gq2gr6Jpc rH09HowOeTLLcSI33WguyculT+HHZGy8SNolJ1hRcyuRYmatxHCnJQ4nCrE8upROkkVM IxNiHGEfvESWvVv5tOBuoH67vzxP3XexNvnWmm0lPpSeOHzydqL3Tz4q1BkYajMu43O9 E2qTj1YaLGwNRG5a6brHxBm14HQ7leiYP8tspLoTxVOVoSjIcRHPnE76MGYoTeO7GoN5 j3qg== X-Gm-Message-State: ACgBeo3zfrH1DHNdm+B3LomwmaFLaa9ZqWrkL12W4Jdszs5JfI/2FWJ1 ODQEJ9FBgd7BPgE6HqdLHBnb6sD7SNW4tA== X-Received: by 2002:a17:90b:4b05:b0:1f5:b540:de3a with SMTP id lx5-20020a17090b4b0500b001f5b540de3amr6201352pjb.43.1660879589480; Thu, 18 Aug 2022 20:26:29 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:bbf3:9914:aa9c:3b4e]) by smtp.gmail.com with ESMTPSA id g184-20020a6252c1000000b00535d19c46d7sm2199904pfb.203.2022.08.18.20.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 20:26:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, iii@linux.ibm.com, dramforever@live.com, alistair.francis@wdc.com, alex.bennee@linaro.org Subject: [PATCH v6 11/21] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c Date: Thu, 18 Aug 2022 20:26:05 -0700 Message-Id: <20220819032615.884847-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220819032615.884847-1-richard.henderson@linaro.org> References: <20220819032615.884847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The base qemu_ram_addr_from_host function is already in softmmu/physmem.c; move the nofail version to be adjacent. Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis --- include/exec/cpu-common.h | 1 + accel/tcg/cputlb.c | 12 ------------ softmmu/physmem.c | 12 ++++++++++++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 2281be4e10..d909429427 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -72,6 +72,7 @@ typedef uintptr_t ram_addr_t; void qemu_ram_remap(ram_addr_t addr, ram_addr_t length); /* This should not be used by devices. */ ram_addr_t qemu_ram_addr_from_host(void *ptr); +ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr); RAMBlock *qemu_ram_block_by_name(const char *name); RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset, ram_addr_t *offset); diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 43bd65c973..80a3eb4f1c 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1283,18 +1283,6 @@ void tlb_set_page(CPUState *cpu, target_ulong vaddr, prot, mmu_idx, size); } -static inline ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr) -{ - ram_addr_t ram_addr; - - ram_addr = qemu_ram_addr_from_host(ptr); - if (ram_addr == RAM_ADDR_INVALID) { - error_report("Bad ram pointer %p", ptr); - abort(); - } - return ram_addr; -} - /* * Note: tlb_fill() can trigger a resize of the TLB. This means that all of the * caller's prior references to the TLB table (e.g. CPUTLBEntry pointers) must diff --git a/softmmu/physmem.c b/softmmu/physmem.c index dc3c3e5f2e..d4c30e99ea 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -2460,6 +2460,18 @@ ram_addr_t qemu_ram_addr_from_host(void *ptr) return block->offset + offset; } +ram_addr_t qemu_ram_addr_from_host_nofail(void *ptr) +{ + ram_addr_t ram_addr; + + ram_addr = qemu_ram_addr_from_host(ptr); + if (ram_addr == RAM_ADDR_INVALID) { + error_report("Bad ram pointer %p", ptr); + abort(); + } + return ram_addr; +} + static MemTxResult flatview_read(FlatView *fv, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr len); static MemTxResult flatview_write(FlatView *fv, hwaddr addr, MemTxAttrs attrs,