From patchwork Mon May 4 17:24:44 2020 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: 283449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA3BCC3A5A9 for ; Mon, 4 May 2020 17:27:03 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 855D720721 for ; Mon, 4 May 2020 17:27:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Htw0BjOE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 855D720721 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVeru-00050U-Mi for qemu-devel@archiver.kernel.org; Mon, 04 May 2020 13:27:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVepx-0001wU-Aw for qemu-devel@nongnu.org; Mon, 04 May 2020 13:25:01 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:47882 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jVepv-0005Gd-OY for qemu-devel@nongnu.org; Mon, 04 May 2020 13:25:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588613098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J2j0wqUPebHWLfyYz6iL8kkjnw7WfmxM1B0D7mnsKjQ=; b=Htw0BjOEG+ZtjtSlrZUgeQOyzy4V8Zd8N5lGvV2tB3mUDysTE2OrvUqg+1IG41mVUS0cqi mMBxVS4C3bWdJcFZgN/VYnGx43DSp0n79+tBqbdoMqHmA+GBka2/U+3C+XHBF8Ev62Wy8y h6Zy/uhj85Qvz8VlwgWY9w24dJ60E+4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-90-IQsJ9heSMfmTTtoOmnPrFw-1; Mon, 04 May 2020 13:24:56 -0400 X-MC-Unique: IQsJ9heSMfmTTtoOmnPrFw-1 Received: by mail-wm1-f72.google.com with SMTP id n127so307670wme.4 for ; Mon, 04 May 2020 10:24:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AbBkM/gfj45zJYp9htQMJfg8nUymcXwOX7nX9TXzWm8=; b=HR5D61uIa/0MeToqKmOPsSWxSbk47KXZRVi0C9fy5GnUWSt/ZukU/XnnJMf/C9PodX G4L23azLdjj7w417xvHvb1lhc1KXvX/o1x4E0F2adu/kJEllyp/q425jBbV7SLpme74h HCBrU6Ms7KSDkePdLs2vgwed4ed095A9dXH3nmgPQaxvH2ht5HR6Zx+yA4dcrUJLUdv5 NqMI1PTKG9Nk0BGQaEOku5s5Bn8AHqgEOde+IxutEQbwshnwUHDybs4C41TxpNGZ9ecq /QpU//cvFhLD7kMIIR/rGCzqYcNCckyqKlSK1SvJ0K3kSD6pDn2HAv7RMfwwytazmdYp YAdQ== X-Gm-Message-State: AGi0PuYMt0CNdCCv9rBzcMmlMv3CGDlpdW3qg2pBtLbbpxHjxyf1OXPe E74cDKhdVZQBrMktv0AnzfbMY7wMBo1G2eXQvzdnrsSdMjFYVFLTjWlcU0DYD+HaluoPpE9Skhq Lr9R94HKL/q5H0lQ= X-Received: by 2002:adf:ee86:: with SMTP id b6mr98938wro.419.1588613094636; Mon, 04 May 2020 10:24:54 -0700 (PDT) X-Google-Smtp-Source: APiQypL6qG+6FGDCUjOPb4Q0wRZpM/tfdWIRsDeaecX9ryA9ojz6oLYojelvKEPez1N0RgHN5G3Uaw== X-Received: by 2002:adf:ee86:: with SMTP id b6mr98924wro.419.1588613094449; Mon, 04 May 2020 10:24:54 -0700 (PDT) Received: from x1w.redhat.com (26.red-88-21-207.staticip.rima-tde.net. [88.21.207.26]) by smtp.gmail.com with ESMTPSA id k5sm3556196wrx.16.2020.05.04.10.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 10:24:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 1/5] target/arm/kvm: Inline set_feature() calls Date: Mon, 4 May 2020 19:24:44 +0200 Message-Id: <20200504172448.9402-2-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200504172448.9402-1-philmd@redhat.com> References: <20200504172448.9402-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 04:24:57 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 , Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We want to move the inlined declarations of set_feature() from cpu*.c to cpu.h. To avoid clashing with the KVM declarations, inline the few KVM calls. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/arm/kvm32.c | 13 ++++--------- target/arm/kvm64.c | 22 ++++++---------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c index f271181ab8..7b3a19e9ae 100644 --- a/target/arm/kvm32.c +++ b/target/arm/kvm32.c @@ -22,11 +22,6 @@ #include "internals.h" #include "qemu/log.h" -static inline void set_feature(uint64_t *features, int feature) -{ - *features |= 1ULL << feature; -} - static int read_sys_reg32(int fd, uint32_t *pret, uint64_t id) { struct kvm_one_reg idreg = { .id = id, .addr = (uintptr_t)pret }; @@ -146,14 +141,14 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) * timers; this in turn implies most of the other feature * bits, but a few must be tested. */ - set_feature(&features, ARM_FEATURE_V7VE); - set_feature(&features, ARM_FEATURE_GENERIC_TIMER); + features |= 1ULL << ARM_FEATURE_V7VE; + features |= 1ULL << ARM_FEATURE_GENERIC_TIMER; if (extract32(id_pfr0, 12, 4) == 1) { - set_feature(&features, ARM_FEATURE_THUMB2EE); + features |= 1ULL << ARM_FEATURE_THUMB2EE; } if (extract32(ahcf->isar.mvfr1, 12, 4) == 1) { - set_feature(&features, ARM_FEATURE_NEON); + features |= 1ULL << ARM_FEATURE_NEON; } ahcf->features = features; diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index be5b31c2b0..cd8ab6b8ae 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -447,16 +447,6 @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) } } -static inline void set_feature(uint64_t *features, int feature) -{ - *features |= 1ULL << feature; -} - -static inline void unset_feature(uint64_t *features, int feature) -{ - *features &= ~(1ULL << feature); -} - static int read_sys_reg32(int fd, uint32_t *pret, uint64_t id) { uint64_t ret; @@ -648,11 +638,11 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) * with VFPv4+Neon; this in turn implies most of the other * feature bits. */ - set_feature(&features, ARM_FEATURE_V8); - set_feature(&features, ARM_FEATURE_NEON); - set_feature(&features, ARM_FEATURE_AARCH64); - set_feature(&features, ARM_FEATURE_PMU); - set_feature(&features, ARM_FEATURE_GENERIC_TIMER); + features |= 1ULL << ARM_FEATURE_V8; + features |= 1ULL << ARM_FEATURE_NEON; + features |= 1ULL << ARM_FEATURE_AARCH64; + features |= 1ULL << ARM_FEATURE_PMU; + features |= 1ULL << ARM_FEATURE_GENERIC_TIMER; ahcf->features = features; @@ -802,7 +792,7 @@ int kvm_arch_init_vcpu(CPUState *cs) if (cpu->has_pmu) { cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_PMU_V3; } else { - unset_feature(&env->features, ARM_FEATURE_PMU); + env->features &= ~(1ULL << ARM_FEATURE_PMU); } if (cpu_isar_feature(aa64_sve, cpu)) { assert(kvm_arm_sve_supported(cs)); From patchwork Mon May 4 17:24:46 2020 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: 283448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A47DC3A5A9 for ; Mon, 4 May 2020 17:27:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16BAD20721 for ; Mon, 4 May 2020 17:27:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Qm/DKl2l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16BAD20721 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVesN-0005dW-3G for qemu-devel@archiver.kernel.org; Mon, 04 May 2020 13:27:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVeqA-0002TU-Pw for qemu-devel@nongnu.org; Mon, 04 May 2020 13:25:14 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:36837 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jVeq9-0005PC-SC for qemu-devel@nongnu.org; Mon, 04 May 2020 13:25:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588613113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Eji01/SBPkfeU3Z/BdrMTnTdR9yItWqYRqGxG9pfew4=; b=Qm/DKl2lvNhNVm3DSzBuzmQkY5qtNu/YQsg75NAedaHjrI+/wjkFuZsXV5Hi8Duts/SK3J cu8j/d3Eb3c9qZz7XLtOUSV/lZkM7vMLgkIpLFG7w7kve/X2eWSBhvw1+a5QZFQ4aYnEnL De9qq5cOIiyE9TcD6R1bsihnQZvtc9o= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-245-pnn2eaeKNieCe_BPyUC4wQ-1; Mon, 04 May 2020 13:25:07 -0400 X-MC-Unique: pnn2eaeKNieCe_BPyUC4wQ-1 Received: by mail-wr1-f71.google.com with SMTP id y4so221515wrt.4 for ; Mon, 04 May 2020 10:25:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ns/oosgPvEQDCh0mvkSvxQ2e1s0FFrQb4T4+vlueLeQ=; b=K7wzGTovf5IaU0ABc459ULTY6zu2lCw/Iws56MPQa5Q6vqh2X88Mjj83TUokINIYmY nnuolMsJssBop9TDPnnJIWLe9BtxD7A6vyGVCVWmoRpYTVwYQLMXuiaLnI9ibVIbEdgY mmClBUL6Qb/mz2dS2XTtHiezCPXPH05V0L+XYVrfLDnIVHRyyBB2K5RYcC9SekH7gp45 GaP/PpFA8Pwj6SKXAymrps66EDA+jZJA5u+4adRnye/aM++0BhgZ7294YcPF0TvEMoTQ 2wXjeIE6Ff/xNtIGUOiZDxvMYL6LomANoS+JsmCuZNm7zFraYhJS+S0hGBk9eXTg7DIu l84A== X-Gm-Message-State: AGi0PuY5vIq8WiQI+iWfv7z5r06kdgZf9+kgVtCP/rduXH/KRlU36nZ/ aipqiPBoEwemnpGDcIWMyT47wXsZVtK2e/8eD7RXsoUGiNjiTT1Y6/c21/dPKzp+L1JOteG3le1 1H0Hpk8yxGwDsFtk= X-Received: by 2002:a1c:bc02:: with SMTP id m2mr15538324wmf.60.1588613103929; Mon, 04 May 2020 10:25:03 -0700 (PDT) X-Google-Smtp-Source: APiQypKTqYOS5s3AcQ8q6h/AX9iBLHJQKHc+rSJ9aOh3VxyWLp00Ca5QccicV0Fdm+dFxXvKRybQ0w== X-Received: by 2002:a1c:bc02:: with SMTP id m2mr15538304wmf.60.1588613103651; Mon, 04 May 2020 10:25:03 -0700 (PDT) Received: from x1w.redhat.com (26.red-88-21-207.staticip.rima-tde.net. [88.21.207.26]) by smtp.gmail.com with ESMTPSA id b66sm179291wmh.12.2020.05.04.10.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 10:25:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 3/5] target/arm/cpu: Use ARRAY_SIZE() to iterate over ARMCPUInfo[] Date: Mon, 4 May 2020 19:24:46 +0200 Message-Id: <20200504172448.9402-4-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200504172448.9402-1-philmd@redhat.com> References: <20200504172448.9402-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 08:14:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 , Richard Henderson , qemu-arm@nongnu.org, =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Use ARRAY_SIZE() to iterate over ARMCPUInfo[]. Since on the aarch64-linux-user build, arm_cpus[] is empty, add the cpu_count variable and only iterate when it is non-zero. Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- Without using cpu_count we get: target/arm/cpu.c:2904:19: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] 2904 | for (i = 0; i < ARRAY_SIZE(arm_cpus); ++i) { | ^ cc1: all warnings being treated as errors --- target/arm/cpu.c | 16 +++++++++------- target/arm/cpu64.c | 8 +++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 13959cb643..b4d73dd47c 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2739,7 +2739,6 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "any", .initfn = arm_max_initfn }, #endif #endif - { .name = NULL } }; static Property arm_cpu_properties[] = { @@ -2887,19 +2886,22 @@ static const TypeInfo idau_interface_type_info = { static void arm_cpu_register_types(void) { - const ARMCPUInfo *info = arm_cpus; + const size_t cpu_count = ARRAY_SIZE(arm_cpus); type_register_static(&arm_cpu_type_info); type_register_static(&idau_interface_type_info); - while (info->name) { - arm_cpu_register(info); - info++; - } - #ifdef CONFIG_KVM type_register_static(&host_arm_cpu_type_info); #endif + + if (cpu_count) { + size_t i; + + for (i = 0; i < cpu_count; ++i) { + arm_cpu_register(&arm_cpus[i]); + } + } } type_init(arm_cpu_register_types) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index cbaa5ed228..f5c49ee32d 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -734,7 +734,6 @@ static const ARMCPUInfo aarch64_cpus[] = { { .name = "cortex-a53", .initfn = aarch64_a53_initfn }, { .name = "cortex-a72", .initfn = aarch64_a72_initfn }, { .name = "max", .initfn = aarch64_max_initfn }, - { .name = NULL } }; static bool aarch64_cpu_get_aarch64(Object *obj, Error **errp) @@ -840,13 +839,12 @@ static const TypeInfo aarch64_cpu_type_info = { static void aarch64_cpu_register_types(void) { - const ARMCPUInfo *info = aarch64_cpus; + size_t i; type_register_static(&aarch64_cpu_type_info); - while (info->name) { - aarch64_cpu_register(info); - info++; + for (i = 0; i < ARRAY_SIZE(aarch64_cpus); ++i) { + aarch64_cpu_register(&aarch64_cpus[i]); } } From patchwork Mon May 4 17:24:47 2020 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: 283447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32ADCC3A5A9 for ; Mon, 4 May 2020 17:31:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F111C2068E for ; Mon, 4 May 2020 17:31:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HDngqIPO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F111C2068E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:34496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVewQ-0002Y9-2C for qemu-devel@archiver.kernel.org; Mon, 04 May 2020 13:31:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVeq9-0002Ps-IF for qemu-devel@nongnu.org; Mon, 04 May 2020 13:25:13 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:39959 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jVeq8-0005OO-8N for qemu-devel@nongnu.org; Mon, 04 May 2020 13:25:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588613111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gKFemNLKvLsfWugRqwCsKjdZxDFrpd75fXOIrjBACXk=; b=HDngqIPOcMQH23uaOzfjn7ru9Q2ujp6HJ2K1fMt3K7oQbWgwLnMVfpPRGrNi6HSKhrsR/y 4SpGOiZK8Fp7svSlAEcMAeRNwbWkxPMb1ma30RaEb6k0cRT4VEOUfQeirsY7lF2bNRVIeE RcFoXe3m67heOV05iFetActK1lu1VQM= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-365-KejHfgNvMOqFp-ex_LjPGA-1; Mon, 04 May 2020 13:25:09 -0400 X-MC-Unique: KejHfgNvMOqFp-ex_LjPGA-1 Received: by mail-wm1-f71.google.com with SMTP id h6so309347wmi.7 for ; Mon, 04 May 2020 10:25:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6FZZJFR4wX+R6WdyE1qjITEUJ4N+wtsCncRkTmCNCbM=; b=Zh+j8ROmSkGDGEi/VFZZt61wGezK1JyusdBGspUrtXixaU5USyK3dbpkx7JJg0gCIK ZIghWJdPWg8Y9Bd/828mdTZM4aHXAhCKj86UiT7evOg42VjOAd8MUhEQDvEKhK5YOO5i sx4X85ZlXcZcqxidpciKg9pu/ghDC51TPGpwHJ9SIb1HDuPvXuVPfRyAELMBuGsePCyl lpIOTvEVMdNTm4ucf1MTsGGDq2BlYV2BCNTnzZYSThaeIrKE5MIvTqTwhKB1W1KE+mWa ugwCkm+JKYU1+dVwNO2zfx7m4ny46dqvH3qmV+7oMHcDZPGZA1JvVkDbK//xL5jToJUy UkyA== X-Gm-Message-State: AGi0PuZzjAxUJxRyL6aOVOZhGwDqbeNBifXlriYv6jhTLLCJPC1eSvMp kkxf7gvRYsrbBoHZEsifixfOjvk8R3/tXQaEu3hFkqFSu5UwiGsn2CETn3umTx4A4T01OxK9cZh LmQ4AM4BIWfK8oIk= X-Received: by 2002:a1c:dfc6:: with SMTP id w189mr16476866wmg.180.1588613108452; Mon, 04 May 2020 10:25:08 -0700 (PDT) X-Google-Smtp-Source: APiQypLI1mPvZDPhY+ZKH4LyKu9+4Ct2WceO2vbk58+8cFyptnnTVQoShNUZ6mIi70U6BLHVVv2kBA== X-Received: by 2002:a1c:dfc6:: with SMTP id w189mr16476851wmg.180.1588613108237; Mon, 04 May 2020 10:25:08 -0700 (PDT) Received: from x1w.redhat.com (26.red-88-21-207.staticip.rima-tde.net. [88.21.207.26]) by smtp.gmail.com with ESMTPSA id n9sm19844703wrx.61.2020.05.04.10.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 10:25:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 4/5] target/arm/cpu: Restrict v8M IDAU interface to Aarch32 CPUs Date: Mon, 4 May 2020 19:24:47 +0200 Message-Id: <20200504172448.9402-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200504172448.9402-1-philmd@redhat.com> References: <20200504172448.9402-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/04 08:14:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-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 , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" As IDAU is a v8M feature, restrict it to the Aarch32 CPUs. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index b4d73dd47c..a10f8c4044 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -2889,7 +2889,6 @@ static void arm_cpu_register_types(void) const size_t cpu_count = ARRAY_SIZE(arm_cpus); type_register_static(&arm_cpu_type_info); - type_register_static(&idau_interface_type_info); #ifdef CONFIG_KVM type_register_static(&host_arm_cpu_type_info); @@ -2898,6 +2897,7 @@ static void arm_cpu_register_types(void) if (cpu_count) { size_t i; + type_register_static(&idau_interface_type_info); for (i = 0; i < cpu_count; ++i) { arm_cpu_register(&arm_cpus[i]); }