From patchwork Mon Sep 23 22:59:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 174225 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3396603ill; Mon, 23 Sep 2019 16:00:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKAzGDI7d9Ca89JyPFlasitgxU6hc2tFyY31KVI5OTRu8llq/1rfTulvt5XCgF9VmcI85K X-Received: by 2002:a37:82c1:: with SMTP id e184mr398193qkd.206.1569279657265; Mon, 23 Sep 2019 16:00:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569279657; cv=none; d=google.com; s=arc-20160816; b=h0O8XuqNnR54fb1f3bOovX9IZcA83qe77vH2iKqd6c5cTQTRwmB9/mhQBPfeueVpQ8 aNt6AZyiN7Q64TRvaGs8QT372/l1tgfVQOlCcJtYnSHgk8YPW+C/AFU139SHK98W/+6T pXZVNlxPYDmDDMZEw2M1bkJDUbC4o7zHGWRr9Omvd4WfalzOK2A/fIUMAn4motiGenTJ sPAiCRbsZnxyBg5sGlkrxsMEjx9mGYkGi4U12BSbfPhh8mvPeMSqLkdDYwQlYr6lJ3NS qyJ5QovYR0QnVpLy0kyu0zL+yW/1o/Uy2rfoxC9N0qDI6seOLVtfy1wCjNFmuKcuYjbT AtsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=q+p5QzYNQKTvFHxw7w5r06HbHDvLV91pgGFYaSNj9io=; b=vXpntecGJUdYXf2glnoFa2I6e1B97BGh+Nxa5zwPEFs8TYYbdKlSlJZVe8mbBVpOyG JBf/5NeF2H6VC2iZCdSaOknAWL/Khr68SMGEd8N5aLd5xLjV3svQLlKVlJowXzpFvR7y qQEkBCj/RKegvM+CmlUNaOf77TmT4QdE0UTsQoXwL2fluv8TFtbIvDkUU+eCDuYDViRB UNL4fA3SRvDmSO/k0TeyDRhTJUnCyqmMGC6cEx8pbcHIPMy91MR6cIjhGALfhXVtqcuL s76RylqUdXnkNDJOlsj8dgHI2xsQIDJ19LP4jYX67mAEPR7SzKG6pAtd4/D1zvmtN6Ta +2ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jiklDqjN; 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=fail (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 f50si9663405qte.342.2019.09.23.16.00.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Sep 2019 16:00:57 -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=fail header.i=@linaro.org header.s=google header.b=jiklDqjN; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCXKB-0005QT-PX for patch@linaro.org; Mon, 23 Sep 2019 19:00:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35681) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCXJT-0005Q7-UV for qemu-devel@nongnu.org; Mon, 23 Sep 2019 19:00:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCXJS-0007w1-NA for qemu-devel@nongnu.org; Mon, 23 Sep 2019 19:00:11 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:33713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iCXJS-0007ur-HM for qemu-devel@nongnu.org; Mon, 23 Sep 2019 19:00:10 -0400 Received: by mail-pg1-x543.google.com with SMTP id i30so4421pgl.0 for ; Mon, 23 Sep 2019 16:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=q+p5QzYNQKTvFHxw7w5r06HbHDvLV91pgGFYaSNj9io=; b=jiklDqjNjvOwyGkMWVnwjr0pGn76PejnXREOb3AMWwgrRNKqBmAn7hv08hKIfiRDb5 Cv7Pt24gCTv5gcQ2yt3ao5qQkLTHhY5QXniNV4lHBp6uG3hMze+AW2A6YXHrcNxckN2n a8vScAzUUA/AMuDrfLBQ8ndris44KrlyMUYeTIWNDZUVQYv6cQd/UytSTc6oCciSFi5p t6obh3ET2aarXXiuPR8Fkl/O5NvwhNdoC1a5wWxPt63M9KdNc5AeblBYhdgFIl+gT8ua z8PQHBvb1U5SDE1voTqS7W1R08sbd5Gtbhmhq/dvToQTYLVbYbw4+ziYICCIDf3Q+Avx jTww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=q+p5QzYNQKTvFHxw7w5r06HbHDvLV91pgGFYaSNj9io=; b=a3zAUtKieWuXoFQpLS/yjjNE2ioyEmMb4EdubbY+fQneaqV5uQAkOVPOB8Zs1EHt1Q xI4p9J8uHrlvUNNZgGWVAPz98PwZehc0mo7ijbL+92bpKWmz1b5tbOVIRncY+FoHHUco AZOInchoZfnXedZccedMa012/bbGaI536mbKWv9fIpSkjVPT3bJRE0fj9TdDeQg/uRyp LCJV9FdHhG0mYJYzZE7skuJjsB9f5N4qQudN/wGeV4IsFyYQkR3KsUOaWTckaw/gFeqF hg0T0JKbXq8N5bicJ9xZAAtB9BRI02DQhlZsBvtBydMGq6s19VeEwNwg1/GTKQ9qyg7E +t4g== X-Gm-Message-State: APjAAAU4158HjnynyR9d/OgEUgNAvGN/7by4yL4FXUfrV04TAmDzptTJ A3xxnXZhYZrKwur/qlKp2Adt2Zmq8e0= X-Received: by 2002:a63:e1a:: with SMTP id d26mr153193pgl.73.1569279609108; Mon, 23 Sep 2019 16:00:09 -0700 (PDT) Received: from localhost.localdomain ([12.206.46.59]) by smtp.gmail.com with ESMTPSA id 74sm11674810pfy.78.2019.09.23.16.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 16:00:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 01/16] exec: Use TARGET_PAGE_BITS_MIN for TLB flags Date: Mon, 23 Sep 2019 15:59:49 -0700 Message-Id: <20190923230004.9231-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190923230004.9231-1-richard.henderson@linaro.org> References: <20190923230004.9231-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, alex.bennee@linaro.org, stefanha@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These bits do not need to vary with the actual page size used by the guest. Reviewed-by: David Hildenbrand Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) -- 2.17.1 Reviewed-by: Alex Bennée diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index d2d443c4f9..e0c8dc540c 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -317,20 +317,24 @@ CPUArchState *cpu_copy(CPUArchState *env); #if !defined(CONFIG_USER_ONLY) -/* Flags stored in the low bits of the TLB virtual address. These are - * defined so that fast path ram access is all zeros. +/* + * Flags stored in the low bits of the TLB virtual address. + * These are defined so that fast path ram access is all zeros. * The flags all must be between TARGET_PAGE_BITS and * maximum address alignment bit. + * + * Use TARGET_PAGE_BITS_MIN so that these bits are constant + * when TARGET_PAGE_BITS_VARY is in effect. */ /* Zero if TLB entry is valid. */ -#define TLB_INVALID_MASK (1 << (TARGET_PAGE_BITS - 1)) +#define TLB_INVALID_MASK (1 << (TARGET_PAGE_BITS_MIN - 1)) /* Set if TLB entry references a clean RAM page. The iotlb entry will contain the page physical address. */ -#define TLB_NOTDIRTY (1 << (TARGET_PAGE_BITS - 2)) +#define TLB_NOTDIRTY (1 << (TARGET_PAGE_BITS_MIN - 2)) /* Set if TLB entry is an IO callback. */ -#define TLB_MMIO (1 << (TARGET_PAGE_BITS - 3)) +#define TLB_MMIO (1 << (TARGET_PAGE_BITS_MIN - 3)) /* Set if TLB entry contains a watchpoint. */ -#define TLB_WATCHPOINT (1 << (TARGET_PAGE_BITS - 4)) +#define TLB_WATCHPOINT (1 << (TARGET_PAGE_BITS_MIN - 4)) /* Use this mask to check interception with an alignment mask * in a TCG backend.