Message ID | 20241114160131.48616-16-richard.henderson@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp366379wrc; Thu, 14 Nov 2024 08:12:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWG4qI8f8wZiuwcTssXpz5GAI0D4Nuy3VirOnrVMtP9t0k3Os32J79F6Jk7yowuA3UvPmi7Jg==@linaro.org X-Google-Smtp-Source: AGHT+IFb9kNz5dW8OYbcRkpMcVNw/zLg3ipaC5a8cFVpLfpmNrIjazomNc0X/4HPdcR3Avp9dveK X-Received: by 2002:a05:6214:33c7:b0:6d3:f5fc:27eb with SMTP id 6a1803df08f44-6d3f5fc294dmr21836036d6.9.1731600762539; Thu, 14 Nov 2024 08:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731600762; cv=none; d=google.com; s=arc-20240605; b=g9XqzHcz99HY4rTvDyVNpU63y/Gqs9jpVj/e1qEmGNSxECB9MlEBd4tqCggagB8T6f oROC+PBWzNQCn32heRTEro+n1t/ALJDVV6SZeSNLoMD00Dyhn9GK5PJripkg2d+P6giR mbhJeJCAfcwnU6yZVHepTiNsa9P+GQve8w6UjB25qAvDRmQdZvFI6gBBbTQGkCqklB9X wmeCNh/qGb1aU1pyyf5G4IoULDWDUmzBg3gv7cRL8a1cBW1HhAZ0clDjMOMbPxPm12mp DINB34UCwz80f8+yU0Iq53R/qcRDz+gOcPF0exS5LyG24XSNDY6zTdjCE/Jpnclu9t80 QMyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=CIfCBBS4NOF8aU4fkbSKUFc82IUgInZTkka8x32P+O8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Jv3iPxHUv/BmQjA8BA3GOCluL89N1+1l+PvXPU9iMV9J00YbsYSfaAkG7W+jFTNqu1 KdGJYRPFviLa3UQ1U6etPanPtcUO6RlqSRP4dg2GPNamNh3PdnUfbBZe8DtQ1Aq/S9+U y64SWUrhhsvuJtB77mqAmBdPfOGGFSxMqBORsxr1kkGjp9imLRxtMNUOHAbzlzhaMDDN x8YvsypupJtV++iFZT+rib1Yqwk/SM/M8AP9ExsTuCtlQgeSxJbI5F+p2ZLMUFqFhLcu isYIWbMDONx0uGvdPV4c1yQXb7hJIOBsGhdHiThPjRbKFjkRSjNlMdm93sQUGUTV6s4x 2IjQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MxhnKw7Y; 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; dara=neutral header.i=@linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d3ee98d170si14910756d6.436.2024.11.14.08.12.42 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Nov 2024 08:12:42 -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=MxhnKw7Y; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1tBcIj-0005L9-9a; Thu, 14 Nov 2024 11:02:33 -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 <richard.henderson@linaro.org>) id 1tBcI3-0004z5-Jz for qemu-devel@nongnu.org; Thu, 14 Nov 2024 11:01:51 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1tBcI0-0002Db-GQ for qemu-devel@nongnu.org; Thu, 14 Nov 2024 11:01:50 -0500 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-720aa3dbda5so600546b3a.1 for <qemu-devel@nongnu.org>; Thu, 14 Nov 2024 08:01:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731600104; x=1732204904; 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=CIfCBBS4NOF8aU4fkbSKUFc82IUgInZTkka8x32P+O8=; b=MxhnKw7Ycsd2Lz1o4fV3Te2gTmgA35JPkuYio81N7DSRFGZA8Nc6Xa9vzhqEg56Qw+ AM29PKMX+SwzPEwpUmahkZJxkmj2vhikmn+iQWVMm1T5s800EmwyziOhe2dV91hLZakc TNNxpOBDFmIp7UOOnakYkp6VJ40zXnfmDnCa2gdE8iXi/qR2nL0a3hfHG1Udw6gTlj1c VcpPvhzhQ2/wb+1cqUOV/uLfV1vt0+fRO8SAA2Qxpbh3cIXY5RSglEF8z04C5jAczGrr z/lV9BPwRNnZiYIDySJm72u23eeUBGIr1zChtRc7FNQgVXnk/XIPaiK+Ydx+26+yc59p FbKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731600104; x=1732204904; 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=CIfCBBS4NOF8aU4fkbSKUFc82IUgInZTkka8x32P+O8=; b=KK8kQ536REW9N1hJ/CLqPIPtJynknqaCk5b+yHEj/+uNO/Ucr2QWFmVWYaCgzH8WJv 5m+kXJx/3tzLm9uLYc8uoVXgyAn5bEUeCIp/edVsxiYUaZenWmogvMp7lPZ1Mmgwv4qI kII2MowWvKbxXZrY/pylHV/JdwJyzqjbbN2SFuMxFx5jS+P27FE2aKdpM8XUhcM2tzLf 7gYeewU2WC0JHDUBDXjyasJd/48QEFJpdkmwoCJscMzQNp0Ncuxb89h1aqV3xGErORHh f6dPf1aHaDlPMcgLIefzW7Ro0YhYcCrm0F0/Gi2Z+ntkEsGygE5740N9w0gRzPxEC7Og MWcw== X-Gm-Message-State: AOJu0YycVlgtXQIhBZLOJWo4PBOXdMzKI2RHdvcIEV9vOIjMQH7auRVH 2ZkOWwpysnmCgsqUznBgGlAa9ZWc8YSp1cu8z67TN5UJBG+mfyOnJtrIDhzxtaQ7yEIps/I40YQ + X-Received: by 2002:a17:90b:2643:b0:2e9:20d8:4140 with SMTP id 98e67ed59e1d1-2e9e4c73ae4mr12373356a91.26.1731600103692; Thu, 14 Nov 2024 08:01:43 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024ec723sm1484438a91.46.2024.11.14.08.01.43 for <qemu-devel@nongnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 08:01:43 -0800 (PST) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PATCH v2 15/54] accel/tcg: Use tlb_hit_page in victim_tlb_hit Date: Thu, 14 Nov 2024 08:00:51 -0800 Message-ID: <20241114160131.48616-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241114160131.48616-1-richard.henderson@linaro.org> References: <20241114160131.48616-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
accel/tcg: Convert victim tlb to IntervalTree
|
expand
|
On 11/14/24 08:00, Richard Henderson wrote: > This is clearer than directly comparing the > page address and the comparator. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > accel/tcg/cputlb.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c > index eb85e96ee2..7ecd327297 100644 > --- a/accel/tcg/cputlb.c > +++ b/accel/tcg/cputlb.c > @@ -1394,9 +1394,8 @@ static bool victim_tlb_hit(CPUState *cpu, size_t mmu_idx, size_t index, > assert_cpu_is_self(cpu); > for (vidx = 0; vidx < CPU_VTLB_SIZE; ++vidx) { > CPUTLBEntry *vtlb = &cpu->neg.tlb.d[mmu_idx].vtable[vidx]; > - uint64_t cmp = tlb_read_idx(vtlb, access_type); > > - if (cmp == page) { > + if (tlb_hit_page(tlb_read_idx(vtlb, access_type), page)) { > /* Found entry in victim tlb, swap tlb and iotlb. */ > CPUTLBEntry tmptlb, *tlb = &cpu->neg.tlb.f[mmu_idx].table[index]; > Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index eb85e96ee2..7ecd327297 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1394,9 +1394,8 @@ static bool victim_tlb_hit(CPUState *cpu, size_t mmu_idx, size_t index, assert_cpu_is_self(cpu); for (vidx = 0; vidx < CPU_VTLB_SIZE; ++vidx) { CPUTLBEntry *vtlb = &cpu->neg.tlb.d[mmu_idx].vtable[vidx]; - uint64_t cmp = tlb_read_idx(vtlb, access_type); - if (cmp == page) { + if (tlb_hit_page(tlb_read_idx(vtlb, access_type), page)) { /* Found entry in victim tlb, swap tlb and iotlb. */ CPUTLBEntry tmptlb, *tlb = &cpu->neg.tlb.f[mmu_idx].table[index];
This is clearer than directly comparing the page address and the comparator. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- accel/tcg/cputlb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)