From nobody Tue Feb 10 05:09:49 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.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499239935656246.4554237414925; Wed, 5 Jul 2017 00:32:15 -0700 (PDT) Received: from localhost ([::1]:44563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSenG-0003o8-HQ for importer@patchew.org; Wed, 05 Jul 2017 03:32:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSeWy-0004s2-Nn for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSeWx-0007n2-Jv for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:24 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33183) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSeWx-0007mT-DT for qemu-devel@nongnu.org; Wed, 05 Jul 2017 03:15:23 -0400 Received: by mail-wm0-x242.google.com with SMTP id j85so30448584wmj.0 for ; Wed, 05 Jul 2017 00:15:23 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y35sm22202793wrc.51.2017.07.05.00.15.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 00:15:21 -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=QyMKvXjqCjuUxbr0FeyifsmV0Wgz3kf012+AzfMWtHg=; b=f+0b64TkONQd0IHN4effBoEnK735G1Onnqk69GeiJPEhY1TnI4dFrbSDYfqUxcMEBF 1VW/CLKqnPnNzGk5kqLYWTVb3kp9xBgL/Un031qPN5e6uaJGtKPfch3o0oUutX8B0oHB TRJYpIUD30de6/w8fKVxS18Oq7lstoKEhqjg5QMnXEUIzOc5+pV6soGhXyNJzMi/rrsy 6LL5AqOgJVHQUzcvFX5IZtQXGdiQhqwBzTLqs69bDzR7WfwZMfZzKTi6sID/d3yfUx21 uoocBwxPLFiq7G2l0O7XINfHlMAHAY4+zW9GdKxGdELoz6qKFWH278gfvLK0A8yBoZcv ssvQ== 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=QyMKvXjqCjuUxbr0FeyifsmV0Wgz3kf012+AzfMWtHg=; b=LmF7T+h0G+tuQ4z0X/Vr5AHg4qXQJRH/7wPA0cEv+yRL5lNXsyohtDCHbZlv5oe+lm j98Osu99iGU3kvxlajy6yi8s5URkQ2K2/QvaolQXd+xHGMdnVGqhGqdITbaP0XxJ9YR3 98MRPvhRkMhj1Lb1lFX4dKm3z0uXGVxL0GQDweVMkQEwwUGDEp9Bdy17nxL8gZsF6ebc DGPxIniYRhhyEH1Uzvd4R/SWBnASuAE0RwdIrcKuoH68dClEYGspJTEsb/cG5d0Wbfku EvOgHgfZCzH20xUW9fujjaX2D4PpJwfYYTT7g4jRNUrU4vGDXAhbmS4NRTE6zfAYR9Q1 g7Hw== X-Gm-Message-State: AKS2vOz5A4lhN0Pt87pw15Cza6Q3Rv7GiJZWdPV1F24P/UdjctzGzjBc rKyPIYBqoNNh+UGJHW4= X-Received: by 10.28.111.215 with SMTP id c84mr31848017wmi.72.1499238922089; Wed, 05 Jul 2017 00:15:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 5 Jul 2017 09:14:30 +0200 Message-Id: <1499238885-26161-28-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499238885-26161-1-git-send-email-pbonzini@redhat.com> References: <1499238885-26161-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:400c:c09::242 Subject: [Qemu-devel] [PULL 27/42] tcg: move page_size_init() function 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: Yang Zhong Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: 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: Yang Zhong translate-all.c will be disabled if tcg is disabled in the build, so page_size_init() function and related variables will be moved to exec.c file. Signed-off-by: Yang Zhong Signed-off-by: Paolo Bonzini --- accel/tcg/translate-all.c | 18 ------------------ accel/tcg/translate-common.c | 3 --- exec.c | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index dc7e816..4fda383 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -112,9 +112,6 @@ typedef struct PageDesc { #define V_L2_BITS 10 #define V_L2_SIZE (1 << V_L2_BITS) =20 -uintptr_t qemu_host_page_size; -intptr_t qemu_host_page_mask; - /* * L1 Mapping properties */ @@ -363,21 +360,6 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retadd= r) return r; } =20 -void page_size_init(void) -{ - /* NOTE: we can always suppose that qemu_host_page_size >=3D - TARGET_PAGE_SIZE */ - qemu_real_host_page_size =3D getpagesize(); - qemu_real_host_page_mask =3D -(intptr_t)qemu_real_host_page_size; - if (qemu_host_page_size =3D=3D 0) { - qemu_host_page_size =3D qemu_real_host_page_size; - } - if (qemu_host_page_size < TARGET_PAGE_SIZE) { - qemu_host_page_size =3D TARGET_PAGE_SIZE; - } - qemu_host_page_mask =3D -(intptr_t)qemu_host_page_size; -} - static void page_init(void) { page_size_init(); diff --git a/accel/tcg/translate-common.c b/accel/tcg/translate-common.c index 40fe5a1..e6b8c4c 100644 --- a/accel/tcg/translate-common.c +++ b/accel/tcg/translate-common.c @@ -23,9 +23,6 @@ #include "sysemu/cpus.h" #include "qemu/main-loop.h" =20 -uintptr_t qemu_real_host_page_size; -intptr_t qemu_real_host_page_mask; - #ifndef CONFIG_USER_ONLY /* mask must never be zero, except for A20 change call */ static void tcg_handle_interrupt(CPUState *cpu, int mask) diff --git a/exec.c b/exec.c index 42ad1ea..ee61915 100644 --- a/exec.c +++ b/exec.c @@ -118,6 +118,11 @@ __thread CPUState *current_cpu; 2 =3D Adaptive rate instruction counting. */ int use_icount; =20 +uintptr_t qemu_host_page_size; +intptr_t qemu_host_page_mask; +uintptr_t qemu_real_host_page_size; +intptr_t qemu_real_host_page_mask; + bool set_preferred_target_page_bits(int bits) { /* The target page size is the lowest common denominator for all @@ -3590,3 +3595,18 @@ err: } =20 #endif + +void page_size_init(void) +{ + /* NOTE: we can always suppose that qemu_host_page_size >=3D + TARGET_PAGE_SIZE */ + qemu_real_host_page_size =3D getpagesize(); + qemu_real_host_page_mask =3D -(intptr_t)qemu_real_host_page_size; + if (qemu_host_page_size =3D=3D 0) { + qemu_host_page_size =3D qemu_real_host_page_size; + } + if (qemu_host_page_size < TARGET_PAGE_SIZE) { + qemu_host_page_size =3D TARGET_PAGE_SIZE; + } + qemu_host_page_mask =3D -(intptr_t)qemu_host_page_size; +} --=20 1.8.3.1