From nobody Wed Nov 27 19:35:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697647153; cv=none; d=zohomail.com; s=zohoarc; b=P3AL/GBtagLLT4HoJlrfpP0B7tNJmDbOr1gvyVWhQvapuDTM0ubnmK+YHgY6IJJtU/yxsJ3UcghG2Cc+gjW4X5G/WKV8uD1jvs0A4UfUHwVnMlQfysPWHj5G3UYl8uP0kMl2HBem9bJ7/rnb2eqJQVV+it80rpDE+NRfVN9Y1Cw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697647153; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=duiHUT8st5eyEW1wOxW61bUKxv0U4vv/DGWXwswcz+Y=; b=SnPBz7pjrd3oByJicX9Lh+EZhANshfoMdJquZHl8o9jjtYImg1OawRu2l3uSqcKGsbXtGmdyuRj2ObzUXwscYNvpHDhnssnMBYOA3knuby5x2APFi7P6rrcfEJtgXZy+a4bBVE91LGAUmEqSof8eOHrjsix7nBAbfYo6SyfoPCk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697647153505130.6520830618456; Wed, 18 Oct 2023 09:39:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt9Z5-0001m0-SB; Wed, 18 Oct 2023 12:38:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt9Yj-0001OY-Sy for qemu-devel@nongnu.org; Wed, 18 Oct 2023 12:38:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt9Yi-0007QG-Eg for qemu-devel@nongnu.org; Wed, 18 Oct 2023 12:38:13 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-570-hXoO9FBZPnG6eAAH5uppjw-1; Wed, 18 Oct 2023 12:37:54 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-993eeb3a950so471041166b.2 for ; Wed, 18 Oct 2023 09:37:54 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id z9-20020a1709063a0900b009c758b6cdefsm261859eje.128.2023.10.18.09.37.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 09:37:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697647091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=duiHUT8st5eyEW1wOxW61bUKxv0U4vv/DGWXwswcz+Y=; b=ZuqeB/lAD43N8nqeIYjjW/AGloHTu3+KQi5IB5LHnK9PUzHXWG6eHTcEODYLb+6o1EkvEy 8ePwmzT4pTVoVjUCWcCloaxwbt4c5Aa3IQwP7wDp3NZMCRtvVPtAIyU0zrZ4PpfScBaSAB fFh9FJgLFmadOBP83RoGNu2Eyhyr80k= X-MC-Unique: hXoO9FBZPnG6eAAH5uppjw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697647073; x=1698251873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=duiHUT8st5eyEW1wOxW61bUKxv0U4vv/DGWXwswcz+Y=; b=ObVsuHWI6LzVljuWmOT37XEsiqA+gODjrhUF4B9fLRmHY0Xu1JNXzqfewCetggyn0L aXJKBS3oOlAKG+KyAu36VFuqIqLSERGM9CNBFuCe1zRo4PgE712D/HZGYjnlxL7hjJ7K HGxfcnhtJIfz6jZXyAuQNiuILsYTTWsC/8/Zn2I4D2migsAH/iT1HEVItQqjtEJc3uKl txh9LzsBWPdqVcdRDghiZps4V7sABJogv9w2U/KPH/nx5bPJNjSAyYYT1IW7Be2Mr2GR 4eb1L4swdpCKheb2FEdhz/fLq3Yk3WokzXzbT6TOrn47PsHhJQb2OrDNyheK5fOSi6s+ A1SQ== X-Gm-Message-State: AOJu0YwOR2aArq5v53C02DNNrKDhAoG3yUQFpT+gHS+bFECd5YGTXfcB 7htHU2LJMyc/NDizo+ITG3yVBQnipoBnsD+WezqmALSr4gzS4BNhGMRLfJ8L85fD9EhiqK7aDkC NtDQ+WYtdT1cgKDmn4NHWQz0Aq44Yz1d50lcciY/T9BFjnbIbMWu/o1MhLWtoF5LDTJ2o6d+wnj M= X-Received: by 2002:a17:906:ee86:b0:9be:cdca:dae9 with SMTP id wt6-20020a170906ee8600b009becdcadae9mr4589168ejb.36.1697647072919; Wed, 18 Oct 2023 09:37:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEV1tOGmBtg6EPRNfybbGe8bXWdinz3Zno8piiSpInItRhmqoeLYg47+FGFneRKOK6IZTXw8g== X-Received: by 2002:a17:906:ee86:b0:9be:cdca:dae9 with SMTP id wt6-20020a170906ee8600b009becdcadae9mr4589150ejb.36.1697647072474; Wed, 18 Oct 2023 09:37:52 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 11/17] kvm: i386: require KVM_CAP_DEBUGREGS Date: Wed, 18 Oct 2023 18:37:22 +0200 Message-ID: <20231018163728.363879-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018163728.363879-1-pbonzini@redhat.com> References: <20231018163728.363879-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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_H3=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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697647154565100003 Content-Type: text/plain; charset="utf-8" This was introduced in KVM in Linux 2.6.35, we can require it unconditional= ly. Signed-off-by: Paolo Bonzini --- accel/kvm/kvm-all.c | 9 --------- include/sysemu/kvm.h | 1 - include/sysemu/kvm_int.h | 1 - target/i386/kvm/kvm.c | 9 +-------- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index b59a48da924..aeda902b3e9 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2528,10 +2528,6 @@ static int kvm_init(MachineState *ms) s->robust_singlestep =3D kvm_check_extension(s, KVM_CAP_X86_ROBUST_SINGLESTEP); =20 -#ifdef KVM_CAP_DEBUGREGS - s->debugregs =3D kvm_check_extension(s, KVM_CAP_DEBUGREGS); -#endif - s->max_nested_state_len =3D kvm_check_extension(s, KVM_CAP_NESTED_STAT= E); =20 s->irq_set_ioctl =3D KVM_IRQ_LINE; @@ -3152,11 +3148,6 @@ int kvm_has_robust_singlestep(void) return kvm_state->robust_singlestep; } =20 -int kvm_has_debugregs(void) -{ - return kvm_state->debugregs; -} - int kvm_max_nested_state_length(void) { return kvm_state->max_nested_state_len; diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index c06982fd64c..16fddeef663 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -192,7 +192,6 @@ unsigned int kvm_get_free_memslots(void); bool kvm_has_sync_mmu(void); int kvm_has_vcpu_events(void); int kvm_has_robust_singlestep(void); -int kvm_has_debugregs(void); int kvm_max_nested_state_length(void); int kvm_has_gsi_routing(void); =20 diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h index 840b905a2e9..151ecc84233 100644 --- a/include/sysemu/kvm_int.h +++ b/include/sysemu/kvm_int.h @@ -79,7 +79,6 @@ struct KVMState bool coalesced_flush_in_progress; int vcpu_events; int robust_singlestep; - int debugregs; #ifdef KVM_CAP_SET_GUEST_DEBUG QTAILQ_HEAD(, kvm_sw_breakpoint) kvm_sw_breakpoints; #endif diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 91dd43eaa9b..86af39c437a 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -93,6 +93,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = =3D { KVM_CAP_INFO(MP_STATE), KVM_CAP_INFO(SIGNAL_MSI), KVM_CAP_INFO(IRQ_ROUTING), + KVM_CAP_INFO(DEBUGREGS), KVM_CAP_LAST_INFO }; =20 @@ -4601,10 +4602,6 @@ static int kvm_put_debugregs(X86CPU *cpu) struct kvm_debugregs dbgregs; int i; =20 - if (!kvm_has_debugregs()) { - return 0; - } - memset(&dbgregs, 0, sizeof(dbgregs)); for (i =3D 0; i < 4; i++) { dbgregs.db[i] =3D env->dr[i]; @@ -4622,10 +4619,6 @@ static int kvm_get_debugregs(X86CPU *cpu) struct kvm_debugregs dbgregs; int i, ret; =20 - if (!kvm_has_debugregs()) { - return 0; - } - ret =3D kvm_vcpu_ioctl(CPU(cpu), KVM_GET_DEBUGREGS, &dbgregs); if (ret < 0) { return ret; --=20 2.41.0