From patchwork Tue Jan 2 01:57:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 759338 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp5856099wrw; Mon, 1 Jan 2024 17:59:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHufXmkXxHlxiwa5SVsdjH/Iy7ClI15FoezJx/JSXWAQ4gYrXy1enKjdbvWndQSz9kZGM4J X-Received: by 2002:a05:6214:238b:b0:680:b342:72c0 with SMTP id fw11-20020a056214238b00b00680b34272c0mr3737431qvb.76.1704160764227; Mon, 01 Jan 2024 17:59:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704160764; cv=none; d=google.com; s=arc-20160816; b=vKKiBNohBUBO5uwm55Co7/V90WzKjmRvzEYyS2YHOugEaqjwCDNhIYWi8+lTWrGHvu WGk3Ggcl4sqLj6KZXwXJ8x2n96jUw1vUtTBm3b9JxcA/MQsKFSxTgQ75wXNR5lpPzBNs TFBpyj70io9dJeiSdIHUzC940thxOgJ+k4fJYWS+c0svbmV7VO9XnMsfhwyTRSkERgKy nobM8QpYim4U5IEGjRdl7salGK+5dtSbbTqWF2I+RejjRYVYDrjET4o53zD+NSJjHu92 IT8YR0Icy4NUW0tXa5lFudf+KGmCpwTFgcirHgX3v9ylRyvf50TpfgL5GQn/fvTwzYuf vXYw== 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:to:from :dkim-signature; bh=/pDTiX/W/3uE1ebfbK0jDL+RrICwab7UesIidaqTDMQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=PI8rppCHmmyIVvD/s180dFYw0XzZ37pHRNAfe743XgffvCss/wkoq8kxr5LEks1M2d OPZ14JnlzKHTOpa9JC645pL+N9VuNgvyZEuGcsNlI1984kqonffLHNw4gTiz3byEADan eulcyAXDWsHUYZrFDDOuXQgkjhfOxeGY04dIAf6aY+x4Flb4zpExNq9nm3Iorpbr/E+p YajOEitulaffLcofU3ErIRlzZ8iAmxXaZ4F6udDGi5iZqKIZan6gXFPKl6tNeD9Ff0YB UCxiu6DWboVBlyp87G2f6loYBAoNYUs2txahs2WPNNHfN3zFxfMBoaDPLHEIW4ZjNI7S ujKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mta5MaAf; 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 s15-20020a0ce30f000000b0067f87ec5939si24708251qvl.324.2024.01.01.17.59.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jan 2024 17:59:24 -0800 (PST) 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=mta5MaAf; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKU3V-0003Ze-So; Mon, 01 Jan 2024 20:58:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rKU3Q-0003UZ-W0 for qemu-devel@nongnu.org; Mon, 01 Jan 2024 20:58:53 -0500 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rKU3P-00073E-Df for qemu-devel@nongnu.org; Mon, 01 Jan 2024 20:58:52 -0500 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-2045bedb806so6360451fac.3 for ; Mon, 01 Jan 2024 17:58:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704160730; x=1704765530; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/pDTiX/W/3uE1ebfbK0jDL+RrICwab7UesIidaqTDMQ=; b=mta5MaAf8zmWkyZMiZx/Ho8mpo4jStj/WSBz183q2UusqAb4BpLik6lyTV5wkSs/lr 4oRWj+lpe/ZCWPKH0xCSbFXgf45Y+09x83c+3WfR0MtRm5g5A8Qzz7MT+bbzmouoI9cT WUKlMg9kltbAfvoece6yjlc/R7W3nskLZoamB23eZneWyGm3kgLvGayyfwK/fPVoZl1I 6x8NEfEh+RE01vwgZJYrB6Fb68hPyeOOVSLKc53RtK/X5ftROUEhqCPPZoEyKvhiNlJg PirrintzKyuYtQSxqtq5+K60SWM3M+oWbCq4RGfLe1XRYzpVZGLDtrOPEvcHw2mTv7IG 39Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704160730; x=1704765530; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/pDTiX/W/3uE1ebfbK0jDL+RrICwab7UesIidaqTDMQ=; b=Go6kUORICTiyfVqJ1qk2h5rcDa++AVj0DldbvztvJ8TtogiFYzd7k5tsGaANaID1Ua GB0xNBtCY5ctyt5KJscuGWlxvUsErvmtmRZIxpZU1a0RZiDj9a+j9wxe/ELaa1NVKOhV 8mL7v8CzkKDij564bg8G9UomSGysgAqlDOmT3FZzi4Pk2OxBe9ACPcX+UkVt4KU2MfEX WUZPv8EVUCpqa97VPdYs6ZWvJVbDyEXa55J9M7czsqSBN3dzPgFnB6OqEx82m+qzik0v CL+n3Cd/rwC1ZH9XmqTujqcC9N9Xo8uP5NQ6SxsuaJj9EwwNcy7NzjKn7qOw59IPFPdW FSqA== X-Gm-Message-State: AOJu0YzNasW9FLPUUSyiTeRNbSDi0NRVoze+u9TO2DmOMUXHCYgK6/Hy Wr5KF90xyAOFqx+cvuEvvVB5kr5O/kEjFushyLa/ruIqe78= X-Received: by 2002:a05:6871:606:b0:204:c23:8831 with SMTP id w6-20020a056871060600b002040c238831mr21960222oan.37.1704160730184; Mon, 01 Jan 2024 17:58:50 -0800 (PST) Received: from stoup.. (124-149-254-207.tpgi.com.au. [124.149.254.207]) by smtp.gmail.com with ESMTPSA id g33-20020a635221000000b0058ee60f8e4dsm19561891pgb.34.2024.01.01.17.58.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 17:58:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 18/33] linux-user: Fix sub-host-page mmap Date: Tue, 2 Jan 2024 12:57:53 +1100 Message-Id: <20240102015808.132373-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240102015808.132373-1-richard.henderson@linaro.org> References: <20240102015808.132373-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::29; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x29.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-bounces+patch=linaro.org@nongnu.org We cannot skip over the_end1 to the_end, because we fail to record the validity of the guest page with the interval tree. Remove "the_end" and rename "the_end1" to "the_end". Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Reviewed-by: Ilya Leoshkevich --- linux-user/mmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index fbaea832c5..48fcdd4a32 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -643,7 +643,7 @@ static abi_long target_mmap__locked(abi_ulong start, abi_ulong len, target_prot, flags, fd, offset)) { return -1; } - goto the_end1; + goto the_end; } if (!mmap_frag(real_start, start, real_start + host_page_size - 1, @@ -690,7 +690,7 @@ static abi_long target_mmap__locked(abi_ulong start, abi_ulong len, passthrough_last = real_last; } } - the_end1: + the_end: if (flags & MAP_ANONYMOUS) { page_flags |= PAGE_ANON; } @@ -708,7 +708,6 @@ static abi_long target_mmap__locked(abi_ulong start, abi_ulong len, } } shm_region_rm_complete(start, last); - the_end: trace_target_mmap_complete(start); if (qemu_loglevel_mask(CPU_LOG_PAGE)) { FILE *f = qemu_log_trylock();