Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp41687lfv; Tue, 12 Apr 2022 16:28:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO+YRA7rU9SatndNxI9PKWY3fePLwfGWnM8OkrYJS0PKRftQouAvsV69JpQn3H90svW/oz X-Received: by 2002:a63:c015:0:b0:385:fe06:eb86 with SMTP id h21-20020a63c015000000b00385fe06eb86mr32095904pgg.132.1649806088718; Tue, 12 Apr 2022 16:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649806088; cv=none; d=google.com; s=arc-20160816; b=vSGYMvQN3MqA2nnS8CqH+66nixoWA9TAf2aF2zFFwL51hVQB5QvOdgZveb30yTUUKS 54v8Es51qAfR4EPLBoeRON3VCLgJTCIrKYFnnwpXMZYDOsrXUQCsD3mWd4fq9NYc0+GQ uI5NHIAmub/OImK07ZywAIhuiv9GcbfIs6lJx24LIn1vZ22WYcRFPb0T9YamP4nC7WwG Sfa0nEzd0/8MMoz6tBnbutJrDuLq+k3hzyfijhY4AENLtOEtRyfktZ40ntQPoIOpKO01 V9xFd/V0I+v7W20Rg5TTafNpaFpAhjiohf2Xb3Od2O0YGajLAcgLaFmoa9NGmbX98jT6 eBcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nbIhYNNLlhczG5+DNEgsTVKM3CAGCLWdELXnmLPs+n0=; b=kudVM3/xH2351IThXdwvuTxGSmc/Ob8nXWEjy7mAP+CDSpGZiwKwc42mx2PQSTtnMJ SYO4pm0x/1ofdWjSxfyUiRoMUZhPjwZHtFWIJ6AzsvPzf65kpFfxMminCHKaezCI0jVH rppVDEv+1nEJ845/kC9L30bcZR0dwJhC9iExN8fubmnRSR6ybMypx6dPPQZtCDdzciAR G7xbFuEvPXaSkzCEXt8q4zWrnf5xYrHUHRBtxkGH6fuUe8aIkyqF0LEt7oFPNrXEaIQA 0n3Cy+ZQ8RXNauMJI0efh+LPV2W+rmvoRqrSuWkYVvshTPRljqPw99hwgG30PNW6wApU KHVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QaeWB0b6; 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 d18-20020a056a00199200b00505a5eb551dsi10441009pfl.70.2022.04.12.16.27.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:28:08 -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=QaeWB0b6; 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 BB2F2105068; Tue, 12 Apr 2022 14:20:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352357AbiDLHXx (ORCPT + 99 others); Tue, 12 Apr 2022 03:23:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353186AbiDLHHU (ORCPT ); Tue, 12 Apr 2022 03:07:20 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B54949CB6; Mon, 11 Apr 2022 23:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649746177; x=1681282177; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=6Vrf9v/aelxqJtAMQ3CWYcL1rqDUMznv81Ys5xCr/Hg=; b=QaeWB0b6U8PxPsmgkiEe8yPlu7A1KNOyjXAx6NwcTh5aai5xnY0qLIMY e+oTfIiALftW4ei02RkUfH/7GdYxybtCyJKhyUAfJ4akEZjkKOwA+Q5Ct 5i/rYuhE1zxYKMKcndo4dGLc6bXQ7w/MznSydNqsW+YkFRvB/jw+1FFxf MwSDM9hWvtDYFhKbRFPQJ5ETXW43MLdrwcRX0YLpT6ZyPku4JbuCv3xZn iByeYZBIpo59MVDcr7OhJLMWS5x03v63VU+B5mw4Mz96hVbr6UTlybwrD mmL29l5gMcedxxQS8GuNXKoOmfs70uIT+S99PrvaYlYUN2Hm6OuF53Fsd w==; X-IronPort-AV: E=McAfee;i="6400,9594,10314"; a="242231184" X-IronPort-AV: E=Sophos;i="5.90,253,1643702400"; d="scan'208";a="242231184" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 23:49:25 -0700 X-IronPort-AV: E=Sophos;i="5.90,253,1643702400"; d="scan'208";a="551563763" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.255.31.239]) ([10.255.31.239]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 23:49:22 -0700 Message-ID: Date: Tue, 12 Apr 2022 14:49:20 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.7.0 Subject: Re: [RFC PATCH v5 102/104] KVM: TDX: Add methods to ignore accesses to CPU state Content-Language: en-US To: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@gmail.com, Paolo Bonzini , Jim Mattson , erdemaktas@google.com, Connor Kuehl , Sean Christopherson References: <3a278829a8617b86b36c32b68a82bc727013ace8.1646422845.git.isaku.yamahata@intel.com> From: Xiaoyao Li In-Reply-To: <3a278829a8617b86b36c32b68a82bc727013ace8.1646422845.git.isaku.yamahata@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, HK_RANDOM_FROM,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 On 3/5/2022 3:49 AM, isaku.yamahata@intel.com wrote: > From: Sean Christopherson > > TDX protects TDX guest state from VMM. Implements to access methods for > TDX guest state to ignore them or return zero. > ... > +void tdx_cache_reg(struct kvm_vcpu *vcpu, enum kvm_reg reg) > +{ > + kvm_register_mark_available(vcpu, reg); > + switch (reg) { > + case VCPU_REGS_RSP: > + case VCPU_REGS_RIP: > + case VCPU_EXREG_PDPTR: > + case VCPU_EXREG_CR0: > + case VCPU_EXREG_CR3: > + case VCPU_EXREG_CR4: > + break; > + default: > + KVM_BUG_ON(1, vcpu->kvm); > + break; > + } > +} Isaku, We missed one case that some GPRs are accessible by KVM/userspace for TDVMCALL exit.