From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EBD0C433F5 for ; Fri, 29 Apr 2022 21:32:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E51D6B0071; Fri, 29 Apr 2022 17:32:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36E6A6B0072; Fri, 29 Apr 2022 17:32:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20F1A6B0073; Fri, 29 Apr 2022 17:32:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 0B7A36B0071 for ; Fri, 29 Apr 2022 17:32:55 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 54EA320B51 for ; Fri, 29 Apr 2022 21:32:54 +0000 (UTC) X-FDA: 79411216668.21.D560252 Received: from mail-vk1-f175.google.com (mail-vk1-f175.google.com [209.85.221.175]) by imf05.hostedemail.com (Postfix) with ESMTP id EA768100044 for ; Fri, 29 Apr 2022 21:32:44 +0000 (UTC) Received: by mail-vk1-f175.google.com with SMTP id x9so4339518vke.4 for ; Fri, 29 Apr 2022 14:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rVdqPMqvfIvQZ2PHeuM66QJoOXNSD8A279chkeDywFk=; b=rnTXyqvs4wp1IGNNvkfXh659zEBChYGRNJowmFvjXgBOB2ac+QnNDFSUflbZq8zg3w yadQ3RDBF0MOeNhujcnHVYrZ7CxjhnXqjJoYF1hJlg0O73GTZLP3rCMFdMHt3+JRL9S4 eg/9El9lgCjoWPrDr5QQFBy5y02+aBL6QbNNwDCe+buMllUhChTWT6AXCtdpGudELI0R gDvE/PS9rX+f4YO078c28UzWf6qrwRZvXZFutM3qny2YcJwu0ozPs0y+Xj8u82dPLuRj ic6729/hK1HH9KWS1qYt5dtdGIn6KhjCrrrQZq21HpIKsSl0I9pJEn8mOW7iMk+3qWm2 SSNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rVdqPMqvfIvQZ2PHeuM66QJoOXNSD8A279chkeDywFk=; b=p6OiKjG5GeJEoZQMJhsY9KOnlXLE762Ufvgm4tOEU1YBdxtginSxphurNJtXSmUxH8 E68TVyrCleB5GOgDTII0vrzYf8yu43kYbnsnMS2+x3nZ8EbXcclwiIN/yt9sUmLhqOOX mAQmpECgTvFKTL5/sljDtVfxmDGM+MBSH89G0+w+TEA/zOxncCODQA2kTUqQFcTYNOoD I8SLsEAYOdP8sTQYMrC1B9jvp1pIbgrCJ7slbw90dkeHQSHOvlEiTRZVwB1Sn5J0mg3d cFgLZHIdqBlaXybOKuqFYiswrlnov8WorZfD41zGMZxaGqFYw8rM2kUs5RTUoO0Vvlac MagQ== X-Gm-Message-State: AOAM531H6RvNYSA6r1h7Rc/HMTDdx/Oj0ttMrhdLuRwdbR9CVN6E5Zzs 24V0WDUqRtR0ZwPZTrfjQ/0eebiEYv3zeAhw6fsgiQ== X-Google-Smtp-Source: ABdhPJx/tKwARIjRcxwvuGqucisuSeAzkGb4hfSBw1vXi/D6brOk37xft6YTYCnG6qr5JGnwstD91+WnGMJEbjTJ9Ec= X-Received: by 2002:a05:6122:2228:b0:32d:e4e:a79a with SMTP id bb40-20020a056122222800b0032d0e4ea79amr411389vkb.27.1651267972988; Fri, 29 Apr 2022 14:32:52 -0700 (PDT) MIME-Version: 1.0 References: <20220428161551.722296-1-erdemaktas@google.com> <6f99684f-172c-ccf2-0be3-9aca85451079@intel.com> <2bf733e7-49f3-12de-bf9d-73b23286754d@intel.com> In-Reply-To: <2bf733e7-49f3-12de-bf9d-73b23286754d@intel.com> From: Jue Wang Date: Fri, 29 Apr 2022 14:32:41 -0700 Message-ID: Subject: Re: [RFC] Expose a memory poison detector ioctl to user space. To: Dave Hansen Cc: Erdem Aktas , almasrymina@google.com, dave.hansen@linux.intel.com, gthelen@google.com, jiaqiyan@google.com, linux-mm@kvack.org, naoya.horiguchi@nec.com, seanjc@google.com, tony.luck@intel.com Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: e1h9hco1dfgotfy37udjdftdjkzt1kqg Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=rnTXyqvs; spf=pass (imf05.hostedemail.com: domain of juew@google.com designates 209.85.221.175 as permitted sender) smtp.mailfrom=juew@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: EA768100044 X-HE-Tag: 1651267964-612006 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000680, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Apr 29, 2022 at 2:10 PM Dave Hansen wrote: > > On 4/29/22 12:46, Jue Wang wrote: > > Per seanjc@google.com: > > TDX doesn't support #MC exception injection, but IRQ "injection" via > > posted interrupts is supported. Accesses to machine check MSRs will > > #VE, i.e. can be emulated by KVM, so CMCI should work fine for TDX > > guests. > > > > Proactively scanning for memory error should benefit TDX guests > > preventing potential host shutdowns. > > It also need to know to avoid unaccepted memory in TDX guests at *least*. > > > It seems the current proposed design can cover TDX & SEV-SNP if the > > direct mapping to guest private memory is preserved? > > I wouldn't go that far. The unaccepted TDX guest memory thing is just > the obvious one at the moment. There are a whole ton of other guest > ballooning mechanisms out there and I'm not sure that all of them are > happy to let you touch ballooned-away memory. This type of scanning is intended to be run on the host side. That should avoid concerns around the guest ballooning or any effects to the host side reclaim that's based on the guest's working set. I don't know why a guest wants to spend its CPU cycles and pollute its caches etc to run this scanner, anyway. This should be a benefit provide by the cloud platform transparently to the guest. > > But, the bigger issue is that those cases had not even been considered. > It means that there is a *LOT* of homework needed to seek out and cover > all the other weird cases. > > I also think the proposed ABI -- exposing physical addresses to > userspace as a part of the design -- is an utter non-starter. This can be addressed with a different design.