Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4721378iob; Sun, 8 May 2022 23:14:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl/5gX3cdT8FzoLhqDs8TXMgODTpvEREj3YrkrhHxS43M/CqFo9IDuhMJVezSodEZs0Rkc X-Received: by 2002:a65:6217:0:b0:3c6:1571:b971 with SMTP id d23-20020a656217000000b003c61571b971mr12122771pgv.124.1652076842786; Sun, 08 May 2022 23:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652076842; cv=none; d=google.com; s=arc-20160816; b=Sj6yqNesmh/+Dty5sFAUrRPdlyGX7eyQKV55exKdNBzkq1/h5Ph+2+ZRtmz+cfbt/O xiwJ3gw789K/+ctaFymXh8zJy+1AQCpg4SfYuhXkrG+DG+ni9PhJMOhdeYdxCIN88JQV oueFfs5Avz8MkdVVL07/aXeZWraqsCRcZYtYm04UvJcRB8AX55pDHzqx89dyjHsSF1hx m9Wn/Shhk5tkTDN/y7iIWKNQ74z3W6JP4xK+IvZJy7rCLDbgHcKPSn/xjYiH73WaKEug 18D9nS6T9yCHTtZLD54HJ5BF6AQyz9AlzGEqqbtLDNLTZp2O2+TIxljxLChpTLtnNEaR aqQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UFNQ+xMyW8+Igq0cBb6h2WTQ7FXyNCERH3BWOZ6PymE=; b=IblVE1HwtgJmkd0EmJH6Rdlb75Dj/e1i7yPwv2y56xyEOt09gHPHfmuBbmNP4rLVFN FynPTAqeOvft9s8sRYihjfAv8s1CR5pz97J2y8rUACfMYOcyUHU6iUISzGwuESMfOdkn etmUsUc5MVzuz6f6AXsfzhP9s5mwD0nV9Sz2MRaV9SkGPbEGe9oqn46RbKjPkXarrQ9w ZztUiYDZNstvVjt/o9FNADSwlJosvT0hlcYBA61XlfnECzaioiXvNOelwqv88ULnOklS 4TnpKu64m2Fvln6mcUcJOqNJA16ybHXuQXCO7bk7rBmZcSNyAGWjGWUJSN+lot87PzO3 UEBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PyS7vwml; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w6-20020a056a0014c600b0050d471105afsi15055345pfu.326.2022.05.08.23.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:14:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PyS7vwml; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D2CD216C5DC; Sun, 8 May 2022 23:13:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383225AbiEESTp (ORCPT + 99 others); Thu, 5 May 2022 14:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383071AbiEESTX (ORCPT ); Thu, 5 May 2022 14:19:23 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8C971117B; Thu, 5 May 2022 11:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651774543; x=1683310543; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DF2YmHbo2UpGtex9X0UYIzKWr6u+VFipK67sZ4vSZkM=; b=PyS7vwmlFSZJAsJ/ZogvCqRNameyPqUBNBB53TK1869q2Cle6CpTnvYR RTHXkDw54eR6GzaL0C3f5OTwK4eF9aFaJQ5XO+IOJhf+cp5GZ5nENdxDu RsFW7Bx2u5baPXyD4RwaHrzz/S2WA8qqMcUwrcpl3icH8KI5ihZjQ/LQv BQfCjCdcimhStCIdb0/bg0OYlIvZFeiMySSEJAtwLHufqMlQvrZmNVwKK cb+mgk3nJLBk6r5yPV7Pk7bEqs650SsNa50qJrUMdHXeLfaf59uGPP4db 8P+9MG0AR0irFll7llVvIyXzmWin++6GfURndmfvzJ9axQSZ2X1vqN/OB Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="265800737" X-IronPort-AV: E=Sophos;i="5.91,202,1647327600"; d="scan'208";a="265800737" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 11:15:43 -0700 X-IronPort-AV: E=Sophos;i="5.91,202,1647327600"; d="scan'208";a="665083216" Received: from ls.sc.intel.com (HELO localhost) ([143.183.96.54]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 11:15:43 -0700 From: isaku.yamahata@intel.com To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar Subject: [RFC PATCH v6 026/104] KVM: TDX: Make KVM_CAP_SET_IDENTITY_MAP_ADDR unsupported for TDX Date: Thu, 5 May 2022 11:14:20 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Isaku Yamahata Because TDX doesn't support KVM_SET_IDENTITY_MAP_ADDR. Return KVM_CAP_SET_IDENTITY_MAP_ADDR as unsupported. Signed-off-by: Isaku Yamahata --- arch/x86/kvm/x86.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 77e83e20180a..fd282e5efec1 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4236,7 +4236,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_IOEVENTFD_NO_LENGTH: case KVM_CAP_PIT2: case KVM_CAP_PIT_STATE2: - case KVM_CAP_SET_IDENTITY_MAP_ADDR: case KVM_CAP_VCPU_EVENTS: case KVM_CAP_HYPERV: case KVM_CAP_HYPERV_VAPIC: @@ -4389,6 +4388,12 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_DISABLE_QUIRKS2: r = KVM_X86_VALID_QUIRKS; break; + case KVM_CAP_SET_IDENTITY_MAP_ADDR: + if (kvm && kvm->arch.vm_type == KVM_X86_TDX_VM) + r = 0; + else + r = 1; + break; case KVM_CAP_VM_TYPES: r = BIT(KVM_X86_DEFAULT_VM); if (static_call(kvm_x86_is_vm_type_supported)(KVM_X86_TDX_VM)) -- 2.25.1