Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1527380ybk; Thu, 21 May 2020 08:58:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjGZiIkZb3Rxvo8V6i8pmQ+cvx193DHHYt3BRJjzWuwjS/uWhyww/x97Ora65JLrOohKLI X-Received: by 2002:a17:906:e211:: with SMTP id gf17mr4176762ejb.495.1590076691351; Thu, 21 May 2020 08:58:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590076691; cv=none; d=google.com; s=arc-20160816; b=G8Eifx9Ap9J9c01vZ5gUsjoENy5iO+xNzrBPezc5PsnfCjhcXK51lIsknALaDcBqoG QdKL7fgJOk6f7TntuOo1sTzROswuUNF9/AkYG1XUQMPX8UTed3KSEHLP4mlY4H9CF72J RmGvfYKQAuBljbQsBx4yIhh7eeGujOmpPY97PiCITYu9KJuIRRmw8x0EjkH2BS4MDwig vWwCY8ofShg657NaNysKPnXMru/k0Htmln7hDI8hM+QPgcGnwZr7SbB4yZCxWXs0mWEx aaTt7bMCgm7Ys8FPXQU8GFkiPLT6MQyH+SvikUszXSKjePpGJLnZD/fYgzcAkycTPPrR vhTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RP0V13tfcBHFjiQL2Hum0eIuWeC/sr9fMRiGZyHGqdo=; b=KHQdc/ttaMB69QGsEqQud87tW9I16jKnp4EFuqK4OtEj7lwc6da7WTZH6BhX3EPO+4 SDZXGAZ7i3H21o9OFMCKW4W0STuY1hKIOizdWl3SeuxL6nVBrRXELdPrvlKJxJP2nz6H ycnz8sRW/C53AiI17boKxrPZem0G6p4/g0aMmMo0j/etQdVAMoj5vWbznD5YHkkCsMDd 537KBp0trPV+Yemqgnor1Az1+Xo+KAJCy7RBiXYaYCssmFDrT0LIUfJyChm4r635bPPQ UuHOBetSqW8W4e3Unw3K6LYYS784sq+nl/Ocm2prZHdF6RvV8ONEoN+z3J6iFWCauy55 mKvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZbCe0UcF; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si3636894edj.333.2020.05.21.08.57.49; Thu, 21 May 2020 08:58:11 -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=@redhat.com header.s=mimecast20190719 header.b=ZbCe0UcF; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729068AbgEUPzn (ORCPT + 99 others); Thu, 21 May 2020 11:55:43 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:26077 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728342AbgEUPzn (ORCPT ); Thu, 21 May 2020 11:55:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590076542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RP0V13tfcBHFjiQL2Hum0eIuWeC/sr9fMRiGZyHGqdo=; b=ZbCe0UcFLFY4jMxEf/JnZqLOumwANtHGyBuh3T5DnWCNSpRPfmnBolFA0XJwTBp6GCNeci oXeZKqiBwuwDBth2ycWUs8VOW4aVN/l9PuHCF2Rpo0yDLk4zbD2Nj02jvnJc5A97EvIRdp H2wJHTqlGgCLrpjALVy3nbnkQ5xEujY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-xpwtyieaP4mfkdsladJA_w-1; Thu, 21 May 2020 11:55:38 -0400 X-MC-Unique: xpwtyieaP4mfkdsladJA_w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 04D52107ACCD; Thu, 21 May 2020 15:55:37 +0000 (UTC) Received: from horse.redhat.com (ovpn-116-233.rdu2.redhat.com [10.10.116.233]) by smtp.corp.redhat.com (Postfix) with ESMTP id D40A95C1B0; Thu, 21 May 2020 15:55:36 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 4354822036E; Thu, 21 May 2020 11:55:36 -0400 (EDT) Date: Thu, 21 May 2020 11:55:36 -0400 From: Vivek Goyal To: Paolo Bonzini Cc: Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andy Lutomirski , LKML , X86 ML , kvm list , stable Subject: Re: [PATCH v2] x86/kvm: Disable KVM_ASYNC_PF_SEND_ALWAYS Message-ID: <20200521155536.GA38602@redhat.com> References: <87eeszjbe6.fsf@nanos.tec.linutronix.de> <2776fced-54c2-40eb-7921-1c68236c7f70@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2776fced-54c2-40eb-7921-1c68236c7f70@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 08, 2020 at 12:07:22AM +0200, Paolo Bonzini wrote: > On 07/04/20 23:41, Andy Lutomirski wrote: > > 2. Access to bad memory results in #MC. Sure, #MC is a turd, but > > it’s an *architectural* turd. By all means, have a nice simple PV > > mechanism to tell the #MC code exactly what went wrong, but keep the > > overall flow the same as in the native case. > > > > I think I like #2 much better. It has another nice effect: a good > > implementation will serve as a way to exercise the #MC code without > > needing to muck with EINJ or with whatever magic Tony uses. The > > average kernel developer does not have access to a box with testable > > memory failure reporting. > > I prefer #VE, but I can see how #MC has some appeal. I have spent some time looking at #MC and trying to figure out if we can use it. I have encountered couple of issues. - Uncorrected Action required machine checks are generated when poison is consumed. So typically all kernel code and exception handling is assuming MCE can be encoutered synchronously only on load and not store. stores don't generate MCE (atleast not AR one, IIUC). If we were to use #MC, we will need to generate it on store as well and then that requires changing assumptions in kernel which assumes stores can't generate #MC (Change all copy_to_user()/copy_from_user() and friends) - Machine check is generated for poisoned memory. And in this it is not exaclty poisoning. It feels like as if memory has gone missing. And failure might be temporary that is if file is truncated again to extend, then next load/store to same memory location will work just fine. My understanding is that sending #MC will mark that page poisoned and it will sort of become permanent failure. I am less concerned about point 2, but not sure how to get past the first issue. Thanks Vivek