Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3489197pxb; Wed, 14 Apr 2021 06:43:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMKVmADyE4aKWnUhtpKNF5vJxRJSIDapt0BBGVpoYfft6TGSC7d+JkTR7QZGI9hEk9N+lR X-Received: by 2002:a17:906:4bd2:: with SMTP id x18mr6049246ejv.1.1618407835134; Wed, 14 Apr 2021 06:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618407835; cv=none; d=google.com; s=arc-20160816; b=gNM1vzXwJHMnDFT6aiozM3sEbP5FOVmKq6LGVp7VC47s+l+bbjLgxhIjT95Gj4kl6W YyG12v5LtTi7C4vVo2MYxL+B6CJ2s7rz+EtU3i8vZ7wXKAlQSMspFTBOu+4HgC94rt8F FyS4krc6DiSRDTpuorcu3ulwVRwI4uuvDitH45dwCmaoPLByFMnh+RRz86rNJmoNV3WP LgWagB+u2sMFmQczpCVos6YhOAKl16R0EzKCtiwdcspXjbPzla42N776HbHk2J61EomD OnmiHvb01SqSYr9c1+9n5Q2sKLRzZuJRqFVRNaCVH8AijKuW+OkJ1JOtyv8io1Y9/Uzj MoxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=tVM5T7WD+9isttd9BfiogfhskbumHL+3BbGPYht13nQ=; b=NZCpX3pg4qscjQysIF1/tAEXu6T9DiMQoaKUUA9hKG9WQuxoI8tu4vp3CxZwz2Rhox hKQaJHF1+mtDxj8sc1wM1xlJBtByRdrWo9L6hvbcMHVQSE69moz+JRa3UiBlD+b4OKcH yI/UIk5dm2pVMrENzvE0vj5ibTssKmon8eGlGCf5ZA2Uft4oEFw/2YrxBIcB3ofTqakL WXSg1xUU98kXOs6OezR9EbGVyNNTjtXcDSJ6R2iaE5boG4eCZqrTIiJvPK1tacqAP2+b 4NCBB0dpZM0+iikdzWGt8lZhG/esAfaw4seDL7PNFHkPMg/+Tu+w/gvjonegRoJeWCGh boPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jmASpZXa; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx8si13132301ejb.385.2021.04.14.06.43.28; Wed, 14 Apr 2021 06:43:55 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=jmASpZXa; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347508AbhDNFr5 (ORCPT + 99 others); Wed, 14 Apr 2021 01:47:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347492AbhDNFry (ORCPT ); Wed, 14 Apr 2021 01:47:54 -0400 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43382C061574 for ; Tue, 13 Apr 2021 22:47:33 -0700 (PDT) Received: by mail-vs1-xe35.google.com with SMTP id 66so9762180vsk.9 for ; Tue, 13 Apr 2021 22:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=tVM5T7WD+9isttd9BfiogfhskbumHL+3BbGPYht13nQ=; b=jmASpZXaYtVDVAS0rSRFBxoRqNjXSAxuK/tHeNfdRXLkTUWuKy1PdBM5ZHS1vgrSZu DeXgCiGMZ0UvNtn6dMvT1DWS3CjwPTXC8XxNiK8MZW7gbPAMPmIskS2FzDH8crbCwWy8 XUsy0kp97jP968CKK2VVloEbSqCDPZl0V9PesHT50Gn9PD22mZSf98gVwyFC9g/oTB1D VtFztYKAaacC4Cms9+3wBVoCNI57iNyhoQOYFHm0e8sLpzGFqixlG5g2YD3ZErz8pUqd CymziIRcoD/STAkwKH/hjtb6P38EZTsrCvwLuPFIiaOzNKuTWXWXPl16hYtuk1Z3o7Nd 2KEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=tVM5T7WD+9isttd9BfiogfhskbumHL+3BbGPYht13nQ=; b=lN4mkTO+A7zeTI1/aw4edo2X0abXt+og34BvVA0dpLAHMWlGIQt4Tf8sCOZG41UPRn 0bFPSzIJfIcnpqdF3lFeXh9J/LM5Hl8u52iX06wswO8nRCDZ/nkHKpne3cemcDjmfK0M lvx/8Sj9EjCt9YgEYLua4kUHloQXivs3vvbejqRoRCfvYuHvzinRoxPx4F8OgdmYyom3 ongsiyn+0ozbZGe1WScOLay5jPqIKDpGea4tXNR6haF8cH/41Tgo+vcoyggPxCF6gmxc Bu98G9JxRiRPRG7cNsdLbo/mu+O1Y2gfXivRltN7MFnQoADOaTpOPIvXOyBMolo+zUJL +rsA== X-Gm-Message-State: AOAM532kXlg/FJu1XYHI0NOqTVjLV6PTEO4NJisAQ4myALxuUOl5z8sY aLYZMOSc5jBgflcbUe5YQWxkVvvbdt48FoP76mOdJg== X-Received: by 2002:a67:71c6:: with SMTP id m189mr25897205vsc.12.1618379252321; Tue, 13 Apr 2021 22:47:32 -0700 (PDT) MIME-Version: 1.0 From: Jue Wang Date: Tue, 13 Apr 2021 22:47:21 -0700 Message-ID: Subject: Re: [PATCH 3/4] mce/copyin: fix to not SIGBUS when copying from user hits poison To: bp@alien8.de Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, luto@kernel.org, naoya.horiguchi@nec.com, tony.luck@intel.com, x86@kernel.org, yaoaili@kingsoft.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Apr 2021 12:07:22 +0200, Petkov, Borislav wrote: >> KVM apparently passes a machine check into the guest. > Ah, there it is: > static void kvm_send_hwpoison_signal(unsigned long address, struct task_struct *tsk) > { > send_sig_mceerr(BUS_MCEERR_AR, (void __user *)address, PAGE_SHIFT, tsk); > } This path is when EPT #PF finds accesses to a hwpoisoned page and sends SIGBUS to user space (KVM exits into user space) with the same semantic as if regular #PF found access to a hwpoisoned page. The KVM_X86_SET_MCE ioctl actually injects a machine check into the guest. We are in process to launch a product with MCE recovery capability in a KVM based virtualization product and plan to expand the scope of the application of it in the near future. > So what I'm missing with all this fun is, yeah, sure, we have this > facility out there but who's using it? Is anyone even using it at all? The in-memory database and analytical domain are definitely using it. A couple examples: SAP HANA - as we've tested and planned to launch as a strategic enterprise use case with MCE recovery capability in our product SQL server - https://support.microsoft.com/en-us/help/2967651/inf-sql-server-may-display-memory-corruption-and-recovery-errors Cheers, -Jue