From nobody Mon Jun 22 18:10:59 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A637BC433EF for ; Fri, 18 Mar 2022 16:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239262AbiCRQbY (ORCPT ); Fri, 18 Mar 2022 12:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231670AbiCRQbA (ORCPT ); Fri, 18 Mar 2022 12:31:00 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C0860DCB for ; Fri, 18 Mar 2022 09:29:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647620980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+IVUPPBkNn1zz7F/vU3QF00X14AGPypfULKyha54TtU=; b=OCHKVyOgFBd9FPoQiMfTJIp8a/Zk/Nwf1J0IhT+1w0da7EaKW4R7pdrCfZ/YPwDyeRl8XG DaoGagIJaYUsQM6PEPpJ5Dd9GDB+tP/NJqBBo5d6hT/rX9BHPxUG6BMXRa4tte2GvWTG9+ YfN/qYQHw0GuXSb1QCVU49DMWBrBGyE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-214-S-5SUzoGNEi8pl1jWhlO7A-1; Fri, 18 Mar 2022 12:29:37 -0400 X-MC-Unique: S-5SUzoGNEi8pl1jWhlO7A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4F05A85A5BC; Fri, 18 Mar 2022 16:29:37 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 315A6404D8FE; Fri, 18 Mar 2022 16:29:37 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: mlevitsk@redhat.com Subject: [PATCH] KVM: x86: do not use KVM_X86_OP_OPTIONAL_RET0 for get_mt_mask Date: Fri, 18 Mar 2022 12:29:37 -0400 Message-Id: <20220318162937.2741151-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Maxim Levitsky KVM_X86_OP_OPTIONAL_RET0 can only be used with 32-bit return values on 32-b= it systems, because unsigned long is only 32-bits wide there and 64-bit values are returned in edx:eax. Reported-by: Maxim Levitsky Signed-off-by: Paolo Bonzini --- arch/x86/include/asm/kvm-x86-ops.h | 2 +- arch/x86/kvm/svm/svm.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/kvm-x86-ops.h b/arch/x86/include/asm/kvm-= x86-ops.h index 29affccb353c..3c368b639c04 100644 --- a/arch/x86/include/asm/kvm-x86-ops.h +++ b/arch/x86/include/asm/kvm-x86-ops.h @@ -87,7 +87,7 @@ KVM_X86_OP(deliver_interrupt) KVM_X86_OP_OPTIONAL(sync_pir_to_irr) KVM_X86_OP_OPTIONAL_RET0(set_tss_addr) KVM_X86_OP_OPTIONAL_RET0(set_identity_map_addr) -KVM_X86_OP_OPTIONAL_RET0(get_mt_mask) +KVM_X86_OP(get_mt_mask) KVM_X86_OP(load_mmu_pgd) KVM_X86_OP(has_wbinvd_exit) KVM_X86_OP(get_l2_tsc_offset) diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index fc5222a0f506..0884c3414a1b 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -3939,6 +3939,11 @@ static bool svm_has_emulated_msr(struct kvm *kvm, u3= 2 index) return true; } =20 +static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio) +{ + return 0; +} + static void svm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu) { struct vcpu_svm *svm =3D to_svm(vcpu); @@ -4593,6 +4598,7 @@ static struct kvm_x86_ops svm_x86_ops __initdata =3D { .check_apicv_inhibit_reasons =3D avic_check_apicv_inhibit_reasons, .apicv_post_state_restore =3D avic_apicv_post_state_restore, =20 + .get_mt_mask =3D svm_get_mt_mask, .get_exit_info =3D svm_get_exit_info, =20 .vcpu_after_set_cpuid =3D svm_vcpu_after_set_cpuid, --=20 2.31.1