From nobody Mon Feb 9 06:08:55 2026 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1589029931; cv=none; d=zohomail.com; s=zohoarc; b=KGnmvUhLQllCRFE+AuXIej3Py7mNKm7J4efDy7kw2KsD49u5ikaglfPP2+bEXQP0ax16IjCdB/ny7/tZYshfiWGT7OUslrhyy/sjI5KBNoDQVRRePVLeH9QLUR+0fPhDoH3NvTNQ/KkHNVTU/6R+cdmT4fMq69hD4q3nZjBKM8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589029931; 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=TeWtSAei3ep1DJcrXDtpu+82w6foJlJk1rjchgbdgfo=; b=g1Gf5aO0+h7siN0feLnX0lEMlFg/7jX+QkmgVrmGyApro4zMGtVwoSKHjUkmBSYtePhKfmkyTZJ37RmsRyBaXAEMtw6A52an4JJ0PVi6vPoyW4kGCMRTEw6ZcnzTBiPty8riXs55VXM+AE40CEWEjF/GOlmfNLUv6Z9gnGuOgE4= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589029931914255.91465321204487; Sat, 9 May 2020 06:12:11 -0700 (PDT) Received: from localhost ([::1]:60082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPH0-0001Us-Kf for importer@patchew.org; Sat, 09 May 2020 09:12:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEH-0003c9-UU; Sat, 09 May 2020 09:09:21 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:36305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEH-0002qr-3W; Sat, 09 May 2020 09:09:21 -0400 Received: by mail-wm1-x343.google.com with SMTP id u127so13582409wmg.1; Sat, 09 May 2020 06:09:19 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TeWtSAei3ep1DJcrXDtpu+82w6foJlJk1rjchgbdgfo=; b=FVDqgvQ0ukrRJhtKvI+c9JPloXHMWIoy4AmFxurl2ULEWeMwOVaSrI1H5mBNVyd+H1 Ed95DK3yvQ4R/SlqX2RCwHGKz/P19lTQd0mUepd5K91LqBkDxhjIlkXh//7fOecLtnL/ r58B6l/H4/FQ2PUD2TtH87WSEDAle4hkIVJRdXeRybIVjl21R8MIuCc4yRUQUPToZ6lG SRAuTKsLgWJdL4s5CCiNuuX546BqvIFtJkUUu5YwAancGKkw+JLUcHNgt5tWiS/gndED D5+gmz1DkoKQfL1Dy+dft260i0kfLg6ar12XmZgV7hqsRhdfAF0HqCC2Z1QqjN+bVGtH D44w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TeWtSAei3ep1DJcrXDtpu+82w6foJlJk1rjchgbdgfo=; b=culRO1TUFFoXO5qduN58a1tWZ0n+ZqdVAD0yqi6x88Z+6uUJyLlqcSEjFupChAtK6j UsbUzlVfv3/9LXUbjC2IpSPM43JTRaYG59oFeO2eCbIug/INWD8JtaYPJ/DoGmlCevM1 YEh0FetCeKmbnvkAisaek8CRGhCIPwBxnfrUCequI3cIbr87uFLaJpi19Q6XqqQGCRLr cElP58HhxnoZ0iWIHl3C3sb6JFNg0oGTWNdL2QcwzpashKQDKf2syb1dfc7YoxWj5YNu h6InouU6K3tXP9o8sc7b9KtTJhRyZ06COXJ2jaOem3/+Jyo/Oj8Yck1OKKLkjjDhX7EZ k5JQ== X-Gm-Message-State: AGi0PuZ3qnzqt6v3c0OiZR0lh44XZxlYMbAie5o2B4hMjOZ8IVOq/dX7 kPVRqMMLQin/khyvt9ksqxZjQVIQ+uY= X-Google-Smtp-Source: APiQypK3virEnIkWexu8Mf8qsHDhzVfpImcldIBfa3jsD5SK4vyes6cGvXjwqv8wQQgx4WnoNRS06g== X-Received: by 2002:a1c:f306:: with SMTP id q6mr21073205wmq.169.1589029758217; Sat, 09 May 2020 06:09:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 01/11] plugins: Restrict functions handling hwaddr to system-mode Date: Sat, 9 May 2020 15:09:00 +0200 Message-Id: <20200509130910.26335-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Restrict qemu_plugin_hwaddr_is_io() and qemu_plugin_hwaddr_device_offset() to system-mode. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/qemu-plugin.h | 2 ++ plugins/api.c | 17 ++--------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 5502e112c8..06c271a107 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -326,6 +326,7 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t inf= o); struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t in= fo, uint64_t vaddr); =20 +#ifndef CONFIG_USER_ONLY /* * The following additional queries can be run on the hwaddr structure * to return information about it. For non-IO accesses the device @@ -333,6 +334,7 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_= plugin_meminfo_t info, */ bool qemu_plugin_hwaddr_is_io(struct qemu_plugin_hwaddr *hwaddr); uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr = *haddr); +#endif /* CONFIG_USER_ONLY */ =20 typedef void (*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, diff --git a/plugins/api.c b/plugins/api.c index 53c8a73582..785ad2e45e 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -249,7 +249,8 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t inf= o) * Virtual Memory queries */ =20 -#ifdef CONFIG_SOFTMMU +#ifndef CONFIG_USER_ONLY + static __thread struct qemu_plugin_hwaddr hwaddr_info; =20 struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t in= fo, @@ -267,26 +268,14 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qem= u_plugin_meminfo_t info, =20 return &hwaddr_info; } -#else -struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t in= fo, - uint64_t vaddr) -{ - return NULL; -} -#endif =20 bool qemu_plugin_hwaddr_is_io(struct qemu_plugin_hwaddr *hwaddr) { -#ifdef CONFIG_SOFTMMU return hwaddr->is_io; -#else - return false; -#endif } =20 uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr = *haddr) { -#ifdef CONFIG_SOFTMMU if (haddr) { if (!haddr->is_io) { ram_addr_t ram_addr =3D qemu_ram_addr_from_host((void *) haddr= ->v.ram.hostaddr); @@ -299,7 +288,6 @@ uint64_t qemu_plugin_hwaddr_device_offset(const struct = qemu_plugin_hwaddr *haddr return haddr->v.io.offset; } } -#endif return 0; } =20 @@ -308,7 +296,6 @@ uint64_t qemu_plugin_hwaddr_device_offset(const struct = qemu_plugin_hwaddr *haddr * will be. This helps the plugin dimension per-vcpu arrays. */ =20 -#ifndef CONFIG_USER_ONLY static MachineState * get_ms(void) { return MACHINE(qdev_get_machine()); --=20 2.21.3 From nobody Mon Feb 9 06:08:55 2026 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1589029850; cv=none; d=zohomail.com; s=zohoarc; b=WD14w7QSzNK0SSPTy2zjfp7UjKR9SUjpmL8qGD0XnSKywmzkhvSMk+ENE15Gd6Jj7o/fOPRJhltt0H8dHsqWFymQ0D/GBN2Tnz9e5Bu0v5iXlgjU2dtA3Eq8faa14+doGaExZ2mIbGD7TJYldI1LKGwZn7TrgxEeeUz2SBG+emc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589029850; 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=FsKgzNtj0JOKlhy4WvhLDnKHvG30g1UF9KO56LbtNlA=; b=feLkXell+630HcALO5loFkuvYf+0EY2rdPu//49yXlJ6X8VAqjQ70PsIXp9/OsfJoxj4fjSBPpqPqRafs4wKFlRYqZY0Qi9hXy3tXF0PLXrwZw+IRZeZqLBnPobA0+f/5OVA51VGCE+5HB5v7MwtUAf2ftJkMK81ZplwspKxoSg= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589029850821839.4522765128013; Sat, 9 May 2020 06:10:50 -0700 (PDT) Received: from localhost ([::1]:53454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPFh-0006vX-HI for importer@patchew.org; Sat, 09 May 2020 09:10:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEK-0003kq-U3; Sat, 09 May 2020 09:09:24 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:33410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEK-0002sO-4g; Sat, 09 May 2020 09:09:24 -0400 Received: by mail-wr1-x443.google.com with SMTP id h9so5152172wrt.0; Sat, 09 May 2020 06:09:22 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FsKgzNtj0JOKlhy4WvhLDnKHvG30g1UF9KO56LbtNlA=; b=QSXhQonqNvr9y6aJqookdYR2z9b+6/7vg30IC+CtmajxekI8w5NmMlHOd8VP9kSOXr 3Qt3QFOzv4yBJ4DGsuoRdGjckHFFKV2+oYWuRHO4ZL1BvRcXWzkNNaJcwIOnxzpee3ty yIaPH41DahTx2g9qjWcaj2Jjwy+dsB3j8dfh3h7p3Wfmpl/a963139QKsbxPurlFs4+O CYC58AlfyyOs/noYt3dYHtc2uWKEuyQ7R2FMftMs/KgfrwtoCNVJ07ZoHD1/8CkUMGE4 c+v6IOUFGGHAQVVSLlNlLI8Atgc/Am63e3IoSXUkWgYWi507/sXOv+M+JJK/Fz8751RN DkEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=FsKgzNtj0JOKlhy4WvhLDnKHvG30g1UF9KO56LbtNlA=; b=XMsItHBim3QC6N5ec7bWTwUXrmVpNtu75cT7Tq9UJmGvLju0Z9t0j1piHMZic74xHo X3ZXAH4hckyPVlMJZmIE81J7Q1vM+KiOYH3TQtgd1qvU6oLW7yFYCr7cT5G9pNhTAKWS keM/uiYddrZpCMd0DbrVknxlS6fd56K0ukNhbs7v5oaCPQn1TaUHJTvlKMO0UGzSZvIz b0I5vSxPjMPEMjqYqGojkcQE0tJYGQmaw70V3KBcsl3hSgNwakO4g5y9eFir/gURJNtl OwbamPPU9rteah1PaP5UuYHm4e1wvSKoGoxm3UNCoSqL9Yt0Zt+bRtaqxCVsyrksxrqX gGdg== X-Gm-Message-State: AGi0PuYe1V4pdRjthSnd7iWXxPU+AOMeBx7dtLAkYQrUzwNp2F4NFzY4 Faso1GBIwtNyMstOzjIb9X3dd2n+8z8= X-Google-Smtp-Source: APiQypJsKW0QaSa4nLUBm/QYXRV1pBW3RL2/LwqZFzcRqs467g/ETRp/URxzLlFFHMMH6bHXqUtvBQ== X-Received: by 2002:a5d:6712:: with SMTP id o18mr9021292wru.115.1589029761168; Sat, 09 May 2020 06:09:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 02/11] sysemu/accel: Restrict machine methods to system-mode Date: Sat, 9 May 2020 15:09:01 +0200 Message-Id: <20200509130910.26335-3-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Restrict init_machine(), setup_post() and has_memory() to system-mode. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck Reviewed-by: Edgar E. Iglesias --- include/sysemu/accel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index 47e5788530..e08b8ab8fa 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -37,10 +37,12 @@ typedef struct AccelClass { /*< public >*/ =20 const char *name; +#ifndef CONFIG_USER_ONLY int (*init_machine)(MachineState *ms); void (*setup_post)(MachineState *ms, AccelState *accel); bool (*has_memory)(MachineState *ms, AddressSpace *as, hwaddr start_addr, hwaddr size); +#endif bool *allowed; /* * Array of global properties that would be applied when specific --=20 2.21.3 From nobody Mon Feb 9 06:08:55 2026 Delivered-To: importer@patchew.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=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1589029838; cv=none; d=zohomail.com; s=zohoarc; b=mY7jtcpYSX5EakPaYe+2RdO7sI44xCxsoho8l9eBQWlJIVdr5SQcRsKj4R3UwuXVDL5OSizxSRsdGh9sJ6ddF6lByxYq3hHH9uvSwb7x99Q6uEL7hoeIwFzVxXpTf0cg8e6XY7rzw6iYpTet3g8DMe2LRxMtEBVqQOw8sMHH/xA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589029838; 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=q8Yj7Svj+riGcka/Uh3qsXECOKShvQfR2c9eaJKoO3w=; b=m6Tj5husVDadKHW7VYPC8XdkkM2QP7eP1CHxIBdOEmUhbmp7JJFV+DMQR8lgNhKbdoQNTK5uTtH+sg5HN6XCuMklSyY5aPfvA6UahJBvxsgGdFy0RBMq0Tt6kv+Fz0UWzMSsFUP+puo9MMmEIKuGnAxAVGPgnhGEvO2uDtzAosg= 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 158902983846673.55092983841189; Sat, 9 May 2020 06:10:38 -0700 (PDT) Received: from localhost ([::1]:52230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPFV-0006EW-0W for importer@patchew.org; Sat, 09 May 2020 09:10:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEN-0003rD-GJ; Sat, 09 May 2020 09:09:27 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:55746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEM-00030E-Nv; Sat, 09 May 2020 09:09:27 -0400 Received: by mail-wm1-x344.google.com with SMTP id e26so12984366wmk.5; Sat, 09 May 2020 06:09:24 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q8Yj7Svj+riGcka/Uh3qsXECOKShvQfR2c9eaJKoO3w=; b=hgE12GnE7B03Rf0Li5UMoMVIpZwMF5xdaHeVTULpTEAeAyfTIxU/73x0FkzMTfwU1G j18eIGtDShw1NpPuIcibyAKGBEv8Z+jV2kfFqO00+zmXDW3YeHpN1wFTTPAlEXSvevsN GTt8SqYZGq2Fz6QJYhaCWQZRqUoF3WMNhNvcgcmVb+1w917mRa4ESy502W8DLWAScJrO 6SyLHzlIeiDPyjJBWJnhTPBdv1EUZgShPkZ3nvVULre8KMn44FOQVM30REYOpSZUpkFZ acaIk8sfbkQh1N7LKB7gZJovLowPsd+E2L/X4weuyf+xaIZdReBPyPHRiuq+l8li+feS 3W5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=q8Yj7Svj+riGcka/Uh3qsXECOKShvQfR2c9eaJKoO3w=; b=U4Q/uqNWPpsHn5dxakZ1k9Vtl+uIxwfG/ISIfYqVpZH1ALStz8QK0u1T76VOKMNOwF zd2z3HjpRkDwxvI+E/8GEIpI2cRUTMBciT6wyU5Yh9Pt5aSFGZcJhUNBD483NHHimBib ZaJSr329IKEbdyCBptSDIFZ9n7r/XUytnbQ4A/QjMULqox8pELsQSOkSCJsYIvv8xWl+ WiNOBW87oBinLHfVIKMmxxxxLqDCSdvKk+Mfh5yRD/fUEPZMmur+bA3J85zAvB1rcjrX 6vWuv1F89p2vdovcV/dJsmlWRc9iUWi4OBM6z2pkk7RnBWMTx1ZTdfs7TwOLrmtDt0WA tvCw== X-Gm-Message-State: AGi0PuZIxJFW3RK97kjqUmKce+7h9GdonjOaa6eU5MmbDsZTgzmPnh72 +hpN01mhIYXAUIP+VjLSFOr9Br7OKbw= X-Google-Smtp-Source: APiQypL0YdzBqET4iF7tG3bgS7EpeWyVFfBof8z1hou5dM1nUjXm3UvbLE6X0Jtl9HSfA7evL3JbLw== X-Received: by 2002:a7b:c390:: with SMTP id s16mr20375629wmj.14.1589029764010; Sat, 09 May 2020 06:09:24 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 03/11] sysemu/tcg: Only declare tcg_allowed when TCG is available Date: Sat, 9 May 2020 15:09:02 +0200 Message-Id: <20200509130910.26335-4-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) When TCG is not available, the tcg_allowed variable does not exist. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck Reviewed-by: Edgar E. Iglesias --- include/sysemu/tcg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sysemu/tcg.h b/include/sysemu/tcg.h index 7d116d2e80..d9d3ca8559 100644 --- a/include/sysemu/tcg.h +++ b/include/sysemu/tcg.h @@ -8,9 +8,9 @@ #ifndef SYSEMU_TCG_H #define SYSEMU_TCG_H =20 -extern bool tcg_allowed; void tcg_exec_init(unsigned long tb_size); #ifdef CONFIG_TCG +extern bool tcg_allowed; #define tcg_enabled() (tcg_allowed) #else #define tcg_enabled() 0 --=20 2.21.3 From nobody Mon Feb 9 06:08:55 2026 Delivered-To: importer@patchew.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=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1589030061; cv=none; d=zohomail.com; s=zohoarc; b=QhVDDIAL0Nq+DyklSDVDC+SRksmOPDRv/qagKO4DXoa4UeoH2XXDr26Z2t+nGRjT5ruufenkX51NLMnj0Cjl18alZiO/a1mRm+KEDv3V3Tp0fsOvJcnUPzOw/MFyakhppH2d0QrmNmDAIcoNKFVliZTSvpnE0MD4hr2GVVwdPw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589030061; 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=/deFlLfSBeeZSBPphjSFXwpz9fqQ8rThdLclvTAwgLE=; b=aC/5WIXXhK7JWidb54p4sTLVPC5ToL7JhlTCpriSctzgf97E0uhAwxLSuT9+0vksRrtt+QHitGJh+5qMgE2Ascg0BSEvNYG7EawL9HEXFMiKj8IWYUyTXx6Bi4N8yxLThoyKOcINy4P3/VJ3msddBIPBFrWyCZvA3QzGOk9uVcE= 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 1589030061950395.8157330500453; Sat, 9 May 2020 06:14:21 -0700 (PDT) Received: from localhost ([::1]:42802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPJ6-0006FX-JN for importer@patchew.org; Sat, 09 May 2020 09:14:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEQ-00041Y-PY; Sat, 09 May 2020 09:09:30 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:52927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEP-0003L7-UG; Sat, 09 May 2020 09:09:30 -0400 Received: by mail-wm1-x344.google.com with SMTP id m24so3357416wml.2; Sat, 09 May 2020 06:09:28 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/deFlLfSBeeZSBPphjSFXwpz9fqQ8rThdLclvTAwgLE=; b=GXc5WD/jotqsaemJao8jVSg1pXJuzyf3A6lWcUqvDc3kiEcIAE+1c7w8dft4D3P4PQ 8933I0NI8h47a5aOH3PEbvKagCUFu7KMOMW/e6+ZgFYN09dkTIUFYz0DGi/pNWSL/Idm bW1Y+JkBDZBPP/47h0/q5kq3uBxu4HCBqYD2GzQrV7vp1pVMgmDVEEu5TGis/ayRRhwO 3BPIs9U0+X6XuHls3MMhYQHiz0RwtmcuL/J4tdaSIQVfdtX9kglYaQ6u7TbqNX6m607Z zy4D0ShG0JNc1PFYtgHeKfGtulBzHHIbVDJouBXhPdd3uBzxhR9LAM59/TYbj5vPjSmg L3uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/deFlLfSBeeZSBPphjSFXwpz9fqQ8rThdLclvTAwgLE=; b=ZgW7AM+TUTEGUjVIpQnYXThNrfVeXmKWRSVHR743Oiga0d04Yt6imMx/Rl/6bb9miD t4OLnEbBUSTZns01ll7/7aRecCLutTBkfSzg1pYfKtOSLtNMz00JKl8Ux65GvrZ0OAeA n2zBnzfST14JTj6TjXog/eULExXcyXRyF5zBbCc7vbfq8P6OO/8yBpGZe3+SHwqDvEO8 BoYa+y4YDRHS4YsdpXw8+elIH7u2iLrVmUzbxWUdn64YWKYuvQJFO2HpyKvU0H1129KL c/udDnu6Ll1Vb0m9GGx/XPXx2kDC4MdxMtwslld86YexYeV5FKAuTtjxr3JbLScNv5NF NPaA== X-Gm-Message-State: AGi0Pua91mmY7yvMapsXT/qt+lbJyJsTuryINUv1KneZ30Cf6/fxJ/O2 Ff/ykQpQvilcoNes64hGEn8JD4kqU0s= X-Google-Smtp-Source: APiQypIVCdAFyRkc2ubH7ow2MRfiq0XjMLNU48lJ+FFzNlFhFUf46VOfeXAxA1DxSFAhNQrANi6jWw== X-Received: by 2002:a05:600c:14d4:: with SMTP id i20mr22378257wmh.118.1589029766837; Sat, 09 May 2020 06:09:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 04/11] sysemu/hvf: Only declare hvf_allowed when HVF is available Date: Sat, 9 May 2020 15:09:03 +0200 Message-Id: <20200509130910.26335-5-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) When HVF is not available, the tcg_allowed variable does not exist. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cameron Esfahani Reviewed-by: Cornelia Huck Reviewed-by: Edgar E. Iglesias --- include/sysemu/hvf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index d211e808e9..fe95743124 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -18,7 +18,6 @@ #include "exec/memory.h" #include "sysemu/accel.h" =20 -extern bool hvf_allowed; #ifdef CONFIG_HVF #include #include @@ -26,11 +25,12 @@ extern bool hvf_allowed; #include "target/i386/cpu.h" uint32_t hvf_get_supported_cpuid(uint32_t func, uint32_t idx, int reg); +extern bool hvf_allowed; #define hvf_enabled() (hvf_allowed) -#else +#else /* !CONFIG_HVF */ #define hvf_enabled() 0 #define hvf_get_supported_cpuid(func, idx, reg) 0 -#endif +#endif /* !CONFIG_HVF */ =20 /* hvf_slot flags */ #define HVF_SLOT_LOG (1 << 0) --=20 2.21.3 From nobody Mon Feb 9 06:08:55 2026 Delivered-To: importer@patchew.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=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1589029859; cv=none; d=zohomail.com; s=zohoarc; b=dyr8ht1pHFWh8mAU9NQUGI+cOqlBSL5X7wvxUIrnNmVvdrrNKL0gaNPtL+pUYjwjzKh0XHsnTUhX9qSgvB8I4kFQuGRhzH62RAsHzsW47yrdIMWgV1pLmCcddmE/0UTxo5O2QQJQ7mwEeEfForlxba0MPijScdzrIRlhNGvoCEc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589029859; 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=LLYk56bTzpbED/TEaMz+Gn8C12EvT1HOdsren3t79iU=; b=HwMlMsiSATW32SHz5mMrNp7bXXxDt6Yyk8bFdKOZw4bitjZXopfQ997NXMwfSEeziGT7gNaFuexZ5BqTBJ+qnbom8V1ELmizix+P8qUassjStDK9/8q3e0cqiRrm2kf7F5cayadY+w75ic3BWqw3OTZxeQ8h5MUbyo1MIawLLdU= 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 1589029859262595.2166207292032; Sat, 9 May 2020 06:10:59 -0700 (PDT) Received: from localhost ([::1]:54352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPFq-0007O5-01 for importer@patchew.org; Sat, 09 May 2020 09:10:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPET-0004BD-Pd; Sat, 09 May 2020 09:09:33 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:39675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPES-0003m1-P4; Sat, 09 May 2020 09:09:33 -0400 Received: by mail-wm1-x343.google.com with SMTP id y24so13637515wma.4; Sat, 09 May 2020 06:09:30 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LLYk56bTzpbED/TEaMz+Gn8C12EvT1HOdsren3t79iU=; b=AP4j+tgCGiMzt4H8rWkM9LRHLvvfy6vChYsu223j14fpzOK2Pqi5/cgs7QkpACs5vh N1zCvIR0D66ZYllrAZ2tWAaeGkrPsXt9xm6zo9skgzr2SVMt97UEzXHLUWu6N9Qtkg4/ euGDM4L2z8UAh+EJOMnGTRHFqqtsYRBZJhTTi+fip9mAE8szTB3dWn8Juth85+yQ+oDS nRW22lLT7lShq9EBYOPsyCZ4ollrQzzeo/9LMlFJ48I9X1gdie42VTArpEW7ZghsvF/V t7rd6CZDBwaKDER1Wx5YA6IC70y1YDpyUZt5/m71ZO0n6akG0hmukMSpoLbWaz03XO/+ B/7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LLYk56bTzpbED/TEaMz+Gn8C12EvT1HOdsren3t79iU=; b=pEptVyEigIZLypIRPmGlgIyCubqdYdiUm8anNOp7uJS4oFwbBCjFhql0sHnGGshxvA tUnhvfGvzzL8PObxYOgZ9N2M309trv6X+Q4UJmJ29RmmejOZBwyKyUtmfWojwo/5s9je tLOnuNOBqRes/M5Jlss1mfvGIZ9BX0eLe5JMUQ+sej92cuXgu1xSLTzchmWpaSJ/d9EG BDpxzwwDrBzO+pR117SdtYRj8WkBs5v53Wuxxdebm+MovcIL9s3AU7BN56HHItyYKQDT JIuuDUND+H4kikexM5aQrWtp/NBTXfX+VEbLvkLUPTVyxjY4WXQBjpAgSWwDT3e4NG2U JatQ== X-Gm-Message-State: AGi0PuYA2xc9bWbwxIABGQ631bV7LJy8oo/8gORty0Y3ceBZpA41edSp QJTpaZxc1IInlF4Qu34TrSFjHZDvVGc= X-Google-Smtp-Source: APiQypJ7r2t/Yta7gA62He4a86vm+KY7sXlClAQIeF/nfivQhskw9hfQngWMoh1D2O9TF+ukw3WKyQ== X-Received: by 2002:a7b:cc0e:: with SMTP id f14mr21365946wmh.39.1589029769835; Sat, 09 May 2020 06:09:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 05/11] target/ppc: Restrict PPCVirtualHypervisorClass to system-mode Date: Sat, 9 May 2020 15:09:04 +0200 Message-Id: <20200509130910.26335-6-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The code related to PPC Virtual Hypervisor is pointless in user-mode. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson --- target/ppc/cpu.h | 4 ++-- target/ppc/kvm_ppc.h | 22 +++++++++++----------- target/ppc/translate_init.inc.c | 4 ++++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 6b6dd7e483..73920a9cac 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1176,6 +1176,7 @@ PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr); PowerPCCPUClass *ppc_cpu_class_by_pvr_mask(uint32_t pvr); PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass *pcc); =20 +#ifndef CONFIG_USER_ONLY struct PPCVirtualHypervisorClass { InterfaceClass parent; void (*hypercall)(PPCVirtualHypervisor *vhyp, PowerPCCPU *cpu); @@ -1189,10 +1190,8 @@ struct PPCVirtualHypervisorClass { void (*hpte_set_r)(PPCVirtualHypervisor *vhyp, hwaddr ptex, uint64_t p= te1); void (*get_pate)(PPCVirtualHypervisor *vhyp, ppc_v3_pate_t *entry); target_ulong (*encode_hpt_for_kvm_pr)(PPCVirtualHypervisor *vhyp); -#ifndef CONFIG_USER_ONLY void (*cpu_exec_enter)(PPCVirtualHypervisor *vhyp, PowerPCCPU *cpu); void (*cpu_exec_exit)(PPCVirtualHypervisor *vhyp, PowerPCCPU *cpu); -#endif }; =20 #define TYPE_PPC_VIRTUAL_HYPERVISOR "ppc-virtual-hypervisor" @@ -1204,6 +1203,7 @@ struct PPCVirtualHypervisorClass { #define PPC_VIRTUAL_HYPERVISOR_GET_CLASS(obj) \ OBJECT_GET_CLASS(PPCVirtualHypervisorClass, (obj), \ TYPE_PPC_VIRTUAL_HYPERVISOR) +#endif /* CONFIG_USER_ONLY */ =20 void ppc_cpu_do_interrupt(CPUState *cpu); bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req); diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index fcaf745516..701c0c262b 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -280,6 +280,17 @@ static inline bool kvmppc_has_cap_spapr_vfio(void) return false; } =20 +static inline void kvmppc_read_hptes(ppc_hash_pte64_t *hptes, + hwaddr ptex, int n) +{ + abort(); +} + +static inline void kvmppc_write_hpte(hwaddr ptex, uint64_t pte0, uint64_t = pte1) +{ + abort(); +} + #endif /* !CONFIG_USER_ONLY */ =20 static inline bool kvmppc_has_cap_epr(void) @@ -310,17 +321,6 @@ static inline int kvmppc_load_htab_chunk(QEMUFile *f, = int fd, uint32_t index, abort(); } =20 -static inline void kvmppc_read_hptes(ppc_hash_pte64_t *hptes, - hwaddr ptex, int n) -{ - abort(); -} - -static inline void kvmppc_write_hpte(hwaddr ptex, uint64_t pte0, uint64_t = pte1) -{ - abort(); -} - static inline bool kvmppc_has_cap_fixup_hcalls(void) { abort(); diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.in= c.c index 2b6e832c4c..4ea0cc501b 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -10946,16 +10946,20 @@ static const TypeInfo ppc_cpu_type_info =3D { .class_init =3D ppc_cpu_class_init, }; =20 +#ifndef CONFIG_USER_ONLY static const TypeInfo ppc_vhyp_type_info =3D { .name =3D TYPE_PPC_VIRTUAL_HYPERVISOR, .parent =3D TYPE_INTERFACE, .class_size =3D sizeof(PPCVirtualHypervisorClass), }; +#endif =20 static void ppc_cpu_register_types(void) { type_register_static(&ppc_cpu_type_info); +#ifndef CONFIG_USER_ONLY type_register_static(&ppc_vhyp_type_info); +#endif } =20 type_init(ppc_cpu_register_types) --=20 2.21.3 From nobody Mon Feb 9 06:08:55 2026 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1589029976; cv=none; d=zohomail.com; s=zohoarc; b=idPlFWpvLjiQmiPYE1qYZ0oB2xEgUYSnBNhT3+g81Nhy+DblsRKHn0lNCO4dwQaZYFNQ90CL0i4IIfyvozG5m0I/rexPwT88TokLuHspiTKVEHV30Bx3aJ/F4qwC7gCvsmwCSgSxQQQ5NdQyc4lqydiCc3scoqaFcrR9jvdYFg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589029976; 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=+DgGlmxYDgp0TKp/P6BFoo5PGVwzBhcu5AKwXK50jX8=; b=jQa5aKetyg8vSFimVea+zP7On7geocckIg90dO/rK9o+zZumMez96SCzoMMy1wSZWpsdD9LMiA/7Kl4qEQdhT/5nO8K9N+PIVBVFV4PYX43vvWIO6KerWv8+9vTKoZJFZjQm6MS3+W3flUuIYesaSSCsOjDqX8yNALsX+kBpyGQ= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158902997670959.970104303123094; Sat, 9 May 2020 06:12:56 -0700 (PDT) Received: from localhost ([::1]:36212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPHj-0003Bm-Ek for importer@patchew.org; Sat, 09 May 2020 09:12:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEW-0004HR-DX; Sat, 09 May 2020 09:09:36 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:45337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEV-0004CM-Gc; Sat, 09 May 2020 09:09:36 -0400 Received: by mail-wr1-x442.google.com with SMTP id v12so5106876wrp.12; Sat, 09 May 2020 06:09:33 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+DgGlmxYDgp0TKp/P6BFoo5PGVwzBhcu5AKwXK50jX8=; b=BvcBFgiQIUD1+RziJDhNMsQ7Ucuo0HzKzddEWCkSr5wWeMkPLjf9T3YUgVn7TEZUW8 BeHtatd35QLZX1SyVZBXps154vdDu6tocL168dUDhvR6IdCcR/lyBozEOsD7vkG7qyXF GwQ4iLBTJ8MjVfX6GmIw020VUza87GqXIP2ErisDDxUDaiaV0WTXD+24msJH8VGk6ZZ9 KgqXgJTJbXg6vRCdSTcREyPVonO1iyvU+21nhXXeCrqDLTbo6JpzO04xrj3l4yq1T0ZP 4MviTafrpBKVsPxCgh618jx/It7wV31V6+Gz1rx4tYch2/z3kVArsHxues7KCOZvW/Jq aPiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+DgGlmxYDgp0TKp/P6BFoo5PGVwzBhcu5AKwXK50jX8=; b=Hp0HjKAhwObViqI0WIrlAIsgnMbXtX52v7AwDnRrGEx0a7PeFovGC+OuEclqwfLLB9 ynBND0bTuRuxqV3VB1MU/YHN4xIjatn9el4J8IFqf9j2kGtxK1JN1nqo13rwgkze7Ej+ T1Bq2hytpK6TuF+58+fCcRDrs8+xooKwrVEusP5+zR2dUCarGgA4p65Azvp8wXBgbTHY 8Zq3s37gEia1VY3X3GZow7kmppikt3iGezjLCIjl4/A6JyPdBI0VVqHG00I8j0uVpJA7 Jtu7s4LpUPYRCPF3jAHMc8XrC7asQn46ZfCHPXb1LW9dUUFKwzBizk42p6T+ufEAaaK3 dT3w== X-Gm-Message-State: AGi0PuZZDL96Z+15PxPkd1xPxc7IuY/c6JHPztkrMo2zkPDVuBMOo8+J TpMIpJ+OzRUqYROAn5bPoDlOlOr2G0o= X-Google-Smtp-Source: APiQypJmQJFMZiRR9DoMibdtr9JH+Z1Pn1cDFuHjz2glYTE1zO+Rwp2YknwOdohPGFoSiQItW5g6mA== X-Received: by 2002:a5d:4c86:: with SMTP id z6mr8019146wrs.279.1589029772695; Sat, 09 May 2020 06:09:32 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 06/11] target/s390x: Only compile decode_basedisp() on system-mode Date: Sat, 9 May 2020 15:09:05 +0200 Message-Id: <20200509130910.26335-7-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The decode_basedisp*() methods are only used in ioinst.c, which is only build in system-mode emulation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck --- target/s390x/internal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/s390x/internal.h b/target/s390x/internal.h index 8c95c734db..c1678dc6bc 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -204,6 +204,8 @@ enum cc_op { CC_OP_MAX }; =20 +#ifndef CONFIG_USER_ONLY + static inline hwaddr decode_basedisp_s(CPUS390XState *env, uint32_t ipb, uint8_t *ar) { @@ -225,6 +227,8 @@ static inline hwaddr decode_basedisp_s(CPUS390XState *e= nv, uint32_t ipb, /* Base/displacement are at the same locations. */ #define decode_basedisp_rs decode_basedisp_s =20 +#endif /* CONFIG_USER_ONLY */ + /* arch_dump.c */ int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque); --=20 2.21.3 From nobody Mon Feb 9 06:08:56 2026 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1589030066; cv=none; d=zohomail.com; s=zohoarc; b=nsnf3hZ1E/QQ2uolktgHS5eHeQCvUCV/niLZ3dXeBMv1Rx3ekO1Qz7TyVeaKXGKY2gU6FU+eeLGOE/KnrLD85tHmJwBnCBrC9p0HP2/CdnPgo2f+lpRElc6v3WayUYvl2eboTpq9J9z8XiLXqrnPO8aAMxKoXxcKh2+QlXF6W/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589030066; 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=dOtABLpYucdkmo0UeAZ60MKjOPNkZbYs54q0kVYNjc4=; b=Q6n313cVLsPK/R/9AiDnLmIMgD5iIO/oy3z3r3n7K29tw+fYW3SKa6nAQoyJ4I0FYsmx+2Q81mEoksaz57tW4rTYdJyIufbZlsCU6N0c9PhkeIS5rzc55eUCF1fnNXKEg81//J5xDirnNUkEM/5keX/Dcahb6NZydJYE/acZeP4= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589030066449793.5298519841526; Sat, 9 May 2020 06:14:26 -0700 (PDT) Received: from localhost ([::1]:43082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPJB-0006Oh-7c for importer@patchew.org; Sat, 09 May 2020 09:14:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEZ-0004S0-Ex; Sat, 09 May 2020 09:09:39 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:36715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEY-0004jo-J3; Sat, 09 May 2020 09:09:39 -0400 Received: by mail-wr1-x441.google.com with SMTP id z8so5142038wrw.3; Sat, 09 May 2020 06:09:36 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dOtABLpYucdkmo0UeAZ60MKjOPNkZbYs54q0kVYNjc4=; b=HQK3okQo3XgNVWABTcc/YPdQSiaGJ3DfZD6sUUm77Yk8M91/zHxprIHjBdeBsmNIdg Bn3+sNvRRbzvzyVK7o+vMnT7F6lWE1Iz3Dc5pZD8yA9Su/M/W/MQvv9soEeS1saLjcTe 1nsJCoI4Dt3gaLZtddO2soy9KlYTqguUaHTrFAwy1FsijxkmQEF8Ye47gY/UgB+Ingrx MXCjshWY7FIM1TOUdJ8OPNMRLvDuykIdDhp0rhL65CbYVOl8DVPRp2ITd3RjPSV48+KN dvEWFWdZoycY7hiqyy+y32YfKU0m1Agt5JeQFR0A3mdwVcz9WhrfrydHnlsV1s0wWDZY JRWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dOtABLpYucdkmo0UeAZ60MKjOPNkZbYs54q0kVYNjc4=; b=ox6lqT3O/fT4moBwL2DnU4lLErqkAbpAO+PSL1bptqMKlRBUcqSXBYlUKxU7nLNC1a ddYvLux7TrAsmy6Ikhjp2+tCPHHF+AQQCiuvBw7SLoqgJzuLmSzxI99ScYuR0jFAbJuk 9AlY93tcqi8/WGX3ZU05YbKEpj4gmtBBcA8YTvoqfLMry0vYDqPKqYwHQUdpogrhoyYW s2yy9WH1jO1zCo5tWBa+7vViw7UhuQpCEwJ/vey2f+HmdC287/NjlitCCLChF3NXuQJM DVDeD1OUzXErY0q4CXq4/7oFWD6emPiYZ2+dL/dZadp/MxCdMizF5Q8PnjyImsxygMcN f7nw== X-Gm-Message-State: AGi0PuZOswPyeF8gui4PkdGhfXUTlbdIFnwaUz0sB2OlWZIygIvVp181 IqFcCIlQRN2oIJ9SaWgaclVYgmq2rnk= X-Google-Smtp-Source: APiQypIV8V4JDCd+NtoSYkuzj8e2yB4xHjwhOrS9F9Bxn7DYiVKkt3jysGRG12LFj+3ejc82YWxp8A== X-Received: by 2002:adf:d841:: with SMTP id k1mr8240629wrl.129.1589029775565; Sat, 09 May 2020 06:09:35 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 07/11] target/s390x/helper: Clean ifdef'ry Date: Sat, 9 May 2020 15:09:06 +0200 Message-Id: <20200509130910.26335-8-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) All this code is guarded checking CONFIG_USER_ONLY definition. Drop the duplicated checks. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck Reviewed-by: David Hildenbrand --- Suspicious ifdef'ry in s390_handle_wait() from commit 83f7f32901c. --- target/s390x/helper.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 09f60406aa..26e3b366e8 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -33,6 +33,7 @@ #endif =20 #ifndef CONFIG_USER_ONLY + void s390x_tod_timer(void *opaque) { cpu_inject_clock_comparator((S390CPU *) opaque); @@ -42,9 +43,6 @@ void s390x_cpu_timer(void *opaque) { cpu_inject_cpu_timer((S390CPU *) opaque); } -#endif - -#ifndef CONFIG_USER_ONLY =20 hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr) { @@ -98,14 +96,12 @@ void s390_handle_wait(S390CPU *cpu) CPUState *cs =3D CPU(cpu); =20 if (s390_cpu_halt(cpu) =3D=3D 0) { -#ifndef CONFIG_USER_ONLY if (is_special_wait_psw(cpu->env.psw.addr)) { qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } else { cpu->env.crash_reason =3D S390_CRASH_REASON_DISABLED_WAIT; qemu_system_guest_panicked(cpu_get_crash_info(cs)); } -#endif } } =20 @@ -328,6 +324,7 @@ int s390_store_adtl_status(S390CPU *cpu, hwaddr addr, h= waddr len) cpu_physical_memory_unmap(sa, len, 1, len); return 0; } + #endif /* CONFIG_USER_ONLY */ =20 void s390_cpu_dump_state(CPUState *cs, FILE *f, int flags) --=20 2.21.3 From nobody Mon Feb 9 06:08:56 2026 Delivered-To: importer@patchew.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=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1589029999; cv=none; d=zohomail.com; s=zohoarc; b=cLhsYIQ4BZU/vbwvTPJziKK6vCPvy1Vog++WT9zkuHJfSepA3sq4bzWJT6UfuICYMCkyDPoiucEDnpb5QPt9BtIeV4d4wexTg4hRHmSaDLemlbay+JQcqZ9yVyg0q5qFncOJvxHV5pYHYDzA9LqnBc0FIWrsbcr5XfkMHBiJXcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589029999; 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=IIEEHUjsrjg149IdCnCJKS5PWD554RDC6FHVKmSpxnE=; b=kcUzqt4PgmYmCP7VsPkoMO1BTmqsUYC3ji4a2ghudN1gTTPvGRALL7TVB8uZmDtA72PEcmhWE0ff8zoK0tIJJb2Xppf5slAlbcs9i4AUWF/5xpdi3aYjrSKLf5NylklEpIM6ZrdhRz5zNOCHisVAlGhvUBHYucAcJ3ivKoaecpQ= 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 158902999918635.04375782067973; Sat, 9 May 2020 06:13:19 -0700 (PDT) Received: from localhost ([::1]:38284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPI5-00041O-Uo for importer@patchew.org; Sat, 09 May 2020 09:13:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEc-0004aQ-9s; Sat, 09 May 2020 09:09:42 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:52926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEb-0005Q0-HU; Sat, 09 May 2020 09:09:41 -0400 Received: by mail-wm1-x341.google.com with SMTP id m24so3357702wml.2; Sat, 09 May 2020 06:09:39 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IIEEHUjsrjg149IdCnCJKS5PWD554RDC6FHVKmSpxnE=; b=Nl0CXBPpXNxQ0v8jKUxF1Se16t8u56AbbYFOXIfPtb3ZUkfj0ZUg/dU3Thk8Lr1Q7t kabpZj03s+ZUNpvujY4Zy+nYe12FYxm2JYH0Sat58Kz7SFKvyQ3iMSG3y1MYqATHFUve XyfFNfP52J7d35j7A/kxh/ByzGKFK/Wgnz3+tTUgFcDTmF7jMtKEdpgxQ5PP4ZMZjUd+ EH1224KiMOCijg6RGClqqyea+dKpk/2QfqW51WcpNx9UN98xYL+BD6Ueqm040CnlBCEx dKrqgMaikR6NN+CpCvHMTBA3/73OgPdGOl6ZD8FHNRWIL1RhGB+33Jxa+5cdqfwouDCs SHQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IIEEHUjsrjg149IdCnCJKS5PWD554RDC6FHVKmSpxnE=; b=H6cMrgyIKSxWy1xD7Wz0qKFu3NyPRonjAiTJ0O4HKfWwD4ofhhzIeChYouFjSpFXnI 07hm98z4p+YsEu8g++pBlSOLgT8iLuHb0fh2pXmDJokf8XgW1A6rG/qNjunvoloq435e tOzAH4OhCxxks+K/YM5YbFtIuMlTxTfC9uX5KyM6j4wX9PndNOYWozXhkxRZ/88IzlQc exP92mp6vz89XNfshuJduvN+sEMLejDdzafVyv/iSa0EvQ/kpGZe2Z3mO2KKoL2nj2HU bD9nS2QeC5m/XBa8cnORvPY1FbyK7gxIYv83vCyyr5jtRs+TOtGYUYhgOcneNS/6yF2k pcXw== X-Gm-Message-State: AGi0PuYOIiBwJlGjWSZBCfomI7eS8VGeO85WtFoV3XJiDAfbKKLNmp9d fDiq5oiVLaqqffcB1JApYkAykf2WlQk= X-Google-Smtp-Source: APiQypIQv5dktkJhLCJa+f5nseiL+K4OPMQciaBIjnNe4IrHVAf2DQjQGyL8101k14juuCgRuJvDfA== X-Received: by 2002:a1c:2e4d:: with SMTP id u74mr22275473wmu.145.1589029778450; Sat, 09 May 2020 06:09:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 08/11] target/s390x: Restrict system-mode declarations Date: Sat, 9 May 2020 15:09:07 +0200 Message-Id: <20200509130910.26335-9-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) As these declarations are restricted to !CONFIG_USER_ONLY in helper.c, only declare them when system-mode emulation is used. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/s390x/internal.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/target/s390x/internal.h b/target/s390x/internal.h index c1678dc6bc..ddc276cdf4 100644 --- a/target/s390x/internal.h +++ b/target/s390x/internal.h @@ -236,7 +236,6 @@ int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, = CPUState *cs, =20 /* cc_helper.c */ const char *cc_name(enum cc_op cc_op); -void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr); uint32_t calc_cc(CPUS390XState *env, uint32_t cc_op, uint64_t src, uint64_= t dst, uint64_t vr); =20 @@ -303,18 +302,20 @@ void s390_cpu_gdb_init(CPUState *cs); =20 /* helper.c */ void s390_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr s390_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); -hwaddr s390_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); +void do_restart_interrupt(CPUS390XState *env); + +#ifndef CONFIG_USER_ONLY +void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr); uint64_t get_psw_mask(CPUS390XState *env); void s390_cpu_recompute_watchpoints(CPUState *cs); void s390x_tod_timer(void *opaque); void s390x_cpu_timer(void *opaque); -void do_restart_interrupt(CPUS390XState *env); void s390_handle_wait(S390CPU *cpu); +hwaddr s390_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +hwaddr s390_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr); #define S390_STORE_STATUS_DEF_ADDR offsetof(LowCore, floating_pt_save_area) int s390_store_status(S390CPU *cpu, hwaddr addr, bool store_arch); int s390_store_adtl_status(S390CPU *cpu, hwaddr addr, hwaddr len); -#ifndef CONFIG_USER_ONLY LowCore *cpu_map_lowcore(CPUS390XState *env); void cpu_unmap_lowcore(LowCore *lowcore); #endif /* CONFIG_USER_ONLY */ --=20 2.21.3 From nobody Mon Feb 9 06:08:56 2026 Delivered-To: importer@patchew.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=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1589030170; cv=none; d=zohomail.com; s=zohoarc; b=Fhdsq60bq7sYS0mMal1eYjWAF6SzW8mVvPlEQtGycBSxot/ZAp+OpY+3hIMgIQ3zOZCjO/EGBTZKcnCMGjxWmHhdeLPAVo8FXtteCbe6ssd66xWoozwYXjQvceXUHX8umpstJ6S+kq9z96waermH6jzAeTIX8D7DB1t1WPmj02E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589030170; 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=KCkyANn4FcnR5rJJUijQsegjOxElV+OnO2NwpohvbPI=; b=OEdyT418QKJQxssTc/0x5AXFpWToRadCdvJfkawlgd1+ZKKz/SOG3bEFENjAn80T/7NimxyqABrcTcoMFrJIKexdfo+a6ZzqtTaDIMbMipLiafWnb98FBMAY5fceN15HpRivRCTQEovPqsRz6fZewypVuDbEHYfGGtM49TVvwR0= 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 1589030170006674.7681115833025; Sat, 9 May 2020 06:16:10 -0700 (PDT) Received: from localhost ([::1]:49048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPKq-0000xl-HM for importer@patchew.org; Sat, 09 May 2020 09:16:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEg-0004of-Ll; Sat, 09 May 2020 09:09:46 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:41148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEe-0005wd-OU; Sat, 09 May 2020 09:09:46 -0400 Received: by mail-wr1-x444.google.com with SMTP id g13so5122573wrb.8; Sat, 09 May 2020 06:09:42 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KCkyANn4FcnR5rJJUijQsegjOxElV+OnO2NwpohvbPI=; b=jDO/4+L2um5973o9LQ8Qntt5S4jpI0mKVBqOSsR7qXSd31oCrA+GubxLPSBjbUzagt brWe5+I2jWCoTMNYziZLAzTr67zfdJw1N4+ldwUBMcV5A9TGOROXaNpeZaOin+wWTS82 4ygZbZRY8BLXpBHl58G9nUmjP5z/pXU739KrGWirFUUIXjnHvMinNPwhW4zFpqthMIj3 P/pPsAzXLN1fecuVYB0ndnfvz2gh3M29QXtOy0JN9d8MyDaOum1Tp43u9m/ze+8pxlBY vzh16q4jHKyaJnUZJ1Gd7vux4WW+ZcQvulz7CCLnTrvcZASrX3Zn1tGhtMbfiqOocppP TQIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KCkyANn4FcnR5rJJUijQsegjOxElV+OnO2NwpohvbPI=; b=jzTAGQKxFgkWGZQjS8wiSwqvYIEinR/4TiTg5HjbkPFzaatqO1Ie6l0hi65S39GEuQ i3pguF3zkmgAIe78XyaiVbutjJaEQb1M9rV0emxdF0znUiyvufUXwAEfunqhVvuqo6V3 nS13bH+xlE7YpTig4n/kj+EjOI4KCcimyI77At/jsFDSZmp+0Az2rItyQPAxgyQTGEAR 1iiFI6kQSXB98Zj2PVuqRHBvbzIe0SO2Fcs8dJvVHpzD2eZx7wjkU1x0sdaRIcun+Gnh M8wcrlQvgF0nXR+uBsYi6zqCs9QN/8WYbfJrmtIqlk0kGB+vT2TMzx3L7OkQVIn/RJUg A7Wg== X-Gm-Message-State: AGi0PubO6GCgE7TQbwfMjY6Iu+DWHV2vftw5XtJZ94GmiKKQzLwaBa3i +z2lPJz6CYD0nfRsVI7pgoKehM4RWfg= X-Google-Smtp-Source: APiQypKTCzVWz4OtBkfMURyuhxOjXVPsQ8QTteSNFY+TQN3SepDpNDqC9FUtqNgzwnqJEPuvgZkE4Q== X-Received: by 2002:a5d:6082:: with SMTP id w2mr8284190wrt.163.1589029781390; Sat, 09 May 2020 06:09:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 09/11] target/cpu: Restrict handlers using hwaddr type to system-mode Date: Sat, 9 May 2020 15:09:08 +0200 Message-Id: <20200509130910.26335-10-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Restrict the following handlers to system-mode: - do_unaligned_access - do_transaction_failed - get_phys_page_debug - get_phys_page_attrs_debug Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson --- include/hw/core/cpu.h | 8 +++++--- target/alpha/cpu.h | 4 +++- target/arm/cpu.h | 6 +++--- target/arm/internals.h | 4 ++++ target/cris/cpu.h | 2 ++ target/hppa/cpu.h | 2 +- target/i386/cpu.h | 2 ++ target/m68k/cpu.h | 7 ++++++- target/microblaze/cpu.h | 5 ++++- target/mips/internal.h | 2 +- target/nios2/cpu.h | 5 ++++- target/openrisc/cpu.h | 3 ++- target/ppc/cpu.h | 2 +- target/riscv/cpu.h | 20 ++++++++++---------- target/sh4/cpu.h | 2 +- target/sparc/cpu.h | 2 ++ target/xtensa/cpu.h | 12 +++++++----- target/hppa/cpu.c | 4 +++- target/ppc/translate_init.inc.c | 2 +- 19 files changed, 62 insertions(+), 32 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5bf94d28cf..ed09d056d1 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -167,6 +167,7 @@ typedef struct CPUClass { int reset_dump_flags; bool (*has_work)(CPUState *cpu); void (*do_interrupt)(CPUState *cpu); +#ifndef CONFIG_USER_ONLY void (*do_unaligned_access)(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); @@ -174,6 +175,10 @@ typedef struct CPUClass { unsigned size, MMUAccessType access_type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retaddr); + hwaddr (*get_phys_page_debug)(CPUState *cpu, vaddr addr); + hwaddr (*get_phys_page_attrs_debug)(CPUState *cpu, vaddr addr, + MemTxAttrs *attrs); +#endif /* CONFIG_USER_ONLY */ bool (*virtio_is_big_endian)(CPUState *cpu); int (*memory_rw_debug)(CPUState *cpu, vaddr addr, uint8_t *buf, int len, bool is_write); @@ -189,9 +194,6 @@ typedef struct CPUClass { bool (*tlb_fill)(CPUState *cpu, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); - hwaddr (*get_phys_page_debug)(CPUState *cpu, vaddr addr); - hwaddr (*get_phys_page_attrs_debug)(CPUState *cpu, vaddr addr, - MemTxAttrs *attrs); int (*asidx_from_attrs)(CPUState *cpu, MemTxAttrs attrs); int (*gdb_read_register)(CPUState *cpu, GByteArray *buf, int reg); int (*gdb_write_register)(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h index be29bdd530..b12021803e 100644 --- a/target/alpha/cpu.h +++ b/target/alpha/cpu.h @@ -279,12 +279,14 @@ extern const VMStateDescription vmstate_alpha_cpu; void alpha_cpu_do_interrupt(CPUState *cpu); bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req); void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags); -hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int alpha_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int alpha_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); +#ifndef CONFIG_USER_ONLY +hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void alpha_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); +#endif =20 #define cpu_list alpha_cpu_list #define cpu_signal_handler cpu_alpha_signal_handler diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 8608da6b6f..d333036bb4 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -966,15 +966,15 @@ uint64_t arm_cpu_mp_affinity(int idx, uint8_t cluster= sz); =20 #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_arm_cpu; + +hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, + MemTxAttrs *attrs); #endif =20 void arm_cpu_do_interrupt(CPUState *cpu); void arm_v7m_cpu_do_interrupt(CPUState *cpu); bool arm_cpu_exec_interrupt(CPUState *cpu, int int_req); =20 -hwaddr arm_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, - MemTxAttrs *attrs); - int arm_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int arm_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); =20 diff --git a/target/arm/internals.h b/target/arm/internals.h index e633aff36e..c0a2a5df71 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -812,6 +812,8 @@ ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env= , bool secstate); * tables */ bool arm_s1_regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx); =20 +#ifndef CONFIG_USER_ONLY + /* Raise a data fault alignment exception for the specified virtual addres= s */ void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, MMUAccessType access_type, @@ -827,6 +829,8 @@ void arm_cpu_do_transaction_failed(CPUState *cs, hwaddr= physaddr, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retaddr= ); =20 +#endif /* !CONFIG_USER_ONLY */ + /* Call any registered EL change hooks */ static inline void arm_call_pre_el_change_hook(ARMCPU *cpu) { diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 8f08d7628b..e9c858ada7 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -193,7 +193,9 @@ bool cris_cpu_exec_interrupt(CPUState *cpu, int int_req= ); =20 void cris_cpu_dump_state(CPUState *cs, FILE *f, int flags); =20 +#ifndef CONFIG_USER_ONLY hwaddr cris_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +#endif =20 int crisv10_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int cris_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 801a4fb1ba..7848425f6a 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -320,7 +320,6 @@ void cpu_hppa_change_prot_id(CPUHPPAState *env); #define cpu_signal_handler cpu_hppa_signal_handler =20 int cpu_hppa_signal_handler(int host_signum, void *pinfo, void *puc); -hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr); int hppa_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int hppa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void hppa_cpu_do_interrupt(CPUState *cpu); @@ -330,6 +329,7 @@ bool hppa_cpu_tlb_fill(CPUState *cs, vaddr address, int= size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); #ifndef CONFIG_USER_ONLY +hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr); int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, int type, hwaddr *pphys, int *pprot); extern const MemoryRegionOps hppa_io_eir_ops; diff --git a/target/i386/cpu.h b/target/i386/cpu.h index e818fc712a..00e0cc0828 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1767,8 +1767,10 @@ void x86_cpu_get_memory_mapping(CPUState *cpu, Memor= yMappingList *list, =20 void x86_cpu_dump_state(CPUState *cs, FILE *f, int flags); =20 +#ifndef CONFIG_USER_ONLY hwaddr x86_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); +#endif =20 int x86_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 521ac67cdd..efc940e7ec 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -167,10 +167,13 @@ struct M68kCPU { void m68k_cpu_do_interrupt(CPUState *cpu); bool m68k_cpu_exec_interrupt(CPUState *cpu, int int_req); void m68k_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int m68k_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); =20 +#ifndef CONFIG_USER_ONLY +hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +#endif + void m68k_tcg_init(void); void m68k_cpu_init_gdb(M68kCPU *cpu); /* @@ -529,10 +532,12 @@ static inline int cpu_mmu_index (CPUM68KState *env, b= ool ifetch) bool m68k_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); +#ifndef CONFIG_USER_ONLY void m68k_cpu_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, MMUAccessType access_type, int mmu_idx, MemTxAttrs attrs, MemTxResult response, uintptr_t retaddr); +#endif =20 typedef CPUM68KState CPUArchState; typedef M68kCPU ArchCPU; diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index a31134b65c..eb57f04d3f 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -318,10 +318,13 @@ struct MicroBlazeCPU { void mb_cpu_do_interrupt(CPUState *cs); bool mb_cpu_exec_interrupt(CPUState *cs, int int_req); void mb_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr mb_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int mb_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int mb_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); =20 +#ifndef CONFIG_USER_ONLY +hwaddr mb_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +#endif + void mb_tcg_init(void); /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero diff --git a/target/mips/internal.h b/target/mips/internal.h index 1bf274b3ef..c38666c6f5 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -81,7 +81,6 @@ enum CPUMIPSMSADataFormat { void mips_cpu_do_interrupt(CPUState *cpu); bool mips_cpu_exec_interrupt(CPUState *cpu, int int_req); void mips_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr mips_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int mips_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int mips_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, @@ -150,6 +149,7 @@ void mips_cpu_do_transaction_failed(CPUState *cs, hwadd= r physaddr, MemTxResult response, uintptr_t retadd= r); hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address, int rw); +hwaddr mips_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); #endif =20 #define cpu_signal_handler cpu_mips_signal_handler diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 4dddf9c3a1..0703295133 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -199,11 +199,14 @@ void nios2_cpu_do_interrupt(CPUState *cs); int cpu_nios2_signal_handler(int host_signum, void *pinfo, void *puc); void dump_mmu(CPUNios2State *env); void nios2_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr nios2_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void nios2_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); =20 +#ifndef CONFIG_USER_ONLY +hwaddr nios2_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +#endif + qemu_irq *nios2_cpu_pic_init(Nios2CPU *cpu); void nios2_check_interrupts(CPUNios2State *env); =20 diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index f37a52e153..60de8ed787 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -319,7 +319,6 @@ void cpu_openrisc_list(void); void openrisc_cpu_do_interrupt(CPUState *cpu); bool openrisc_cpu_exec_interrupt(CPUState *cpu, int int_req); void openrisc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int openrisc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg= ); int openrisc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void openrisc_translate_init(void); @@ -335,6 +334,8 @@ int print_insn_or1k(bfd_vma addr, disassemble_info *inf= o); #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_openrisc_cpu; =20 +hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); + /* hw/openrisc_pic.c */ void cpu_openrisc_pic_init(OpenRISCCPU *cpu); =20 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 73920a9cac..f7b27aefed 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1209,12 +1209,12 @@ void ppc_cpu_do_interrupt(CPUState *cpu); bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req); void ppc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); void ppc_cpu_dump_statistics(CPUState *cpu, int flags); -hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int ppc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int ppc_cpu_gdb_read_register_apple(CPUState *cpu, GByteArray *buf, int re= g); int ppc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); int ppc_cpu_gdb_write_register_apple(CPUState *cpu, uint8_t *buf, int reg); #ifndef CONFIG_USER_ONLY +hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void ppc_gdb_gen_spr_xml(PowerPCCPU *cpu); const char *ppc_gdb_get_dynamic_xml(CPUState *cs, const char *xml_name); #endif diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index d0e7f5b9c5..69edee6484 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -303,18 +303,9 @@ void riscv_cpu_set_virt_enabled(CPURISCVState *env, bo= ol enable); bool riscv_cpu_force_hs_excep_enabled(CPURISCVState *env); void riscv_cpu_set_force_hs_excep(CPURISCVState *env, bool enable); int riscv_cpu_mmu_index(CPURISCVState *env, bool ifetch); -hwaddr riscv_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); -void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr, - MMUAccessType access_type, int mmu_idx, - uintptr_t retaddr); bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); -void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, - vaddr addr, unsigned size, - MMUAccessType access_type, - int mmu_idx, MemTxAttrs attrs, - MemTxResult response, uintptr_t retad= dr); char *riscv_isa_string(RISCVCPU *cpu); void riscv_cpu_list(void); =20 @@ -323,12 +314,21 @@ void riscv_cpu_list(void); #define cpu_mmu_index riscv_cpu_mmu_index =20 #ifndef CONFIG_USER_ONLY +hwaddr riscv_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +void riscv_cpu_do_unaligned_access(CPUState *cs, vaddr addr, + MMUAccessType access_type, int mmu_idx, + uintptr_t retaddr); +void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, + vaddr addr, unsigned size, + MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retad= dr); void riscv_cpu_swap_hypervisor_regs(CPURISCVState *env); int riscv_cpu_claim_interrupts(RISCVCPU *cpu, uint32_t interrupts); uint32_t riscv_cpu_update_mip(RISCVCPU *cpu, uint32_t mask, uint32_t value= ); #define BOOL_TO_MASK(x) (-!!(x)) /* helper for riscv_cpu_update_mip value = */ void riscv_cpu_set_rdtime_fn(CPURISCVState *env, uint64_t (*fn)(void)); -#endif +#endif /* !CONFIG_USER_ONLY */ void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv); =20 void riscv_translate_init(void); diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index dbe58c7888..40d92413b8 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -207,7 +207,6 @@ struct SuperHCPU { void superh_cpu_do_interrupt(CPUState *cpu); bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req); void superh_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int superh_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int superh_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void superh_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, @@ -223,6 +222,7 @@ bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, =20 void sh4_cpu_list(void); #if !defined(CONFIG_USER_ONLY) +hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void cpu_sh4_invalidate_tlb(CPUSH4State *s); uint32_t cpu_sh4_read_mmaped_itlb_addr(CPUSH4State *s, hwaddr addr); diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index b9369398f2..31887a811a 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -570,7 +570,9 @@ extern const VMStateDescription vmstate_sparc_cpu; =20 void sparc_cpu_do_interrupt(CPUState *cpu); void sparc_cpu_dump_state(CPUState *cpu, FILE *f, int flags); +#ifndef CONFIG_USER_ONLY hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +#endif int sparc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int sparc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void QEMU_NORETURN sparc_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 7a46dccbe1..47fe57df87 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -564,19 +564,21 @@ bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address,= int size, bool probe, uintptr_t retaddr); void xtensa_cpu_do_interrupt(CPUState *cpu); bool xtensa_cpu_exec_interrupt(CPUState *cpu, int interrupt_request); -void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr= addr, - unsigned size, MMUAccessType access_= type, - int mmu_idx, MemTxAttrs attrs, - MemTxResult response, uintptr_t reta= ddr); void xtensa_cpu_dump_state(CPUState *cpu, FILE *f, int flags); -hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); void xtensa_count_regs(const XtensaConfig *config, unsigned *n_regs, unsigned *n_core_regs); int xtensa_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int xtensa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); +#ifndef CONFIG_USER_ONLY +hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); +void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr= addr, + unsigned size, MMUAccessType access_= type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t reta= ddr); void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); +#endif /* !CONFIG_USER_ONLY */ =20 #define cpu_signal_handler cpu_xtensa_signal_handler #define cpu_list xtensa_cpu_list diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 71b6aca45d..6d33288d2a 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -70,6 +70,7 @@ static void hppa_cpu_disas_set_info(CPUState *cs, disasse= mble_info *info) info->print_insn =3D print_insn_hppa; } =20 +#ifndef CONFIG_USER_ONLY static void hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) @@ -86,6 +87,7 @@ static void hppa_cpu_do_unaligned_access(CPUState *cs, va= ddr addr, =20 cpu_loop_exit_restore(cs, retaddr); } +#endif /* !CONFIG_USER_ONLY */ =20 static void hppa_cpu_realizefn(DeviceState *dev, Error **errp) { @@ -150,8 +152,8 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *= data) #ifndef CONFIG_USER_ONLY cc->get_phys_page_debug =3D hppa_cpu_get_phys_page_debug; dc->vmsd =3D &vmstate_hppa_cpu; -#endif cc->do_unaligned_access =3D hppa_cpu_do_unaligned_access; +#endif cc->disas_set_info =3D hppa_cpu_disas_set_info; cc->tcg_initialize =3D hppa_translate_init; =20 diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.in= c.c index 4ea0cc501b..8c428e2009 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -10892,8 +10892,8 @@ static void ppc_cpu_class_init(ObjectClass *oc, voi= d *data) cc->set_pc =3D ppc_cpu_set_pc; cc->gdb_read_register =3D ppc_cpu_gdb_read_register; cc->gdb_write_register =3D ppc_cpu_gdb_write_register; - cc->do_unaligned_access =3D ppc_cpu_do_unaligned_access; #ifndef CONFIG_USER_ONLY + cc->do_unaligned_access =3D ppc_cpu_do_unaligned_access; cc->get_phys_page_debug =3D ppc_cpu_get_phys_page_debug; cc->vmsd =3D &vmstate_ppc_cpu; #endif --=20 2.21.3 From nobody Mon Feb 9 06:08:56 2026 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1589030151; cv=none; d=zohomail.com; s=zohoarc; b=Lzs3FOqZv/xrLDLvoMatTVIee4IHm9xeyZG8f4rT9Zx8PtbnCRlA+5Olx6YroxNMIq5sw8YnTSNQqYbp70Hy2g1mO/CrT1kpbOpq1KdDUU2MfKpcY63j9Y1bcJO7k3vJKMTzOUTdYNs46crOba/pFh3Mk4GC9ENUfNc4x1Ciwnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589030151; 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=kJ9dbndR3EJ3N94DuL32xKff0HO4BFM4yLLW9t9p4DU=; b=cSx+qlyRpSmjga4wKFT/OEoWwFseOPC28DAl74Qv3UXmdmZ0HXhXqtesspT+L9bRsOe6xBVHVcUGc9Nv9NiZsAZ96aUncyWFEql9PBY0C0OZvaB4Yy2hOWX/n2TfKZsZRztBP5we1GFSwOjumqz26t0GQoufDREFGUAwcxLiOXI= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589030151622454.7159812965083; Sat, 9 May 2020 06:15:51 -0700 (PDT) Received: from localhost ([::1]:48012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPKY-0000WH-6b for importer@patchew.org; Sat, 09 May 2020 09:15:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEh-0004sO-U5; Sat, 09 May 2020 09:09:47 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:45340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEh-0006b1-2e; Sat, 09 May 2020 09:09:47 -0400 Received: by mail-wr1-x444.google.com with SMTP id v12so5107262wrp.12; Sat, 09 May 2020 06:09:45 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kJ9dbndR3EJ3N94DuL32xKff0HO4BFM4yLLW9t9p4DU=; b=flf4veSgSNp7WVQXiv7V7NrX4UAefRYgFkBmINorTlpVmyHhE7veSTufxoQW+l6Dot wR4o/pIkezvKsQqfk7pi/vw7fH8RkeyXgbJuREtSTbXGDFEouDylssuXi6SMi8W1jC5F 5aED8Ld4faiQC7wAF1M2ntUooqoguTRu/E29eqc9poBI//e0zx/vU6BrIVDw5CAtIRJQ U1HvgPNfo1scPphSCiVyayMiZg9brfMjvP3CZScx0xnjDbgj7SjIjb3Aon3WxpxEpyNk 8Tgzh6WxdSkr+gT7kxZVlRfnD7P4SSu4HY+r7qtPXUW500nMnbMXQG11g89ahQXrW1ih IqKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kJ9dbndR3EJ3N94DuL32xKff0HO4BFM4yLLW9t9p4DU=; b=hYA51jR8pZ/PL8K7HablazVaKXoEBGkUuhOQXN1e1ALamv/GaU6LkD23pQu7j2msnH hNwDNEssAnvv2+OVxEtRcP1eeiQ7zknfcD6yGy5IQxeJYdMKDD6eYwJhMGlK/ux4LWuO hqRVDk3m5f1ZN31132vVuvk/KMt1TBbgxx2X97YWeD/TPiGzJgrPG6q1La7HxXCz6rjI dUGbMfk8V7NXfrlLxYMrOT52snpZXS1PJGf00KNaP0VAj+XR/BobCXkVy+5QD/4X8iW8 nO8AU7nmuMC2Oct6Ih2703Vwb07pho3zYwIvwRndTcJ+BQ0dtRw/d6f9vy2vYpjVvANs URNg== X-Gm-Message-State: AGi0PuY2GKowuEDM8U3qY1HqeuqAQKpbKvSzeg3ZMGtmLo0yO+SN0XSs fUrcHa0XScTrvg632DgQeH4rE146QGg= X-Google-Smtp-Source: APiQypLurdSmGrp9B56qX9CNWGd9AI2ip7cdRiw9zhMpmGh5F+d4uyBrY7d4KNVvcCiBokEwwDx36g== X-Received: by 2002:a05:6000:11cd:: with SMTP id i13mr8894961wrx.95.1589029784233; Sat, 09 May 2020 06:09:44 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 10/11] exec: Use 'cpu-common.h' instead of system-mode specific 'hwaddr.h' Date: Sat, 9 May 2020 15:09:09 +0200 Message-Id: <20200509130910.26335-11-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The "exec/hwaddr.h" header is restricted to system-mode emulation. Instead, use "exec/cpu-common.h", which is meant for all modes. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/disas/disas.h | 2 +- include/hw/core/cpu.h | 2 +- include/sysemu/accel.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/disas/disas.h b/include/disas/disas.h index 36c33f6f19..531b42e002 100644 --- a/include/disas/disas.h +++ b/include/disas/disas.h @@ -1,7 +1,7 @@ #ifndef QEMU_DISAS_H #define QEMU_DISAS_H =20 -#include "exec/hwaddr.h" +#include "exec/cpu-common.h" =20 #ifdef NEED_CPU_H #include "cpu.h" diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index ed09d056d1..a215ae451d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -22,7 +22,7 @@ =20 #include "hw/qdev-core.h" #include "disas/dis-asm.h" -#include "exec/hwaddr.h" +#include "exec/cpu-common.h" #include "exec/memattrs.h" #include "qapi/qapi-types-run-state.h" #include "qemu/bitmap.h" diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h index e08b8ab8fa..e223a1d87b 100644 --- a/include/sysemu/accel.h +++ b/include/sysemu/accel.h @@ -24,7 +24,7 @@ #define HW_ACCEL_H =20 #include "qom/object.h" -#include "exec/hwaddr.h" +#include "exec/cpu-common.h" =20 typedef struct AccelState { /*< private >*/ --=20 2.21.3 From nobody Mon Feb 9 06:08:56 2026 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1589030256; cv=none; d=zohomail.com; s=zohoarc; b=BhfadKxBskrVo/q2i5aRj4XlX+C7vdP1GOefkt0Cl00Q0a4bvcB+ZfDhfan6rgKjC5Hk/AKYiB3btaQ1VssHuhE8Xdae7Suamzrjq6mbwFziVs4O0OU9qSrhsZTWG9QxrGCgQv5+WCGknw3Gvq8V38hqw/g2pXwzem8mkAvjWC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589030256; 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=FhXzEDZMFN7nI/HcObjzYIjU52XHskJ+5ArXsA4s8n0=; b=Wlyqb41pxNW/m7Khsz82Hk06UnbUnemESiIgG1CPLS4eJ3LK0CDOGCndIy+++PYjnbsLeJ0pYgGGqeicFb9H1KvBGuTKOohaFyD7myRQRt4VGvHzsQi+D/jNaIK1on0kPOzakkAjN7YxKdg/s5u5M2Ga1ls8ku9JlD1C6VnlRGA= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15890302567341019.6166003016327; Sat, 9 May 2020 06:17:36 -0700 (PDT) Received: from localhost ([::1]:53346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXPMF-0002hC-6j for importer@patchew.org; Sat, 09 May 2020 09:17:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXPEk-00052e-SO; Sat, 09 May 2020 09:09:50 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:33571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXPEk-0007KQ-2k; Sat, 09 May 2020 09:09:50 -0400 Received: by mail-wm1-x344.google.com with SMTP id d207so184525wmd.0; Sat, 09 May 2020 06:09:48 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id m65sm1411410wmm.17.2020.05.09.06.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 06:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FhXzEDZMFN7nI/HcObjzYIjU52XHskJ+5ArXsA4s8n0=; b=tMA+dOHPorUcef3Ii8plnVwx5/I0le3h8ZG+eca+U8AHmyZPa1SS3f3WuI15TwaqMj dp9D1WaZwrnsb5FDXqtTKtmj9ql7Ri9+E8lUya6BaANZi94a9jnQGJI6G4UF9TPdagy3 OgmgfqIWppS9Pv6g6oO0G49S6T5H9O2kFz53VTuxNlRRSqGgB2PYtlmYAhUAAIgl/CYG HU4xvfI3vTtrbHl3Tih+sk24b+RCb6pHPSaM+TNWHXOX0xGVdE/7Gx1IYmx3SoM0UFHV VJQOMdVbuLbFyNLdR4Iii9ly1xsgPL8IN+1T7566Y3evQ9HqdPdME6aN9M/UwH5+GcKH jFEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=FhXzEDZMFN7nI/HcObjzYIjU52XHskJ+5ArXsA4s8n0=; b=O8iCxlCsqFws6bOvjOGDWHIrBjkPezLF/ik5kl+ewBKajosPnOhoZl2VZio1cK3YHL SYdR+xH5DEbXRjRlw+M714JqNuq1U9oNnfb9DGeKJiFPPy0A1yJxN8W7s9LTbE47NlPm zVmnNrLvifzh56Ao08sCsHo1pb61caUbaGWJjBCAT3jphIks3lMWZqRDlQQr9bKkYJBB 9ns5v0OEQQ+fDAp9CMG6a4eOfNWxkWG+RhfzxPu25tNQN8sNz4lr31fvgRdlJl3mixhT RncLJM+N45goXFyL6WS+X5fDqHPRPOtTDn2fcbyX5+iOpO5glCi+2Gkhg7G5QHn6EG0v Fvwg== X-Gm-Message-State: AGi0PubTgWopvLKhMmaA023Mfz/tcC7EXemDXMOS85J48Ssm24UGA7l7 i4xnqGNXOtk7vVJLTLb05OVQoYL3n0Y= X-Google-Smtp-Source: APiQypIPiOQOoy1QDhlipK4I1Af7DTsG6G0dwlgqBHdFcvssaN5XNM/0LHVECJmyi5GMwxGZeM77rg== X-Received: by 2002:a7b:c118:: with SMTP id w24mr20571336wmi.173.1589029787021; Sat, 09 May 2020 06:09:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 11/11] exec/cpu-common: Poison hwaddr type in user-mode emulation Date: Sat, 9 May 2020 15:09:10 +0200 Message-Id: <20200509130910.26335-12-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200509130910.26335-1-f4bug@amsat.org> References: <20200509130910.26335-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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 , Chris Wulff , Sagar Karandikar , David Hildenbrand , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , "Edgar E. Iglesias" , Marek Vasut , Aleksandar Markovic , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Gibson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Roman Bolshakov , Laurent Vivier , Palmer Dabbelt , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The 'hwaddr' type is restricted to system-mode. Declare it poisoned on user-mode emulation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Checkpatch complains: WARNING: architecture specific defines should be avoided #10: FILE: include/exec/cpu-common.h:7: +#ifdef __GNUC__ --- include/exec/cpu-common.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index b47e5630e7..56cfce8153 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -3,9 +3,13 @@ =20 /* CPU interfaces that are target independent. */ =20 -#ifndef CONFIG_USER_ONLY +#ifdef CONFIG_USER_ONLY +#ifdef __GNUC__ +#pragma GCC poison hwaddr +#endif /* __GNUC__ */ +#else #include "exec/hwaddr.h" -#endif +#endif /* CONFIG_USER_ONLY */ =20 /* The CPU list lock nests outside page_(un)lock or mmap_(un)lock */ void qemu_init_cpu_list(void); --=20 2.21.3