mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: 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
Date: Tue, 11 Jun 2024 09:16:13 -0700	[thread overview]
Message-ID: <fa788a95-1814-4782-8a36-f9dce7a04b66@intel.com> (raw)
In-Reply-To: <4df2ebee-40c0-4ea3-8909-13b90f049ff1@intel.com>

On 6/10/24 06:55, Dave Hansen wrote:
>> Enlightened userspace may choose to handle MMIO on their own if the
>> kernel does not emulate it.
>>
>> Handle the EPT_VIOLATION exit reason for userspace and deliver SIGBUS
>> instead of SIGSEGV. SIGBUS is more appropriate for the MMIO situation.
> Is any userspace _actually_ doing this?  Sure, SIGBUS is more
> appropriate but in practice unprepared userspace crashes either way.

I also can't help but wonder if there's a better way to do this.

Just thinking out loud.... Ideally, we'd reject creating a potentially
troublesome VMA at mmap() time.  That's way better than, for instance,
panic()'ing at some random place in the middle of program execution.

But I guess that's likely not possible because someone could be doing a
VM_MIXEDMAP VMA that only has normal private pages and never _actually_
needs or has a shared page mapped.

I'd still love to know what actual kernel drivers and actual userspace
would be involved in this whole dance.  It's still way too theoretical
for me.

  parent reply	other threads:[~2024-06-11 16:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28 10:09 Kirill A. Shutemov
2024-06-10 13:34 ` Kirill A. Shutemov
2024-06-10 13:55 ` Dave Hansen
2024-06-10 14:31   ` Kirill A. Shutemov
2024-06-11 16:16   ` Dave Hansen [this message]
2024-06-11 17:17     ` [EXTERNAL] " Chris Oo
2024-06-11 17:25       ` Jeremi Piotrowski
2024-06-12  9:46         ` Kirill A. Shutemov
2024-06-12  9:50     ` Kirill A. Shutemov
  -- strict thread matches above, loose matches on Subject: below --
2024-05-21  7:35 Kirill A. Shutemov
2024-05-21 13:35 ` Kuppuswamy Sathyanarayanan
2024-05-23 10:14   ` Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa788a95-1814-4782-8a36-f9dce7a04b66@intel.com \
    --to=dave.hansen@intel.com \
    --cc=John.Starks@microsoft.com \
    --cc=bp@alien8.de \
    --cc=cho@microsoft.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=decui@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®