From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661508; cv=none; d=zohomail.com; s=zohoarc; b=Pc+EYAtHz+Kze3i/IdbiLOaVn/Nbm2ax9Ors0rpAL1ldj4La9wH9ray8vEHQYFxl7AptaACyGLlNvSpFCcXk9fcfLmqvv5u+Dod1ekPd/prTVqrwfzTQfOdhkZBwL+2dFxK7qrxsV/HfTwqVbgIuqa0erpYsEc1KG04YCHeKhuw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661508; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TwrbDOcBiJWe3P20iSui/ewdKReKQwEsoISJVZqcFRc=; b=M80khBGihgCV5Nv5mCE/Jo3kRQOCv+wFKQGT/rBjq0wrRgcu1tWFCigTpqd52WlA+SeSrT1tZsHZC1C6bPst7iI8M8qqokpDAuJS4dR9UcBk8CZvoeV+vZnB+oRF6M0sRwc4VCkDAfomxD7uU06YD7TWGKmVOZT7NWa67trOB+U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661508036208.2254596268558; Tue, 21 Jan 2020 18:51:48 -0800 (PST) Received: from localhost ([::1]:35684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu67O-0007E3-Dp for importer@patchew.org; Tue, 21 Jan 2020 21:51:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45142) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65a-0005Me-Mu for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65Y-0002go-SH for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:54 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:45146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65Y-0002gU-Kl for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:52 -0500 Received: by mail-pl1-x643.google.com with SMTP id b22so2248773pls.12 for ; Tue, 21 Jan 2020 18:49:52 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.49.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:49:50 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=TwrbDOcBiJWe3P20iSui/ewdKReKQwEsoISJVZqcFRc=; b=svCUYgfD0pnczTgtjhO8kkdeoXkbnxHe5OOAvSkSfRWOurKDuCgBvks/X4nxCKO3fm nW0nj5228SGKXozo+zPYJKo3q37LbaWUBEp8EnMWqE+IdV9zJ4q5l78UdqOiRkIqqJU2 qa+xTibg1cNenlVBK8m6ApQ/QYVgXaU127OFJr9oSN/oqxhEgpdRbmW1r4x0VC3cbI7I qM3HsZn4c7dDMfkIZKW9UQOPIaR9r2jeajA5ovhasX5pGVeFRzuIT6DOsFClHmvjn6/T RYw314iCqdVi0vSiL/FFHgseypzWvjZYEoBh6TQRsd9FPT9Sb1ZGeaM6ySH0XD0kFIl4 1WFw== 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:mime-version:content-transfer-encoding; bh=TwrbDOcBiJWe3P20iSui/ewdKReKQwEsoISJVZqcFRc=; b=q/xLKlWc84DS4zehAnw2Y1xQDMFWvh7eYhzSU8q8jLUvjkxf/Jwe12wBM7gkTHYD5d A4WUOcaaErR04tSv47gb51lySqDOIwHdxBmSm/KGFbsY88W1gbV4a78dsWDgssXEDWc/ JQV0uDxg7uCfTl067S8XvTUEJhgsgIAJbhBfHma+QxBXGPc2SygKUZewmph25bEq0++O 8UrOO9HhIiIkjpwP0PPA8vaSFD0D+V39bnS+z9thGbu3jp6uIK1ZGUAT9vbVMJIDhNSN d60H/mRytEtQ+zsTFU9Q9orAVl5o8C8y5jjPRqzEEk6MH1YTEQDIALAiPUps2bbWR0VT R3Sg== X-Gm-Message-State: APjAAAX3NxN3Ph8K0XkfoZAWFxVnI8V/GtP25znuVP31jOj177CKEZ1V yXIu0P/55qyTKrVEYAR7o2Ovq9w+GvA= X-Google-Smtp-Source: APXvYqxCw/CfLVYxCJvwQEE6r+LKThk3sOrRKgPzo7Ho/7cGR0e8MtAeyyeNGsyr1QsdUuB9qljckQ== X-Received: by 2002:a17:90b:46cf:: with SMTP id jx15mr473309pjb.2.1579661391276; Tue, 21 Jan 2020 18:49:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 01/16] cputlb: Handle NB_MMU_MODES > TARGET_PAGE_BITS_MIN Date: Tue, 21 Jan 2020 16:49:31 -1000 Message-Id: <20200122024946.28484-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::643 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" In target/arm we will shortly have "too many" mmu_idx. The current minimum barrier is caused by the way in which tlb_flush_page_by_mmuidx is coded. We can remove this limitation by allocating memory for consumption by the worker. Let us assume that this is the unlikely case, as will be the case for the majority of targets which have so far satisfied the BUILD_BUG_ON, and only allocate memory when necessary. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 167 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 132 insertions(+), 35 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index a991ea2964..02b381cf50 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -449,28 +449,29 @@ static void tlb_flush_page_locked(CPUArchState *env, = int midx, } } =20 -/* As we are going to hijack the bottom bits of the page address for a - * mmuidx bit mask we need to fail to build if we can't do that +/** + * tlb_flush_page_by_mmuidx_async_0: + * @cpu: cpu on which to flush + * @addr: page of virtual address to flush + * @idxmap: set of mmu_idx to flush + * + * Helper for tlb_flush_page_by_mmuidx and friends, flush one page + * at @addr from the tlbs indicated by @idxmap from @cpu. */ -QEMU_BUILD_BUG_ON(NB_MMU_MODES > TARGET_PAGE_BITS_MIN); - -static void tlb_flush_page_by_mmuidx_async_work(CPUState *cpu, - run_on_cpu_data data) +static void tlb_flush_page_by_mmuidx_async_0(CPUState *cpu, + target_ulong addr, + uint16_t idxmap) { CPUArchState *env =3D cpu->env_ptr; - target_ulong addr_and_mmuidx =3D (target_ulong) data.target_ptr; - target_ulong addr =3D addr_and_mmuidx & TARGET_PAGE_MASK; - unsigned long mmu_idx_bitmap =3D addr_and_mmuidx & ALL_MMUIDX_BITS; int mmu_idx; =20 assert_cpu_is_self(cpu); =20 - tlb_debug("page addr:" TARGET_FMT_lx " mmu_map:0x%lx\n", - addr, mmu_idx_bitmap); + tlb_debug("page addr:" TARGET_FMT_lx " mmu_map:0x%x\n", addr, idxmap); =20 qemu_spin_lock(&env_tlb(env)->c.lock); for (mmu_idx =3D 0; mmu_idx < NB_MMU_MODES; mmu_idx++) { - if (test_bit(mmu_idx, &mmu_idx_bitmap)) { + if ((idxmap >> mmu_idx) & 1) { tlb_flush_page_locked(env, mmu_idx, addr); } } @@ -479,22 +480,75 @@ static void tlb_flush_page_by_mmuidx_async_work(CPUSt= ate *cpu, tb_flush_jmp_cache(cpu, addr); } =20 +/** + * tlb_flush_page_by_mmuidx_async_1: + * @cpu: cpu on which to flush + * @data: encoded addr + idxmap + * + * Helper for tlb_flush_page_by_mmuidx and friends, called through + * async_run_on_cpu. The idxmap parameter is encoded in the page + * offset of the target_ptr field. This limits the set of mmu_idx + * that can be passed via this method. + */ +static void tlb_flush_page_by_mmuidx_async_1(CPUState *cpu, + run_on_cpu_data data) +{ + target_ulong addr_and_idxmap =3D (target_ulong) data.target_ptr; + target_ulong addr =3D addr_and_idxmap & TARGET_PAGE_MASK; + uint16_t idxmap =3D addr_and_idxmap & ~TARGET_PAGE_MASK; + + tlb_flush_page_by_mmuidx_async_0(cpu, addr, idxmap); +} + +typedef struct { + target_ulong addr; + uint16_t idxmap; +} TLBFlushPageByMMUIdxData; + +/** + * tlb_flush_page_by_mmuidx_async_2: + * @cpu: cpu on which to flush + * @data: allocated addr + idxmap + * + * Helper for tlb_flush_page_by_mmuidx and friends, called through + * async_run_on_cpu. The addr+idxmap parameters are stored in a + * TLBFlushPageByMMUIdxData structure that has been allocated + * specifically for this helper. Free the structure when done. + */ +static void tlb_flush_page_by_mmuidx_async_2(CPUState *cpu, + run_on_cpu_data data) +{ + TLBFlushPageByMMUIdxData *d =3D data.host_ptr; + + tlb_flush_page_by_mmuidx_async_0(cpu, d->addr, d->idxmap); + g_free(d); +} + void tlb_flush_page_by_mmuidx(CPUState *cpu, target_ulong addr, uint16_t i= dxmap) { - target_ulong addr_and_mmu_idx; - tlb_debug("addr: "TARGET_FMT_lx" mmu_idx:%" PRIx16 "\n", addr, idxmap); =20 /* This should already be page aligned */ - addr_and_mmu_idx =3D addr & TARGET_PAGE_MASK; - addr_and_mmu_idx |=3D idxmap; + addr &=3D TARGET_PAGE_MASK; =20 - if (!qemu_cpu_is_self(cpu)) { - async_run_on_cpu(cpu, tlb_flush_page_by_mmuidx_async_work, - RUN_ON_CPU_TARGET_PTR(addr_and_mmu_idx)); + if (qemu_cpu_is_self(cpu)) { + tlb_flush_page_by_mmuidx_async_0(cpu, addr, idxmap); + } else if (idxmap < TARGET_PAGE_SIZE) { + /* + * Most targets have only a few mmu_idx. In the case where + * we can stuff idxmap into the low TARGET_PAGE_BITS, avoid + * allocating memory for this operation. + */ + async_run_on_cpu(cpu, tlb_flush_page_by_mmuidx_async_1, + RUN_ON_CPU_TARGET_PTR(addr | idxmap)); } else { - tlb_flush_page_by_mmuidx_async_work( - cpu, RUN_ON_CPU_TARGET_PTR(addr_and_mmu_idx)); + TLBFlushPageByMMUIdxData *d =3D g_new(TLBFlushPageByMMUIdxData, 1); + + /* Otherwise allocate a structure, freed by the worker. */ + d->addr =3D addr; + d->idxmap =3D idxmap; + async_run_on_cpu(cpu, tlb_flush_page_by_mmuidx_async_2, + RUN_ON_CPU_HOST_PTR(d)); } } =20 @@ -506,17 +560,36 @@ void tlb_flush_page(CPUState *cpu, target_ulong addr) void tlb_flush_page_by_mmuidx_all_cpus(CPUState *src_cpu, target_ulong add= r, uint16_t idxmap) { - const run_on_cpu_func fn =3D tlb_flush_page_by_mmuidx_async_work; - target_ulong addr_and_mmu_idx; - tlb_debug("addr: "TARGET_FMT_lx" mmu_idx:%"PRIx16"\n", addr, idxmap); =20 /* This should already be page aligned */ - addr_and_mmu_idx =3D addr & TARGET_PAGE_MASK; - addr_and_mmu_idx |=3D idxmap; + addr &=3D TARGET_PAGE_MASK; =20 - flush_all_helper(src_cpu, fn, RUN_ON_CPU_TARGET_PTR(addr_and_mmu_idx)); - fn(src_cpu, RUN_ON_CPU_TARGET_PTR(addr_and_mmu_idx)); + /* + * Allocate memory to hold addr+idxmap only when needed. + * See tlb_flush_page_by_mmuidx for details. + */ + if (idxmap < TARGET_PAGE_SIZE) { + flush_all_helper(src_cpu, tlb_flush_page_by_mmuidx_async_1, + RUN_ON_CPU_TARGET_PTR(addr | idxmap)); + } else { + CPUState *dst_cpu; + + /* Allocate a separate data block for each destination cpu. */ + CPU_FOREACH(dst_cpu) { + if (dst_cpu !=3D src_cpu) { + TLBFlushPageByMMUIdxData *d + =3D g_new(TLBFlushPageByMMUIdxData, 1); + + d->addr =3D addr; + d->idxmap =3D idxmap; + async_run_on_cpu(dst_cpu, tlb_flush_page_by_mmuidx_async_2, + RUN_ON_CPU_HOST_PTR(d)); + } + } + } + + tlb_flush_page_by_mmuidx_async_0(src_cpu, addr, idxmap); } =20 void tlb_flush_page_all_cpus(CPUState *src, target_ulong addr) @@ -528,17 +601,41 @@ void tlb_flush_page_by_mmuidx_all_cpus_synced(CPUStat= e *src_cpu, target_ulong addr, uint16_t idxmap) { - const run_on_cpu_func fn =3D tlb_flush_page_by_mmuidx_async_work; - target_ulong addr_and_mmu_idx; - tlb_debug("addr: "TARGET_FMT_lx" mmu_idx:%"PRIx16"\n", addr, idxmap); =20 /* This should already be page aligned */ - addr_and_mmu_idx =3D addr & TARGET_PAGE_MASK; - addr_and_mmu_idx |=3D idxmap; + addr &=3D TARGET_PAGE_MASK; =20 - flush_all_helper(src_cpu, fn, RUN_ON_CPU_TARGET_PTR(addr_and_mmu_idx)); - async_safe_run_on_cpu(src_cpu, fn, RUN_ON_CPU_TARGET_PTR(addr_and_mmu_= idx)); + /* + * Allocate memory to hold addr+idxmap only when needed. + * See tlb_flush_page_by_mmuidx for details. + */ + if (idxmap < TARGET_PAGE_SIZE) { + flush_all_helper(src_cpu, tlb_flush_page_by_mmuidx_async_1, + RUN_ON_CPU_TARGET_PTR(addr | idxmap)); + async_safe_run_on_cpu(src_cpu, tlb_flush_page_by_mmuidx_async_1, + RUN_ON_CPU_TARGET_PTR(addr | idxmap)); + } else { + CPUState *dst_cpu; + TLBFlushPageByMMUIdxData *d; + + /* Allocate a separate data block for each destination cpu. */ + CPU_FOREACH(dst_cpu) { + if (dst_cpu !=3D src_cpu) { + d =3D g_new(TLBFlushPageByMMUIdxData, 1); + d->addr =3D addr; + d->idxmap =3D idxmap; + async_run_on_cpu(dst_cpu, tlb_flush_page_by_mmuidx_async_2, + RUN_ON_CPU_HOST_PTR(d)); + } + } + + d =3D g_new(TLBFlushPageByMMUIdxData, 1); + d->addr =3D addr; + d->idxmap =3D idxmap; + async_safe_run_on_cpu(src_cpu, tlb_flush_page_by_mmuidx_async_2, + RUN_ON_CPU_HOST_PTR(d)); + } } =20 void tlb_flush_page_all_cpus_synced(CPUState *src, target_ulong addr) --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661648; cv=none; d=zohomail.com; s=zohoarc; b=kRIuFarHBU14z3OIjJP2QppXr9hocGxazg1H9rzfMXKgcC07ecnmJZdn2y3aN/IZwWEGGVbTBVFV1KFVXvsPQWvEaaOlhkMtx6jW84QUBfmOWTaogvmo3Y16yiFuI9dk8cfbCoLJcUr8ls/osNd2tGftsrQaEM71J++4SvlxyGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661648; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z7pbnhcun0cxDNFbutIi0zQ3uYITFRp+E+8VBAtnKcc=; b=eSP5ReHlj3A2peQRu8yMwTxObL0dYRH9tmdnYwOuI04FNtQ3zs07qT+u9Yz9T1izhswwBh6j5m5s9eHjfrSM2+75ieBo9+tZbBe8ptNB0rbX/+oJs2LAizoDFqKvPqA/7czdKggONDz/Fg/Y2E6QIcjwkfOa7uPHm3lCFiiXzQ4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661648739331.9718708204168; Tue, 21 Jan 2020 18:54:08 -0800 (PST) Received: from localhost ([::1]:35724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu69e-00026A-QN for importer@patchew.org; Tue, 21 Jan 2020 21:54:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65b-0005N6-5u for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65a-0002hP-6O for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:55 -0500 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:54232) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65a-0002h6-1C for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:54 -0500 Received: by mail-pj1-x102e.google.com with SMTP id n96so2388271pjc.3 for ; Tue, 21 Jan 2020 18:49:53 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.49.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:49:52 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=z7pbnhcun0cxDNFbutIi0zQ3uYITFRp+E+8VBAtnKcc=; b=nu9i+kDv2Ob4EV3nm4q66/93566r+ZfeJioCD6juZhUcRzQNCrLB3cYESSxk8ej4mX PrdusaPijQvrZq9DfT+Xk9owEEPTgcKM+nUbY4JpP2iTTxd9q1ISQYbdmWSly6/9hwzm e4Q7BhC8+QnbR7sN5b+LtRKbOV1ApQ7gxGHhk63rTmcEuaQdZLhrR76D7u2CBq9ZauaM F31eINm6OUuZALIdRHqyNcBuqQTmsv0WJxxdnM0VVbZN88p3r6SgNnIxEffEE8rayJ6s SzTtQNI4MW+0WYyQaNW5XJdNu/VSAcZS1+nPjnJt2BbPNUY/XMsntp0VgeqZrjDXOI1r usxg== 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:mime-version:content-transfer-encoding; bh=z7pbnhcun0cxDNFbutIi0zQ3uYITFRp+E+8VBAtnKcc=; b=GnbK+sDA45a8xm+cIkM23lQY9fWWsaS3h+EccExuDZbJf4YYQGLn995J/YD2vUIVKg t+VJ3nqQsCclqLxVKWiRt12dU0y2olwViyUhGcMX75XTX+LnQ65IISY2v3YLiLknY5rf 8OmwAJqQlNbfqEj835hQ9+tj2ErWPVyQ+jVWU4rzJcYFrP4rryIfRgVfokoyUu76pdtC 9tXsde/JdWtjxQ6NzWeU1AxeUDtDmI4yKaMvvijvJoH5nn2Tws/s3N4UK2D9XEzOAxRo RWpPc+Mdzq5cVYFwJskVhiRSqm9K7nJm/fbBAQ/WnIXhuvMm4covNMcmlgLAHc6zEuvD XdCg== X-Gm-Message-State: APjAAAXnSfU77m9nDflfhyGJjN1vI6U4F5V34mI4+vljrOXcKCKOTbO+ uA2KR4/uCJkhJq4krpKnx96jtQYSRwo= X-Google-Smtp-Source: APXvYqxylTNRUiEwEnGZ26mfTWG9pKHdwGuuo2GZ3kjs6ysuDO0SgyHghAG3g0bczBJ8MvCZkh59tw== X-Received: by 2002:a17:90a:d807:: with SMTP id a7mr432288pjv.15.1579661392834; Tue, 21 Jan 2020 18:49:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 02/16] util/cacheinfo: fix crash when compiling with uClibc Date: Tue, 21 Jan 2020 16:49:32 -1000 Message-Id: <20200122024946.28484-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::102e 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: peter.maydell@linaro.org, Carlos Santos Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Carlos Santos uClibc defines _SC_LEVEL1_ICACHE_LINESIZE and _SC_LEVEL1_DCACHE_LINESIZE but the corresponding sysconf calls returns -1, which is a valid result, meaning that the limit is indeterminate. Handle this situation using the fallback values instead of crashing due to an assertion failure. Signed-off-by: Carlos Santos Message-Id: <20191017123713.30192-1-casantos@redhat.com> Signed-off-by: Richard Henderson --- util/cacheinfo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/util/cacheinfo.c b/util/cacheinfo.c index ea6f3e99bf..d94dc6adc8 100644 --- a/util/cacheinfo.c +++ b/util/cacheinfo.c @@ -93,10 +93,16 @@ static void sys_cache_info(int *isize, int *dsize) static void sys_cache_info(int *isize, int *dsize) { # ifdef _SC_LEVEL1_ICACHE_LINESIZE - *isize =3D sysconf(_SC_LEVEL1_ICACHE_LINESIZE); + int tmp_isize =3D (int) sysconf(_SC_LEVEL1_ICACHE_LINESIZE); + if (tmp_isize > 0) { + *isize =3D tmp_isize; + } # endif # ifdef _SC_LEVEL1_DCACHE_LINESIZE - *dsize =3D sysconf(_SC_LEVEL1_DCACHE_LINESIZE); + int tmp_dsize =3D (int) sysconf(_SC_LEVEL1_DCACHE_LINESIZE); + if (tmp_dsize > 0) { + *dsize =3D tmp_dsize; + } # endif } #endif /* sys_cache_info */ --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661795; cv=none; d=zohomail.com; s=zohoarc; b=XM26UvYvO0Dj//zospxBxPuPIgNbLkeWrSQgzukaV46BHGqaJmoSGFq2wGGLdkdqxpGN46sZVGxAbndRPAMJKoZldESLFci5k+35NO/0QH/09duy9KPB/7BtD7OVA9vRDdbUnMOWAlpc0tfCcGhFvIzVBrMy8gfeGf8NNrbOHQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661795; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pu4pttn5OmCwY0HJaYMHcfh+W4ea/gLi0/NHNHqzkuE=; b=X125HG1tSHi0//ZY0uNcIxNNwLchplEKlVw4Waj+ona9zu75aaMbo3l9HA4CW2DBgezOiHNR6Y/r8tEZXswSnxUd5s8nOofBWl3ahLzVU6H39INLT7BLw2ZhGkXCUy+dpHLHEyUgkBK3SrPKFb0e9MNKghcHQjmiYoMMerC/MJs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661795952965.8196014557178; Tue, 21 Jan 2020 18:56:35 -0800 (PST) Received: from localhost ([::1]:35784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6C2-0005h4-N7 for importer@patchew.org; Tue, 21 Jan 2020 21:56:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45162) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65d-0005Q4-4G for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65c-0002i8-2M for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:56 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:43676) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65b-0002hu-TK for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:56 -0500 Received: by mail-pg1-x532.google.com with SMTP id k197so2619496pga.10 for ; Tue, 21 Jan 2020 18:49:55 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:49:54 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=pu4pttn5OmCwY0HJaYMHcfh+W4ea/gLi0/NHNHqzkuE=; b=NgsC7cOWeLZVaPsRjLhoCfJrNM+JKWSph6ovGHKMiRHrBc5k7rwehgs/c0D50IzSeR 6ZJKnbNMecxmfphE0ASimZV4/EU6pSRD6Z2YiG0hZBcfP8RFMypdAjwDQmlC56SL+Hk3 G3C+4JX4D12PDGpjCZT/PLSTToxqyidlV8/UtYGY4Iryy7IFBsZHTsPq7ZA4yqitAfOI zAbE4J2s7bm0aUeQOZwtl1eRmgvtZpHUkRfaTaVGm23EGSNhM1ltWAMLdeMdXX0h7sNe vxcnFpzRCzHjWGevqqErdgLrxdVa0AZNPmE7UlMaLvRWTFbLiEZcvLTABBvOycqVBP7F jO4w== 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:mime-version:content-transfer-encoding; bh=pu4pttn5OmCwY0HJaYMHcfh+W4ea/gLi0/NHNHqzkuE=; b=dZmJXu/3SX9wrazr7h3xRP1sJCpIY0jPgHUObp+SSjgdlbR4X4AlXh80nsMSpTkpmL UZLea/VJfwUX3PDDverG1tsIY38TUkT5TKmcEWkjwCOZVG3jB9d1G8Bnig2CDRW1jIsr Y8dBOBb9/3bUzR0t27ZGpThdXcsZkasrjsXzxe1Eig1CHHcycgJgiLR/Hu7eoYZ7wpk4 XS5c4Ccu3AHaXovC+hTwLKkl4fygAMEhiNq6lRfBBQOiPPs9b1Z4qUN91FPoykdnyH49 5IPF4iuT5wvUut9GZMK49S6YcUF1Ri79M6S6Z7GbYTnIGAuJZ7hggkYQa9XytiJOtkHx jquA== X-Gm-Message-State: APjAAAVoQWzy6uttMUU8SdP2VEca5cdNINMitCRfD47rJRX24P1UdQO+ UOCLNXsdxfTngTLHTHk4kj5YkDbRkjg= X-Google-Smtp-Source: APXvYqwD2FPN6Idg2uOYYUU0C2Tq9jfqHhCHwzBqSYOC2keEYzJSEeSXJMii9U5tUKogAOek+4BLrA== X-Received: by 2002:a63:2ad8:: with SMTP id q207mr8772938pgq.45.1579661394669; Tue, 21 Jan 2020 18:49:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/16] vl: Remove unused variable in configure_accelerators Date: Tue, 21 Jan 2020 16:49:33 -1000 Message-Id: <20200122024946.28484-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::532 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: peter.maydell@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The accel_initialised variable no longer has any setters. Fixes: 6f6e1698a68c Acked-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed by: Aleksandar Markovic Signed-off-by: Richard Henderson --- vl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 71d3e7eefb..da5bf2de27 100644 --- a/vl.c +++ b/vl.c @@ -2756,7 +2756,6 @@ static void configure_accelerators(const char *progna= me) { const char *accel; char **accel_list, **tmp; - bool accel_initialised =3D false; bool init_failed =3D false; =20 qemu_opts_foreach(qemu_find_opts("icount"), @@ -2783,7 +2782,7 @@ static void configure_accelerators(const char *progna= me) =20 accel_list =3D g_strsplit(accel, ":", 0); =20 - for (tmp =3D accel_list; !accel_initialised && tmp && *tmp; tmp++)= { + for (tmp =3D accel_list; tmp && *tmp; tmp++) { /* * Filter invalid accelerators here, to prevent obscenities * such as "-machine accel=3Dtcg,,thread=3Dsingle". --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661651; cv=none; d=zohomail.com; s=zohoarc; b=mP5yRWTFHLjWFzRCiU6CiHfc2PgMB4JPVcjQ76OvX9ckvWJ/xS9XHQ1iwS3oHMF0IegD4/wAmzgBWEPhwA4imp+BgJB03rhZCI64IB4ZdwaDIQJcAAo/SP1XBqfLQl1rKY0FO0wKK0dRy6TYOFzOZs6URz9c9toX59j0CNoN2KY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661651; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xHv4f0JmN5WxUUYKqDgfyhWuDMzuO34D5maeyp28uZ4=; b=XwXfLTF8aBRv8LlIwboiYx14cS+BbnBCPnLjdZ4I6EN63bPopNwilP+/Izcaoc0EXsc3k5T6NhCBF2+r4XaoyflOwncXr1pvUlv+mqLyQMlKg6sW24LFSkA2cENockqYx54j+Vrd8l5JsSpwGsQVY6IyWMu+1/aeys8PnZ6w2+U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661651489667.4959631206689; Tue, 21 Jan 2020 18:54:11 -0800 (PST) Received: from localhost ([::1]:35732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu69h-0002D6-Sv for importer@patchew.org; Tue, 21 Jan 2020 21:54:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45174) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65e-0005Tp-RW for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65d-0002is-RH for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:58 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:34035) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65d-0002iS-M0 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:57 -0500 Received: by mail-pg1-x544.google.com with SMTP id r11so2650178pgf.1 for ; Tue, 21 Jan 2020 18:49:57 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:49:55 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=xHv4f0JmN5WxUUYKqDgfyhWuDMzuO34D5maeyp28uZ4=; b=NFYDrYzsEiXiFYYbW4USPAmua5f8Npmj+m+mYCEudC0NUWYWZ2faantl21NKuTQ8q4 631VKIcE4qB6Ez9P5IOl27kU9PzawLNgoYZ7nNYrIJTy5Bm/0Rk73kA7X3hQiAPP08EK voYasp1iDBFICU7at5mpngeytBIsn3cXB7vfCAARM7yUmV0Q85a+cswosVXHsXMxvifH Uhohre08e44uN+Z+J0iiPSt5s/hXG3K/HsnAVOszP7aTXUREiAZr/WK4zGBzg0+Mn+CS pUKChB4Nh0neSoMhrF8MqJpgekOFw0YcGf1pfFeP7hG8u9WhSSmyZV39kCCK1wnb+Cxv Ik1g== 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:mime-version:content-transfer-encoding; bh=xHv4f0JmN5WxUUYKqDgfyhWuDMzuO34D5maeyp28uZ4=; b=R3J5RoBQtD0sqG8pzobLP9IOdHKrU7+fImhHI6T5YcMWZGFihJdy+DrZmoQDt0qukF c2e8sA7otqro3E9uh25W866nO45GBbePuohoSr/EKR7ZMvX7w0bBa/Muhzbs3MybItt+ hl1bbWzFQ6+b1Z70smKiwZNsXIKn88d/iW3wUHPyHnoJ4eLt7BgcGbEJlFy1XJsCJksZ kartVi1+9HxbC33s+ZI1uUD/yoYKdLetzqUHM9hq8FvfMJawzQo8vMGmIFOLcEmHlBZF sE3js41Pv0hmBoZqJuK1f1Mgg2c9I5yZyZU40Tmg9cm+J02vgV26rAsz+v0PPPq0SaEd xFrA== X-Gm-Message-State: APjAAAWTJ7y58zmZBEx3fMGD/OBnRko7YFCs1Lcq/y6FiaSR0OXs3Wu2 Uqtp3t1VuR2Mf0pd+9GVcBSvih6pVaw= X-Google-Smtp-Source: APXvYqxDP1hX6sU/hqn/k8qPf2sb8xq47lVzm+qDTCZ0/iOCE+pvm1Y5vm9DH0jKiEs6OXFqLHwYIw== X-Received: by 2002:aa7:9729:: with SMTP id k9mr610452pfg.72.1579661396404; Tue, 21 Jan 2020 18:49:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 04/16] vl: Reduce scope of variables in configure_accelerators Date: Tue, 21 Jan 2020 16:49:34 -1000 Message-Id: <20200122024946.28484-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 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: peter.maydell@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The accel_list and tmp variables are only used when manufacturing -machine accel, options based on -accel. Acked-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Reviewed by: Aleksandar Markovic Signed-off-by: Richard Henderson --- vl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index da5bf2de27..94c9301e7f 100644 --- a/vl.c +++ b/vl.c @@ -2755,7 +2755,6 @@ static int do_configure_accelerator(void *opaque, Qem= uOpts *opts, Error **errp) static void configure_accelerators(const char *progname) { const char *accel; - char **accel_list, **tmp; bool init_failed =3D false; =20 qemu_opts_foreach(qemu_find_opts("icount"), @@ -2763,6 +2762,8 @@ static void configure_accelerators(const char *progna= me) =20 accel =3D qemu_opt_get(qemu_get_machine_opts(), "accel"); if (QTAILQ_EMPTY(&qemu_accel_opts.head)) { + char **accel_list, **tmp; + if (accel =3D=3D NULL) { /* Select the default accelerator */ if (!accel_find("tcg") && !accel_find("kvm")) { --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661795; cv=none; d=zohomail.com; s=zohoarc; b=fGtQFk6gCv+CpsTQt4zV8dlAMkBVAOLlG/ujFt/5BLnQTWQzBq17krlsQPfVWk8CCycqjIIjLj0pcYTIBktMTwW4ZctfVZTMwRpcSpcqcz54sFMpCAf422WN6c+6AjLq5EyL+udkYl7fCj7YYYIP9jDOCJxtqUWMUWJo8hGipRM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661795; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9qn6/Kr8nQny0P1ZY5wKZEoB92qxHxFg7JpuXIVQ1XE=; b=OmonQ5g8wekKrudpTk2/KJpgX3e11Gm3RVSqsVyvkgK6JMN8rTOKkn4HitG7beT41BWM+YY50Hcp9yO/Mm3v+m2yHHlMxuzmHJhLbWBhhCm8KekSOnP1BcalTkuvnnG/iddgzzKh6DU1+FUdRrPI7uG597by/oLforT54QZa5Bw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661795947967.7849843165019; Tue, 21 Jan 2020 18:56:35 -0800 (PST) Received: from localhost ([::1]:35788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6C2-0005lg-N8 for importer@patchew.org; Tue, 21 Jan 2020 21:56:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45188) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65g-0005Wh-Ps for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65f-0002jk-PI for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:00 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:50544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65f-0002jS-JQ for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:49:59 -0500 Received: by mail-pj1-x1033.google.com with SMTP id r67so2396172pjb.0 for ; Tue, 21 Jan 2020 18:49:59 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:49:57 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=9qn6/Kr8nQny0P1ZY5wKZEoB92qxHxFg7JpuXIVQ1XE=; b=LCVfjbU0gmt3EUpnAgy7NnhvVDgePmiawksVZ3kWjVxACMPBMBd6+ayyi6ojYmntX1 zgQ3EWdxUVtKrlkdI0WzFVuMdPD0xuJg9vTqArJUlJLmSE1LI/0X5khMaE3DAtJn2A3r au8JkBH08V6eGD9zOhrAaoaosq15XXlvo55SQL0YkDeh0vnVbezuUeWk5OGSgMBsN1I8 JM89ZSkMJb0KwIa5JwjVMbbW4GaAsN0kh43nuUF4YAYX8vXdnh09RSUjgQoSYSsL+sQX Q/umWw5q2fl1F6dC95VOBKwt7XS2izv6EfhrKpL4lb2fbwXUhCBkfYm/o/aUNRw9CETs ARyQ== 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:mime-version:content-transfer-encoding; bh=9qn6/Kr8nQny0P1ZY5wKZEoB92qxHxFg7JpuXIVQ1XE=; b=dPM9NyuPw3UFHBiue8ziUo9SKHAICND6cJ1pD/G7XI4hoWVPpw9KJDIEHVGjS2UMqY Uwkc3Vpten92SKHU9GCbX5QIETmbaXkdFm6SESltypX2HlTXx9Sb0MX3q12o2UPCtIl1 veBWRjFX3ooHNFiTYK1ZgL8xCkyuqkbVL8GPVEGzW97+izaKL8x0b0q+p8T4bV23Ku68 klsJTqZHt4XeV/bppDhm4Fp3NrHyc1irqxKimyQuzegqSlC2iPUrrqFZMttbLQ0TKnPe A1SmPorIbvziW+NsOfM7oOVzy6W+idNfhyAhVMzR/5I6pd1CdUa34IhLg5ji4UiRLaiW 9kjw== X-Gm-Message-State: APjAAAW+OO3SJPDRh9MRMlqIuw+ErAQ7VgS+SDgjJK3fH50vcJ2fbbWb +hhgO+SBaVavSsx8QxEs6y6FFAiUcI0= X-Google-Smtp-Source: APXvYqxGaUeSwg1dZYHi/srigCpDgoKrzzDErpTPuhM/YQ8uHtooGsnpt51dvP84wT8o5WGbFWF//A== X-Received: by 2002:a17:902:7009:: with SMTP id y9mr8665732plk.254.1579661398385; Tue, 21 Jan 2020 18:49:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 05/16] vl: Remove useless test in configure_accelerators Date: Tue, 21 Jan 2020 16:49:35 -1000 Message-Id: <20200122024946.28484-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1033 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: peter.maydell@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The result of g_strsplit is never NULL. Acked-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed by: Aleksandar Markovic Signed-off-by: Richard Henderson --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 94c9301e7f..1e5e9b9aeb 100644 --- a/vl.c +++ b/vl.c @@ -2783,7 +2783,7 @@ static void configure_accelerators(const char *progna= me) =20 accel_list =3D g_strsplit(accel, ":", 0); =20 - for (tmp =3D accel_list; tmp && *tmp; tmp++) { + for (tmp =3D accel_list; *tmp; tmp++) { /* * Filter invalid accelerators here, to prevent obscenities * such as "-machine accel=3Dtcg,,thread=3Dsingle". --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661936; cv=none; d=zohomail.com; s=zohoarc; b=fbuDO8PBg1uqSH2iel++SKvYy+7tvrLp2VFvXKTcH68clmkv58hWfD1df+YP2jNlndMkHdr6dYVLoWubIzwwAP/cNLKXGi9qKQNBC4e35MHgKaTpsv/wGVK2U3kCn+va8d9n20Ntvk6mn5vnxrE8g43HegNEywASESNg6kHeSBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661936; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2rUEM0gwnbOEePRjkDj6MANZGx/QWCSdQiyiEsobitQ=; b=c/9oi7im/bQVWy3xTbizJVHOuJ9l/vCCvTx66ZWkEX7oHQ5LypILaT2Uq1aVwFSpDGBoH3IZQMit9GLdu2O6cG9/bkZmIYJzqXOe/7Qi49Zx2P9MMhW0eYoQRayD8ZtBewLi5UeQ1m6IFlpBJVohIR5RpWDUHjT7+5egEKPL3mY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661936955401.56172796241094; Tue, 21 Jan 2020 18:58:56 -0800 (PST) Received: from localhost ([::1]:35822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6EJ-0008UT-8l for importer@patchew.org; Tue, 21 Jan 2020 21:58:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45200) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65k-0005bt-2m for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65h-0002kY-HA for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:03 -0500 Received: from mail-pj1-x1042.google.com ([2607:f8b0:4864:20::1042]:55776) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65h-0002kC-Ad for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:01 -0500 Received: by mail-pj1-x1042.google.com with SMTP id d5so2383858pjz.5 for ; Tue, 21 Jan 2020 18:50:01 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:49:59 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=2rUEM0gwnbOEePRjkDj6MANZGx/QWCSdQiyiEsobitQ=; b=L6jhPu+qwOtZaprrpA9lBOjcOWjdsHQU53tfQivMEMDzLVZ8PeM2++n7oVPig9QFtD 8l0IunoTgc63/g8Yu36geQ3Y1yS1sbuk3jAZgktwbSdfqAiIIfAtRiCTlpeMNUuwk3m+ WP9krt/o81SeM713J/zlMw39/2fy1IhE7PcU8GGW75QAR7Mh91PUY9/jBr/1ZGoI56Wf XsrAcgd1Fs4rAAJ0wHvw3Ypdp4RW7suMyh9GExXUfCpxRfbRhoxPxRiM9n6PNj7yiT5j 4s9r17Fk7HbdiFvRRsAiWxyYyejepBB7X+Jfp8B3aANV9FChrMmOqDkRvj/6KF9DK5x7 rxIg== 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:mime-version:content-transfer-encoding; bh=2rUEM0gwnbOEePRjkDj6MANZGx/QWCSdQiyiEsobitQ=; b=YonZy2RIeykRdhDKpxXTIuF7bZKw31SSp1Es9864wpy775EaOqiGLlLakdYu84L6c2 wmY7YB9hPzSFx6wdMAIh86m/Ix0DSegOL1sx91C4qV9HlW56TPKtEHct2dTlvzdKgGVh rLbWuindw/lAzrHi2Je10YWbBIPpLyv/JBziRMaKIlIYHMcgI+Tw4dTxSoNAGq7UNp1L w6aXo36iof0Re31GaMqDJDN8/66Mq1BBG1n+nREeMHKuJXhv+4LVdNZ1vKTF4CflQ/h6 t0l5qVmCrXRY8S2SqbW4mjGDu9FuCN8wM9KsmoURXaQ1vUkTxx58qiHbY1Dxh544oIg1 UBpg== X-Gm-Message-State: APjAAAWRPFrwGWBgqK19KK3MPhXK67rb7+qLoSSQ72wWgbSUW+wZF2vz GITCdbDLZbvzFPopkrmwGCXh9nF9GLQ= X-Google-Smtp-Source: APXvYqyH9PJVNPKJBbtdIxv6O+KwFD9AglAKOL5yk9SoR+qY64Dcn7xoE8qLnlzNGLVYz8zBAqvS1w== X-Received: by 2002:a17:902:7296:: with SMTP id d22mr8926428pll.55.1579661400071; Tue, 21 Jan 2020 18:50:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 06/16] vl: Only choose enabled accelerators in configure_accelerators Date: Tue, 21 Jan 2020 16:49:36 -1000 Message-Id: <20200122024946.28484-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1042 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: peter.maydell@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) By choosing "tcg:kvm" when kvm is not enabled, we generate an incorrect warning: "invalid accelerator kvm". At the same time, use g_str_has_suffix rather than open-coding the same operation. Presumably the inverse is also true with --disable-tcg. Fixes: 28a0961757fc Acked-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e Reviewed by: Aleksandar Markovic Signed-off-by: Richard Henderson --- vl.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/vl.c b/vl.c index 1e5e9b9aeb..4c5033842c 100644 --- a/vl.c +++ b/vl.c @@ -2766,21 +2766,26 @@ static void configure_accelerators(const char *prog= name) =20 if (accel =3D=3D NULL) { /* Select the default accelerator */ - if (!accel_find("tcg") && !accel_find("kvm")) { - error_report("No accelerator selected and" - " no default accelerator available"); - exit(1); - } else { - int pnlen =3D strlen(progname); - if (pnlen >=3D 3 && g_str_equal(&progname[pnlen - 3], "kvm= ")) { + bool have_tcg =3D accel_find("tcg"); + bool have_kvm =3D accel_find("kvm"); + + if (have_tcg && have_kvm) { + if (g_str_has_suffix(progname, "kvm")) { /* If the program name ends with "kvm", we prefer KVM = */ accel =3D "kvm:tcg"; } else { accel =3D "tcg:kvm"; } + } else if (have_kvm) { + accel =3D "kvm"; + } else if (have_tcg) { + accel =3D "tcg"; + } else { + error_report("No accelerator selected and" + " no default accelerator available"); + exit(1); } } - accel_list =3D g_strsplit(accel, ":", 0); =20 for (tmp =3D accel_list; *tmp; tmp++) { --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661530; cv=none; d=zohomail.com; s=zohoarc; b=ZZ8cepAqlp86PPGElWCkpaVtdIXTvPASAlS87g7JTGIU6hPzihAynoYlZBuR4pc0ZDozTJK76dnGLyirORLJqi1LB9pCAPrmxCT817+8ta0ERTmx1GYAb2xogKm79cXIVDyQrE20MWRIzSFpDF4jARDCMV6FRq5/JycdAlnSOLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661530; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6xOoTwiPWbJWg1dQvhdtD+14yzwztym6bWFoctdkQiM=; b=XEVmjGxF8onO8HcHWCwlvDDvF3k8CrXOZk7n+knNT19+cZuRvpbD6SOUAKAWe6xx0z12gwmEm2YcsULo6h+3wCr9Yk/QV6fgRaDNTFRsJsuz5rFTqDbOwtgpFq+4agb3F2lTqw03FI3CWix8CA8/kRAI3CkAQAR07pVG6ZHZt0Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661530586613.8627291880545; Tue, 21 Jan 2020 18:52:10 -0800 (PST) Received: from localhost ([::1]:35688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu67l-0007qR-2i for importer@patchew.org; Tue, 21 Jan 2020 21:52:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45212) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65m-0005eX-0f for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65k-0002lV-5j for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:05 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:45633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65k-0002kx-0T for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:04 -0500 Received: by mail-pg1-x543.google.com with SMTP id b9so2608439pgk.12 for ; Tue, 21 Jan 2020 18:50:02 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:01 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=6xOoTwiPWbJWg1dQvhdtD+14yzwztym6bWFoctdkQiM=; b=kz+qWa5+Z+v/qQftTxebP/DJ4lqYonIlT73ayK6t/p9ob/c3lzdsCrsA201cNA1Gll BcuYKQdWK8lqU5elp6mTA16gpqRBVbVOG26wZmMdk/QHpWT7vDiOP5Utx367FfeQnLAx rA46XRbP9JqZFfNS9ctyduB2uffw5+RUBBxHOokGBpyM4c9ViqfX7cYg22eFtJqtLS+m t2HdWFVanYyNcEgmNfpE/hi/FDeyyPlNvXMYfyqTLX07jRB0l6OqnABahMvwXn37fIcG J445cvq7Sd4f/PyK+FKaBPi/1+9gbHyd/lfQQfoPkNWSVkycIZhv2JZQEc5790U2ReFs Q3rA== 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:mime-version:content-transfer-encoding; bh=6xOoTwiPWbJWg1dQvhdtD+14yzwztym6bWFoctdkQiM=; b=CHWA41Hc0AsGHYuK7m1pxLGLNxLndBOlsn1FCBPxkILMIeRLp2vqyR/MYYkGLTPrn+ 1Lv393sU8yyxRU82YjXWH7hGtYVjOqLBmFpP3eAC9m6fAyP7yI/6SrB2rSnFcQ315dFu RLEjNxnlVZdYDI84Fc8Enq6LaGdPcia4OK2Sr8o6WEfPwGsD6hRp/Fxb3vmO7mCidrRn wHWzfli/p8H7ujWg3wQAiqE+5Cdyyrs4jxX0OmNsbDdEsaPP5SI4une49yppvLUYuyE4 JsbiyQ7oxncNRcBfR47He53Suy435VQHrVNVUzGzYV4/1EqCYkXnaimbu9cIn357vvfp 6cow== X-Gm-Message-State: APjAAAXP0njcRq7OZRqnvUvCvym1q3gU6SCMy9Dmpzy0m3tMlxi6Gfud SlYEEe0GhhsqoEio5pPD3FSYYTf26mw= X-Google-Smtp-Source: APXvYqzNwo6Sr1TuBt4tfMN5kcXQ//tKME085H2vus2z0X4Og1j4uk4UZRsUmWJnOZrTGIms/LlgUw== X-Received: by 2002:a65:4109:: with SMTP id w9mr8683687pgp.383.1579661401842; Tue, 21 Jan 2020 18:50:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/16] cputlb: Merge tlb_table_flush_by_mmuidx into tlb_flush_one_mmuidx_locked Date: Tue, 21 Jan 2020 16:49:37 -1000 Message-Id: <20200122024946.28484-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: peter.maydell@linaro.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) There is only one caller for tlb_table_flush_by_mmuidx. Place the result at the earlier line number, due to an expected user in the near future. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 02b381cf50..3a4881cf69 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -224,11 +224,16 @@ static void tlb_mmu_resize_locked(CPUArchState *env, = int mmu_idx) } } =20 -static inline void tlb_table_flush_by_mmuidx(CPUArchState *env, int mmu_id= x) +static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) { tlb_mmu_resize_locked(env, mmu_idx); - memset(env_tlb(env)->f[mmu_idx].table, -1, sizeof_tlb(env, mmu_idx)); env_tlb(env)->d[mmu_idx].n_used_entries =3D 0; + env_tlb(env)->d[mmu_idx].large_page_addr =3D -1; + env_tlb(env)->d[mmu_idx].large_page_mask =3D -1; + env_tlb(env)->d[mmu_idx].vindex =3D 0; + memset(env_tlb(env)->f[mmu_idx].table, -1, sizeof_tlb(env, mmu_idx)); + memset(env_tlb(env)->d[mmu_idx].vtable, -1, + sizeof(env_tlb(env)->d[0].vtable)); } =20 static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu= _idx) @@ -289,16 +294,6 @@ void tlb_flush_counts(size_t *pfull, size_t *ppart, si= ze_t *pelide) *pelide =3D elide; } =20 -static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) -{ - tlb_table_flush_by_mmuidx(env, mmu_idx); - env_tlb(env)->d[mmu_idx].large_page_addr =3D -1; - env_tlb(env)->d[mmu_idx].large_page_mask =3D -1; - env_tlb(env)->d[mmu_idx].vindex =3D 0; - memset(env_tlb(env)->d[mmu_idx].vtable, -1, - sizeof(env_tlb(env)->d[0].vtable)); -} - static void tlb_flush_by_mmuidx_async_work(CPUState *cpu, run_on_cpu_data = data) { CPUArchState *env =3D cpu->env_ptr; --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579662044; cv=none; d=zohomail.com; s=zohoarc; b=bSVzfqwUR9Rqp81C/8MihUEY00qIvBwGwUuEQ8B/NJDcqikC/t20fFsL3l9Lp3AEAIdTsQnHbYGGQGlEiFP1COQSl+qeiDFGALZOpUlxckDrXc+sCSeiK9xSDKkJz86PzWpVZ1mfExxD2BJIt1VGsiuy9JbJn4V2IlrPtm2RRd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579662044; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dYsBbKvboqEn2Q05z2r8sR33xxD2SrXUDQPkfTlhf+A=; b=mWmc6oKw5SOyx/2VUHPegt/LWqs2zTL00HREQzfCGQWpputsWCnhjFrA1uS6GYb/ku0x5C2rEugYf0D3O1Fnk96tdd3kl8frgc7+9T0IXDsHuY+jQwB2RwfaINvYpCvAfhvCvufd/oQg9wbbYESvZvigLeR0Hju3PyZ8KUuy/7I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579662044581875.7262852969427; Tue, 21 Jan 2020 19:00:44 -0800 (PST) Received: from localhost ([::1]:35870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6G2-0002DB-Vp for importer@patchew.org; Tue, 21 Jan 2020 22:00:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45224) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65n-0005gb-97 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65m-0002m8-4W for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:07 -0500 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:55135) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65l-0002lf-V5 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:06 -0500 Received: by mail-pj1-x1043.google.com with SMTP id kx11so2383270pjb.4 for ; Tue, 21 Jan 2020 18:50:05 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:03 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=dYsBbKvboqEn2Q05z2r8sR33xxD2SrXUDQPkfTlhf+A=; b=CZaaOtlpbwcvnRTL3mrCRh/kgeGRZ4f4XBdZVzJiHsSmXKB+Eg6LHUnHapQJcm/5ZJ Xxm15IncKPqpuZWKm5LUsWnpUrEF1VT6So9E43vWCU42x6BvCYdXkVwqGmEE+NPqNMcm XZrVN588pXxd56E7Ik77BjNrA7rw1OMecsoOPUWVOieXXFAy0F3OVgoLzqd2vl7tyAd0 nNx3ALzHrKSr3PzoKZUHwcADjnRXkh0GDiS4vEhFa6EN6ZNXsswKjiePN3RNTEf3BAtj d7ozc5oqsmtHZXrLLnDVqNm+GjGveM4uOTzBAdUBUIpTZ6I5FWoTPY/NqxWs0ha+CAwt x6FA== 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:mime-version:content-transfer-encoding; bh=dYsBbKvboqEn2Q05z2r8sR33xxD2SrXUDQPkfTlhf+A=; b=kRdC8d7gYXbNUViNL03cr2zLwHNaf9w28wNWU90UTMrO98vd0ZqBch0xclwHEOqTQO WwYftpZER2ZhTn9fD8xoEyKgmW9ugyi0wqZ4wMt0SDdj4qGJ5zI1uiV6YDVt+IoU68WD 37tyqOElLnY0j//8WHpbNjB5wiG+yy8Dl3WpepzVBkBxeEP+xzkIACHoI4KXgPxUmdbU 2U/HTJrwOTYftKcN9Xs8wcXaaf+Teqj4Hlp0A3rQvtOEnW71ZUwGahU4bWSOnn7Nf+oE FecAsTdxFC8jPzCfvYJrJNRqLphrl9iQG7B/7uUBbQsIZu0gW4hZherehSxZNRMkkYdp X8xw== X-Gm-Message-State: APjAAAWUlvs+IuRsBg0+Jb3qmTuYnFasIUlugh7rVleom/L06jgba+8U FitA+IBzZCJ4gx5CHbMKvZ9pNx/3mMQ= X-Google-Smtp-Source: APXvYqwL5xd9ujZPM9iVMOn4pAiopKOPkHa5jgYmWgm50r0kvFRtyVZzrAhqqupLR1YARVbwL99y2A== X-Received: by 2002:a17:902:8207:: with SMTP id x7mr8336772pln.185.1579661403897; Tue, 21 Jan 2020 18:50:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 08/16] cputlb: Make tlb_n_entries private to cputlb.c Date: Tue, 21 Jan 2020 16:49:38 -1000 Message-Id: <20200122024946.28484-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1043 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: peter.maydell@linaro.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) There are no users of this function outside cputlb.c, and its interface will change in the next patch. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- include/exec/cpu_ldst.h | 5 ----- accel/tcg/cputlb.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index a46116167c..53de19753a 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -234,11 +234,6 @@ static inline uintptr_t tlb_index(CPUArchState *env, u= intptr_t mmu_idx, return (addr >> TARGET_PAGE_BITS) & size_mask; } =20 -static inline size_t tlb_n_entries(CPUArchState *env, uintptr_t mmu_idx) -{ - return (env_tlb(env)->f[mmu_idx].mask >> CPU_TLB_ENTRY_BITS) + 1; -} - /* Find the TLB entry corresponding to the mmu_idx + address pair. */ static inline CPUTLBEntry *tlb_entry(CPUArchState *env, uintptr_t mmu_idx, target_ulong addr) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 3a4881cf69..500c56d74d 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -80,6 +80,11 @@ QEMU_BUILD_BUG_ON(sizeof(target_ulong) > sizeof(run_on_c= pu_data)); QEMU_BUILD_BUG_ON(NB_MMU_MODES > 16); #define ALL_MMUIDX_BITS ((1 << NB_MMU_MODES) - 1) =20 +static inline size_t tlb_n_entries(CPUArchState *env, uintptr_t mmu_idx) +{ + return (env_tlb(env)->f[mmu_idx].mask >> CPU_TLB_ENTRY_BITS) + 1; +} + static inline size_t sizeof_tlb(CPUArchState *env, uintptr_t mmu_idx) { return env_tlb(env)->f[mmu_idx].mask + (1 << CPU_TLB_ENTRY_BITS); --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661677; cv=none; d=zohomail.com; s=zohoarc; b=ReHxj+xMr2eBEDW3s1r05ZGyK5Gj0MW1BRqug229xT9V0apulopsgZcGq53oYiWiOpZBb+rSR3ms0x0M/lLgA8USpVU/5YYghwz9psZTohtStbI9p6hwQ+5C8xbKZ7SE91X9637WFc6u4Ob4QCuhfWpexvovt6EPbEmalnYLdaE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661677; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LhXy4iUjavswiSO2/mQ5JX54ZZQdZ3jpXP3LWsXowkI=; b=O+Q5z651yDJ1a+F8emB7PMg0bufvkPhASiokIg84ytzn9lh3wmQXbl2Z83DqEFJt8uVaBdlCUWgn1IHI8Psq1MKp3zklM6bDkmIkPAGRgJOXPIzCApEF7W4VGozRtAB/h0t5X6YraEEs6ptAHo/IhdJF496RrV9G+kWw4SwRnpk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661677552350.3624646739802; Tue, 21 Jan 2020 18:54:37 -0800 (PST) Received: from localhost ([::1]:35736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6A8-0002uT-4b for importer@patchew.org; Tue, 21 Jan 2020 21:54:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45236) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65o-0005iV-Ef for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65n-0002mc-9f for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:08 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:41179) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65n-0002mH-41 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:07 -0500 Received: by mail-pl1-x644.google.com with SMTP id t14so2256989plr.8 for ; Tue, 21 Jan 2020 18:50:07 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:05 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=LhXy4iUjavswiSO2/mQ5JX54ZZQdZ3jpXP3LWsXowkI=; b=oGgKYogyffPAeHHV0zp7Ai46aZ39EbHTIvqEI9n9f93jO9qr/UdzL+KpSKpHi3DSaH 0FrZwZL/3nhEdO4rmbTeBVeQfFk95y4SGEjuM1Ib9xoToXW9KcsO/DUHroA5G2gouHuC FJSjx/rfC9k0srTpn9HBsyh4QhDo0WkGeG4uDIoA57Q4wEd+iotOyU0wnMqF9/ym/3q6 rsqDwFAUlEH/4z4nY7TxiYLXd0lx1VhF54/y/JGj0Fspw7oxn21lpvLp94l+b81UWRQF sG2EPlyJsu7XdzAeacNllsLVx0VK534KcHHmaNajDFYw9rE44NIzdl++anSd4AWy7xCM y68w== 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:mime-version:content-transfer-encoding; bh=LhXy4iUjavswiSO2/mQ5JX54ZZQdZ3jpXP3LWsXowkI=; b=F2JiMnpt+hYMYl+KRRWYOo7cA4D6OA03i+KmC+XwPL0A1Vj1syRy92O3TN0CuYHBpL BnDZ6WSLD7sm7Dt62PAJtFdtq9rpwKeeqBDyFEj5tafM1sjI1ETMGbvrjCVl553BNcHy FjZ782+uh3+F/sOy5xtVX/QQwU18g5WWI48Y6e5+tKh6LSdhy3H/A9MVWhm4NkkPkdDO qAwk7NcaqaqL8KzxZU41YptvvSlDFeuwTZ1BIgZkLwHtHCHAfOEKS3OUOqPXZb4bx777 5b0C3HmLifawqfIbSVcb3IYtVwf1qMq9W2A7JDAo7uugMIzp8591Nu1iN63h6fOwryTz gpkQ== X-Gm-Message-State: APjAAAXjoe7KL8hRjzFtEKietawe7cw/i1VH9nE66sv5m6yvOlnCmq3/ VbYgug3iMbqUWkNgB4SEXbS4VXKiBAA= X-Google-Smtp-Source: APXvYqwd401eJQFUGEd1cNiEW6dlReOTrN+Vx1o9QNYTv93tONL+q5FcTP0itvIqZxaaXpyarpLuXQ== X-Received: by 2002:a17:902:be06:: with SMTP id r6mr7887537pls.99.1579661405845; Tue, 21 Jan 2020 18:50:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 09/16] cputlb: Pass CPUTLBDescFast to tlb_n_entries and sizeof_tlb Date: Tue, 21 Jan 2020 16:49:39 -1000 Message-Id: <20200122024946.28484-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 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: peter.maydell@linaro.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We do not need the entire CPUArchState to compute these values. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 500c56d74d..cc6f4c994b 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -80,14 +80,14 @@ QEMU_BUILD_BUG_ON(sizeof(target_ulong) > sizeof(run_on_= cpu_data)); QEMU_BUILD_BUG_ON(NB_MMU_MODES > 16); #define ALL_MMUIDX_BITS ((1 << NB_MMU_MODES) - 1) =20 -static inline size_t tlb_n_entries(CPUArchState *env, uintptr_t mmu_idx) +static inline size_t tlb_n_entries(CPUTLBDescFast *fast) { - return (env_tlb(env)->f[mmu_idx].mask >> CPU_TLB_ENTRY_BITS) + 1; + return (fast->mask >> CPU_TLB_ENTRY_BITS) + 1; } =20 -static inline size_t sizeof_tlb(CPUArchState *env, uintptr_t mmu_idx) +static inline size_t sizeof_tlb(CPUTLBDescFast *fast) { - return env_tlb(env)->f[mmu_idx].mask + (1 << CPU_TLB_ENTRY_BITS); + return fast->mask + (1 << CPU_TLB_ENTRY_BITS); } =20 static void tlb_window_reset(CPUTLBDesc *desc, int64_t ns, @@ -156,7 +156,7 @@ static void tlb_dyn_init(CPUArchState *env) static void tlb_mmu_resize_locked(CPUArchState *env, int mmu_idx) { CPUTLBDesc *desc =3D &env_tlb(env)->d[mmu_idx]; - size_t old_size =3D tlb_n_entries(env, mmu_idx); + size_t old_size =3D tlb_n_entries(&env_tlb(env)->f[mmu_idx]); size_t rate; size_t new_size =3D old_size; int64_t now =3D get_clock_realtime(); @@ -236,7 +236,8 @@ static void tlb_flush_one_mmuidx_locked(CPUArchState *e= nv, int mmu_idx) env_tlb(env)->d[mmu_idx].large_page_addr =3D -1; env_tlb(env)->d[mmu_idx].large_page_mask =3D -1; env_tlb(env)->d[mmu_idx].vindex =3D 0; - memset(env_tlb(env)->f[mmu_idx].table, -1, sizeof_tlb(env, mmu_idx)); + memset(env_tlb(env)->f[mmu_idx].table, -1, + sizeof_tlb(&env_tlb(env)->f[mmu_idx])); memset(env_tlb(env)->d[mmu_idx].vtable, -1, sizeof(env_tlb(env)->d[0].vtable)); } @@ -719,7 +720,7 @@ void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, = ram_addr_t length) qemu_spin_lock(&env_tlb(env)->c.lock); for (mmu_idx =3D 0; mmu_idx < NB_MMU_MODES; mmu_idx++) { unsigned int i; - unsigned int n =3D tlb_n_entries(env, mmu_idx); + unsigned int n =3D tlb_n_entries(&env_tlb(env)->f[mmu_idx]); =20 for (i =3D 0; i < n; i++) { tlb_reset_dirty_range_locked(&env_tlb(env)->f[mmu_idx].table[i= ], --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579662132; cv=none; d=zohomail.com; s=zohoarc; b=BfTWnhUghjS0N2wYDuQOifra+wko+T/xanpzvVL55IoU2B9ydpwKEay8Ynquab8w3g988X9UCMgzF/eFT2Ke7Kdvw8yWQ9k31M/W4Jk0fXfMvFPRU5mEQcAJPUWS7NHmdimkhXo7iPqk8DWKcHp8MZV+DYd0uGQAEmUFfzrBg+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579662132; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wIDWcLu0KGxPWYY161PaG0CZqx2uLhbLjATvWFH7yr4=; b=E7mtWZnbmtNTazp2h8FjxJb3TOU5W5V/qIaVMfbJKFF4stFCom7U89LiJE5ScJgOjAAsnUbw41cTmb4DwaoGQzdguy7aRh9tfUukW8eLnP+P9JkaNCdNj8MXjnpkAZA4KEZyu8If2et2LXERkTJ7zrqOHgCc1B/EG4aIg1jWP7k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579662132293160.11843492499122; Tue, 21 Jan 2020 19:02:12 -0800 (PST) Received: from localhost ([::1]:35884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6HT-00038o-9V for importer@patchew.org; Tue, 21 Jan 2020 22:02:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45249) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65q-0005lZ-CH for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65p-0002nN-4k for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:10 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:34673) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65o-0002n4-Vb for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:09 -0500 Received: by mail-pf1-x444.google.com with SMTP id i6so2571918pfc.1 for ; Tue, 21 Jan 2020 18:50:08 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:07 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=wIDWcLu0KGxPWYY161PaG0CZqx2uLhbLjATvWFH7yr4=; b=DyIBZv+a0wSwNfD2qYdhk/N28TFeF53UIc5tH23bi/mH6J7Nr4P0skLOjrhctA9bAJ fgftI0nXoLQBQxNkJ8EVjszP08DYfHDKY3Q5EQZTW2/3uz+14vSMNezd6dnn+LBsm8xj N1yQIimcgfIUtfpQXZEqTwpr6mrjgDv6mOIxOjD0RqKlWjVdTBmBHaUARP9cRQisy2MI lQERy5UHG9joLFErETcqhU6GjoOiZzdDD3tpADDgZUkWxeNDs2L6oh2ZFmeK6H+msIl1 ye7nrZLg+pQ26Q8eVO4SGjsx30c8XqF27Iw/2crNd410E84ZOc9yBGt6mHppxsmY1q9p DkHw== 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:mime-version:content-transfer-encoding; bh=wIDWcLu0KGxPWYY161PaG0CZqx2uLhbLjATvWFH7yr4=; b=lBejussY29YwME1SpFw5mbcLCamNiyfKIqP//3bC5pYtcyBc0ctqWCMzZ7q2Bnf0xQ ZyA5v+48JdMrtK++xrzac2QvoPXu2G0hH9z9va29mXJnw5ONjsXLm4XI/QD6/SpJk6qB fjWpc+R+tGq5Wh+2pzmOlplO7jTvtCXG1TgzLsMSUrp+d1pV3K37RSwRkrplYSS8C0cq mjlVFq/dhkRgI/LuRBe5kKLKoyQh4cA2rvVZq+8uy3nmwl49xlVAZiOl3W8YzFIU8cgf QWiIzV02+bc8PkJEFGDYaa0F+fQSQUjrAUD9aFYxYmsOdan5cfbYLMKRhARTXCN1tpvT mBFQ== X-Gm-Message-State: APjAAAWIqhIrP/6AMqQL1we1HMCbx3Xxi7ia59zgZOxCbuUDN7NkFKjC xVBwgmO9sqJrj1qMDf1stZAXqXvOy9Q= X-Google-Smtp-Source: APXvYqw5d0HjtBypkDc5Z6nJNZJYWv3GLsqwX6el4aYlHx7Ild43wb98FlLaxXKF4SKbsU/Y+i273Q== X-Received: by 2002:a63:7d6:: with SMTP id 205mr9003533pgh.131.1579661407680; Tue, 21 Jan 2020 18:50:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/16] cputlb: Hoist tlb portions in tlb_mmu_resize_locked Date: Tue, 21 Jan 2020 16:49:40 -1000 Message-Id: <20200122024946.28484-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 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: peter.maydell@linaro.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) No functional change, but the smaller expressions make the code easier to read. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index cc6f4c994b..5252bcb949 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -115,8 +115,8 @@ static void tlb_dyn_init(CPUArchState *env) =20 /** * tlb_mmu_resize_locked() - perform TLB resize bookkeeping; resize if nec= essary - * @env: CPU that owns the TLB - * @mmu_idx: MMU index of the TLB + * @desc: The CPUTLBDesc portion of the TLB + * @fast: The CPUTLBDescFast portion of the same TLB * * Called with tlb_lock_held. * @@ -153,10 +153,9 @@ static void tlb_dyn_init(CPUArchState *env) * high), since otherwise we are likely to have a significant amount of * conflict misses. */ -static void tlb_mmu_resize_locked(CPUArchState *env, int mmu_idx) +static void tlb_mmu_resize_locked(CPUTLBDesc *desc, CPUTLBDescFast *fast) { - CPUTLBDesc *desc =3D &env_tlb(env)->d[mmu_idx]; - size_t old_size =3D tlb_n_entries(&env_tlb(env)->f[mmu_idx]); + size_t old_size =3D tlb_n_entries(fast); size_t rate; size_t new_size =3D old_size; int64_t now =3D get_clock_realtime(); @@ -198,14 +197,15 @@ static void tlb_mmu_resize_locked(CPUArchState *env, = int mmu_idx) return; } =20 - g_free(env_tlb(env)->f[mmu_idx].table); - g_free(env_tlb(env)->d[mmu_idx].iotlb); + g_free(fast->table); + g_free(desc->iotlb); =20 tlb_window_reset(desc, now, 0); /* desc->n_used_entries is cleared by the caller */ - env_tlb(env)->f[mmu_idx].mask =3D (new_size - 1) << CPU_TLB_ENTRY_BITS; - env_tlb(env)->f[mmu_idx].table =3D g_try_new(CPUTLBEntry, new_size); - env_tlb(env)->d[mmu_idx].iotlb =3D g_try_new(CPUIOTLBEntry, new_size); + fast->mask =3D (new_size - 1) << CPU_TLB_ENTRY_BITS; + fast->table =3D g_try_new(CPUTLBEntry, new_size); + desc->iotlb =3D g_try_new(CPUIOTLBEntry, new_size); + /* * If the allocations fail, try smaller sizes. We just freed some * memory, so going back to half of new_size has a good chance of work= ing. @@ -213,25 +213,24 @@ static void tlb_mmu_resize_locked(CPUArchState *env, = int mmu_idx) * allocations to fail though, so we progressively reduce the allocati= on * size, aborting if we cannot even allocate the smallest TLB we suppo= rt. */ - while (env_tlb(env)->f[mmu_idx].table =3D=3D NULL || - env_tlb(env)->d[mmu_idx].iotlb =3D=3D NULL) { + while (fast->table =3D=3D NULL || desc->iotlb =3D=3D NULL) { if (new_size =3D=3D (1 << CPU_TLB_DYN_MIN_BITS)) { error_report("%s: %s", __func__, strerror(errno)); abort(); } new_size =3D MAX(new_size >> 1, 1 << CPU_TLB_DYN_MIN_BITS); - env_tlb(env)->f[mmu_idx].mask =3D (new_size - 1) << CPU_TLB_ENTRY_= BITS; + fast->mask =3D (new_size - 1) << CPU_TLB_ENTRY_BITS; =20 - g_free(env_tlb(env)->f[mmu_idx].table); - g_free(env_tlb(env)->d[mmu_idx].iotlb); - env_tlb(env)->f[mmu_idx].table =3D g_try_new(CPUTLBEntry, new_size= ); - env_tlb(env)->d[mmu_idx].iotlb =3D g_try_new(CPUIOTLBEntry, new_si= ze); + g_free(fast->table); + g_free(desc->iotlb); + fast->table =3D g_try_new(CPUTLBEntry, new_size); + desc->iotlb =3D g_try_new(CPUIOTLBEntry, new_size); } } =20 static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) { - tlb_mmu_resize_locked(env, mmu_idx); + tlb_mmu_resize_locked(&env_tlb(env)->d[mmu_idx], &env_tlb(env)->f[mmu_= idx]); env_tlb(env)->d[mmu_idx].n_used_entries =3D 0; env_tlb(env)->d[mmu_idx].large_page_addr =3D -1; env_tlb(env)->d[mmu_idx].large_page_mask =3D -1; --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661830; cv=none; d=zohomail.com; s=zohoarc; b=RJOkJ8Gqvi9xQvyzMd0kmDO8aW5fgY/CS7Yx/MHhRQwCOQsU8SQI9T/4iJhufJzwmrfftUKAc7/YifL8RBsIVupFeCDk36l0voT3X4a2qDfKlFRgVhcQRgKeIRB3nSlByNMvxkVLeJzqfJtzpSosRBFhW9osFTP9b0ETpQO0CX0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661830; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7JCjtS3iuX6LFH/2brU8boRCZGNEugPuBApINFMUJPI=; b=GXLWUJ6T7wN1ZsmxHHBOyvAJn5m8sz0wuGOOGkhYr3JBt5MImqeRrPoWI5ujQuauK24L5l69eRsq2MpESKuSysvsZNlbACz0cvavHhQ10MGTKVt6UdHtWRhHHx67lVO2Cxq/cD8E7pooPzbhdygv51bQ9wuvhJX5DARypoGc/oU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661830224519.3872553295154; Tue, 21 Jan 2020 18:57:10 -0800 (PST) Received: from localhost ([::1]:35792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6Ca-0006Ps-RB for importer@patchew.org; Tue, 21 Jan 2020 21:57:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45262) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65s-0005p5-Ee for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65r-0002oC-3n for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:12 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:47003) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65q-0002o1-UO for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:11 -0500 Received: by mail-pl1-x642.google.com with SMTP id y8so2246577pll.13 for ; Tue, 21 Jan 2020 18:50:10 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:09 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=7JCjtS3iuX6LFH/2brU8boRCZGNEugPuBApINFMUJPI=; b=v7nGXgvceZauoiroQ5C1BTvb4JmA2VtBaBCBmGce2IZajSxdmj+A+6Eo4XNOMl9+tn absgO5sqdSLuAvd4TkPQ8L8mA4UmOF9NwM92JLExPAvuj2TdeDgVF2jAd/MX+fnID4ao PzSWFx3oGlUCx1xILyQszVfUlA3val0LALi6A2hIlawvWWP8QWRFYQeinlhCgET9k2Z3 L+GXer2+LjtQ/XpGBG4r39KFgaBPdt2OxvYvcAHGZB09hBu/ZCPjQrtkNvtMDOCdmtw3 4iriTdmzQm8DSP4YTq+uk31toPgyS14Z5Vc6D3BpvhsAOkVNB/5Chb+OXwR5+wDvlSXH kwsA== 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:mime-version:content-transfer-encoding; bh=7JCjtS3iuX6LFH/2brU8boRCZGNEugPuBApINFMUJPI=; b=XCGCS6xOfInhNK8PFiKXracZFCvJqvErCSC5CnukHn8bE9u8UrnQfTVmGFyOhgkWJn NnTJOBw77ND9ZIy2DWW4rOvlNOR8dDA2xGsSYwBW7MWmgx8TdNLu0Q63E6Nd3NL4F+gr luz3iSo69xqow0s85ip+91Q/tEdX3bDFX4oigELuEzvwwX+cz59eH7MdPg7oBHP45aru TIedxX8bheRbK2F4ibc4VldGWieRbi1mO0zzATQoiHwD5cZMdg1BjYAGTQmFe+sDcZCU AUY4z1SaBJnLF4LvHSkGcdXMIbXBH2RnqGieRVI38xMy0fL/Jggp0lbOdC1M4b6vey9C WOOw== X-Gm-Message-State: APjAAAVlgecwQ+f6jGdFcUU+mmLgPlhxxevZohcFcJILBA5HUQvBt8wb SxH0t9uqlRcQ5aebTmgIKgwIHQwA+Yg= X-Google-Smtp-Source: APXvYqxmTN7k0288RjXc2Q6lDfgbG0voUGoxhM2bn1cearFEx9nH+UFAxXS7HcVMxJwi3QprXg+q4w== X-Received: by 2002:a17:902:41:: with SMTP id 59mr8858013pla.39.1579661409648; Tue, 21 Jan 2020 18:50:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 11/16] cputlb: Hoist tlb portions in tlb_flush_one_mmuidx_locked Date: Tue, 21 Jan 2020 16:49:41 -1000 Message-Id: <20200122024946.28484-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 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: peter.maydell@linaro.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) No functional change, but the smaller expressions make the code easier to read. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 5252bcb949..bffca0e7e7 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -230,15 +230,16 @@ static void tlb_mmu_resize_locked(CPUTLBDesc *desc, C= PUTLBDescFast *fast) =20 static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) { - tlb_mmu_resize_locked(&env_tlb(env)->d[mmu_idx], &env_tlb(env)->f[mmu_= idx]); - env_tlb(env)->d[mmu_idx].n_used_entries =3D 0; - env_tlb(env)->d[mmu_idx].large_page_addr =3D -1; - env_tlb(env)->d[mmu_idx].large_page_mask =3D -1; - env_tlb(env)->d[mmu_idx].vindex =3D 0; - memset(env_tlb(env)->f[mmu_idx].table, -1, - sizeof_tlb(&env_tlb(env)->f[mmu_idx])); - memset(env_tlb(env)->d[mmu_idx].vtable, -1, - sizeof(env_tlb(env)->d[0].vtable)); + CPUTLBDesc *desc =3D &env_tlb(env)->d[mmu_idx]; + CPUTLBDescFast *fast =3D &env_tlb(env)->f[mmu_idx]; + + tlb_mmu_resize_locked(desc, fast); + desc->n_used_entries =3D 0; + desc->large_page_addr =3D -1; + desc->large_page_mask =3D -1; + desc->vindex =3D 0; + memset(fast->table, -1, sizeof_tlb(fast)); + memset(desc->vtable, -1, sizeof(desc->vtable)); } =20 static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu= _idx) --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661937; cv=none; d=zohomail.com; s=zohoarc; b=D9jW4xYhu4VuI3ksj8jc7qzKnEZBRo3TN/gPWoQV5lial0SPMzDpERRk5i8gTbvCm3K99dkIx0pMhqrIDRAOsEugSv2Gw/aLFGvFFiOAWti7RhVuAhlqy/fA77ZEoErmhH31IrocGIa+8qyL2K+tzov2bXXiKBPXh4cuny3zW30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661937; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2lpOSEVgn1nYSDoRmP2S6TPZlPRGf7XKMhZlo+r1VEs=; b=fvFHjiTmFymoPJDeUOJWvha+Ae0UigwQs1sOuEG7obx2xI7CjSFOeQQt5zawFvna/iCI3vCdE5UcMmX3ZdLIbMqyPixrXIcxx9E6Chu3MVV/zg+t8PCkmXnhCFWKsypGxw6r/BlHznGgZGcl1ifBWvexs3U3uBJANAjHV87qAmg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661937148652.2077281304908; Tue, 21 Jan 2020 18:58:57 -0800 (PST) Received: from localhost ([::1]:35826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6EJ-000065-MA for importer@patchew.org; Tue, 21 Jan 2020 21:58:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45279) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65u-0005s1-6u for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65s-0002on-Vm for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:14 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:38250) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65s-0002oY-QP for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:12 -0500 Received: by mail-pg1-x52c.google.com with SMTP id a33so2641028pgm.5 for ; Tue, 21 Jan 2020 18:50:12 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:11 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=2lpOSEVgn1nYSDoRmP2S6TPZlPRGf7XKMhZlo+r1VEs=; b=W6HYfoh9wZpjjRwHL+rySq01JXTftRX1I3SA0TJzJS3WU0y++XAWshbawoTcwXdd/8 ryyBNolrFPzZZnFPR24JCxeVW6SukwM3ZjXqUIcA9EtBksYBipck9xKhj6c68y3MEouK 2C75lnyYcL+WqqqnSmFgULSCuVHKP3d+Ucie1ZtOjI2irHsI9xQ5YIWyPsuK7m4Sc4Eo RL6qWsk/AEyhhpAOPNoeh7rmIxo4d0aq8kvu7IqnThLDfsuRPQ5teCgMTB6CP21bGMln mWT52vPxpHxlJkKcX3oF8CaSCv0rDW5fQ1cMNAcpkVXgFtYunGRPFFZd/GLJl8C7B3Ep thsA== 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:mime-version:content-transfer-encoding; bh=2lpOSEVgn1nYSDoRmP2S6TPZlPRGf7XKMhZlo+r1VEs=; b=RXdYsGixBIKJ8U4PhL4nuXPZsB4/Zm0glZEYj/d2T9GieZ06NZ0Va4mvBaAv174W6/ 7B3VIpr18DEHPMUDCGwtkWJwXYnSg4l+8LymmqhgVR08LoyElA33lPeUJCmtATDbSz53 kpPqzYBLmun29rpYEKWRUXln54wahE7mXzBXL0rNO+JQb/6i5SLx6CB//tx60fvtzldt moO5ajBLHT8V2hvS9Y8QUqWDONh21YRg71txy0SwBNTMcl3ee5q9xiT6ilfQY6jOjKNt 0sgBrFVE8le3dwelTLpNCRcXYi5uN+gU6ptT4B7imbEl3uXg/pvLkdwy2N2/E1LSeBKl LxKw== X-Gm-Message-State: APjAAAVrAZe+Mq5NtTKOgQma5qsIy/mbGKAouzT3o1wKJknyOLpCJK19 ZvP1WLPQw9pjZyw/euvytYihX3rrMcA= X-Google-Smtp-Source: APXvYqzhfjeY5g9CF8AF493zrLcX+dCMRX7gqrX3hJM6PnRlbdwi8DCikqR9aadvgNh9wgIfy/6+ig== X-Received: by 2002:a63:5512:: with SMTP id j18mr8440190pgb.189.1579661411592; Tue, 21 Jan 2020 18:50:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 12/16] cputlb: Split out tlb_mmu_flush_locked Date: Tue, 21 Jan 2020 16:49:42 -1000 Message-Id: <20200122024946.28484-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52c 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: peter.maydell@linaro.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We will want to be able to flush a tlb without resizing. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index bffca0e7e7..28cfff1556 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -228,12 +228,8 @@ static void tlb_mmu_resize_locked(CPUTLBDesc *desc, CP= UTLBDescFast *fast) } } =20 -static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) +static void tlb_mmu_flush_locked(CPUTLBDesc *desc, CPUTLBDescFast *fast) { - CPUTLBDesc *desc =3D &env_tlb(env)->d[mmu_idx]; - CPUTLBDescFast *fast =3D &env_tlb(env)->f[mmu_idx]; - - tlb_mmu_resize_locked(desc, fast); desc->n_used_entries =3D 0; desc->large_page_addr =3D -1; desc->large_page_mask =3D -1; @@ -242,6 +238,15 @@ static void tlb_flush_one_mmuidx_locked(CPUArchState *= env, int mmu_idx) memset(desc->vtable, -1, sizeof(desc->vtable)); } =20 +static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) +{ + CPUTLBDesc *desc =3D &env_tlb(env)->d[mmu_idx]; + CPUTLBDescFast *fast =3D &env_tlb(env)->f[mmu_idx]; + + tlb_mmu_resize_locked(desc, fast); + tlb_mmu_flush_locked(desc, fast); +} + static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu= _idx) { env_tlb(env)->d[mmu_idx].n_used_entries++; --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661963; cv=none; d=zohomail.com; s=zohoarc; b=NC6q+CLPzfkgfUQMJtbzy5kKHOZJmRAzc83ELzhbIuu/upamwnnsf5z0hrmsuCPmasDkofCDiB1UOi0T/EN+GPDQ4bGQjbjXV3OLPfWD5VYD7fcl6r7dqYOwcpB9ETrx25pTmqWtUOeq70b/G3n/pPtmCmt5cuMd8cOyP1aEaCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661963; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=soIhy7U60hFR3tjy2P21a+DUoF3Ye/nEhgI5woKnVmY=; b=gY8H7fOV6IS7v3dC7pKARAJSglrPEv5UVZBh2ytze3K3Op4dpN69heKPB/sXkBkTzeRLqGHlrPLPbGx/kMSdkd4OF3TKGtA9LOjixuJU1yoGdP5CzNmaaUHGe6ocjmAHxqqVYRSaZpaXNoTaWvK1tEajQ2jfcUZ4J2NHM2LbM5Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661963885290.84394036842355; Tue, 21 Jan 2020 18:59:23 -0800 (PST) Received: from localhost ([::1]:35830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6Ek-0000kk-6q for importer@patchew.org; Tue, 21 Jan 2020 21:59:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45298) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65w-0005xP-B2 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65v-0002px-0k for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:16 -0500 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:45038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65u-0002pf-Ra for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:14 -0500 Received: by mail-pg1-x542.google.com with SMTP id x7so2621335pgl.11 for ; Tue, 21 Jan 2020 18:50:14 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:12 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=soIhy7U60hFR3tjy2P21a+DUoF3Ye/nEhgI5woKnVmY=; b=X1DrHwYTrrAguV+foHlRxiW9HpyGDnbnn8U0HJ5fEp9T3zddgFBxMKTRS1wGu6mC8h i1VpBjJMOeSv8b+R10mEcUd/74aBUT8labkoD+ufhCzNAx5sX7vJiJBDdOwlZ8x6ZPwR Qk7txK3Gy3dIPfrGTmSrPXB/E8nZ1F73D5W2ePxPA0WbR3AsuL8UDFKsPgnz2WMxNDcI YV60b+SXxZEq8OUylz3LfClINf1pErqBN/n/GJIfc9iiWZM/E6PzcC4KtevkobBk6O1G YA2FIeFzL/pnnxVD6chCmKZSvwIkT20OjEZ+9mUc3DoaO2eQPhlnJgCm9DyKjuzMjhYx jZrw== 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:mime-version:content-transfer-encoding; bh=soIhy7U60hFR3tjy2P21a+DUoF3Ye/nEhgI5woKnVmY=; b=Cn/EwdCdAO6NC/ku9YdGskUx9ar7KSrSZ03h+4DS+iaQot81T1i3W08pXohAHFnJu7 x9AlJIFWCCVCDLTH4gHQ+ssXEAZhCrsN761WCXtbyiddFdD1N5k+vz8h02OoWnoFRmI0 YZJ7i8oY0G74s2CYx3sHUrI2Dh9NVLcuGYG+H7S3jGbyoeGKgXoBBvKIc/i1KpBEwTUm WGpU7AuXTuarw2Om3JAiTmSofDa+W2ONk50ye//7JxvmZNQJ+z9zNTtk3biRrNqhry03 vrQB8i/HBrZlI8GCHcIxOUT+gMlqAS7dF6fptJ1jbq3d+VLbBpT+Lhqt4ZrLs0Owqwwn 67JQ== X-Gm-Message-State: APjAAAVwDB4UMCKBRESyzlTH4jub6YCmW7SM0KYEQr907PM3MFkghqrH Jf10LIo6UEP9RutoAVBtKfZq+FvV40I= X-Google-Smtp-Source: APXvYqx6yoRRZglRCdel1ROQi224P7rHoQ45dKZ9im+9BJqMmU7F6b0A1Xf4iDzfjkeZXfiR5rz7eg== X-Received: by 2002:a62:197:: with SMTP id 145mr598467pfb.188.1579661413596; Tue, 21 Jan 2020 18:50:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 13/16] cputlb: Partially merge tlb_dyn_init into tlb_init Date: Tue, 21 Jan 2020 16:49:43 -1000 Message-Id: <20200122024946.28484-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 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: peter.maydell@linaro.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Merge into the only caller, but at the same time split out tlb_mmu_init to initialize a single tlb entry. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 28cfff1556..360495468e 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -97,22 +97,6 @@ static void tlb_window_reset(CPUTLBDesc *desc, int64_t n= s, desc->window_max_entries =3D max_entries; } =20 -static void tlb_dyn_init(CPUArchState *env) -{ - int i; - - for (i =3D 0; i < NB_MMU_MODES; i++) { - CPUTLBDesc *desc =3D &env_tlb(env)->d[i]; - size_t n_entries =3D 1 << CPU_TLB_DYN_DEFAULT_BITS; - - tlb_window_reset(desc, get_clock_realtime(), 0); - desc->n_used_entries =3D 0; - env_tlb(env)->f[i].mask =3D (n_entries - 1) << CPU_TLB_ENTRY_BITS; - env_tlb(env)->f[i].table =3D g_new(CPUTLBEntry, n_entries); - env_tlb(env)->d[i].iotlb =3D g_new(CPUIOTLBEntry, n_entries); - } -} - /** * tlb_mmu_resize_locked() - perform TLB resize bookkeeping; resize if nec= essary * @desc: The CPUTLBDesc portion of the TLB @@ -247,6 +231,17 @@ static void tlb_flush_one_mmuidx_locked(CPUArchState *= env, int mmu_idx) tlb_mmu_flush_locked(desc, fast); } =20 +static void tlb_mmu_init(CPUTLBDesc *desc, CPUTLBDescFast *fast, int64_t n= ow) +{ + size_t n_entries =3D 1 << CPU_TLB_DYN_DEFAULT_BITS; + + tlb_window_reset(desc, now, 0); + desc->n_used_entries =3D 0; + fast->mask =3D (n_entries - 1) << CPU_TLB_ENTRY_BITS; + fast->table =3D g_new(CPUTLBEntry, n_entries); + desc->iotlb =3D g_new(CPUIOTLBEntry, n_entries); +} + static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu= _idx) { env_tlb(env)->d[mmu_idx].n_used_entries++; @@ -260,13 +255,17 @@ static inline void tlb_n_used_entries_dec(CPUArchStat= e *env, uintptr_t mmu_idx) void tlb_init(CPUState *cpu) { CPUArchState *env =3D cpu->env_ptr; + int64_t now =3D get_clock_realtime(); + int i; =20 qemu_spin_init(&env_tlb(env)->c.lock); =20 /* Ensure that cpu_reset performs a full flush. */ env_tlb(env)->c.dirty =3D ALL_MMUIDX_BITS; =20 - tlb_dyn_init(env); + for (i =3D 0; i < NB_MMU_MODES; i++) { + tlb_mmu_init(&env_tlb(env)->d[i], &env_tlb(env)->f[i], now); + } } =20 /* flush_all_helper: run fn across all cpus --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579662194; cv=none; d=zohomail.com; s=zohoarc; b=FHNtvqeSL/6kejvXHT3fwK+00WbXFM55EHOHuBlfE5HXDiOfGCB4S1P+rIhxtg660qwANWbrSbUOnbXSDwuZORwY6+PvnbYS612HqPSJsiqRHbqJ3zHOM9q3iJ0v0jK9eQAQbodV1Bx2kqS0Rl4Wy8NavJXd8JNcFbt8J+rwOiA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579662194; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OC7OFlyDpMmCOREVcuHdNbrSQHKywa5Jyi9QRDoEIWg=; b=QA4wFOINu2EFDJsf2E+DKD1Y+14F+g1h87DJDW08Whzjh3ecSTKOt6Osbhsd+lFdHB5rTTwU7z3jYCoEhxxyYjxcRPuDORDtYY17M4GClF+2atCKLUMWFwBv49Pr3gKJf0ahGdbqnTtVUxtVpKeFCyE48ijMlwCuPj2/tcYteyM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579662194622564.224646506484; Tue, 21 Jan 2020 19:03:14 -0800 (PST) Received: from localhost ([::1]:35900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6IT-0004AP-Dl for importer@patchew.org; Tue, 21 Jan 2020 22:03:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45316) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu65y-000615-Bc for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65x-0002ql-42 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:18 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:44304) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65w-0002qQ-Ui for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:17 -0500 Received: by mail-pg1-x535.google.com with SMTP id x7so2621402pgl.11 for ; Tue, 21 Jan 2020 18:50:16 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:15 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=OC7OFlyDpMmCOREVcuHdNbrSQHKywa5Jyi9QRDoEIWg=; b=dv1SAZUqUI16gtonxdk2iR1y9ISk84nd3FrJEN6Hp3+97AIz59flEaAS2npyywRBZc ZMFoUISEkBw0qztqoBJvvXV0iPS/klbAwhXykL/Ym5WJND3fxJJkJaBcqv78uRJME6Mo NKECewEmCwKPmwWO2JukdEhB0p/ohOdsoy9DOJ4J8QjbkdlxLTJCT7gW6bJ4s6LtCSAl 4Pudh6+ZUvRniWHKsMI3pMFDH2v0tpyaghaZC4/nRNDxEC3McOoSnmg1HGw2dNZQrlwd Mi6PKnDRRQTi/b6acIjAzvfE2/ququzX9k2RunC7vEr4GXT+ypOPrJBniLCbrzOh2VQr q2cA== 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:mime-version:content-transfer-encoding; bh=OC7OFlyDpMmCOREVcuHdNbrSQHKywa5Jyi9QRDoEIWg=; b=KqGRYVRTGhTerGxfIC4nJE9s8bskqn2dXgQnAoDRDwVRBhws5FD3wpYCd6fUINzLNp Jvpve4TKkUuOZu5LSHOIxoGKs8iQzl04e54omS3J7hMjUzDaJCHOkqZCz47Vl8TcYl0x DxqjMmtH344kCKIZPb+/kLNWR34FLI4va5YAGWweniA0i/1PtZc4eZYG6GeygGedTng4 raOAsWrrCmT4r0V7yotswTKBjKDOLAbyK8R8zMTMzFsZFfiHZtrmlSZnzje2jG0xHYRG BS1Iuc09JbJvIOu8pu0EScaI3NAPb+RHIJQs1sDK5wM0Dd54cbwhVFmrP91hEw81QngC vt3Q== X-Gm-Message-State: APjAAAXnAROPcynO3u4akuRgNHRZc+9Zcso+eVhbo/MhdGZFgUQlGPJW ZAZ1rSjsTmq4Be9/dn86GBkImFwcPj4= X-Google-Smtp-Source: APXvYqzB9eoLmdc7W2OzykHfwjg53N3KWzgOuh2VHwMuKwy3lH/cPiw4Nr0lA/jLPYAHsXHMvDMRtw== X-Received: by 2002:a63:1210:: with SMTP id h16mr8626507pgl.171.1579661415758; Tue, 21 Jan 2020 18:50:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 14/16] cputlb: Initialize tlbs as flushed Date: Tue, 21 Jan 2020 16:49:44 -1000 Message-Id: <20200122024946.28484-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::535 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: peter.maydell@linaro.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) There's little point in leaving these data structures half initialized, and relying on a flush to be done during reset. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 360495468e..5a35386224 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -240,6 +240,7 @@ static void tlb_mmu_init(CPUTLBDesc *desc, CPUTLBDescFa= st *fast, int64_t now) fast->mask =3D (n_entries - 1) << CPU_TLB_ENTRY_BITS; fast->table =3D g_new(CPUTLBEntry, n_entries); desc->iotlb =3D g_new(CPUIOTLBEntry, n_entries); + tlb_mmu_flush_locked(desc, fast); } =20 static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu= _idx) @@ -260,8 +261,8 @@ void tlb_init(CPUState *cpu) =20 qemu_spin_init(&env_tlb(env)->c.lock); =20 - /* Ensure that cpu_reset performs a full flush. */ - env_tlb(env)->c.dirty =3D ALL_MMUIDX_BITS; + /* All tlbs are initialized flushed. */ + env_tlb(env)->c.dirty =3D 0; =20 for (i =3D 0; i < NB_MMU_MODES; i++) { tlb_mmu_init(&env_tlb(env)->d[i], &env_tlb(env)->f[i], now); --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661574; cv=none; d=zohomail.com; s=zohoarc; b=CCt/XanmOdHdD1vJWo+FyH9n2cr1bNxNMdSzI9OgxCZsa2dMTYkYcDXQ9sUI7T2avTMiZeOSh6SMqyUwJChwxybV0n5ynAwVpJkcTyMTYGlyF2wudlCesmOgFbmm4N/xLwRt7KdYmT1SLt+Ds2nbmGz1A2/Ojhnktg7vOlmicSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661574; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DOpEwK3gCWb7kYmz3HJItlWdtjpnT0EgenDFNDj5Ga0=; b=lo7ms8Mv3qvZlY2x5VAU9OHMV3nVL5NlQH0W4zSNTQbu+QLjolFyZ2lY1RRp4NU5R/INKUjdHN0GvyPipEsP1QurFxpqDgRF9vjvprt8foW5kigm6pPtav5WrGmwn+x1Rci8M2mVHeJ+OXk5m8so7XnOUCNbCX6N33oUDNztOfc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661574001934.9384427739559; Tue, 21 Jan 2020 18:52:54 -0800 (PST) Received: from localhost ([::1]:35696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu68S-0000L3-LY for importer@patchew.org; Tue, 21 Jan 2020 21:52:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45328) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu660-00064o-ET for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu65z-0002ra-7H for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:20 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:39291) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu65z-0002rO-0t for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:19 -0500 Received: by mail-pg1-x543.google.com with SMTP id 4so2634695pgd.6 for ; Tue, 21 Jan 2020 18:50:18 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:17 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=DOpEwK3gCWb7kYmz3HJItlWdtjpnT0EgenDFNDj5Ga0=; b=E+RxQOp+TlOk5Zqy8vCX1+1cFbNmhCLiP/ry759CWWLVjC9QAszy+BuEOjcC4HXYtr 7q22SI+39kFanWUNuqSSWjnvvhqfUaoHuMlulQ2gwKirMjeHSSrA0MraogNJ+ps+cgpe iQrLal6iLSnevwe+I7ji6QCIfjgd2d0B43EtdGh5SOuWlvSpCSIU58SKR67butd0iH8/ A72qkxrzv/UOf47kugKTc03QFnRTf4mE76nnEqP5/AKZqgSc7Mu5ahtF1fKgYNNsiaWo 6z148nV7vN08ZZkR70zWVVdyiGXKqBIZHga9/mea/NrxHHwfQCj6a/daFn5X23jbT19I zt5g== 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:mime-version:content-transfer-encoding; bh=DOpEwK3gCWb7kYmz3HJItlWdtjpnT0EgenDFNDj5Ga0=; b=kUarf+oA3HX4AQY1Um4jBJ2vNzEa3z4MjFpsPKbi/iVaw9/00TAB+1HY/7s4Qd/4OM +YdRarFvrddwqAttbIFyAUUq4BvRoY1Jw5By8KJSTQy7L+0pnXNHdAEbISjgx6A8I5kU 8TeNZw0A72Fh7NvJQrB0G8lFJsJHGyfnE++3DtMI/Oj2k3gQdk0ChSr38imOxSelWMI3 lOoO+cdQOA08Dzp9PTTeExH7KPTfBRgqcZU9g1veg9YCk6/SWE0xoe9tHGYonMJlSzth ZSHOMYuY1kPqxDwEsDyLH7wbP5k+MAwsGd94vGzaF10JYBEAC5/94p1nTvjKEP/v7RzP GC2A== X-Gm-Message-State: APjAAAWzBIrgrm7F4H+yvjGJ3AqIt+tAMuGY1+twBXPoSWPd/fsMjQXn jlgSrQtyik1tNgoWJmXmmhTzCrDfGcc= X-Google-Smtp-Source: APXvYqwGjY+RCd2+RrYCWF39TEf1w4GMhmitehSNJpCVFprVo4leTFVnVqOsI7gqDnRYugle4Y3FZQ== X-Received: by 2002:a63:ce55:: with SMTP id r21mr8567582pgi.156.1579661417808; Tue, 21 Jan 2020 18:50:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 15/16] cputlb: Hoist timestamp outside of loops over tlbs Date: Tue, 21 Jan 2020 16:49:45 -1000 Message-Id: <20200122024946.28484-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: peter.maydell@linaro.org, Alistair Francis , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Do not call get_clock_realtime() in tlb_mmu_resize_locked, but hoist outside of any loop over a set of tlbs. This is only two (indirect) callers, tlb_flush_by_mmuidx_async_work and tlb_flush_page_locked, so not onerous. Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 5a35386224..e3b5750c3b 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -137,12 +137,12 @@ static void tlb_window_reset(CPUTLBDesc *desc, int64_= t ns, * high), since otherwise we are likely to have a significant amount of * conflict misses. */ -static void tlb_mmu_resize_locked(CPUTLBDesc *desc, CPUTLBDescFast *fast) +static void tlb_mmu_resize_locked(CPUTLBDesc *desc, CPUTLBDescFast *fast, + int64_t now) { size_t old_size =3D tlb_n_entries(fast); size_t rate; size_t new_size =3D old_size; - int64_t now =3D get_clock_realtime(); int64_t window_len_ms =3D 100; int64_t window_len_ns =3D window_len_ms * 1000 * 1000; bool window_expired =3D now > desc->window_begin_ns + window_len_ns; @@ -222,12 +222,13 @@ static void tlb_mmu_flush_locked(CPUTLBDesc *desc, CP= UTLBDescFast *fast) memset(desc->vtable, -1, sizeof(desc->vtable)); } =20 -static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) +static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx, + int64_t now) { CPUTLBDesc *desc =3D &env_tlb(env)->d[mmu_idx]; CPUTLBDescFast *fast =3D &env_tlb(env)->f[mmu_idx]; =20 - tlb_mmu_resize_locked(desc, fast); + tlb_mmu_resize_locked(desc, fast, now); tlb_mmu_flush_locked(desc, fast); } =20 @@ -310,6 +311,7 @@ static void tlb_flush_by_mmuidx_async_work(CPUState *cp= u, run_on_cpu_data data) CPUArchState *env =3D cpu->env_ptr; uint16_t asked =3D data.host_int; uint16_t all_dirty, work, to_clean; + int64_t now =3D get_clock_realtime(); =20 assert_cpu_is_self(cpu); =20 @@ -324,7 +326,7 @@ static void tlb_flush_by_mmuidx_async_work(CPUState *cp= u, run_on_cpu_data data) =20 for (work =3D to_clean; work !=3D 0; work &=3D work - 1) { int mmu_idx =3D ctz32(work); - tlb_flush_one_mmuidx_locked(env, mmu_idx); + tlb_flush_one_mmuidx_locked(env, mmu_idx, now); } =20 qemu_spin_unlock(&env_tlb(env)->c.lock); @@ -446,7 +448,7 @@ static void tlb_flush_page_locked(CPUArchState *env, in= t midx, tlb_debug("forcing full flush midx %d (" TARGET_FMT_lx "/" TARGET_FMT_lx ")\n", midx, lp_addr, lp_mask); - tlb_flush_one_mmuidx_locked(env, midx); + tlb_flush_one_mmuidx_locked(env, midx, get_clock_realtime()); } else { if (tlb_flush_entry_locked(tlb_entry(env, midx, page), page)) { tlb_n_used_entries_dec(env, midx); --=20 2.20.1 From nobody Sat May 18 22:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1579661720; cv=none; d=zohomail.com; s=zohoarc; b=BJEU9YuJqlG1jE0hg5hwj+DwBK9TYU+DBfn5r0uqeuKsZS6ke/slb5CiHn7I5iOGibltqGnvNo/BUAg6+iKJBpYLKNDlH37rho6R7aHXlNotflm+AA23Y7k/+O/CUhmADO7iC97w04+NJGskppf3VPXRiLtODx5WaV6fbAJkZ58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579661720; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ObBk+vUxn+dSJ2XFF+LrNKyy5bCa/sEjKehWCWAOBzw=; b=V7TWCzglMGIFfjlJQDvc0X/wNom3fXW/SwdR9gIr7iyH0w09m0i4m00TdZyTq1dKyA2sK6gL7nLU2h3Qk2+ylnf37jPkM/bNFzKxbbKNzMR5WSFfsUYde3xaKdXISFXid3leL+6DVDzw/G9UGyAV+hi3qvZ2hnvM0OAlLn94EXs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579661720291935.8614876564538; Tue, 21 Jan 2020 18:55:20 -0800 (PST) Received: from localhost ([::1]:35744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu6Ao-0003sT-L9 for importer@patchew.org; Tue, 21 Jan 2020 21:55:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45341) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iu662-00066P-KT for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iu661-0002td-4q for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:22 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:39350) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iu660-0002tJ-VD for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:21 -0500 Received: by mail-pf1-x434.google.com with SMTP id q10so2560027pfs.6 for ; Tue, 21 Jan 2020 18:50:20 -0800 (PST) Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com. [173.198.77.92]) by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:50:19 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=ObBk+vUxn+dSJ2XFF+LrNKyy5bCa/sEjKehWCWAOBzw=; b=aj75Md6rAzLnCZchpKeM666PFo6NCY8tM9z+noe+9Tcs63e7UI7iySWnNGMuQNRV7l aAq+hH1Low3shxENTUMMVrBTPdi1frZOIB7tFAGFpxqb+uueIElzfOiJ1KOPY72Gf9w6 rFu3VQutgS06xK13XYhW7+fjYq9pB+nTvBM/wlkr94fIWggu8GMNk9kUoP6p9NX4glbn BFXHOkog2PVKuTqCKMPAwuExoCSkJH3Gsgs4jv8IERasoMkUchOc3GWeJ2UoYrEsMMtJ Wc8zompLvmBV997lr6ka+lJAfOLIJ0ZobeXhCALx7H8FD8zQYND0navtDNDj0D+uAtBz fazA== 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:mime-version:content-transfer-encoding; bh=ObBk+vUxn+dSJ2XFF+LrNKyy5bCa/sEjKehWCWAOBzw=; b=oEPmACsecG3iUplOeGC1nRoeeOghprSGVc9UWJBGxFHCajoZ6bEJbP0D/P36r7G4hs 2emCOMnG7HLeOWtMvPfuiEPFadeBWi+VmEDcND7qM16sjcw9XMi0W5HKVnrKf8M6Pf2q 4N6npPu5QjI6Xrc+aQNcTIfvN45AZTrkopyTrcvb2FkyC/JEZxPTKTrRnD0iTGXExVVt gbVDgVyO3qSUrFR4OGQpDD846p/Dgit5VzxlLXKXH/K5LAx+z9E4rqSnA1aQFXCAG4Z7 UfMlURxNqxAH9OtsrWSrVhhwOcBQM98l/6UG0OUtc3A7feUzUpZURraLhOEvEyjHOwNI 2uRg== X-Gm-Message-State: APjAAAWRQcZr2an9yN3b/EyjVuGjmeAwjDrdxzP0/q7XHBvuCgE3uiDR bQchI6+th+pDDvQ2aeAdEiUidG2bVCo= X-Google-Smtp-Source: APXvYqzERdfM3fEqyxF8f0AObtrSpYxs8BMSs02G+vHKOKQDmzizvQc7rGox7VHQ9/ERK8pmTmePZA== X-Received: by 2002:a63:454a:: with SMTP id u10mr9061801pgk.248.1579661419640; Tue, 21 Jan 2020 18:50:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 16/16] scripts/git.orderfile: Display decodetree before C source Date: Tue, 21 Jan 2020 16:49:46 -1000 Message-Id: <20200122024946.28484-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org> References: <20200122024946.28484-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::434 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , peter.maydell@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 To avoid scrolling each instruction when reviewing tcg helpers written for the decodetree script, display the .decode files (similar to header declarations) before the C source (implementation of previous declarations). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella Reviewed-by: Alex Benn=C3=A9e Message-Id: <20191230082856.30556-1-philmd@redhat.com> Signed-off-by: Richard Henderson --- scripts/git.orderfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/git.orderfile b/scripts/git.orderfile index e89790941c..1f747b583a 100644 --- a/scripts/git.orderfile +++ b/scripts/git.orderfile @@ -25,5 +25,8 @@ qga/*.json # headers *.h =20 +# decoding tree specification +*.decode + # code *.c --=20 2.20.1