From nobody Wed Nov 27 15:49:46 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=1698276570; cv=none; d=zohomail.com; s=zohoarc; b=dojLAfXOctUvVv3HZRCIaJOCpcUtMn2xIQS7zdIpsvzmEgBIRXXFOVbfU2aTGO2gbR15tZEyTkqloow3rvRKKg4scutLDZ+bC849kM/97TibxPGxdnHEQtkkDtwVqplI96SztIJ8SSodGC71HctrnS1yZdrwWrwhIdlqFM1zwS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698276570; 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=FMmrenvtAKAEB/AkfeeWMbQ57rrPYZxDXMhbNc53l7U=; b=hIFyP9+kyh5tDhMD12I6ovtebrjqi9unnImRkEdxBXU5zlDTrcaKMUQnEQfKvBh7TnOcKT/YA8wAIHJL5dFDtKdYvYK7q3Uo8grmf1KYDTHAOSYmAKw9xoyRmUCw1MWnnxst8gylIDjL84smi2uXFbgf89256CfYwbLU6WYWN2c= 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 1698276570054281.96172609800533; Wed, 25 Oct 2023 16:29:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvnI9-0001ib-BH; Wed, 25 Oct 2023 19:28:01 -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 1qvnI7-0001hd-Ji for qemu-devel@nongnu.org; Wed, 25 Oct 2023 19:27:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvnI5-0005IS-RL for qemu-devel@nongnu.org; Wed, 25 Oct 2023 19:27:59 -0400 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-W99JxP81MySasxUq4bo56A-1; Wed, 25 Oct 2023 19:27:55 -0400 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-77892f2ee51so52671285a.1 for ; Wed, 25 Oct 2023 16:27:55 -0700 (PDT) Received: from [172.19.0.201] ([192.80.84.35]) by smtp.gmail.com with ESMTPSA id k22-20020a05620a143600b00774350813ccsm4557318qkj.118.2023.10.25.16.27.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 16:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698276476; 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=FMmrenvtAKAEB/AkfeeWMbQ57rrPYZxDXMhbNc53l7U=; b=VJjbuTbdiEzw7COxl6WXBzk9j5Rf9NuRvgEJxmIpVjUxj09hx/2JC+0P5/Xi6kaDNUcBep AH2IjeC2G2bHwmb42zGmC+V+04Vd1Hs3L6x9mZyL7TUudH5EUvS6EUhMEAzvX+LvK9OUe2 u0/igBV6FSJXEfiLuLza+NQ1xI/22Ik= X-MC-Unique: W99JxP81MySasxUq4bo56A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698276474; x=1698881274; 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=FMmrenvtAKAEB/AkfeeWMbQ57rrPYZxDXMhbNc53l7U=; b=AUyyDRSiLZ1VPk6CqWiBeVY1dPm6w9m7QWeFSmkg8RIJ2U59aFgtooznfwJaIz1QCv /+rb0mvDw1PvbqCCRpDXeN9x0mEyBf0oRuktnejZSK123/DMcmi7f6X0PW6IqKWnQkx/ 5YCwBZaRnQIdMvGp72EhfqxCLuDCG/AxViTIZeMdJNOyC7GgQL3HR7VUM6CQ88rVDRQF bC3jtCoV6KS5WZv7Qg5fWslGlMEhunTpYZBIvafwszPk2zmFHOxm+I5sCOOI2TpaP4lC yfHV871oamqZHFzMfa8PtJ2ySqxFy/rqF+wL1Uej09ArJJwWwhwcrfsmphRln3l85cgb n68w== X-Gm-Message-State: AOJu0YyvZzdeNVK4OZ2VjqgUUXbQlcXzZQe8FmghEzwnVyYmlFon77P6 x7APH0+GFL6LYypDbGp9yTFh+Bdv2GpqP+6z+hCfjg9RhAvIj7bcJaQf5mZfOfx/8MbkQwv2goa S/O3+7DBV0K1ArpvXTYEMQxWqHRQhbl3IiSHS8k6aPdNWaPn7SmV6Zkh6vG3uoUSQm6Gy01WpFQ 8= X-Received: by 2002:a05:622a:386:b0:41e:23fc:a040 with SMTP id j6-20020a05622a038600b0041e23fca040mr9908377qtx.56.1698276474253; Wed, 25 Oct 2023 16:27:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQrLCemwJz8NGSSVcvGQUDs1MU/tbZAvn2NuIqbB4ZeT9fPDTn2cO8xaWplvn969IKxgw+rQ== X-Received: by 2002:a05:622a:386:b0:41e:23fc:a040 with SMTP id j6-20020a05622a038600b0041e23fca040mr9908362qtx.56.1698276473899; Wed, 25 Oct 2023 16:27:53 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 18/24] kvm: i386: require KVM_CAP_DEBUGREGS Date: Thu, 26 Oct 2023 01:27:11 +0200 Message-ID: <20231025232718.89428-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231025232718.89428-1-pbonzini@redhat.com> References: <20231025232718.89428-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.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 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, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: 1698276571891100002 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 31c03cc1932..02c031d1f29 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -193,7 +193,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 94b2516c29f..b8fb74d7f17 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