Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp486858pxb; Thu, 2 Sep 2021 08:29:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtMUXqcpMPz95gc0IdVZPqx7/9SIZ9ISAhwzMQocK7NJxjrX01e88Ha9Dg7pJuCWQBmzu0 X-Received: by 2002:a17:906:3e10:: with SMTP id k16mr4580068eji.116.1630596547875; Thu, 02 Sep 2021 08:29:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630596547; cv=none; d=google.com; s=arc-20160816; b=OevM+Q75cced+HRogjs08GZ37G80uGBbxTaHOZt1xQHNatqiaGuQOWHhX3W/24yj95 AZI9zcqKdEVAVn9E1lTPfSfSphzAZslluB4QWcilt2V6rTmn3FwphoywNRbhjD27S+bR fMLGteYRgdsmx1i/0mR6CI7+b0daBuvZYuOWGFJr+BgT1ZEf3DnrV0FdhGIClFqfoR61 1BfdM3hhhQhIpqtd3Y4RMIiiaF7Db55ECmuOjpiopnHZw1Oihx5DgLXX9issF3PSy+Vz lk+kLAPKh9tGKoUb4u+jXvRqD1VBCMACigwwTUnAYrcAfbdhLVfWquooPRILJUM4rKAr 6IxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=6zx3YD1mp/noVYGvp+muJW7aCkdtR5fdeAJNSUrkquw=; b=nOK6+toheQ/aaNZQMOImoQ0+nEeknBePs+ZITooeHvzkA8m7GcSLQ8BAVaZYvZED5J EIsBNJDpIGE/19WnNQMGKjKkUh9plQ8ZQnPosxKkw4F2jwiu68PlPbrpdM4G+fDr+J5O uEr9Oj40kNNJCt+YxDBs2pBt+OhukzVkjEiafSl2FKDXpdmlAgs3Qn8/iR4/EuvTCrKK WOSHZ2EEq7wOH51LPmRx/aEmFDL0fixXZ2qNGKdBZl+kIRrQc0rVQIDK6ygw2zn9rNuk cuPt7qZ6L1+CNdQAyj5s+W8xpTrPDvHQY8kZiHexU5ZdXDKfbzH2rtFkspBBmrTgpOCK x8dg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si2401444edp.371.2021.09.02.08.28.32; Thu, 02 Sep 2021 08:29:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345812AbhIBP0H (ORCPT + 99 others); Thu, 2 Sep 2021 11:26:07 -0400 Received: from mga04.intel.com ([192.55.52.120]:46851 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbhIBP0E (ORCPT ); Thu, 2 Sep 2021 11:26:04 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10094"; a="217290489" X-IronPort-AV: E=Sophos;i="5.85,262,1624345200"; d="scan'208";a="217290489" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2021 08:25:05 -0700 X-IronPort-AV: E=Sophos;i="5.85,262,1624345200"; d="scan'208";a="533335602" Received: from yzhai-mobl1.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.209.161.204]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2021 08:25:04 -0700 Subject: Re: [PATCH v5 07/12] x86/traps: Add #VE support for TDX guest To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org References: <20210804181329.2899708-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210804181329.2899708-8-sathyanarayanan.kuppuswamy@linux.intel.com> <99c5f6e9-a747-1a4a-d0f4-95b8b28e0d02@linux.intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <42201ef7-6552-3fbc-23ef-013cb3e93649@linux.intel.com> Date: Thu, 2 Sep 2021 08:24:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/24/21 10:46 AM, Borislav Petkov wrote: > On Tue, Aug 24, 2021 at 10:32:13AM -0700, Kuppuswamy, Sathyanarayanan wrote: >> Mainly chose it avoid future name conflicts with KVM (tdx) calls. But > > What name conflicts with KVM calls? Please explain. Currently there are no name conflicts. But in our initial submissions (RFC v?) we had some conflicts in functions like (tdx_get_tdreport() and tdx_get_quote()). Since it is no longer true and "tdg" is not a favorite prefix, I will rename tdg -> tdx in next submission. > >> It is required to handle #VE exceptions raised by unhandled MSR >> read/writes. > > Example? Please elaborate. If MSR read/write failed in tdx_handle_virtualization_exception(), it will return non zero return value which in turn will trigger ve_raise_fault(). If we don't call fixup_exception() for such case, it will trigger oops and eventually panic in TDX. For MSR read/write failures we don't want to panic. #VE MSR read/write -> exc_virtualization_exception() -> tdx_handle_virtualization_exception() ->tdx_write_msr_safe() -> ve_raise_fault -> fixup_exception() > >> Ok. I can check it. But there is only one statement after this call. >> So it may not be very helpful. > > Looking at die_addr(), that calls the die notifier too. So do you > even *have* to call it here with VEFSTR? As yo say, there's only one > statement after that call and box is dead in the water after that so why > even bother... Reason for calling die_addr() is to trigger oops for failed #VE handling, which is desirable for TDX. Also sending die notification may be useful for debuggers. This sequence of calls are similar to exc_general_protection(). > -- Sathyanarayanan Kuppuswamy Linux Kernel Developer