From patchwork Mon Feb 17 13:06:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 865934 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1076005wri; Mon, 17 Feb 2025 05:07:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXp5QCsZSMnFAz1YJIPNVmXWW7qZnRfbBkdGiUVBEC09MLElG7pIUFanBAShC26DUVuckxDlw==@linaro.org X-Google-Smtp-Source: AGHT+IE7Di7cbBs3y8fL6V3Hnhau6klarGAeIJmRvwGl5YjJCcpML7AsZnLFP1m771UNrYjXmwC/ X-Received: by 2002:a05:6122:3a10:b0:520:3536:feac with SMTP id 71dfb90a1353d-5209dd2abc3mr3247974e0c.11.1739797641184; Mon, 17 Feb 2025 05:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739797641; cv=none; d=google.com; s=arc-20240605; b=RPJApHHLcWIT3M7C9MCgv6beG+Jn42dzTsb5Kr4an31N7Eu209ETYNid9Nmw/Z+jm3 FAg4Dy3WZG3RDhV6iyAA1uKHhxgkH6UzLijYbRW+xXh2EuWeCt4t2gQEZ/6O+NC82C/A 5teecJkIn/M7k8ntDYEPnUQvEsqWWDNvEBJVT9hH+EEID1IhP262Z5YxXrm8oXUBJ9/d bFkTFyJMDQ2fColY19vBddsSywaNglKgkX+391lZ5Zsb/tx0w4JHaFZHTKsmutZWFfb7 meaHoP5OZJFFfsHBDho9UieRM8G6cTl3tIkY4QJ1swUV2tQWVReihTk75VpN2NiQhJpG Vnug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7QzO70em+SWmM19nvv4jHPXxR+fFgMfgrFERsTk++Jo=; fh=DXomWywNH/2babz/5F0loN8t7CwqQh+osTxlwLsrsp0=; b=FUaDHirHz6Q3pr5gfHBEzkvSJ5eflvX8mwYaGQTZ4A2REKD26gRJY/TsDhrBTBbvC+ yAf6NKHviEkaCxfGAPoKMdB0htHC/V273g/YTO3R1eRuX7VVtlPq9edVLk4uhi9oRNz0 q230WOM89+5rnmrmSeijtympjsalmtCkRvxFUGktlwJPDD+xGmn0DRHTA/CT5jqvTlOk Rc5R0sKlyS0N8gXBwaPJlsZ89bc9Vyf6oz/USlNn1PHcpDk+wJgBstr6oa1bHXRawTLS iFU2cajRCBrE+hYKblbXRDV744/M0grm4dYuQQ9SexuOYefO0kElJlu1JPfu+ree/wxB 7jEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="blhRGow/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-520b09d29casi479967e0c.85.2025.02.17.05.07.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 05:07:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="blhRGow/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tk0pe-00026M-PS; Mon, 17 Feb 2025 08:06:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tk0pd-00026D-Eu for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:06:41 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk0pb-0004lP-Hp for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:06:40 -0500 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2fbfc9ff0b9so6551349a91.2 for ; Mon, 17 Feb 2025 05:06:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739797598; x=1740402398; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7QzO70em+SWmM19nvv4jHPXxR+fFgMfgrFERsTk++Jo=; b=blhRGow/TedrWfYyj72BanNkbT2YeBSCdgqS/ABl1MAdOB46ROClz2asbAzsXB0mKC eunIBGf7EEDUFCmn8WmWKQdy20WqG4XUgBimSFD+ShIVaCvPotD2/UfpWBuv/X3cESCG L6XeuD79tlW9Di6+WfOg6UOoyZYJKjABc6E1G5up8+Q87WkBjV1VlMId2E6+uJRoYuLj 3M3aF5j3GoynDq0ClpYaX/dRQlM0E51RivGW1Bfxt0Vnmhitzyf5QA2a/12a79fwsBcS nxnI+KndgJTpXTNNzc6vJNRFcCMvENexoeXv3O3Ga4WEK5iLfb9d/VlNmwyYrHylyCLw WgNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739797598; x=1740402398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7QzO70em+SWmM19nvv4jHPXxR+fFgMfgrFERsTk++Jo=; b=d88/dsUrBhfbXKyLX7fXENrzKNcd96+jKa0ob32NrQBFWV7d+cb03K98Qlkmmmob9W U8Fv4FpntPfvYH7jHYE0wdOa0AVILOXxGcsE0WpMcXLYuzdRu6Cfkq0xnLP0StcAbO8f DLHWbBsbcG8UawD3sx5PFS0Vj1eOd4i9WRodifr3jh0NdDcg2aE60OjpcZLAkppXqEMr DQ0VeXByP9EuKhaSGb4ehhDOlv91mpKQy2jPcq15z5O3wuk5lo3cZykpm6ER+G5xw/5X so/LRVArwCmmFuY8gYhHji+x5CQQKA3vKRYTs4DEsWdrm63PWW4/5ipQU+diMnhWQBJk GjSQ== X-Gm-Message-State: AOJu0Yzb7Z0zu00pHqovWWjoh3rswXHzzHnwpyiD0/WKYCq/siH1EQaE 7rERbeZQmGMuiabZx/DNdiGeYfJFSo0+I0eQ97x3cYzsu3i7Y+IqUubNZb25SoslztwVNvv2x+7 xlM8= X-Gm-Gg: ASbGncuClzU96+kUUJo7+nRZ1VLQazbwzfuTXzAhSjxkyybXT6Sqiz9Zv4yauPRvK5i /OunEZyqhC73JhKM6aI2L15IpHM5jFeml0MaKFeLUwvjfBGTLZN8dfAumG9qyYL5iqH+2ttzOSt O/6Dx9dcFFlEgP3WY6EMVI1glS4gVbMyFUDYn73PWJHUwxKJUqXQYI+3VKsJpvTpZ6Cd1JPv1xG DlgkBe5GXNiGINWfTSL0SR1etheBVfaja0oS8PClXnI4sRvrIMk1suUnyfP2K8yMa0PWcSOEakO ARQUMVWXJ1lvoOauCe3PgoCDJc1V27jgpkJn6CExGzY= X-Received: by 2002:a17:90b:4c0c:b0:2f6:d266:f45e with SMTP id 98e67ed59e1d1-2fc40d14fcemr14940725a91.2.1739797597690; Mon, 17 Feb 2025 05:06:37 -0800 (PST) Received: from localhost.localdomain ([176.167.144.216]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-220d545d046sm71339195ad.114.2025.02.17.05.06.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Feb 2025 05:06:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Riku Voipio , Richard Henderson , Pierrick Bouvier , Paolo Bonzini , Anton Johansson , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/5] accel/accel-cpu-target.h: Include missing 'cpu.h' header Date: Mon, 17 Feb 2025 14:06:06 +0100 Message-ID: <20250217130610.18313-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250217130610.18313-1-philmd@linaro.org> References: <20250217130610.18313-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=philmd@linaro.org; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org CPU_RESOLVING_TYPE is declared per target in "cpu.h". Include it (along with "qom/object.h") to avoid when moving code around: include/accel/accel-cpu-target.h:26:50: error: expected ')' 26 | DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) | ^ include/accel/accel-cpu-target.h:23:33: note: expanded from macro 'TYPE_ACCEL_CPU' 23 | #define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE | ^ include/accel/accel-cpu-target.h:26:1: note: to match this '(' 26 | DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) | ^ include/qom/object.h:196:14: note: expanded from macro 'DECLARE_CLASS_CHECKERS' 196 | { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \ | ^ include/qom/object.h:558:5: note: expanded from macro 'OBJECT_GET_CLASS' 558 | OBJECT_CLASS_CHECK(class, object_get_class(OBJECT(obj)), name) | ^ include/qom/object.h:544:74: note: expanded from macro 'OBJECT_CLASS_CHECK' 544 | ((class_type *)object_class_dynamic_cast_assert(OBJECT_CLASS(class), (name), \ | ^ Signed-off-by: Philippe Mathieu-Daudé Acked-by: Richard Henderson Message-Id: <20250123234415.59850-13-philmd@linaro.org> --- include/accel/accel-cpu-target.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/accel/accel-cpu-target.h b/include/accel/accel-cpu-target.h index 0a8e518600d..37dde7fae3e 100644 --- a/include/accel/accel-cpu-target.h +++ b/include/accel/accel-cpu-target.h @@ -20,6 +20,9 @@ * subclasses in target/, or the accel implementation itself in accel/ */ +#include "qom/object.h" +#include "cpu.h" + #define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE #define ACCEL_CPU_NAME(name) (name "-" TYPE_ACCEL_CPU) typedef struct AccelCPUClass AccelCPUClass; From patchwork Mon Feb 17 13:06:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 865933 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1075945wri; Mon, 17 Feb 2025 05:07:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW9jhZrjfOn3ynZrzIJznZkFT4mOvRBQUUpxy7b7+1NUhbMYbtroTBGAccw189hpCQl4W5sWg==@linaro.org X-Google-Smtp-Source: AGHT+IGv/NdaXDucLkDN+K/h0RrN/6APpA2MQnL7shXmP+hDr13pn/WgHLlQSx/K1Et6YSJNbG3m X-Received: by 2002:ac8:5a4d:0:b0:471:cc90:7aee with SMTP id d75a77b69052e-471dbcdd5cemr124758741cf.11.1739797635072; Mon, 17 Feb 2025 05:07:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739797635; cv=none; d=google.com; s=arc-20240605; b=YgO+duOSJI/tl58PQ7lHGWFuPvSyuR+Lo39r88smWurNHKzrFGLcBhF3xv7MflwwzS HNu1EbinB1wUiBQD7G91AITwG5F0L5RjM6UdI78NlFxYQDasMw8BtL0XVQwI1iyvhX0k 9b6oCPkd+eSnObrYNeOnyZHLw4MNlfNxbdiAYa7RBCTGaPyz2XcUIPde8B7uywA7NxWe MbYDST6Fbm7SslWqN4JiPuNgMzvnkQW4wCYu51+qOVmaWIjYVXpNBd3LyDRgOvCfM6Ak Hood224m+nJgktAQ/+Gae1dkHpGhcN21JUnqCbHdGm+jJOJzlJlIP53WJPWZ9kJcqTF0 d61A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7O0UWINckwcSYd7NHNQigdFexck5lWKOcbh3yCa7cb0=; fh=DXomWywNH/2babz/5F0loN8t7CwqQh+osTxlwLsrsp0=; b=JwHmKaM6DLygtVCZsfX7F7DUVmncAE+xrN4w3e1yPDbR6X16U6esiPk8NzHXHGg6la 8aYaJ0fMA6DqeiwA7qk5RdtRC8Ut45xk4PYCQhi6p0H8l1E0GuLkdEpF2GKHvizmNBSD qS6002sPnmqwPkJuEtuSWGbQdtmzMganxStM/L1hO9cBSGZrqkO2XVZFQJi4PK6s+Hes a6szehjblE/r8gzu6ChPT+dGHp3MoU3+Yx49fWg8+ykupPU3sQ8j75BBnj9iRgTwDJhk 6KDwc7Q/aJXfxKIc+fqvcuSp+z0RZV8WkP2sd9EEPW8DAfSsO70q0D771rW6cDXlT+X4 xyZQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ke3/3Rie"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-471c2b5f05dsi89359141cf.472.2025.02.17.05.07.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 05:07:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ke3/3Rie"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tk0px-0002Nd-Av; Mon, 17 Feb 2025 08:07:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tk0pu-0002Mb-PU for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:06:58 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk0ps-0004oU-2c for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:06:58 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-220ca204d04so56797655ad.0 for ; Mon, 17 Feb 2025 05:06:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739797614; x=1740402414; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7O0UWINckwcSYd7NHNQigdFexck5lWKOcbh3yCa7cb0=; b=ke3/3RieAy5QBQzHEn5NMU2IIfeNj1RI1fZFg2+UFwVuoxQb5cUNKSD56Hpg1OVjV4 qMCDMZepFeyXW7yRDlEinV6WJHbFeYKm6AezoiZ4Pgbwj8OjiKZvJKPGoNH1x7SHKcMM fpoJxATCmVPy7KgAxKAC8d5jRJsuqwUDlUT8FF9Fk60NawQSGj/iEIVUSD41HR8/J8vR zLcmOul5gqWSSHht35J1452gxsvplBbgSa6fsPK6qixBa0tmjpAVfTpBpHlCmbeySpK5 nes7aqvOyv7wXS4VwQ0UFtQJAM1cKgWn7SkYZ1Emdl3szbtHeiTLvDhoMoUuOtD8BIKH +99Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739797614; x=1740402414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7O0UWINckwcSYd7NHNQigdFexck5lWKOcbh3yCa7cb0=; b=Sb7z9oM3xWfaGx/WGg6R50NxufMe3fhMfi71A8iIYQO+4YTyK/io9JcWwa5GdAmIfG QXn5SLAZuE1KAxQpc+JEoff6fmD4wC9JV0CMJ2wDkqTtNeDp4+grH/QTUMfapnQ9B6oS MhTWqrl/cVhYNv/KEDlkVp4jAasUvdMR5i36vYX/wgxy7FVQSNKSnBFllVArUPGlW1cE EeSWv03ur1fO8xRKOjvLK/LanoKVZC03C/o+Ujg2gTlVZ5Xvsu72Mag7T5a0mcpMoSyj jW6JEwX1sn0tKbqiFqdzragjy9kzbW4B0KALtDFrSNT0KobAr9ALwU/80jE+O7Qzd+oT Gp2Q== X-Gm-Message-State: AOJu0YzCZjpJquRJS8MLT75Djq+G8Ld+z5i6lpXo+xSEy18NaCrKYbIY 9ZI1V1CcLOtu5exX7Ug78Fb0IpvCM/iwGLaf7EK1w5NNnwymQKTfAkHCp9H8lUGquB5KL2jSaw5 c+bM= X-Gm-Gg: ASbGncvDNrntD6eiGJlVhvO0phoBM9bP7A8hYCZK+QKUh1medf1yuJUf8tfPwlSLXF0 pun3vkUWC+sRt6CdpWxUWTcnRb1BuBsrcLrAQzU0vbQXt8UlumwujGw7ogEun8qBIzO2/I3JxfB Z+9t+4XE/ejKXRKp+zslGUItAFnKaqbRAopKsTE+Tf7IwbTyVaxwhB7TwklqBvotxST+Zxq13tv 7HCt5OJm2pbC1snP2T6a8DvNd0VDz6mWlPQdyhSstPn48C7am9zLT331XJDExW0WDsBEZKofFAW FnLUgG3o9Cnheahx83c56A407vMV3CDl0VPSLdsG7RI= X-Received: by 2002:a05:6a00:1408:b0:732:2923:b70f with SMTP id d2e1a72fcca58-732617bf52cmr15434269b3a.11.1739797612678; Mon, 17 Feb 2025 05:06:52 -0800 (PST) Received: from localhost.localdomain ([176.167.144.216]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-732425463ebsm8306546b3a.19.2025.02.17.05.06.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Feb 2025 05:06:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Riku Voipio , Richard Henderson , Pierrick Bouvier , Paolo Bonzini , Anton Johansson , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] accel/tcg: Include missing bswap headers in user-exec.c Date: Mon, 17 Feb 2025 14:06:07 +0100 Message-ID: <20250217130610.18313-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250217130610.18313-1-philmd@linaro.org> References: <20250217130610.18313-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=philmd@linaro.org; helo=mail-pl1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Commit 35c653c4029 ("tcg: Add 128-bit guest memory primitives") introduced the use of bswap128() which is declared in "qemu/int128.h", commit de95016dfbf ("accel/tcg: Implement helper_{ld,st}*_mmu for user-only") introduced the other bswap*() uses, which are declared in "qemu/bswap.h". Include the missing headers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/user-exec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index c4454100ad7..9d53c9440ea 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -30,6 +30,8 @@ #include "exec/page-protection.h" #include "exec/helper-proto.h" #include "qemu/atomic128.h" +#include "qemu/bswap.h" +#include "qemu/int128.h" #include "trace.h" #include "tcg/tcg-ldst.h" #include "internal-common.h" From patchwork Mon Feb 17 13:06:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 865935 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1076117wri; Mon, 17 Feb 2025 05:07:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXPbcVuMzTnvilEQsMf84W3uu0EPbJBK6jJBQ7WJTNcSqkuhz+wxpW0Gvydi7Hfp3i/N/3xcA==@linaro.org X-Google-Smtp-Source: AGHT+IHsCEUCJlbUpGjpb2Pfxxaxma3/kx+PtsJMD7SRwfpbecTi8+D68AvkIacNh/HAqebvD9/K X-Received: by 2002:a05:622a:1b27:b0:471:8e90:dd5a with SMTP id d75a77b69052e-471dbe7e7afmr148618821cf.32.1739797654970; Mon, 17 Feb 2025 05:07:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739797654; cv=none; d=google.com; s=arc-20240605; b=UOjr12sw0a4bPeZ0jvKY0zF8oTUl0QcJfP8lHv/9pBXQUwUHxZ5vda3lzIhcDjKEWI FBoDIBckcMxGa0tSHgH5wHMtX7QAQqwaEJXk+T97DkqQ+FdUyEnaw4V6+akg3tE/vxeM YAZB3EsLOAQlri5nH8BV85w7zv+6c9kqcB/eWMbi32UqAgBU7ZTnOX8xdtt1DVLxSt8e ZOVf20Z/IBuqFAycgvl4h0k9Ymv70+cmj8agxVhazFU2LN53P73LmECHDm8o6OeDjvag F18q2IFq1QxEQt5gqxvQdoRaQXd9VszjKqRhpco7o2fesMKhzpo59n3+yWPIttNBHdA5 EQCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fF0xXoskNTP3E7oiZ/UkECykSfMxXBb4Zdq1BDiDxuU=; fh=DXomWywNH/2babz/5F0loN8t7CwqQh+osTxlwLsrsp0=; b=BrKLvW357EtHXcrtp249Va+Dh7jcCQsHFkw+GDKcgxyhxuf4iOUDTxxKEBbXglAH1o 2pvUcvYrk2zRJWRSnwyswIyP9ugZ7sriaqkVCD4U0/dXX6NdXk0H+xj/KhMDrwTWo8Ed sfL55G6xynXmV8od/s6hmDkhvZAxU87HEu8MWouvFh7fEYKF5bdyN3d0SSMSreivMr14 a7t4UU3MXMAbXeoGRfmqC/tM2wNnFq5wGJznIBi9GyBmDWL1q73HKIgnYK0I+MTDPvU1 9PcewvyittWMv2oFgcsoePsbx30BpRHYtoADxLELKMLOaDk3qmAyR45GhbSfub/khewz l2sg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RfN+EPQS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-471f1cb52d9si18005061cf.293.2025.02.17.05.07.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 05:07:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RfN+EPQS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tk0qA-0002wc-3o; Mon, 17 Feb 2025 08:07:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tk0q7-0002oo-Lf for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:07:11 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk0q5-0004qo-Pj for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:07:11 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-220d601886fso55753125ad.1 for ; Mon, 17 Feb 2025 05:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739797628; x=1740402428; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fF0xXoskNTP3E7oiZ/UkECykSfMxXBb4Zdq1BDiDxuU=; b=RfN+EPQSS+s+1FApesuIFKuqLpIg8FpeGsnpIabQs6ofD87ohQZ+4/CEihnZ7a5E6G 7sqXHKXHb+iMmK9FcQJCNurb1Lggihwc43+bQwwEyylf06UmtaVoMm6zjocmgRLzCKaM FiIlOV6kRoxJRHGJDUSINkm7J6iSidBiwTwfrtpJtOLZI4bE6jmFtfTnRcIIPgYQtZKp V5KFE+64Jgcnz9VzQJMyeeA3/pleGjFRNqR/Y6toamMt/9wMdYKgGAIt6ry+C/wIAqZt IfxQrSFh/uZ7wMjeOImOudNltGaz6OsOERE0+/3WezGtwE93Qc3hgBARxVtczsNqLeDK NZSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739797628; x=1740402428; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fF0xXoskNTP3E7oiZ/UkECykSfMxXBb4Zdq1BDiDxuU=; b=QwojVe8xQ5NMs7rgo6pwDA36PDkQcSyIcyzR9Mxdl3wBmx5gSdu5BoCiat+tf/4MRq eiAWRSPGIY46Q5n5u8gEvyG/O9YGi3TY1Qqk6gX3c+Kikz9Ng9WLm3urTj+XM+nSwuBY falGXbMv/bm/2s7VAFlR687dheEJxnfmBqOTq/mCYSvvq+ImUFszpLDF6Co9xqpoLGca bn8ew02R0iTWXh6uDr+eyzinWzT02C/4YJzlOP4R/c9+6Y6mihK1DoPQFZ5bRGl5Jtbk W0DNi9cQl27kY1wxvzIK0vLsUA8musRz7jSN5fbLkf0zBTGTeoUSdGpTPtMcgQvIfGjn j63Q== X-Gm-Message-State: AOJu0YxgsH+6XFgP2AL2jXpPYHEysFyQ4ormbvbreYWXLipOWFFLVxhM S7cNtGwAg0iVVDemNOcoxd1yJ4Ov3J24YkhuaC000/uBGh2GccjlrM8IDW8vYFQ9XTZC3xh5Wj8 SA+c= X-Gm-Gg: ASbGncuImAbxtL6b70uuu5hHvODZYM4ZE+FhxvkaExzB0Y1MDfKeaRgl5DkSoqxNVOH AaArU+zODOEXU8xjSRNE5OcejTvatsrIWtRbUtU0GKKh2DK0GbibSu1//LT+2SByfQXLfzOg2tG hSKP62lqpG2Oo/aq0QLMclKH5noMNQ4w/Lnq3q300YDW3Tcv8rBMLj4BcWDd7LzqfATAlyNfp8x w9Lr3irwqT+nDCvZ5xAFBNNFOSf2vkFfiXE138gcN6/rayflXgDoVHR598pJ42yg/4lbskrXFuh KV7R5g5rTyauKBZnLaMPFfoBh9xfxFTBK/HEkk0h5zU= X-Received: by 2002:a05:6a20:3949:b0:1ee:bb7f:9b39 with SMTP id adf61e73a8af0-1eebb7f9e9amr1558071637.1.1739797627824; Mon, 17 Feb 2025 05:07:07 -0800 (PST) Received: from localhost.localdomain ([176.167.144.216]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-732771a01bbsm2490735b3a.78.2025.02.17.05.07.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Feb 2025 05:07:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Riku Voipio , Richard Henderson , Pierrick Bouvier , Paolo Bonzini , Anton Johansson , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/5] accel/tcg: Take mmap lock in the whole cpu_memory_rw_debug() function Date: Mon, 17 Feb 2025 14:06:08 +0100 Message-ID: <20250217130610.18313-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250217130610.18313-1-philmd@linaro.org> References: <20250217130610.18313-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Simplify user implementation of cpu_memory_rw_debug() by taking the mmap lock globally. See commit 87ab2704296 ("linux-user: Allow gdbstub to ignore page protection") for why this lock is necessary. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- cpu-target.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index 20933bde7d4..b5230ce1837 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -380,6 +380,8 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, int ret = -1; int fd = -1; + mmap_lock(); + while (len > 0) { page = addr & TARGET_PAGE_MASK; l = (page + TARGET_PAGE_SIZE) - addr; @@ -414,11 +416,9 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, * be under mmap_lock() in order to prevent the creation of * another TranslationBlock in between. */ - mmap_lock(); tb_invalidate_phys_range(addr, addr + l - 1); written = pwrite(fd, buf, l, (off_t)(uintptr_t)g2h_untagged(addr)); - mmap_unlock(); if (written != l) { goto out_close; } @@ -454,6 +454,8 @@ out_close: close(fd); } out: + mmap_unlock(); + return ret; } #endif From patchwork Mon Feb 17 13:06:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 865936 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1076203wri; Mon, 17 Feb 2025 05:07:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXWV/D4tYudfBdyvUyr4itt2Iozyk61Yd0du+mOtSySu6Djk2xKZu63z68mPy1i2eISmlwLsw==@linaro.org X-Google-Smtp-Source: AGHT+IHTNgmRfOkPxUhVjiQ0Wf6O18Bn4f5au+krHcjsX81kNuONFxycx/uhnSniJkeeL6rskr6N X-Received: by 2002:a05:620a:1aa9:b0:7bf:f916:faf3 with SMTP id af79cd13be357-7c08a99c57dmr1319791685a.8.1739797664392; Mon, 17 Feb 2025 05:07:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739797664; cv=none; d=google.com; s=arc-20240605; b=ZNnDXwK9ehw7MXDpHYDom1Gwgz4ZPjN1Lu5ofZEldx7QVcPBmm8MXrVxlbBOoPvjlo S1xDFvukGfFNSNjgCXDh5a5ATp5k/4jYVwI57vVIzkgCOY+HtOpR6t/VKKBWDQ5b0bwG 4Imiof+27kInBgHjUYPP5sz6RbdrY7PxANc1NlTsUCDENLtBZLA8PT+RKYl271Xp+hXO Mi4bwf+153/5FvV6aseuMFywl8DdKmVELDuuoU1v+JxFGHPdqpRx61DkkbFRBRORESg4 1cp4V7wksvUzblC93XeUHX63qkagJuQq04iz0nHt4eTlIKjB6MrCu2+FaEwprZ3ljsRb rd7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u9uCPjDW0dErB0lZ2crkMfUrfBy4bGr0Qf3z7+OEIYI=; fh=DXomWywNH/2babz/5F0loN8t7CwqQh+osTxlwLsrsp0=; b=bgqkizb763+msAoKFmSWHtnuhTi+oU3JFcoHmhU3FXdQWfhT5Z/2B7bpE3lEttiziN TXoZv091jowZdq3sblDaFmHiNTxogok17m2MxOIxxAH8t11fhxxDRKM8rHpayfH7Bw17 b1SYbPfvdz0nC0fat5NvoUCp/GL9LHrijWx6pgHj8d1UsEvIicVEV1WlLtu2+wLhG4Tm wIa4fjT/Xmzx9WSIdqcnlJ/kO6vtpgcln0po4ctO34Ei3MtlZk7OyrKkZXlLfewPJ7tx FOwo4Nz/s6Mhrm7slfB/4T09R5Z2uVFgL6L8fIzh8c88uC4aT+IhOhznLVkkFACdCOCS pG6Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ur/7CNUM"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c0a35e8ddbsi96504785a.499.2025.02.17.05.07.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 05:07:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ur/7CNUM"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tk0qT-0003U8-HC; Mon, 17 Feb 2025 08:07:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tk0qO-0003I3-31 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:07:29 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk0qM-0004st-4s for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:07:27 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2fa5af6d743so6549454a91.3 for ; Mon, 17 Feb 2025 05:07:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739797642; x=1740402442; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u9uCPjDW0dErB0lZ2crkMfUrfBy4bGr0Qf3z7+OEIYI=; b=ur/7CNUMxXx/T6FcW++52hSYwKp055Oqi0MrhaRJ7ja3fFIHEdaPO6YRtLrkh6dOgP wFoO+PQw5rXIwuusMbICafGmg1aGIyX48YvlmNYCB5uA7OWiKpMOa7ReAh2pLEXe6LlM IFCypIVZW8hcj9QKENGxES5PyXT733KypA5banQfhbQN5E86rlYq/BVqDKJjRV3Y/OVG +5ujSRnC/8HpPDvy9jJQ7w/Ya2+wJlUsUhuai/N06RM0B2H9/7lmaL4i+lZ286z0fky6 Mh0iCGeTX/dOQqeG67DoXqL8iV1oQGK0Bn5pOo50XMIKHAKFGa1YBXUVPkcyiT/5/5io BsEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739797642; x=1740402442; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u9uCPjDW0dErB0lZ2crkMfUrfBy4bGr0Qf3z7+OEIYI=; b=EiWmZ5aRnsBS1YR2BWQisVA5BmX+1TyT2kn3tzmbmfUM1bNbJbAalCdtAw9d9Z5fZs RQPKTpSX9M3LNFUTwnz1nwLUhdsQ5KgzJTIg5BdS/AF5ZXFj/Lk9KQgdnZSzPbOsO0PH tBDXgw84xCMmtmFnhPmV+bIJI8Nr0ErtHzO8/iVx65OEbIHXDJcCGT/WvQxUnL1qGhci K3FIg8GBswmo5TAcrM17s8xJ4GMSi5WhctLEwa2gdBk4RJ1OgoK8yduBEEdX8T7DZlUG YpPDDWnLRsJ3heAW92ikhhVF9/H51Jg3xHc8mBe96AzXQPAbf8yiIMw68pOa/AgxwI4O dDsw== X-Gm-Message-State: AOJu0Yy2qp+8EtmCxtrHyeCq8DnA+HvIFz8J8b18pEDH3ZCJYQ3CpDZQ py4tv2aX2UkIxpF/NNwHVaema7Jiu9dwUlglgUqVKvwXkQnOoy2BgIO//RGoIUi41w1cGjUbAEy E/4o= X-Gm-Gg: ASbGncuNzodyML9anF03AmQcv01xTFrFShBqaSoFlgXlfeBhrg0Sc78d9G/Dz40Tv8Z SBVRAs0YqKgulebP10KDEYvTIosj/L3+6xCc6WO5e1FNeGaJpSFPkBNdnQMTkwPWL6Fp7KLsYUp W7p2N5/Gr8Csv2Z5BbGhPYZOL8/y4tMhZvmEkEFVp5OY5wg+8FB6S0bOVet5xvATcqpXlcmLlQ6 oGMiFrLkmO8ygNIMbqVSvJ8mBGgKIOoVQ4lZJf5spZbZp53LX8zK5ebcvfIWttbbGHS8CjVqbTe PyjqD4Re/WdWu/OT6hkTnWaxfdurJtZfAG3MuyGwa7k= X-Received: by 2002:a17:90a:e7c3:b0:2f4:49d8:e718 with SMTP id 98e67ed59e1d1-2fc40f1049cmr14477229a91.9.1739797642407; Mon, 17 Feb 2025 05:07:22 -0800 (PST) Received: from localhost.localdomain ([176.167.144.216]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2211eafd20dsm24132925ad.182.2025.02.17.05.07.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Feb 2025 05:07:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Riku Voipio , Richard Henderson , Pierrick Bouvier , Paolo Bonzini , Anton Johansson , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/5] accel/tcg: Avoid using lock_user() in cpu_memory_rw_debug() Date: Mon, 17 Feb 2025 14:06:09 +0100 Message-ID: <20250217130610.18313-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250217130610.18313-1-philmd@linaro.org> References: <20250217130610.18313-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=philmd@linaro.org; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We checked the page flags with page_get_flags(), so locking the page is superfluous. Remove the lock_user() calls and directly use g2h() in place. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- cpu-target.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index b5230ce1837..3892ce12229 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -374,7 +374,6 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, { int flags; vaddr l, page; - void * p; uint8_t *buf = ptr; ssize_t written; int ret = -1; @@ -393,13 +392,7 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, } if (is_write) { if (flags & PAGE_WRITE) { - /* XXX: this code should not depend on lock_user */ - p = lock_user(VERIFY_WRITE, addr, l, 0); - if (!p) { - goto out_close; - } - memcpy(p, buf, l); - unlock_user(p, addr, l); + memcpy(g2h(cpu, addr), buf, l); } else { /* Bypass the host page protection using ptrace. */ if (fd == -1) { @@ -424,13 +417,7 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, } } } else if (flags & PAGE_READ) { - /* XXX: this code should not depend on lock_user */ - p = lock_user(VERIFY_READ, addr, l, 1); - if (!p) { - goto out_close; - } - memcpy(buf, p, l); - unlock_user(p, addr, 0); + memcpy(buf, g2h(cpu, addr), l); } else { /* Bypass the host page protection using ptrace. */ if (fd == -1) { From patchwork Mon Feb 17 13:06:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 865937 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e6:0:b0:38f:210b:807b with SMTP id g6csp1076533wri; Mon, 17 Feb 2025 05:08:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWuL9mYLbVkUO+wnbYH5BqIdFuRElqXwtS3nOpA7N8CFTpzrYv3YdM2MhHfTnwk/vqX7Lb4UQ==@linaro.org X-Google-Smtp-Source: AGHT+IFOtPIxfTXPsEpUaQQ4VWNu8QgBaTGLtosYd5B2c/6LoItkyYjkm77+v/z9WctsJCSfJoG7 X-Received: by 2002:a05:620a:1724:b0:7c0:88e6:f76c with SMTP id af79cd13be357-7c08aaacb6cmr1327794485a.51.1739797699331; Mon, 17 Feb 2025 05:08:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739797699; cv=none; d=google.com; s=arc-20240605; b=TJgRcIxEwGxzK/SXYOvHRw+emOfN+123Pu/0JBsjffEsywgVgrdmByyRLv/rkrrYxq BH239mD88cMpuqmF+NG8A3Wn74pSk4gf4uhBtLKBqenmwAQBpXzo9XdghMh1gpWZYddW VRJ8WRnwbvZz4bNmfDgJxQNp07oHXn3K5Sg0htQ5p9NMHXLWxPx93bpngVWszlNk2Oln tlmgjRdiHPg54EvdYgGAMIRUi4EacnluFPELToijK6r9DyF4diN23MeKIg/6kvZGIcF9 zU0IG4j3VnZmaQNTb0r9irP3oRGm4FbjwKERjZ6RV1Bptc55/ThK7h6ZTz/G3jHfFzh5 qOFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FJIia44DGrjZyTLCck3b7pQzZNSq4mcpp1g0jS1BWP4=; fh=DXomWywNH/2babz/5F0loN8t7CwqQh+osTxlwLsrsp0=; b=Ph+gu3+9Gv4CSsUbtr99s3OJinRONcq5cAwuSN/a96EOcTrwq0rtvLp8BnvhOuRSM2 AAJVDK6EyFQNQIWuQA0waUzOk8/lDMQMraocSEtn066sczfxWqrooWJavs4cGcvuWiA6 JBjtkE1aQ6MwIvAi0TxRTxLSlxi+nGoBv4TMxyxpO4NFYv99p13QiUSPOQht995fJLba Bebf8o5CBfzGmHI0QzU1F4+sdBpErhh1FB3xN84Rd13KREgad9ImVNuvvl2L9LvmRdEh LT7PfldqM+4MN1CAKQ5LmGghONbFQvr7eK/eBLLl0tshTCKsyNqbg0VH9+4NcdQz1e9C Ct5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DxiiGDvG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c0a7ff8031si23298985a.407.2025.02.17.05.08.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Feb 2025 05:08:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DxiiGDvG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tk0qr-00046G-OG; Mon, 17 Feb 2025 08:08:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tk0qb-0003rc-Lz for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:07:44 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tk0qZ-0004vA-Hy for qemu-devel@nongnu.org; Mon, 17 Feb 2025 08:07:41 -0500 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2fc20e0f0ceso5291574a91.3 for ; Mon, 17 Feb 2025 05:07:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739797657; x=1740402457; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FJIia44DGrjZyTLCck3b7pQzZNSq4mcpp1g0jS1BWP4=; b=DxiiGDvG/5ByU23p9y4vixrCgoL7+Ys36YAH3YwTkpuHvstltWvOiXZSh2s8SpuZO6 SXtbturKzolzmE6gfWqUiWEcq1EV5s7RuEx+w9TTJhzhL4WsaWWc6U4xDnbdFwXQ+xTG iOIfGLghwQcCVJCG033E/qOrJY93NYh1Ie3AxYVY2jlmr5nP0cqKmN07kIBxId6UEaLz TkFWluVdbjtGM5S01/SGOUAIZXVLGNmsahqtepUQjonbrMrA9z2bTk3wZtU6UGJEvNyK y7gpW4/HSjwaKRS6qRsm2Yy4ySz8clP97t4fqd5FMMfZf0Mc0XXq4/vdsV2b8lHtOgw1 RIyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739797657; x=1740402457; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FJIia44DGrjZyTLCck3b7pQzZNSq4mcpp1g0jS1BWP4=; b=owxCnVuJoM8s236NeVmqRiK8psDiJAxySm9FLNXzwe5C1w7ALqsydD0CCo9oN6dwRv JfgZEgt78qHoxvCj+1lW1ZDDSIYWEJNjIiy4CgHNeD6qHgg4UJ6mGnbT6s+EiVPa2LCO lj8OO96WwgB9bP9sp9hhA9wLGMJNQQHo0FKNfMGmK12bULQVIVN+XGi5Ew3NEJMo8fMF Om0sKL7yEeaajxFZ0Q1OATVCH6JkNpcIZu85HeKAdxuX5KUgwHLrqGKht6wahNP4phxe hZAuCtXNtNAxn3rt6Lfu/UTDUAaGu0WcZRHUqYWaLDvNYZq6ZJ9ejHYfj6eCytFMpXXK UilA== X-Gm-Message-State: AOJu0YxtkVTaEKYwGzdE3awWyS249d9OwPGrbWX/JvQnFhePgvxXR19G irZwhECJYhpVALSsQWGdP0hwy9eYTPYydBhvY7JtdVIHxQrxog0vgklr5WRJWkqoF/NdSVAl5KO sQpA= X-Gm-Gg: ASbGncvJGKQWKYRt6bR13IdB5GXKtfADUp1iMonq/y+5t+V8S6V0za9Cx03+2V9v3jg sRSEzK2aTtq3uGsdhBCN23FS6sKDnReaWmiBDjEaBBWcGbf9Vgw5D0Ll/0Xdklks5OJkfuEWcmL zjRSmVln+wNLu1fuMsvmwImGBq/YZyAx6tyDOiNpOl3PfWhjLogkHc9FHh3JPmT+tx4TKDuB70d S7o9duyhrcqbiWTxZMVn09kjpCSSNQuAy1HSMcWf/JLgEplFYi12pGlBcFjoim9LbfMbMoQCcoz WTjOUoymCiZSkLx7vsNv8fFVoBnw8zz+RNe76Me0bJk= X-Received: by 2002:a17:90b:3ec5:b0:2fa:20f4:d27a with SMTP id 98e67ed59e1d1-2fc40d12e34mr16599021a91.7.1739797657466; Mon, 17 Feb 2025 05:07:37 -0800 (PST) Received: from localhost.localdomain ([176.167.144.216]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-220d5596133sm71399385ad.259.2025.02.17.05.07.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Feb 2025 05:07:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Riku Voipio , Richard Henderson , Pierrick Bouvier , Paolo Bonzini , Anton Johansson , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/5] accel/tcg: Move cpu_memory_rw_debug() user implementation to user-exec.c Date: Mon, 17 Feb 2025 14:06:10 +0100 Message-ID: <20250217130610.18313-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250217130610.18313-1-philmd@linaro.org> References: <20250217130610.18313-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=philmd@linaro.org; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org cpu_memory_rw_debug() system implementation is defined in system/physmem.c. Move the user one to accel/tcg/user-exec.c to simplify cpu-target.c maintenance. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/user-exec.c | 80 ++++++++++++++++++++++++++++++++++++++ cpu-target.c | 90 +------------------------------------------ 2 files changed, 82 insertions(+), 88 deletions(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 9d53c9440ea..2322181b151 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "accel/tcg/cpu-ops.h" #include "disas/disas.h" +#include "exec/vaddr.h" #include "exec/exec-all.h" #include "tcg/tcg.h" #include "qemu/bitops.h" @@ -971,6 +972,85 @@ static void *cpu_mmu_lookup(CPUState *cpu, vaddr addr, return ret; } +/* physical memory access (slow version, mainly for debug) */ +int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, + void *ptr, size_t len, bool is_write) +{ + int flags; + vaddr l, page; + uint8_t *buf = ptr; + ssize_t written; + int ret = -1; + int fd = -1; + + mmap_lock(); + + while (len > 0) { + page = addr & TARGET_PAGE_MASK; + l = (page + TARGET_PAGE_SIZE) - addr; + if (l > len) { + l = len; + } + flags = page_get_flags(page); + if (!(flags & PAGE_VALID)) { + goto out_close; + } + if (is_write) { + if (flags & PAGE_WRITE) { + memcpy(g2h(cpu, addr), buf, l); + } else { + /* Bypass the host page protection using ptrace. */ + if (fd == -1) { + fd = open("/proc/self/mem", O_WRONLY); + if (fd == -1) { + goto out; + } + } + /* + * If there is a TranslationBlock and we weren't bypassing the + * host page protection, the memcpy() above would SEGV, + * ultimately leading to page_unprotect(). So invalidate the + * translations manually. Both invalidation and pwrite() must + * be under mmap_lock() in order to prevent the creation of + * another TranslationBlock in between. + */ + tb_invalidate_phys_range(addr, addr + l - 1); + written = pwrite(fd, buf, l, + (off_t)(uintptr_t)g2h_untagged(addr)); + if (written != l) { + goto out_close; + } + } + } else if (flags & PAGE_READ) { + memcpy(buf, g2h(cpu, addr), l); + } else { + /* Bypass the host page protection using ptrace. */ + if (fd == -1) { + fd = open("/proc/self/mem", O_RDONLY); + if (fd == -1) { + goto out; + } + } + if (pread(fd, buf, l, + (off_t)(uintptr_t)g2h_untagged(addr)) != l) { + goto out_close; + } + } + len -= l; + buf += l; + addr += l; + } + ret = 0; +out_close: + if (fd != -1) { + close(fd); + } +out: + mmap_unlock(); + + return ret; +} + #include "ldst_atomicity.c.inc" static uint8_t do_ld1_mmu(CPUState *cpu, vaddr addr, MemOpIdx oi, diff --git a/cpu-target.c b/cpu-target.c index 3892ce12229..83688f1d508 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -19,18 +19,12 @@ #include "qemu/osdep.h" #include "qapi/error.h" - -#include "exec/target_page.h" -#include "exec/page-protection.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" #include "migration/vmstate.h" -#ifdef CONFIG_USER_ONLY -#include "qemu.h" -#include "user/page-protection.h" -#else +#ifndef CONFIG_USER_ONLY #include "hw/core/sysemu-cpu-ops.h" #include "exec/address-spaces.h" #include "exec/memory.h" @@ -43,11 +37,11 @@ #include "exec/cpu-common.h" #include "exec/exec-all.h" #include "exec/tb-flush.h" -#include "exec/translation-block.h" #include "exec/log.h" #include "accel/accel-cpu-target.h" #include "trace/trace-root.h" #include "qemu/accel.h" +#include "hw/core/cpu.h" #ifndef CONFIG_USER_ONLY static int cpu_common_post_load(void *opaque, int version_id) @@ -367,86 +361,6 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) abort(); } -/* physical memory access (slow version, mainly for debug) */ -#if defined(CONFIG_USER_ONLY) -int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, - void *ptr, size_t len, bool is_write) -{ - int flags; - vaddr l, page; - uint8_t *buf = ptr; - ssize_t written; - int ret = -1; - int fd = -1; - - mmap_lock(); - - while (len > 0) { - page = addr & TARGET_PAGE_MASK; - l = (page + TARGET_PAGE_SIZE) - addr; - if (l > len) - l = len; - flags = page_get_flags(page); - if (!(flags & PAGE_VALID)) { - goto out_close; - } - if (is_write) { - if (flags & PAGE_WRITE) { - memcpy(g2h(cpu, addr), buf, l); - } else { - /* Bypass the host page protection using ptrace. */ - if (fd == -1) { - fd = open("/proc/self/mem", O_WRONLY); - if (fd == -1) { - goto out; - } - } - /* - * If there is a TranslationBlock and we weren't bypassing the - * host page protection, the memcpy() above would SEGV, - * ultimately leading to page_unprotect(). So invalidate the - * translations manually. Both invalidation and pwrite() must - * be under mmap_lock() in order to prevent the creation of - * another TranslationBlock in between. - */ - tb_invalidate_phys_range(addr, addr + l - 1); - written = pwrite(fd, buf, l, - (off_t)(uintptr_t)g2h_untagged(addr)); - if (written != l) { - goto out_close; - } - } - } else if (flags & PAGE_READ) { - memcpy(buf, g2h(cpu, addr), l); - } else { - /* Bypass the host page protection using ptrace. */ - if (fd == -1) { - fd = open("/proc/self/mem", O_RDONLY); - if (fd == -1) { - goto out; - } - } - if (pread(fd, buf, l, - (off_t)(uintptr_t)g2h_untagged(addr)) != l) { - goto out_close; - } - } - len -= l; - buf += l; - addr += l; - } - ret = 0; -out_close: - if (fd != -1) { - close(fd); - } -out: - mmap_unlock(); - - return ret; -} -#endif - bool target_words_bigendian(void) { return TARGET_BIG_ENDIAN;