From patchwork Thu Oct 15 16:44:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 11839771 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAB1414B4 for ; Thu, 15 Oct 2020 16:47:34 +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 291D722240 for ; Thu, 15 Oct 2020 16:47:33 +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="HgYURdWe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 291D722240 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6Pc-0005rZ-EF for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Oct 2020 12:47:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6NM-0004MD-C2 for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT6NK-0000Tr-Gz for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602780308; 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=PoGymc5wSiG2tFQo3gPL9k7V8VQk8HjWzxjKM/wIN+M=; b=HgYURdWeK2UZxehNLeiEArCEAe3VylqDPvIBJ2xOG/PcpRYMxiDIbBkMJar1qgY5c0e3kJ 3VccDkH40f87TTMci/Ah6PB28YvrhDgQz9DvKZTXOU+cd4bd/BlEkwdzN9xNAQN2PLTnYw yGVwQVRbiZ7z6gFIGu+Zs2jM33X6gw8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-80--sMkXWm8O6eXsywFcPXWvg-1; Thu, 15 Oct 2020 12:45:06 -0400 X-MC-Unique: -sMkXWm8O6eXsywFcPXWvg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C4D4F100746B; Thu, 15 Oct 2020 16:45:03 +0000 (UTC) Received: from localhost (ovpn-66-44.rdu2.redhat.com [10.10.66.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87EBE19C4F; Thu, 15 Oct 2020 16:45:03 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 1/9] i386: drop x86_cpu_get_supported_feature_word() forward declaration Date: Thu, 15 Oct 2020 12:44:53 -0400 Message-Id: <20201015164501.462775-2-ehabkost@redhat.com> In-Reply-To: <20201015164501.462775-1-ehabkost@redhat.com> References: <20201015164501.462775-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 02:10:02 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Igor Mammedov , Vitaly Kuznetsov , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Vitaly Kuznetsov We only use x86_cpu_get_supported_feature_word() after its implementation, no forward declaration needed. Signed-off-by: Vitaly Kuznetsov Message-Id: <20200904145431.196885-3-vkuznets@redhat.com> Signed-off-by: Eduardo Habkost --- target/i386/cpu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 9eafbe3690..a33af2359c 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4180,9 +4180,6 @@ void x86_cpu_change_kvm_default(const char *prop, const char *value) assert(pv->prop); } -static uint64_t x86_cpu_get_supported_feature_word(FeatureWord w, - bool migratable_only); - static bool lmce_supported(void) { uint64_t mce_cap = 0; From patchwork Thu Oct 15 16:44:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 11839779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D13EF1744 for ; Thu, 15 Oct 2020 16:50:10 +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 6F27822255 for ; Thu, 15 Oct 2020 16:50:10 +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="M0GsVqEK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F27822255 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:55566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6S9-0008Jy-4S for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Oct 2020 12:50:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6NQ-0004MT-5d for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT6NN-0000U3-TT for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602780311; 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=FjSWs2ueHTFAYbwmQwSRzeDlYFK9piLsfc+JOFi7X2Q=; b=M0GsVqEKF43LjS0irsNtwgXsFk36Qbrp9jtA80vDn0v3h3vkdwbksXXxEDGZrdkd1nWexH g0cNwNYNWPOeEItWkUFqM+flBppA/nlKMxpq3oSCpG9iDNgEyaH9XbQTTq1ivMBjVBMzqM lPw7NRNLjgabp67ZZXGVEexMHUqKkOg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-503-YwResHO9MY-tBZXT2_Af_A-1; Thu, 15 Oct 2020 12:45:08 -0400 X-MC-Unique: YwResHO9MY-tBZXT2_Af_A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 624F05708A; Thu, 15 Oct 2020 16:45:07 +0000 (UTC) Received: from localhost (ovpn-66-44.rdu2.redhat.com [10.10.66.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FC8219C4F; Thu, 15 Oct 2020 16:45:04 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 2/9] i386/kvm: fix FEATURE_HYPERV_EDX value in hyperv_passthrough case Date: Thu, 15 Oct 2020 12:44:54 -0400 Message-Id: <20201015164501.462775-3-ehabkost@redhat.com> In-Reply-To: <20201015164501.462775-1-ehabkost@redhat.com> References: <20201015164501.462775-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 02:38:26 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Igor Mammedov , Eduardo Habkost , Zhenyu Wang , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Zhenyu Wang Fix typo to use correct edx value for FEATURE_HYPERV_EDX when hyperv_passthrough is enabled. Signed-off-by: Zhenyu Wang Message-Id: <20190820103030.12515-1-zhenyuw@linux.intel.com> Fixes: e48ddcc6ce13 ("i386/kvm: implement 'hv-passthrough' mode") Signed-off-by: Eduardo Habkost --- target/i386/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 8b12387d30..0098be7015 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -1214,7 +1214,7 @@ static int hyperv_handle_properties(CPUState *cs, if (c) { env->features[FEAT_HYPERV_EAX] = c->eax; env->features[FEAT_HYPERV_EBX] = c->ebx; - env->features[FEAT_HYPERV_EDX] = c->eax; + env->features[FEAT_HYPERV_EDX] = c->edx; } c = cpuid_find_entry(cpuid, HV_CPUID_ENLIGHTMENT_INFO, 0); if (c) { From patchwork Thu Oct 15 16:44:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 11839773 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9093A14B4 for ; Thu, 15 Oct 2020 16:47:35 +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 19DE822240 for ; Thu, 15 Oct 2020 16:47:34 +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="RvGBSpRU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19DE822240 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6Pd-0005sq-Q4 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Oct 2020 12:47:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6NS-0004Ma-67 for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT6NN-0000U5-TO for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602780311; 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=ZpynZSVA1qN6ltS+zJYlz+OUy8xgGllKPauyeHYcGkw=; b=RvGBSpRUtB5eFEFLzFnbT1oL6njE2WL8g1kX5EOVUVnAp+GAmc3Nivzyqcsy4ZYMT8E4VZ QBna8grl/x2I3njoezA2W3HovZbkaIjcP4AwdtNIk+eBktJb12pRQHl9QAp+gWQjPH/odR 7owjM1wj+M8CYssOktcqJPgj/9L/CEQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-335-eLz_WMi3PAejqGw-ewQIvA-1; Thu, 15 Oct 2020 12:45:10 -0400 X-MC-Unique: eLz_WMi3PAejqGw-ewQIvA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE2068D4420; Thu, 15 Oct 2020 16:45:08 +0000 (UTC) Received: from localhost (ovpn-66-44.rdu2.redhat.com [10.10.66.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6CFCE76649; Thu, 15 Oct 2020 16:45:08 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 3/9] target/i386: Remove core_id assert check in CPUID 0x8000001E Date: Thu, 15 Oct 2020 12:44:55 -0400 Message-Id: <20201015164501.462775-4-ehabkost@redhat.com> In-Reply-To: <20201015164501.462775-1-ehabkost@redhat.com> References: <20201015164501.462775-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 02:38:26 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Igor Mammedov , Eduardo Habkost , Babu Moger , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Babu Moger With x2apic enabled, configurations can have more that 255 cores. Noticed the device add test is hitting an assert when during cpu hotplug with core_id > 255. This is due to assert check in the CPUID 0x8000001E. Remove the assert check and fix the problem. Fixes the bug: Link: https://bugzilla.redhat.com/show_bug.cgi?id=1834200 Signed-off-by: Babu Moger Message-Id: <160072824160.9666.8890355282135970684.stgit@naples-babu.amd.com> Signed-off-by: Eduardo Habkost --- target/i386/cpu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index a33af2359c..25ec64124e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5910,9 +5910,14 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, } break; case 0x8000001E: - assert(cpu->core_id <= 255); - encode_topo_cpuid8000001e(cpu, &topo_info, - eax, ebx, ecx, edx); + if (cpu->core_id <= 255) { + encode_topo_cpuid8000001e(cpu, &topo_info, eax, ebx, ecx, edx); + } else { + *eax = 0; + *ebx = 0; + *ecx = 0; + *edx = 0; + } break; case 0xC0000000: *eax = env->cpuid_xlevel2; From patchwork Thu Oct 15 16:44:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 11839783 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E9EC1580 for ; Thu, 15 Oct 2020 16:53:18 +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 B06FF2068D for ; Thu, 15 Oct 2020 16:53:17 +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="FU5v6AMx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B06FF2068D 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:33948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6VA-0002qU-LU for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Oct 2020 12:53:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6NW-0004Ml-P0 for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29257) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT6NO-0000UV-Bs for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602780313; 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=9hb+1/7cb7CdrsmNglCj3VIi1UB0HDXrR2h+oR1OePk=; b=FU5v6AMxXDOzeFw0ZRoVKuDkGDGapCf0ewXxhXfyxeosWVvBFmzUyyOwYUpk4d+wapIin3 qJGf7vPdNlGsavSqnKLAnVdwyzitxd+YlfrR0KwkAwg9jo4kyW2J156zgJtjS5Ug/AeKfD 5ZajebccPLYq6m1oY48TIFPh7EdZgGo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-66-AtbkhMdxPvKNC3-kHmpyfQ-1; Thu, 15 Oct 2020 12:45:11 -0400 X-MC-Unique: AtbkhMdxPvKNC3-kHmpyfQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BA6A01921FA2; Thu, 15 Oct 2020 16:45:09 +0000 (UTC) Received: from localhost (ovpn-66-44.rdu2.redhat.com [10.10.66.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 81A136EF54; Thu, 15 Oct 2020 16:45:09 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 4/9] i386/kvm: Require KVM_CAP_IRQ_ROUTING Date: Thu, 15 Oct 2020 12:44:56 -0400 Message-Id: <20201015164501.462775-5-ehabkost@redhat.com> In-Reply-To: <20201015164501.462775-1-ehabkost@redhat.com> References: <20201015164501.462775-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 02:10:02 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Igor Mammedov , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" KVM_CAP_IRQ_ROUTING is available since 2009 (Linux v2.6.30), so it's safe to just make it a requirement on x86. Signed-off-by: Eduardo Habkost Acked-by: Paolo Bonzini Message-Id: <20200922201922.2153598-2-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- target/i386/kvm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 0098be7015..69c691ad77 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -2114,6 +2114,11 @@ int kvm_arch_init(MachineState *ms, KVMState *s) int ret; struct utsname utsname; + if (!kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) { + error_report("kvm: KVM_CAP_IRQ_ROUTING not supported by KVM"); + return -ENOTSUP; + } + has_xsave = kvm_check_extension(s, KVM_CAP_XSAVE); has_xcrs = kvm_check_extension(s, KVM_CAP_XCRS); has_pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2); From patchwork Thu Oct 15 16:44:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 11839817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A28C14B4 for ; Thu, 15 Oct 2020 16:57:06 +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 A317B2225D for ; Thu, 15 Oct 2020 16:57:05 +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="BW/nxDeD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A317B2225D 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:42320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6Yq-0006Zx-JH for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Oct 2020 12:57:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6Na-0004NT-Le for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT6NP-0000Ue-1Y for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602780313; 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=nWd4yB75Wt66mVlUSGrxHhIA1yEu4PJLln4W+/ohXyU=; b=BW/nxDeDSABjcCcqoG8z6VAquMo3Dcw5obWRM0raXW8aQNGEm+aZodABKriUTaPk0jxfsj Bt9CgGRE93d8CE51LKnAI4qmwILMyM6LqrD9v7yMDVnR6m9JBen1ieUlnb7M8+qkOIFx+o WoYJW88NN+N3wT/stM9yT2l/201GtQQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350-5v7_WUwVOFG1_c2zotQPNg-1; Thu, 15 Oct 2020 12:45:11 -0400 X-MC-Unique: 5v7_WUwVOFG1_c2zotQPNg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A8F6C107AFC6; Thu, 15 Oct 2020 16:45:10 +0000 (UTC) Received: from localhost (ovpn-66-44.rdu2.redhat.com [10.10.66.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7269C19C4F; Thu, 15 Oct 2020 16:45:10 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 5/9] i386/kvm: Remove IRQ routing support checks Date: Thu, 15 Oct 2020 12:44:57 -0400 Message-Id: <20201015164501.462775-6-ehabkost@redhat.com> In-Reply-To: <20201015164501.462775-1-ehabkost@redhat.com> References: <20201015164501.462775-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 02:10:02 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Igor Mammedov , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" KVM_CAP_IRQ_ROUTING is always available on x86, so replace checks for kvm_has_gsi_routing() and KVM_CAP_IRQ_ROUTING with asserts. Signed-off-by: Eduardo Habkost Acked-by: Paolo Bonzini Message-Id: <20200922201922.2153598-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/i386/kvm/apic.c | 5 ++--- hw/i386/kvm/ioapic.c | 33 ++++++++++++++++----------------- target/i386/kvm.c | 7 ------- 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/hw/i386/kvm/apic.c b/hw/i386/kvm/apic.c index 4eb2d77b87..dd29906061 100644 --- a/hw/i386/kvm/apic.c +++ b/hw/i386/kvm/apic.c @@ -225,9 +225,8 @@ static void kvm_apic_realize(DeviceState *dev, Error **errp) memory_region_init_io(&s->io_memory, OBJECT(s), &kvm_apic_io_ops, s, "kvm-apic-msi", APIC_SPACE_SIZE); - if (kvm_has_gsi_routing()) { - msi_nonbroken = true; - } + assert(kvm_has_gsi_routing()); + msi_nonbroken = true; } static void kvm_apic_unrealize(DeviceState *dev) diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c index c5528df942..dfc3c98005 100644 --- a/hw/i386/kvm/ioapic.c +++ b/hw/i386/kvm/ioapic.c @@ -25,27 +25,26 @@ void kvm_pc_setup_irq_routing(bool pci_enabled) KVMState *s = kvm_state; int i; - if (kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) { - for (i = 0; i < 8; ++i) { - if (i == 2) { - continue; - } - kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_MASTER, i); - } - for (i = 8; i < 16; ++i) { - kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8); + assert(kvm_has_gsi_routing()); + for (i = 0; i < 8; ++i) { + if (i == 2) { + continue; } - if (pci_enabled) { - for (i = 0; i < 24; ++i) { - if (i == 0) { - kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2); - } else if (i != 2) { - kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, i); - } + kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_MASTER, i); + } + for (i = 8; i < 16; ++i) { + kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8); + } + if (pci_enabled) { + for (i = 0; i < 24; ++i) { + if (i == 0) { + kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, 2); + } else if (i != 2) { + kvm_irqchip_add_irq_route(s, i, KVM_IRQCHIP_IOAPIC, i); } } - kvm_irqchip_commit_routes(s); } + kvm_irqchip_commit_routes(s); } typedef struct KVMIOAPICState KVMIOAPICState; diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 69c691ad77..588d893a63 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -4552,13 +4552,6 @@ bool kvm_arch_stop_on_emulation_error(CPUState *cs) void kvm_arch_init_irq_routing(KVMState *s) { - if (!kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) { - /* If kernel can't do irq routing, interrupt source - * override 0->2 cannot be set up as required by HPET. - * So we have to disable it. - */ - no_hpet = 1; - } /* We know at this point that we're using the in-kernel * irqchip, so we can use irqfds, and on x86 we know * we can use msi via irqfd and GSI routing. From patchwork Thu Oct 15 16:44:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 11839821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 24AC314B4 for ; Thu, 15 Oct 2020 16:58:31 +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 C2DCE206CA for ; Thu, 15 Oct 2020 16:58:30 +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="e9AD/VU1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2DCE206CA 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:50508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6aD-0001To-Mc for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Oct 2020 12:58:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6Nc-0004Nm-LQ for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:33799) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT6NR-0000XO-U7 for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602780317; 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=gGmqgei+Up8VgdSbIiXXnU58C7qtGxogY9pgtEwOVOA=; b=e9AD/VU1UtYGEgJbpb6CReO68MA0hNDQOgnU2XM2/bOdU/I9nXK95w5L1hCgkJ041gydT4 rIy0dER6s9eJKxSg3GnDs88nRV9AHsZrMuzH85ydf3eNXzuRMofDZPTZ3r2FJWYfmSJhgQ bcxzmGkuC16W8l6LWj7uMlsTO9TwATQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-jdAFo9-hMkaHUpdIk_FZhg-1; Thu, 15 Oct 2020 12:45:12 -0400 X-MC-Unique: jdAFo9-hMkaHUpdIk_FZhg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8991A1007470; Thu, 15 Oct 2020 16:45:11 +0000 (UTC) Received: from localhost (ovpn-66-44.rdu2.redhat.com [10.10.66.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5705A5D9D5; Thu, 15 Oct 2020 16:45:11 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 6/9] i386/kvm: Delete kvm_allows_irq0_override() Date: Thu, 15 Oct 2020 12:44:58 -0400 Message-Id: <20201015164501.462775-7-ehabkost@redhat.com> In-Reply-To: <20201015164501.462775-1-ehabkost@redhat.com> References: <20201015164501.462775-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 02:10:02 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Igor Mammedov , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As IRQ routing is always available on x86, kvm_allows_irq0_override() will always return true, so we don't need the function anymore. Signed-off-by: Eduardo Habkost Acked-by: Paolo Bonzini Message-Id: <20200922201922.2153598-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- target/i386/kvm_i386.h | 1 - hw/i386/fw_cfg.c | 2 +- hw/i386/microvm.c | 2 +- hw/i386/pc.c | 2 +- target/i386/kvm-stub.c | 5 ----- target/i386/kvm.c | 5 ----- 6 files changed, 3 insertions(+), 14 deletions(-) diff --git a/target/i386/kvm_i386.h b/target/i386/kvm_i386.h index 0fce4e51d2..a4a619cebb 100644 --- a/target/i386/kvm_i386.h +++ b/target/i386/kvm_i386.h @@ -32,7 +32,6 @@ #endif /* CONFIG_KVM */ -bool kvm_allows_irq0_override(void); bool kvm_has_smm(void); bool kvm_has_adjust_clock(void); bool kvm_has_adjust_clock_stable(void); diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index 33441ad484..e06579490c 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -123,7 +123,7 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms, fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES, acpi_tables, acpi_tables_len); #endif - fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override()); + fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, 1); fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE, &e820_reserve, sizeof(e820_reserve)); diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 73a7a142b4..68a7f424ac 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -290,7 +290,7 @@ static void microvm_memory_init(MicrovmMachineState *mms) fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, machine->smp.max_cpus); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); - fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override()); + fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, 1); fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE, &e820_reserve, sizeof(e820_reserve)); fw_cfg_add_file(fw_cfg, "etc/e820", e820_table, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e87be5d29a..4e323755d0 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -827,7 +827,7 @@ void pc_guest_info_init(PCMachineState *pcms) MachineState *ms = MACHINE(pcms); X86MachineState *x86ms = X86_MACHINE(pcms); - x86ms->apic_xrupt_override = kvm_allows_irq0_override(); + x86ms->apic_xrupt_override = true; pcms->numa_nodes = ms->numa_state->num_nodes; pcms->node_mem = g_malloc0(pcms->numa_nodes * sizeof *pcms->node_mem); diff --git a/target/i386/kvm-stub.c b/target/i386/kvm-stub.c index 872ef7df4c..92f49121b8 100644 --- a/target/i386/kvm-stub.c +++ b/target/i386/kvm-stub.c @@ -13,11 +13,6 @@ #include "cpu.h" #include "kvm_i386.h" -bool kvm_allows_irq0_override(void) -{ - return 1; -} - #ifndef __OPTIMIZE__ bool kvm_has_smm(void) { diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 588d893a63..cf46259534 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -154,11 +154,6 @@ bool kvm_has_exception_payload(void) return has_exception_payload; } -bool kvm_allows_irq0_override(void) -{ - return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing(); -} - static bool kvm_x2apic_api_set_flags(uint64_t flags) { KVMState *s = KVM_STATE(current_accel()); From patchwork Thu Oct 15 16:44:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 11839777 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6F4914B4 for ; Thu, 15 Oct 2020 16:50:10 +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 4F9CE22240 for ; Thu, 15 Oct 2020 16:50:10 +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="fJ9UnK2n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F9CE22240 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:55646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6S9-0008Ln-6l for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Oct 2020 12:50:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6Ne-0004OM-Mc for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT6NR-0000XE-TT for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602780316; 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=sCDuD6H6MJD1t3wMyUJdOcMIiE41OOWS2VG/S+mOCY4=; b=fJ9UnK2naFxZ1EdACrB6T/G0/A2RrT1b31ZaGYt+3N17P7m1zqceKI8UdtVcPHtuWHcVlZ w8lg1wZYoiah/ABR336eT2XKRSFHKMDPIliACcmHuF71V3GYEFarykhZJJAxNGIfL/ObsB KpPg7tmzNphQ+/vUz54QonTs2v1Bmyo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-154-i6B9MYqHPxGBbOjANKJu9g-1; Thu, 15 Oct 2020 12:45:13 -0400 X-MC-Unique: i6B9MYqHPxGBbOjANKJu9g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8335356B56; Thu, 15 Oct 2020 16:45:12 +0000 (UTC) Received: from localhost (ovpn-66-44.rdu2.redhat.com [10.10.66.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4442C5C1BD; Thu, 15 Oct 2020 16:45:12 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 7/9] kvm: Correct documentation of kvm_irqchip_*() Date: Thu, 15 Oct 2020 12:44:59 -0400 Message-Id: <20201015164501.462775-8-ehabkost@redhat.com> In-Reply-To: <20201015164501.462775-1-ehabkost@redhat.com> References: <20201015164501.462775-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 02:10:02 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Igor Mammedov , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" When split irqchip support was introduced, the meaning of kvm_irqchip_in_kernel() changed: now it only means the LAPIC is in kernel. The PIC, IOAPIC, and PIT might be in userspace if irqchip=split was set. Update the doc comment to reflect that. While at it, remove the "the user asked us" part in kvm_irqchip_is_split() doc comment. That macro has nothing to do with existence of explicit user-provided options. Signed-off-by: Eduardo Habkost Acked-by: Paolo Bonzini Message-Id: <20200922203612.2178370-1-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/sysemu/kvm.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index fe7dab1466..bb5d5cf497 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -51,23 +51,22 @@ extern bool kvm_msi_use_devid; /** * kvm_irqchip_in_kernel: * - * Returns: true if the user asked us to create an in-kernel - * irqchip via the "kernel_irqchip=on" machine option. + * Returns: true if an in-kernel irqchip was created. * What this actually means is architecture and machine model - * specific: on PC, for instance, it means that the LAPIC, - * IOAPIC and PIT are all in kernel. This function should never - * be used from generic target-independent code: use one of the - * following functions or some other specific check instead. + * specific: on PC, for instance, it means that the LAPIC + * is in kernel. This function should never be used from generic + * target-independent code: use one of the following functions or + * some other specific check instead. */ #define kvm_irqchip_in_kernel() (kvm_kernel_irqchip) /** * kvm_irqchip_is_split: * - * Returns: true if the user asked us to split the irqchip - * implementation between user and kernel space. The details are - * architecture and machine specific. On PC, it means that the PIC, - * IOAPIC, and PIT are in user space while the LAPIC is in the kernel. + * Returns: true if the irqchip implementation is split between + * user and kernel space. The details are architecture and + * machine specific. On PC, it means that the PIC, IOAPIC, and + * PIT are in user space while the LAPIC is in the kernel. */ #define kvm_irqchip_is_split() (kvm_split_irqchip) From patchwork Thu Oct 15 16:45:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 11839781 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B34414B4 for ; Thu, 15 Oct 2020 16:53:16 +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 BAC0C2068D for ; Thu, 15 Oct 2020 16:53:15 +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="Fvjopy16" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAC0C2068D 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:33766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6V8-0002ls-LG for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Oct 2020 12:53:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6Na-0004NU-MG for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:31297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT6NR-0000XL-Tr for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602780316; 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=Dml4u4hzBMkhrKuVpNMnp+Qa3nDbJZGUvC7br4Ju0N0=; b=Fvjopy16reUL1ytzNf4YgtWjL+JgQEHBzsyLJCV8ZGVidELU6S9RW8mtENBrO47J5ZJ4uA Yfu0++tBryMrbZgaXytFKvM7+FZ1MDSdQu0Rql/lhz7sRCV8ng6sOdK6O+UQUmXqOKsWSM bCdo+rHeQq6GsXRdQqnvvu0ewTxA+h4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-550-29PkpWkCOnONas_RomBwDw-1; Thu, 15 Oct 2020 12:45:14 -0400 X-MC-Unique: 29PkpWkCOnONas_RomBwDw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F6821074665; Thu, 15 Oct 2020 16:45:13 +0000 (UTC) Received: from localhost (ovpn-66-44.rdu2.redhat.com [10.10.66.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BE6476673; Thu, 15 Oct 2020 16:45:13 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 8/9] cpu: Introduce CPU model deprecation API Date: Thu, 15 Oct 2020 12:45:00 -0400 Message-Id: <20201015164501.462775-9-ehabkost@redhat.com> In-Reply-To: <20201015164501.462775-1-ehabkost@redhat.com> References: <20201015164501.462775-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 02:10:02 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Igor Mammedov , Robert Hoo , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Robert Hoo Implement the ability of marking some versions deprecated. When that CPU model is chosen, print a warning. The warning message can be customized, e.g. suggesting an alternative CPU model to be used instead. The deprecation message will be printed by x86_cpu_list_entry(), e.g. '-cpu help'. QMP command 'query-cpu-definitions' will return a bool value indicating the deprecation status. Signed-off-by: Robert Hoo Message-Id: <1600758855-80046-1-git-send-email-robert.hu@linux.intel.com> [ehabkost: reword commit message] [ehabkost: Handle NULL cpu_type] Signed-off-by: Eduardo Habkost --- qapi/machine-target.json | 7 ++++++- include/hw/core/cpu.h | 3 +++ hw/core/machine.c | 12 ++++++++++-- target/i386/cpu.c | 8 ++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine-target.json index 698850cc78..fec3bb8679 100644 --- a/qapi/machine-target.json +++ b/qapi/machine-target.json @@ -286,6 +286,10 @@ # in the VM configuration, because aliases may stop being # migration-safe in the future (since 4.1) # +# @deprecated: If true, this CPU model is deprecated and may be removed in +# in some future version of QEMU according to the QEMU deprecation +# policy. (since 5.2) +# # @unavailable-features is a list of QOM property names that # represent CPU model attributes that prevent the CPU from running. # If the QOM property is read-only, that means there's no known @@ -310,7 +314,8 @@ 'static': 'bool', '*unavailable-features': [ 'str' ], 'typename': 'str', - '*alias-of' : 'str' }, + '*alias-of' : 'str', + 'deprecated' : 'bool' }, 'if': 'defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386) || defined(TARGET_S390X) || defined(TARGET_MIPS)' } ## diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 4879f25026..9c3a45ad7b 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -155,6 +155,8 @@ struct TranslationBlock; * @disas_set_info: Setup architecture specific components of disassembly info * @adjust_watchpoint_address: Perform a target-specific adjustment to an * address before attempting to match it against watchpoints. + * @deprecation_note: If this CPUClass is deprecated, this field provides + * related information. * * Represents a CPU family or model. */ @@ -221,6 +223,7 @@ struct CPUClass { vaddr (*adjust_watchpoint_address)(CPUState *cpu, vaddr addr, int len); void (*tcg_initialize)(void); + const char *deprecation_note; /* Keep non-pointer data at the end to minimize holes. */ int gdb_num_core_regs; bool gdb_stop_before_watchpoint; diff --git a/hw/core/machine.c b/hw/core/machine.c index 7e2f4ec08e..d740a7e963 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1087,6 +1087,8 @@ MemoryRegion *machine_consume_memdev(MachineState *machine, void machine_run_board_init(MachineState *machine) { MachineClass *machine_class = MACHINE_GET_CLASS(machine); + ObjectClass *oc = object_class_by_name(machine->cpu_type); + CPUClass *cc; if (machine->ram_memdev_id) { Object *o; @@ -1106,11 +1108,10 @@ void machine_run_board_init(MachineState *machine) * specified a CPU with -cpu check here that the user CPU is supported. */ if (machine_class->valid_cpu_types && machine->cpu_type) { - ObjectClass *class = object_class_by_name(machine->cpu_type); int i; for (i = 0; machine_class->valid_cpu_types[i]; i++) { - if (object_class_dynamic_cast(class, + if (object_class_dynamic_cast(oc, machine_class->valid_cpu_types[i])) { /* The user specificed CPU is in the valid field, we are * good to go. @@ -1133,6 +1134,13 @@ void machine_run_board_init(MachineState *machine) } } + /* Check if CPU type is deprecated and warn if so */ + cc = CPU_CLASS(oc); + if (cc && cc->deprecation_note) { + warn_report("CPU model %s is deprecated -- %s", machine->cpu_type, + cc->deprecation_note); + } + machine_class->init(machine); } diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 25ec64124e..2e3ee41c56 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1633,6 +1633,7 @@ typedef struct X86CPUDefinition { * If NULL, version 1 will be registered automatically. */ const X86CPUVersionDefinition *versions; + const char *deprecation_note; } X86CPUDefinition; /* Reference to a specific CPU model version */ @@ -4990,6 +4991,11 @@ static void x86_cpu_definition_entry(gpointer data, gpointer user_data) info->migration_safe = cc->migration_safe; info->has_migration_safe = true; info->q_static = cc->static_model; + if (cc->model && cc->model->cpudef->deprecation_note) { + info->deprecated = true; + } else { + info->deprecated = false; + } /* * Old machine types won't report aliases, so that alias translation * doesn't break compatibility with previous QEMU versions. @@ -5380,9 +5386,11 @@ static void x86_cpu_cpudef_class_init(ObjectClass *oc, void *data) { X86CPUModel *model = data; X86CPUClass *xcc = X86_CPU_CLASS(oc); + CPUClass *cc = CPU_CLASS(oc); xcc->model = model; xcc->migration_safe = true; + cc->deprecation_note = model->cpudef->deprecation_note; } static void x86_register_cpu_model_type(const char *name, X86CPUModel *model) From patchwork Thu Oct 15 16:45:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 11839785 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 772C314B4 for ; Thu, 15 Oct 2020 16:53:25 +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 D3AA62068D for ; Thu, 15 Oct 2020 16:53:24 +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="GwTT6wQ0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3AA62068D 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT6VH-0002so-GR for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Oct 2020 12:53:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT6Ng-0004Of-L6 for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kT6NZ-0000aO-Kg for qemu-devel@nongnu.org; Thu, 15 Oct 2020 12:45:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602780321; 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=Yf9rGomi4LHyASEleBQ5pCAugrkXHIE2Bvx640kQbiM=; b=GwTT6wQ0jCb8ak0yfmUSZZk9UPJm/hHESoYrb2l4Z2u9JH8kKiuqKASI+Qn63ORk1hO0Kq aN0bRkgRb9O7NoSYf4pwQHvXFhUP1a9xo/qiUeg+b+L04qIrW2+20lA7SdsP+R8GQdCCQV l+vZikfVeJbzdh1n+RU1jCAdY4wsqjA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-356-MXd1RyhFPtqS55lAV1Hdtg-1; Thu, 15 Oct 2020 12:45:16 -0400 X-MC-Unique: MXd1RyhFPtqS55lAV1Hdtg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9347F8D4420; Thu, 15 Oct 2020 16:45:14 +0000 (UTC) Received: from localhost (ovpn-66-44.rdu2.redhat.com [10.10.66.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 368D96EF68; Thu, 15 Oct 2020 16:45:14 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 9/9] i386: Mark Icelake-Client CPU models deprecated Date: Thu, 15 Oct 2020 12:45:01 -0400 Message-Id: <20201015164501.462775-10-ehabkost@redhat.com> In-Reply-To: <20201015164501.462775-1-ehabkost@redhat.com> References: <20201015164501.462775-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 02:10:02 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Igor Mammedov , Robert Hoo , Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Robert Hoo Icelake-Client CPU models will be removed in the future. Signed-off-by: Robert Hoo Message-Id: <1600758855-80046-2-git-send-email-robert.hu@linux.intel.com> [ehabkost: reword deprecation note, fix version in doc] Signed-off-by: Eduardo Habkost --- docs/system/deprecated.rst | 6 ++++++ target/i386/cpu.c | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index 09ec8b1ae8..21d122c49a 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -314,6 +314,12 @@ a future version of QEMU. Support for this CPU was removed from the upstream Linux kernel, and there is no available upstream toolchain to build binaries for it. +``Icelake-Client`` CPU Model (since 5.2.0) +'''''''''''''''''''''''''''''''''''''''''' + +``Icelake-Client`` CPU Models are deprecated. Use ``Icelake-Server`` CPU +Models instead. + System emulator devices ----------------------- diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 2e3ee41c56..576746d763 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3358,10 +3358,13 @@ static X86CPUDefinition builtin_x86_defs[] = { .xlevel = 0x80000008, .model_id = "Intel Core Processor (Icelake)", .versions = (X86CPUVersionDefinition[]) { - { .version = 1 }, + { + .version = 1, + .note = "deprecated" + }, { .version = 2, - .note = "no TSX", + .note = "no TSX, deprecated", .alias = "Icelake-Client-noTSX", .props = (PropValue[]) { { "hle", "off" }, @@ -3370,7 +3373,8 @@ static X86CPUDefinition builtin_x86_defs[] = { }, }, { /* end of list */ } - } + }, + .deprecation_note = "use Icelake-Server instead" }, { .name = "Icelake-Server",