From nobody Thu Nov 6 01:09:04 2025 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.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538295544760296.27023175114334; Sun, 30 Sep 2018 01:19:04 -0700 (PDT) Received: from localhost ([::1]:54231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6WwR-0006kw-Im for importer@patchew.org; Sun, 30 Sep 2018 04:19:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6Wr5-00024X-2y for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6Wr3-0008OR-2e for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:30 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:36646) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6Wr2-0008Ju-By for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:13:28 -0400 Received: by mail-wr1-x432.google.com with SMTP id y16so2236034wrw.3 for ; Sun, 30 Sep 2018 01:13:27 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.13.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=7oPkOe1NBZcsT5l/ZfMa7quymJ4Ev7ythyogW25/sXg=; b=KVMQt/h6xGt5ALpUY3wvvRbVMKJVNYKxKoaNUwRhrnHCVXAkexfJlJTRXfaU+jc8Hv tkcDIjjdy7aG+dXWisUAxf9z8U2or1ppbg/4l0/F5xrbFd38lmhukKNYsl0fHAIEqx4O Z+NLud9qw2SJRTC4J4lO5XwvR7B8lnYueZJsbMF0DckFq0kVhoR30uzKFhurPMLDX1QF HvVm3jwFp1UtHt7aZyKKr/aCJ+qHvIsFbENQThPqa7UyB7cfpzK4f6HJP9hBwJpKXwQ+ y4DSVM69DvHHtVa/GaIZQTjnA3sufKENVNkFL1JnLuJ099nXb+82IARoLyFuV0VBrkcS whlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=7oPkOe1NBZcsT5l/ZfMa7quymJ4Ev7ythyogW25/sXg=; b=CRAwpA+TnhZn7n8HUXxdcHAm/rNdAOgnst8Sx1Aaw6wAhizP3D72M1hqA1PGHZ+lgM wmeP5MvGJ5bKZrWm1eRNq5tWWp445LNMbULA1Tk8YATKGy2qmZKAWZbzkjnaYdVHXFh3 /oCY3kygLRyKmtcWyLWY1pMKFNp3Vo5/6WbtiXSN5efjiaeAHNokt3/mE5TdkbZX+RGa GoZZKuXr+3hWBmNGrw9M5NwZ9AxasxWHG6Gs7KYuurPm8z5r173Jpy66R/CeohXqxhdy 8PIQ0rh9BqoK/PI4eZMIZhbANFfL+RRSh1S/McuFZ/Y5Ahj7/2vQL89OuuP2aF75xWVj Nxkg== X-Gm-Message-State: ABuFfoisLeIFVmFYGnBhHFgHC6gk4WF6RaEUpcXsUDxdusqCoHqW3t9Y pK0tHSZXX2mGmvRspC+YH70TPj8N X-Google-Smtp-Source: ACcGV60joTRNPsSNvXyTiLJMFVCVfDTV8ZR7yZdRoX2MM3XmSNrSqkM3vZHuRn4f7Y3ONcBGWPiVFw== X-Received: by 2002:adf:9f0f:: with SMTP id l15-v6mr3822124wrf.206.1538295205997; Sun, 30 Sep 2018 01:13:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:12:05 +0200 Message-Id: <1538295197-23704-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 Subject: [Qemu-devel] [PULL 07/79] cacheinfo: add i/d cache_linesize_log 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: "Emilio G. Cota" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Message-Id: <20180910232752.31565-2-cota@braap.org> Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 2 ++ util/cacheinfo.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index a91068d..a746a5e 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -570,6 +570,8 @@ extern uintptr_t qemu_real_host_page_size; extern intptr_t qemu_real_host_page_mask; =20 extern int qemu_icache_linesize; +extern int qemu_icache_linesize_log; extern int qemu_dcache_linesize; +extern int qemu_dcache_linesize_log; =20 #endif diff --git a/util/cacheinfo.c b/util/cacheinfo.c index db5172d..6c8fe79 100644 --- a/util/cacheinfo.c +++ b/util/cacheinfo.c @@ -7,9 +7,12 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/host-utils.h" =20 int qemu_icache_linesize =3D 0; +int qemu_icache_linesize_log; int qemu_dcache_linesize =3D 0; +int qemu_dcache_linesize_log; =20 /* * Operating system specific detection mechanisms. @@ -172,6 +175,11 @@ static void __attribute__((constructor)) init_cache_in= fo(void) arch_cache_info(&isize, &dsize); fallback_cache_info(&isize, &dsize); =20 + assert((isize & (isize - 1)) =3D=3D 0); + assert((dsize & (dsize - 1)) =3D=3D 0); + qemu_icache_linesize =3D isize; + qemu_icache_linesize_log =3D ctz32(isize); qemu_dcache_linesize =3D dsize; + qemu_dcache_linesize_log =3D ctz32(dsize); } --=20 1.8.3.1