Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3692175ybb; Mon, 6 Apr 2020 13:43:14 -0700 (PDT) X-Google-Smtp-Source: APiQypLduoptWUXCqGHyJCvL9kMYpuHan/IMEgofehRBvYs79mVB/iwRa41L+8WK/EZMvq5GD8g+ X-Received: by 2002:aca:4403:: with SMTP id r3mr1014190oia.84.1586205794361; Mon, 06 Apr 2020 13:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586205794; cv=none; d=google.com; s=arc-20160816; b=TsMjZfnUS/TdjaopL6TgtH7PhKkmXEtqk2ZRdtf4ze9ZpTvsBpe42Tsfsia+utunS1 8Eyt6yUFjgZhZCP+JwPvu1gzBakDtZlqMFPp9VuW5Pdn986D82ymP5+rBeuwhfKuS0bL 0ydnrorQeg0KRA/msE2xHFFFVQMD2ZEA0ylTBqP6RNBh2D7IgtozZ4ztBB/zwR1UDWp3 t8TrNJQeWj1+oxhBZjk/SNXXlmm+WBs260IqcrOfbD/d1udyxb9W17/5DCSJegWQuxMq UjUrxZW5MzicHZtQlosjd22znyYzFwa6WldO/tqsYm0YwAaK8b76NpYMiZdQ9z9B9I5M DbAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=KpXibZi6Btj16gC41T+0t49MWAlKN4EvW+f2e9BTI4M=; b=dCqmsJYJV5oMIRYkF2pW4USfbxo603zF+eM5NIS8zw65R4ziGEhYsN8UVF99MgX4fZ xa5jtDDNtEb08yfHb/no/7c+T2dU0CvO19x57LkK+X0+C0oxED9w1qaH8XNikZAobPgD ukpgx6q58/ywfJcDJW6L3uD3gEyEFWpmjmE3Ew7RPg75hV8YxnFHqAFFDdCfuWCfA0oP TOa+i0PB8jbMBD0WMcljPO7KiO6YTIKnxMPtKNLKQxBMhkSxXmPkZJnuptkL0wlLEQry EBS1L06GQ/WF7ugSE/b9bpSYpAKYzUKo/nviRD7xXE0tYMgiqdvPY93hQkgR8T/XyjBb NdEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=LPFZgf7g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si249386oin.43.2020.04.06.13.43.01; Mon, 06 Apr 2020 13:43:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=LPFZgf7g; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725995AbgDFUmc (ORCPT + 99 others); Mon, 6 Apr 2020 16:42:32 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34468 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgDFUmc (ORCPT ); Mon, 6 Apr 2020 16:42:32 -0400 Received: by mail-pg1-f193.google.com with SMTP id l14so596637pgb.1 for ; Mon, 06 Apr 2020 13:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=KpXibZi6Btj16gC41T+0t49MWAlKN4EvW+f2e9BTI4M=; b=LPFZgf7glUE3tmytdqro5zcHhKLNIL7cB2vz7+vhw9o6W1eS0loavqe6Asm9/A5mzn qHWtSWUDie4Py9vlLNvLGoVOyvNbW50/2lHTv1a7zTqIsEar9IzSwffDfQq8zgtPbNs4 707ZeUPKaetLr05mg7Moz908MXLOLjWebdhYuo0okHeY1wGHECeJGHURWe7Lsc3gf+lz a3G1PfG6z0SNmxx1nlcVwjXWCTb5QS/oejP7HKYXsnr8xQRADm1IETEd7R7NCB4/EI2C FE5Hi1nMcwP8WjJN0Pu5hU2FVQ71GmuhFjxd/9X0WDmVaaf1lDJODo3O3KHQvCm6oQX2 J2QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=KpXibZi6Btj16gC41T+0t49MWAlKN4EvW+f2e9BTI4M=; b=LFlEs/GU5eO16qAdGwDbk3vvsxiTEGVwwVvDseh+f8FfY00mIJmySOVLGwcbK6SOHb 5YTg6R6I7fri3hzeTddGJ4zOjUyRBez2tNmfpMsd0oUNf1m55xKcvTd0F9qwOLy2dOPg GWpekLGZvxc9UwfbNpWEPt4JZAJeTDoJLiuLPtC8KdB0rwj6edC64Y3G+XwfxS+ThrGg 4DBniUSc8TuctnwiRObhen+JOYtJovlIa5zL9TTFr6EfZuKWLqo76WMC/MLpLT+KzI5l Ea3DAsWsbMiuR+mXhSwlPh1n/lqc6PBNV2SvO9DhLDMXCbq/QUZs9QQeTv7na3NQAWKS Nj+Q== X-Gm-Message-State: AGi0PuaW+7XwES7HhBstZOGfRFjQmm0yJVlIcHG/mN+OrwalrlciFZJO MPPoVWTjTRy+qqg+Daxp2VCItA== X-Received: by 2002:aa7:96c8:: with SMTP id h8mr1243020pfq.49.1586205751040; Mon, 06 Apr 2020 13:42:31 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:54d3:a29c:f391:9a0d? ([2601:646:c200:1ef2:54d3:a29c:f391:9a0d]) by smtp.gmail.com with ESMTPSA id r13sm1562176pgj.9.2020.04.06.13.42.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Apr 2020 13:42:30 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v2] x86/kvm: Disable KVM_ASYNC_PF_SEND_ALWAYS Date: Mon, 6 Apr 2020 13:42:28 -0700 Message-Id: References: <6875DD55-2408-4216-B32A-9487A4FDEFD8@amacapital.net> Cc: Vivek Goyal , Thomas Gleixner , Andy Lutomirski , Paolo Bonzini , LKML , X86 ML , kvm list , stable In-Reply-To: <6875DD55-2408-4216-B32A-9487A4FDEFD8@amacapital.net> To: Peter Zijlstra X-Mailer: iPhone Mail (17E255) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Apr 6, 2020, at 1:32 PM, Andy Lutomirski wrote: >=20 > =EF=BB=BF >> On Apr 6, 2020, at 1:25 PM, Peter Zijlstra wrote: >>=20 >> =EF=BB=BFOn Mon, Apr 06, 2020 at 03:09:51PM -0400, Vivek Goyal wrote: >>>> On Mon, Mar 09, 2020 at 09:22:15PM +0100, Peter Zijlstra wrote: >>>>> On Mon, Mar 09, 2020 at 08:05:18PM +0100, Thomas Gleixner wrote: >>>>>> Andy Lutomirski writes: >>>>>=20 >>>>>>> I'm okay with the save/restore dance, I guess. It's just yet more >>>>>>> entry crud to deal with architecture nastiness, except that this >>>>>>> nastiness is 100% software and isn't Intel/AMD's fault. >>>>>>=20 >>>>>> And we can do it in C and don't have to fiddle with it in the ASM >>>>>> maze. >>>>>=20 >>>>> Right; I'd still love to kill KVM_ASYNC_PF_SEND_ALWAYS though, even if= >>>>> we do the save/restore in do_nmi(). That is some wild brain melt. Also= , >>>>> AFAIK none of the distros are actually shipping a PREEMPT=3Dy kernel >>>>> anyway, so killing it shouldn't matter much. >>>=20 >>> It will be nice if we can retain KVM_ASYNC_PF_SEND_ALWAYS. I have anothe= r >>> use case outside CONFIG_PREEMPT. >>>=20 >>> I am trying to extend async pf interface to also report page fault error= s >>> to the guest. >>=20 >> Then please start over and design a sane ParaVirt Fault interface. The >> current one is utter crap. >=20 > Agreed. Don=E2=80=99t extend the current mechanism. Replace it. >=20 > I would be happy to review a replacement. I=E2=80=99m not really excited t= o review an extension of the current mess. The current thing is barely, if a= t all, correct. I read your patch. It cannot possibly be correct. You need to decide what h= appens if you get a memory failure when guest interrupts are off. If this ha= ppens, you can=E2=80=99t send #PF, but you also can=E2=80=99t just swallow t= he error. The existing APF code is so messy that it=E2=80=99s not at all obv= ious what your code ends up doing, but I=E2=80=99m pretty sure it doesn=E2=80= =99t do anything sensible, especially since the ABI doesn=E2=80=99t have a s= ensible option. I think you should inject MCE and coordinate with Tony Luck to make it sane.= And, in the special case that the new improved async PF mechanism is enable= d *and* interrupts are on, you can skip the MCE and instead inject a new imp= roved APF. But, as it stands, I will NAK any guest code that tries to make #PF handle m= emory failure. Sorry, it=E2=80=99s just too messy to actually analyze all th= e cases.=