Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1128574iob; Wed, 18 May 2022 23:10:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUWJ9OqHw+ryC0fhuLOxAngwe7rOj40V7dDF9cC7PIUlibID9d/fvhXIm6bMcB2ekKTEVF X-Received: by 2002:a17:90b:1808:b0:1dc:8904:76a1 with SMTP id lw8-20020a17090b180800b001dc890476a1mr3471146pjb.202.1652940608361; Wed, 18 May 2022 23:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652940608; cv=none; d=google.com; s=arc-20160816; b=fyegX1c1VpEEwBNvK3vdN+fHmjMeJRGSA4X5aPtgx2W0btGdo+Fiz2PUIX398cHXN3 Xx4HiZ0NYtqGknUEDPDZU/ozDrAdQBglzmvXYSF/ITDgPg/Iqsqd/pTXltINxEDDakYq F08TmHBcBxxlOsxCPVEcr9NHKF95Tzly8817vKwfjubTBOMhoSOiQ4ZWgQ568gbeWRHg IvPa+9A0yQkVvAXI5LBeCv0r/gVgJm2FZmd09ffZ1nsFGf8UDn6/aEjGG+t6ZNqkX7Ji 0Zh5Ymv1jIWOWAU2AD14uW8IgvJGPTPm8EBcSKYugLBYs0Ff7GHziQN1W1jHJNQMaK14 RusQ== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=KGN0zpkzQx/pW4dWN0pjZb/36meo+ROaAWQn7bQai5k=; b=1IJhSfln0+NEBMMvHuJFoxzHbiP5Gyhwky4bsEP+ePfU/KwVyIAMCiOxsWOw7koIFK KK+hiNr6TNCZaxGq/Ovxq7l1Ort38D9bn7OUbB7/81LXYyOfKIbUvJ35WcJy+hIqn98a adTrtBd9odlGYkvTXyIYNzXJov/ynW8BFzbJlEEQu61UtrrfuoHMMeclx9gs3DMsVTVT WUNC5j2nvF2xFHrANbyfz6iLEbHNf+j/KMVSYVpUpVm4QEp4w0OARwZttkaynFsE6FxH JX4UeyoPS1gQoYZ+C9QKlg5RYg75NY2/TMmcQ317y8EoKmHLO0fX1uWh8AFLNV3qixnZ rUQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GjfPgl4B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a17090a694700b001ca84546104si4930529pjm.27.2022.05.18.23.09.52; Wed, 18 May 2022 23:10:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GjfPgl4B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229654AbiERX5I (ORCPT + 99 others); Wed, 18 May 2022 19:57:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231132AbiERX5E (ORCPT ); Wed, 18 May 2022 19:57:04 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B13C8A205F; Wed, 18 May 2022 16:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652918219; x=1684454219; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=sYnBWBRsHWJ/CxGScUq9f0aZZYV853hQS0dqrvcFiLM=; b=GjfPgl4BKfE7EJcB8jvLb1bkSfE6TdRgs0eKIwCSAvHUr7K5kQ9QLae0 Iaz0zdAv0OFI+Ag0+ogi1V2udrWLjQM/RAe+ZNEuQ82wtG2hvTN935rZK PqEAqjN+Kml9Lm3V/5xHqxuDUyiY8HsZSuN8spf1gEf3mfMJnhmWfyXMc u3CJa1T5NzI9LfwKQWl3PTEJ/U86Ji4QJZqOMQKGI2yjGz+Bqc4KNhb1b doLQH7vNTLSktbRR7/mvKeL51T5meoTzRuXtyCm22sXpwdvM83UEJjq7/ CLP8cyDTpswAFU27u3+PMHyL8J77IiF7q9RefcB4aPyQw9MKVFEZY0iEa A==; X-IronPort-AV: E=McAfee;i="6400,9594,10351"; a="334990901" X-IronPort-AV: E=Sophos;i="5.91,235,1647327600"; d="scan'208";a="334990901" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2022 16:56:59 -0700 X-IronPort-AV: E=Sophos;i="5.91,235,1647327600"; d="scan'208";a="700864699" Received: from ppamkunt-mobl1.amr.corp.intel.com (HELO khuang2-desk.gar.corp.intel.com) ([10.254.33.252]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2022 16:56:55 -0700 Message-ID: <1e880953645d966a9869531409e1296c2ae234f9.camel@intel.com> Subject: Re: [PATCH v3 09/21] x86/virt/tdx: Get information about TDX module and convertible memory From: Kai Huang To: Sagi Shahar Cc: Dave Hansen , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Sean Christopherson , Paolo Bonzini , len.brown@intel.com, tony.luck@intel.com, rafael.j.wysocki@intel.com, reinette.chatre@intel.com, dan.j.williams@intel.com, peterz@infradead.org, ak@linux.intel.com, kirill.shutemov@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, "Yamahata, Isaku" Date: Thu, 19 May 2022 11:56:53 +1200 In-Reply-To: References: <145620795852bf24ba2124a3f8234fd4aaac19d4.1649219184.git.kai.huang@intel.com> <0bab7221179229317a11311386c968bd0d40e344.camel@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Wed, 2022-05-18 at 15:30 -0700, Sagi Shahar wrote: > > > > > > > +   pr_info("TDX module: vendor_id 0x%x, major_version %u, minor_version > > > > %u, build_date %u, build_num %u", > > > > +           tdx_sysinfo.vendor_id, tdx_sysinfo.major_version, > > > > +           tdx_sysinfo.minor_version, tdx_sysinfo.build_date, > > > > +           tdx_sysinfo.build_num); > > > > + > > > > +   /* Print BIOS provided CMRs */ > > > > +   print_cmrs(tdx_cmr_array, cmr_num, "BIOS-CMR"); > > > > + > > sanitize_cmrs already prints the cmrs in case of success. So for valid > cmrs we are going to print them twice. > Would it be better to only print cmrs here in case sanitize_cmrs fails? The "BIOS-CMR" will always have 32 entries. It includes all the *empty* CMRs after the valid CMRs, so the two are different. But yes it seems there's no need to always print "BIOS-CMR". -- Thanks, -Kai