Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp890839lqp; Thu, 23 May 2024 03:14:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLgRtLuT7AxwXr6eRbn4HsMa83PluRcml/uRo6pY9e1ADD3BawnPrhadBxW5UGAtJug4yXpFccuUK+JO/slW/xQow5f+0a3kfmo9WBDA== X-Google-Smtp-Source: AGHT+IH1Ph0k6L6HGAxAKTz158zSk+1gfbWk0a70HKTFCo6XdGQluFOjk5SRwIHCX9JV+ahYbLco X-Received: by 2002:a05:6512:ea5:b0:528:c1ff:2fc0 with SMTP id 2adb3069b0e04-528c1ff31b8mr363477e87.0.1716459286637; Thu, 23 May 2024 03:14:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716459286; cv=pass; d=google.com; s=arc-20160816; b=sTmgkCI66jvyoNkpIpWbYC0Jtqc8yt6vrCr3bLoKzhYgIF4Nm8hdgL01WrY4lmXnTD LjfV+b7jqMj8oPvJZC7h06J8i4RoeQ+F/quF+agseVAAgMDKIJ3sSUEuXMkJq0MqhwTX 3VMrbBP+nslA/fpBp/pu4+tkvdVVjtJsWqrua0Eu6UtzCCaioQx5gTb0X8ENyLMPiLXd 0LD8mxovNPsRzTzj3vDvdskBPl6OFT4/iVk4pOQxc/TIVXPqurItcnPmPSNbvkySIJ8r 6S42VU+e7AXR2uySKgpfxFpdEgB2kIVyDJbuPMY+AZCKEra5VhsF6ZNrLR3sGEuLLChl bpAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EqUq4obIW9qOcPzOYWsE6LcTwQnaCRXt6ThMuE4w5n4=; fh=GAUdxjNR9HoFXFtZLDopRrsAGLWjVtdWRt0NW7CNezc=; b=INhZNJEtQBn3QKpRfgILqTPY23iGdSePeBuz5ElYjDNmfSX6himldnkU3N/RtuX5ai 2znQ+18U3oIR8tO/aByL6aE5hmCTsrLXQZy8JUEJot2EXCFBltv5PlNqDebOOFQuYk2A TGzl08NdtMwzEWuy7CZGHXK5AKce8pg9YM6N33f9YTBZnBUk522FnTexmIxdjdSjRiEy hiT9O0qWX2rB9yePLqthY5kOUqnHdPldocjeP0st6m4S0MwFn5OK9G5kY3BSE85Jh118 DnHYZ2a6X0zv4A4ohcgGH50K7bhmbnBwD3e+neHWG5AQSRZr8oWlqWcPuUncnvkekB7t BHQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aXCKIBQZ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-187315-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187315-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba2e59si1617855366b.513.2024.05.23.03.14.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 03:14:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187315-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aXCKIBQZ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-187315-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187315-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 57EED1F225F9 for ; Thu, 23 May 2024 10:14:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A838013EFFB; Thu, 23 May 2024 10:14:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aXCKIBQZ" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 989F313DDA3 for ; Thu, 23 May 2024 10:14:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716459276; cv=none; b=jLolZkiN5wEmOTfMsoPFgWm5bmTa1rc0ZiF0dO+kH/AnLDUCkzQcAHmOlR+rfsKL3lBwA5nuDMtENG6QC5n4rmRU1+rP9hTnWI7R8NNy/5EsZ2Mr1dchOEmCyI/WvVbTId9wJHKqOqtQEDPK9wbIVxfXxh4uBcRDIFZRKkxBXkY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716459276; c=relaxed/simple; bh=/iBsBSSY36qg1ntH/L641V63e2jJqPM62jX3pmzZfBI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kd95nNDo8uOxrPr3mivgQokDuehzTzIjD9s49sV/aJfrlDhjuBHI//aucLxJiQjWbwVuHHn7fcqquenmUc/84D0jcPmFnCF7LoS6w/84m8J3HJTOGvs3vq/28FRh8N0Od5cOfI28a0n8Lh7j0XJTLM77qNeGFg4JwDtSTjci+ZM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=aXCKIBQZ; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716459275; x=1747995275; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/iBsBSSY36qg1ntH/L641V63e2jJqPM62jX3pmzZfBI=; b=aXCKIBQZwVEZCZcTtS5jpb4HCsnNM8gTLjGXbQJO1ugLoGtKSt+rN6Or k7P31SNCqBkAPQSFoMmOwpbUtbXUGJcb3C+sWd5Q48ZJKzwwvUn6eUJVk y7xbRM1CGBufGhPXskZHqK6xSKd2jWHI4IqxqW0/bA/UHG0pY926ZaH/I MOm4fBU1rO5tNln0ipdJAR45n11EiGZ7V6UJfQNcepZswitMggeT14Zlt NlQ/qQc4lPSVMS+kzTzG80/NlddyST9e0Fic4vk6N3gAxvDBBOPmIcftv q5owItGmeUzXqrAlIu3tiEtRYB9iGQrE22JR+jKAO2lro2ykj8Y2VR36m Q==; X-CSE-ConnectionGUID: UoR6xfvvRgGVjJrgFx+Psw== X-CSE-MsgGUID: aqMC+SYdRcSveEtsOAg7ig== X-IronPort-AV: E=McAfee;i="6600,9927,11080"; a="12994672" X-IronPort-AV: E=Sophos;i="6.08,182,1712646000"; d="scan'208";a="12994672" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2024 03:14:35 -0700 X-CSE-ConnectionGUID: J5CZK5LoR4CTGoSR4wse1A== X-CSE-MsgGUID: sDpxEzTfQt2U9SNspZFgGA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,182,1712646000"; d="scan'208";a="64835066" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 23 May 2024 03:14:32 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 0EEA7E7; Thu, 23 May 2024 13:14:30 +0300 (EEST) Date: Thu, 23 May 2024 13:14:30 +0300 From: "Kirill A. Shutemov" To: Kuppuswamy Sathyanarayanan Cc: Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, cho@microsoft.com, decui@microsoft.com, John.Starks@microsoft.com Subject: Re: [PATCH] x86/tdx: Generate SIGBUS on userspace MMIO Message-ID: References: <20240521073505.2190633-1-kirill.shutemov@linux.intel.com> <38dec9ee-1dde-4b3b-87c7-a65161d4a015@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <38dec9ee-1dde-4b3b-87c7-a65161d4a015@linux.intel.com> On Tue, May 21, 2024 at 06:35:49AM -0700, Kuppuswamy Sathyanarayanan wrote: > > On 5/21/24 12:35 AM, Kirill A. Shutemov wrote: > > Currently attempt to do MMIO from userspace in TDX guest leads to > > warning about unexpect #VE and SIGSEGV being delivered to the process. > > > > Enlightened userspace might choose to deal with MMIO on their own if > > kernel doesn't emulate it. > > Any specific use cases ? Like who is using it? Microsoft folks wanted it. Chris, Dexuan, John, any comments? But it is generally right thing to do. SIGBUS is right signal to deliver. -- Kiryl Shutsemau / Kirill A. Shutemov