From patchwork Tue Jun 27 11:51:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13294387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2684AEB64D9 for ; Tue, 27 Jun 2023 11:51:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231467AbjF0Lvm (ORCPT ); Tue, 27 Jun 2023 07:51:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbjF0Lvg (ORCPT ); Tue, 27 Jun 2023 07:51:36 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56538120 for ; Tue, 27 Jun 2023 04:51:35 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2b698371937so44265701fa.3 for ; Tue, 27 Jun 2023 04:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687866693; x=1690458693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vqGKfDWguJ/wQ1MgcOKBra/Rp1I0sbXrog+W6VzRYIk=; b=ewP/4+l1QLLin+KK4AdIpG6bDe13BPYlhXal/v/3ycYZcBW61sbUWbK85IvzFqoKWq taSeDcJpBYtghpfLdfEoAXcv+EI3epbC/jcMtzm19+bZ5TGMitS4MrDYVCY4T+SQvvwg krtsS2xOqMCc5FagWxKD2GAFDfSG5WSMWZtZkhtkWbNKSSh0qNt1XHRFiskR3ixRupXW 5D6SGbX/c+qD+5Ied4g3hsI0hqfWWsq4XyMgPeJQQW8nLSwbUS5PpZ799Gvymqq25yQR G2/Jeqkuk4ZJ0l3k+RcQCJjYqxjZp7QZZ2jnu3EKwZlfPMjivKmZrvBy2uemvS9Tz+L0 aM1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687866693; x=1690458693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vqGKfDWguJ/wQ1MgcOKBra/Rp1I0sbXrog+W6VzRYIk=; b=NkQnmyY0U2qL1JIrN/bJOPoNa8B+ebEDcISsbeDxkuGQes5+dkgXLafvAWazHJ42X/ NKoQ4rrNny/axnlwxXXWbze8pfqCAcBSWrXbla+5X4z4Z3n2fTVQ+ox6QVs+to5e6+RS vatLyXi9CAzDRZlApT3tztHjVVAPbcJU1S4g+nqT8GB0zm8Z5a4jKr9eFurPHT5bWoYI P2PK9/cqe5zScxoqFcP83vSnofuKPkc/V0d09R4QA64D3j6/ZUV56qG4qmrGGoMV8WTe HHGc3R7sCE9nGpY4ItfPdYjwUZ2E7bWyBbrQeTXn9A0uXMvfoyTyG6WJEyryRVpyVZP2 wYAg== X-Gm-Message-State: AC+VfDwmu8u4L+OgFdF1g+iFrsGQrMYkRqSX/buVDk/btCOoLGR1hEye 3dcJh+IxXV2FYMjrL3p9RJdA0Q== X-Google-Smtp-Source: ACHHUZ4G6BPvWH8r1ThUzkk54gczIHvhE6zDhvt40IrOFYOLgRAQlYtaiLny9tyUaBy38s2P0CdE+g== X-Received: by 2002:a2e:2408:0:b0:2b5:89db:187 with SMTP id k8-20020a2e2408000000b002b589db0187mr12374664ljk.42.1687866693587; Tue, 27 Jun 2023 04:51:33 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.204]) by smtp.gmail.com with ESMTPSA id v20-20020aa7dbd4000000b00514a5f7a145sm3701188edt.37.2023.06.27.04.51.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 04:51:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , qemu-ppc@nongnu.org, Paolo Bonzini , Greg Kurz , kvm@vger.kernel.org, Nicholas Piggin , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 1/6] target/ppc: Have 'kvm_ppc.h' include 'sysemu/kvm.h' Date: Tue, 27 Jun 2023 13:51:19 +0200 Message-Id: <20230627115124.19632-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230627115124.19632-1-philmd@linaro.org> References: <20230627115124.19632-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org "kvm_ppc.h" declares: int kvm_handle_nmi(PowerPCCPU *cpu, struct kvm_run *run); 'struct kvm_run' is declared in "sysemu/kvm.h", include it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater --- target/ppc/kvm_ppc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 611debc3ce..2e395416f0 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -9,6 +9,7 @@ #ifndef KVM_PPC_H #define KVM_PPC_H +#include "sysemu/kvm.h" #include "exec/hwaddr.h" #include "cpu.h" From patchwork Tue Jun 27 11:51:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13294388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1A4EEB64DC for ; Tue, 27 Jun 2023 11:51:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230475AbjF0Lvp (ORCPT ); Tue, 27 Jun 2023 07:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbjF0Lvm (ORCPT ); Tue, 27 Jun 2023 07:51:42 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 252A92727 for ; Tue, 27 Jun 2023 04:51:41 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-98377c5d53eso540099666b.0 for ; Tue, 27 Jun 2023 04:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687866699; x=1690458699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5EM+qSWWOslftV8HcBXpILD27b+3+W5mkalItnU32xI=; b=zK/wO1TEMHYu1s8XH1PAIG4ggr3gqj0hxpHfpqqesgDccWWASPBRBwTqjxvaLS7OM/ RhMBJrthSW8x7Vdiz/3rk8ib0FJBohtxOdjRkOHHxTNXzMH+9mJodaN5iBmJDghhQe6C aVf9y97NdoZtReSmqCSzF/SPOBoo2Rjd66wYrVJqBLCSDW5Y7Tb/1uD2lswOQV6Uqs7r jnrJYC9q6Z3xfVRXCLZ6b7P1d9qfr1IAeVNRqpWnYkEGqA9L6MTYjxDAlFpbQ2oSEOZ6 On/49dj0L5K/TeWwyPNO6VoamET9qq1TBnwFBHI8G5Y7JBnd3tCu6O2RlijPXj4RAXqe gaEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687866699; x=1690458699; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5EM+qSWWOslftV8HcBXpILD27b+3+W5mkalItnU32xI=; b=Zm1nrLyQ+s7Paq08mwK896UPHRUYuPUVcZz++pu7O41fdDTQK5YVG9f7scmSe2UXku mlDJP6ALm1SH8lxbYOrVqDue+wQKLJlnUmuDIUEbpYhq2W0hETv7zKmQEmwUgJxMVtZr Nsc3ydGyPJK+N/XvTJuL9sYWg1fFBPQKhfpTVZlocQq6psnbKrEy+W6ncpmC12FiCS4v nWIUhgG4o9/9B4ap2k2+/OyEzZIj3V0mIdIZ6sJl0eLzIx6wmWUDk4A3l1m04l/hpht7 ftvQPJQP840QQvQasEv4AR/+kRP3wLf894szfxrDLhwVwoRFXXh3iE1DzOCbuEjyLKzu y/eA== X-Gm-Message-State: AC+VfDwprJPpoCm787ZdC9H9MhUKb8ktyYTU90LkwENygbERisXA71yI gjXzYqTiECWWzBAWbiNe4sRggA== X-Google-Smtp-Source: ACHHUZ6IqFkk/UBT9Y/2spa5T+pGGl9y+Nj7mw+jrVqROYCX1zp6Lg0qSp29vM1gcaCZRbjsPfXHcA== X-Received: by 2002:a17:906:684c:b0:98e:4c96:6e18 with SMTP id a12-20020a170906684c00b0098e4c966e18mr4150187ejs.5.1687866699521; Tue, 27 Jun 2023 04:51:39 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.204]) by smtp.gmail.com with ESMTPSA id ce23-20020a170906b25700b009920f18a5f0sm791874ejb.185.2023.06.27.04.51.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 04:51:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , qemu-ppc@nongnu.org, Paolo Bonzini , Greg Kurz , kvm@vger.kernel.org, Nicholas Piggin , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 2/6] target/ppc: Reorder #ifdef'ry in kvm_ppc.h Date: Tue, 27 Jun 2023 13:51:20 +0200 Message-Id: <20230627115124.19632-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230627115124.19632-1-philmd@linaro.org> References: <20230627115124.19632-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Keep a single if/else/endif block checking CONFIG_KVM. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater --- target/ppc/kvm_ppc.h | 62 ++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 2e395416f0..49954a300b 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -93,7 +93,34 @@ void kvmppc_set_reg_tb_offset(PowerPCCPU *cpu, int64_t tb_offset); int kvm_handle_nmi(PowerPCCPU *cpu, struct kvm_run *run); -#else +#define kvmppc_eieio() \ + do { \ + if (kvm_enabled()) { \ + asm volatile("eieio" : : : "memory"); \ + } \ + } while (0) + +/* Store data cache blocks back to memory */ +static inline void kvmppc_dcbst_range(PowerPCCPU *cpu, uint8_t *addr, int len) +{ + uint8_t *p; + + for (p = addr; p < addr + len; p += cpu->env.dcache_line_size) { + asm volatile("dcbst 0,%0" : : "r"(p) : "memory"); + } +} + +/* Invalidate instruction cache blocks */ +static inline void kvmppc_icbi_range(PowerPCCPU *cpu, uint8_t *addr, int len) +{ + uint8_t *p; + + for (p = addr; p < addr + len; p += cpu->env.icache_line_size) { + asm volatile("icbi 0,%0" : : "r"(p)); + } +} + +#else /* !CONFIG_KVM */ static inline uint32_t kvmppc_get_tbfreq(void) { @@ -440,10 +467,6 @@ static inline bool kvmppc_pvr_workaround_required(PowerPCCPU *cpu) return false; } -#endif - -#ifndef CONFIG_KVM - #define kvmppc_eieio() do { } while (0) static inline void kvmppc_dcbst_range(PowerPCCPU *cpu, uint8_t *addr, int len) @@ -454,35 +477,6 @@ static inline void kvmppc_icbi_range(PowerPCCPU *cpu, uint8_t *addr, int len) { } -#else /* CONFIG_KVM */ - -#define kvmppc_eieio() \ - do { \ - if (kvm_enabled()) { \ - asm volatile("eieio" : : : "memory"); \ - } \ - } while (0) - -/* Store data cache blocks back to memory */ -static inline void kvmppc_dcbst_range(PowerPCCPU *cpu, uint8_t *addr, int len) -{ - uint8_t *p; - - for (p = addr; p < addr + len; p += cpu->env.dcache_line_size) { - asm volatile("dcbst 0,%0" : : "r"(p) : "memory"); - } -} - -/* Invalidate instruction cache blocks */ -static inline void kvmppc_icbi_range(PowerPCCPU *cpu, uint8_t *addr, int len) -{ - uint8_t *p; - - for (p = addr; p < addr + len; p += cpu->env.icache_line_size) { - asm volatile("icbi 0,%0" : : "r"(p)); - } -} - #endif /* CONFIG_KVM */ #endif /* KVM_PPC_H */ From patchwork Tue Jun 27 11:51:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13294389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C7A6EB64D9 for ; Tue, 27 Jun 2023 11:51:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231218AbjF0Lvu (ORCPT ); Tue, 27 Jun 2023 07:51:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231130AbjF0Lvs (ORCPT ); Tue, 27 Jun 2023 07:51:48 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AC35E69 for ; Tue, 27 Jun 2023 04:51:47 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-98df3dea907so422970666b.3 for ; Tue, 27 Jun 2023 04:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687866705; x=1690458705; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wwRqncGBMw48ZRHZQQygcwpEXInzVqgYCZMTOEm7gro=; b=mnixBROMk4W/E5oZOyhcDKzrHtFUiMXo/SHSOVZCdjVa4W+QHAk1YP6JN0WdriXCRg 7kgoxdRSdpXiXm9/tuZtgVuUAVG4ULDZsoY7BNnEAtsId8Zrgl3kiwhYh8lszegl3BbK eboQUwrTSJ19pIAC5BvplUdAQ5sUlzxk+8+17nFe/f8c02iQ5HztThoAHTWuKxBxryTN vQz3qYE32MLVfAyKfOuC1Jf5fuf2ID3FOaFQZuzkK/hinGVcshX/IMsG6Y03ITu8CKRp tLJv9jBxZg9m/AMaSr9x1W1DFD3qMA1U+SUcDCepP90EDHA7/670RNlWEjyMxhvaXW6J bCDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687866705; x=1690458705; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wwRqncGBMw48ZRHZQQygcwpEXInzVqgYCZMTOEm7gro=; b=jERymvpp7gr0zWzVOw532rIKS4O3JaOS2GJizjAcJTZwr3SK5NOsPuE36Z6t1/q62R ZDIoM3itzMkuN1IFZJjsQo3V+g0uF1JJcmjfRAYxIQzTYR/+GMGoK/c9ulHMUOKnamAJ SsfLeEmhVE1BQGtVapbRhrCzTDVWoZJ82CYAJrIQpVAiR+A1Fdr+pLgBAP1HOZGMBBQp i8QDqD1jfetAwwx2aAHQsZjuP7Zh86upH69DSLa6+7gWCCrXBApToYlSjcyx5vPHoVbB 2FMh7eseJtTpMJUjvW2q3vfewzH+mN+IDppDTGiMA6aU1aDtYs/LSc3lh2HvK+SqhbPV //8w== X-Gm-Message-State: AC+VfDzY4UFy/XOx1CWHHIOH4itKj3RjW4iDmUo4+TS7bt4LsIuyHa2+ slwqeeL95C0EM1VEn2vPZJQc+A== X-Google-Smtp-Source: ACHHUZ6xLnSQ/b3U5NJqWbrTuz86G0gbNTSsjgso5M/VhbPKvGVEY9yrkxTf9DH2qSNmGFKSSTxcGw== X-Received: by 2002:a17:906:6a04:b0:988:a837:327a with SMTP id qw4-20020a1709066a0400b00988a837327amr22018537ejc.44.1687866705562; Tue, 27 Jun 2023 04:51:45 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.204]) by smtp.gmail.com with ESMTPSA id h14-20020a17090634ce00b0098238141deasm4478624ejb.90.2023.06.27.04.51.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 04:51:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , qemu-ppc@nongnu.org, Paolo Bonzini , Greg Kurz , kvm@vger.kernel.org, Nicholas Piggin , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 3/6] target/ppc: Move CPU QOM definitions to cpu-qom.h Date: Tue, 27 Jun 2023 13:51:21 +0200 Message-Id: <20230627115124.19632-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230627115124.19632-1-philmd@linaro.org> References: <20230627115124.19632-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater --- target/ppc/cpu-qom.h | 5 +++++ target/ppc/cpu.h | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 9666f54f65..c2bff349cc 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -31,6 +31,11 @@ OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU) +#define POWERPC_CPU_TYPE_SUFFIX "-" TYPE_POWERPC_CPU +#define POWERPC_CPU_TYPE_NAME(model) model POWERPC_CPU_TYPE_SUFFIX +#define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU +#define cpu_list ppc_cpu_list + ObjectClass *ppc_cpu_class_by_name(const char *name); typedef struct CPUArchState CPUPPCState; diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index af12c93ebc..e91e1774e5 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1468,12 +1468,6 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *env, int gprn) int ppc_dcr_read(ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp); int ppc_dcr_write(ppc_dcr_t *dcr_env, int dcrn, uint32_t val); -#define POWERPC_CPU_TYPE_SUFFIX "-" TYPE_POWERPC_CPU -#define POWERPC_CPU_TYPE_NAME(model) model POWERPC_CPU_TYPE_SUFFIX -#define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU - -#define cpu_list ppc_cpu_list - /* MMU modes definitions */ #define MMU_USER_IDX 0 static inline int cpu_mmu_index(CPUPPCState *env, bool ifetch) From patchwork Tue Jun 27 11:51:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13294390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F275EB64D9 for ; Tue, 27 Jun 2023 11:52:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231522AbjF0Lv5 (ORCPT ); Tue, 27 Jun 2023 07:51:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231130AbjF0Lvy (ORCPT ); Tue, 27 Jun 2023 07:51:54 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16D23120 for ; Tue, 27 Jun 2023 04:51:53 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-51d9124e1baso3780056a12.2 for ; Tue, 27 Jun 2023 04:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687866711; x=1690458711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TGZXRn778tTjabpObTTq7zFLfhDFVmkSDdvtG4Gr8rE=; b=ivXPP7EELHfP6sJ0l5qbHx5mCV8QlbwHGwSr7NB/wOhD6ru2flkDn3IF6/KjnLc1Sc RuPyAvov01ZLYBdsoZomj1ewZoI+FtwOEl+ccTsSDdOldyqu+FZwmlFqzaqtzYFbfs8P ce1DotNHn0nwCBkYyHAAx/Bd9+mhjvIj0Pyhk+o56mBDh/nXkkbTS71Ee83uhnydL9yI P77qRKp256o1b5l9IuNXT9ndDCwwreprJlClr4Q5c4N+b1Th9tj8Xpj+sbA3a1w9/BJR GOcbV8TtL+sewaMNfqzFZ2+sjHp2XuNJOG9liHKOZSwFlzeMYHcKGHdDLNplrav8YT5U JkmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687866711; x=1690458711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TGZXRn778tTjabpObTTq7zFLfhDFVmkSDdvtG4Gr8rE=; b=SDtwEMkz5S8BY93ngEyhWLORUq8aHekH27iS2/g5DLkDeg+8/8pmmshijU0ePJNprX HmvIYGhsi+Yw6UBGAeftYT/CcThSwkQ5P1QeJLmCkha5bs384t/z5v2t6EnQ75JD/CF4 P/vrECW/Xh/D0WD1cRgqDWRORv3NSI+fYMBG1zOHDBDIBFWk6bThbVVu+O07wLRQwEBk MBdBUI731LChm26Q5FqBdakhVWIMoakKiN8DdWiZ7EuU1SeuFHclk5IcNb9zB6yFJ6Pf H40HqU0D+ze7doTQb5VGGhIf1uXt7rTOl3rFRDe9VyilzwQ/UWz4hYT7AZjWqz8L8YB0 cUIQ== X-Gm-Message-State: AC+VfDyiGaqf6C7tQu+o9GosvU9DvxFokH2kpYCjuWN0Hkmkx62U2qCg Twmvq184Bhbz9AxFrVEqGQ60fQ== X-Google-Smtp-Source: ACHHUZ6KmfyVDXHoF0LSGwDDJ1p2i/7O7JP2KiimBL6Oz48s5RB2ncVVHEPFcgvvbfKEdG3eNwqUoQ== X-Received: by 2002:aa7:d5d6:0:b0:51d:961c:8ad4 with SMTP id d22-20020aa7d5d6000000b0051d961c8ad4mr4856426eds.28.1687866711477; Tue, 27 Jun 2023 04:51:51 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.204]) by smtp.gmail.com with ESMTPSA id v20-20020aa7dbd4000000b00514a5f7a145sm3701418edt.37.2023.06.27.04.51.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 04:51:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , qemu-ppc@nongnu.org, Paolo Bonzini , Greg Kurz , kvm@vger.kernel.org, Nicholas Piggin , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/6] target/ppc: Define TYPE_HOST_POWERPC_CPU in cpu-qom.h Date: Tue, 27 Jun 2023 13:51:22 +0200 Message-Id: <20230627115124.19632-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230627115124.19632-1-philmd@linaro.org> References: <20230627115124.19632-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org TYPE_HOST_POWERPC_CPU is used in various places of cpu_init.c, in order to restrict "kvm_ppc.h" to sysemu, move this QOM-related definition to cpu-qom.h. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Greg Kurz --- target/ppc/cpu-qom.h | 2 ++ target/ppc/kvm_ppc.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index c2bff349cc..4e4061068e 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -36,6 +36,8 @@ OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU) #define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU #define cpu_list ppc_cpu_list +#define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host") + ObjectClass *ppc_cpu_class_by_name(const char *name); typedef struct CPUArchState CPUPPCState; diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 49954a300b..901e188c9a 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -13,8 +13,6 @@ #include "exec/hwaddr.h" #include "cpu.h" -#define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host") - #ifdef CONFIG_KVM uint32_t kvmppc_get_tbfreq(void); From patchwork Tue Jun 27 11:51:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13294391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80C03EB64D9 for ; Tue, 27 Jun 2023 11:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231213AbjF0LwF (ORCPT ); Tue, 27 Jun 2023 07:52:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbjF0LwE (ORCPT ); Tue, 27 Jun 2023 07:52:04 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADE45E71 for ; Tue, 27 Jun 2023 04:51:58 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-991b7a4d2e8so272814866b.1 for ; Tue, 27 Jun 2023 04:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687866717; x=1690458717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VO9Kit1sdoJ392FVmc33R5cx+Y6OihE9F+t/ncxHt8c=; b=YT5YuAOOsTqqfatWHVtR5bkFlY0OTtUHvz/0s46L5ULvuQ9jKzUP8DdeP4Gvihrma4 p3ihWqPzfDEhIHOOPHC+rsh5mMYQeIQ3JnTnrFzesbzAqWnLmlojrINFWAaITg2IsoRa fFIVnpjnh0gaHLZeA0mtf9bEsjWc7j+R1jKgwpen8bJanw32gRd8dXnt/1Jln2WieGxc SfADtn16kwQiMn1ONmCxcXlGIEhWJ91N3aoLX3XCIWTMHMS7sJOPVwM7N15G+1CRoRf0 cb1rzlPPnpb0DCmjSUxVMvNUof956VdbGliqmdPEL8p2bsAS8PUXfgobj2cWf3KG5MOu rvAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687866717; x=1690458717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VO9Kit1sdoJ392FVmc33R5cx+Y6OihE9F+t/ncxHt8c=; b=QRdszwrP9tTeVRc754Pvp/RTzhDUU7AIYKj19GgDBNb9nNMRlqND0u47nprDbmNwwW zeSwQsaH0XZeCGqLE0ukSylPy1GPoZ8VQtOGJ3Q8ri2KTJJ2WXd1DkffJrxYL1tC1xo4 EZV83BsAxCOaNFjgwGyYLxAy5eyXwxTWWJzXD954b9Pbx8/uVGd89IMDWzMcHulre+zB UuiZhLhQPEnRaeMXQrtZThIXiqLMPQxHEawii5ZRdO7nBbzoMbPYTUlp9cN9Bd2Ot34n 1iiAtovxr4E0zbfy7k7LoHTQx4Qy8fA+wpwduVardVqsPJ/SkTLg84ewQu/fD5Pj0xRI Yfpw== X-Gm-Message-State: AC+VfDy4FqwaQp1WJErWQzHpGtsD40A/vGzyX5RKDDxJbexbk57C4KOh 9PWeAgv9h678yMGvi8tdFxabfQ== X-Google-Smtp-Source: ACHHUZ5LgZQOdPi8vbeWTXXgBKtBWYxquWJPWcOG+nXOG6pwEQj7QCL4ybEz91QzLvRj1pWiyaIm9A== X-Received: by 2002:a17:907:9450:b0:989:3670:3696 with SMTP id dl16-20020a170907945000b0098936703696mr17867636ejc.58.1687866717193; Tue, 27 Jun 2023 04:51:57 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.204]) by smtp.gmail.com with ESMTPSA id a2-20020a1709065f8200b009827b97c89csm4455614eju.102.2023.06.27.04.51.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 04:51:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , qemu-ppc@nongnu.org, Paolo Bonzini , Greg Kurz , kvm@vger.kernel.org, Nicholas Piggin , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 5/6] target/ppc: Restrict 'kvm_ppc.h' to sysemu in cpu_init.c Date: Tue, 27 Jun 2023 13:51:23 +0200 Message-Id: <20230627115124.19632-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230627115124.19632-1-philmd@linaro.org> References: <20230627115124.19632-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org User emulation shouldn't need any of the KVM prototypes declared in "kvm_ppc.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Greg Kurz --- target/ppc/cpu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index aeff71d063..f2afb539eb 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -21,7 +21,6 @@ #include "qemu/osdep.h" #include "disas/dis-asm.h" #include "gdbstub/helpers.h" -#include "kvm_ppc.h" #include "sysemu/cpus.h" #include "sysemu/hw_accel.h" #include "sysemu/tcg.h" @@ -49,6 +48,7 @@ #ifndef CONFIG_USER_ONLY #include "hw/boards.h" #include "hw/intc/intc.h" +#include "kvm_ppc.h" #endif /* #define PPC_DEBUG_SPR */ From patchwork Tue Jun 27 11:51:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13294392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48E8AEB64D9 for ; Tue, 27 Jun 2023 11:52:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231453AbjF0LwK (ORCPT ); Tue, 27 Jun 2023 07:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230238AbjF0LwI (ORCPT ); Tue, 27 Jun 2023 07:52:08 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65059120 for ; Tue, 27 Jun 2023 04:52:04 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-51d9a925e9aso2637301a12.0 for ; Tue, 27 Jun 2023 04:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687866723; x=1690458723; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Exw+JZXOL4uO7+3m9iYv0CMoNufl6q663SemmcVGUDs=; b=D243fL8YZ2ilzOwTH/R8fl1t9I9RYRViHPE68ZXBeP+S469Nr7nvuq4AqADY5HOsyu zq9quS90T8MgbQ7+yyRMLjcPtSE347AwW60WlQ5t5OYGSNaz7KMjHMqpR7rujdO0iMOA aryT5Wtx7M4p6y+JSfmdYDUCxAileqJkzUDSh09Pd7zzPJF5NxyXSdYhWqjSx0z7vcH6 7COGTXxcsk0Z+/cqu6QwPo0GsQRk5kPyiXvWmbRjqTvBaPU8ZKuhCKlUhnOUzOGLhqBL sIRRkvo2lkxuucS9iU0L65KEQvNQJP1J0HA58464MLtV2nvdEqSTC3ASlRMC5nMBKKHW ZlWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687866723; x=1690458723; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Exw+JZXOL4uO7+3m9iYv0CMoNufl6q663SemmcVGUDs=; b=KiSJO1IWN3h1A+KO+nfB0hcivOVeKeZhW8sQn9oHYxO6BFclIDwDjDoh9Tndu6uOYH vgtzBaA/1OsDlw3suxM0HXF43NNUlqVEYjlAYD5SZrOtj2sOjsTuV2GMTrenzrh3tIsY rRfDw0+KzwVK+3nJYhymMsy8etroLNDUctbHFuzesxmlzRCLVmo4NjRKIxXEpxZbb6jY ym7SqYJbTrWiQeQj/hJwlJVRcrusjpZZQAHCXmzFXELKlMl1hZvLsapi9rgOGxxkO8UE HseQ3ajXcAgsRVz1BILleEMDVDxj+y2IX8cocI5dJOLUmn9PuvLf0p8NsP3o4ODBT5EH ddPA== X-Gm-Message-State: AC+VfDw+JwG4JYwfaZ6u3UrFq9Wp9OgT5jatewfnZQIaZG25UPaKsheO tNtfqe51BWlny0uk+OxxxotOeg== X-Google-Smtp-Source: ACHHUZ6uCsnqM9P3N/MzuPiI6BmEG2Gg8wTsAU8ZrHvRjeKw1Voa0SIfZlyjcTP+MPN77umcbDZmgA== X-Received: by 2002:a05:6402:498:b0:519:b784:b157 with SMTP id k24-20020a056402049800b00519b784b157mr20050286edv.12.1687866722978; Tue, 27 Jun 2023 04:52:02 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.204]) by smtp.gmail.com with ESMTPSA id q14-20020a056402040e00b0051d890b2407sm3384524edv.81.2023.06.27.04.52.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 27 Jun 2023 04:52:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , qemu-ppc@nongnu.org, Paolo Bonzini , Greg Kurz , kvm@vger.kernel.org, Nicholas Piggin , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 6/6] target/ppc: Remove pointless checks of CONFIG_USER_ONLY in 'kvm_ppc.h' Date: Tue, 27 Jun 2023 13:51:24 +0200 Message-Id: <20230627115124.19632-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230627115124.19632-1-philmd@linaro.org> References: <20230627115124.19632-1-philmd@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Greg Kurz --- target/ppc/kvm_ppc.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 901e188c9a..6a4dd9c560 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -42,7 +42,6 @@ int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu); target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu, bool radix, bool gtse, uint64_t proc_tbl); -#ifndef CONFIG_USER_ONLY bool kvmppc_spapr_use_multitce(void); int kvmppc_spapr_enable_inkernel_multitce(void); void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift, @@ -52,7 +51,6 @@ int kvmppc_remove_spapr_tce(void *table, int pfd, uint32_t window_size); int kvmppc_reset_htab(int shift_hint); uint64_t kvmppc_vrma_limit(unsigned int hash_shift); bool kvmppc_has_cap_spapr_vfio(void); -#endif /* !CONFIG_USER_ONLY */ bool kvmppc_has_cap_epr(void); int kvmppc_define_rtas_kernel_token(uint32_t token, const char *function); int kvmppc_get_htab_fd(bool write, uint64_t index, Error **errp); @@ -262,7 +260,6 @@ static inline void kvmppc_set_reg_tb_offset(PowerPCCPU *cpu, int64_t tb_offset) { } -#ifndef CONFIG_USER_ONLY static inline bool kvmppc_spapr_use_multitce(void) { return false; @@ -322,8 +319,6 @@ static inline void kvmppc_write_hpte(hwaddr ptex, uint64_t pte0, uint64_t pte1) abort(); } -#endif /* !CONFIG_USER_ONLY */ - static inline bool kvmppc_has_cap_epr(void) { return false;