Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp448533ybh; Sat, 7 Mar 2020 02:09:42 -0800 (PST) X-Google-Smtp-Source: ADFU+vvtR5uLJv/oZubJlA8nVOm+OXIUa+VEt6u7kYnKieTkc3UqppxuAWi3d1cOnl22Y7vb/DYh X-Received: by 2002:a9d:1a4:: with SMTP id e33mr696618ote.343.1583575782625; Sat, 07 Mar 2020 02:09:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583575782; cv=none; d=google.com; s=arc-20160816; b=vxW2iJK6coAyKlA6oyJ2ojXFnC8BBwozHK6qXvXqmanPvrfRSmt0FNQHgtEoVgkAVV O6YRZvvqRX+6OvwAupLoOYql3rn+oTQrpo1Hveo8gpdDiRZjsKrzQPlA/3eQ+peg3GcO qo9VmJTqOEeqjVlRryt/mvR5IkBJFgMK9q0Vj7Cf7ergoeV4zwXMtAL9MaAiBRnGXMut NGQubUaat8wegqbRR1wCYanYBXPtwvDPsBlvlr0mSmZmAWVyAmTYmnLnblVnYwaeE6Yz golRTyavW7aDB5OBVxqVqHCMnFo3aozwprQIjj1GXvO225q1+GD7fKirHtDYm2OyapeV csmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=aGmlviYD6pfGOfkH+l5WbASdv4gLNcSU/j/xsPkO8uA=; b=sewdjyJxdcWMECIfKFUfYThcZuhDb/1lEjN3Rw9nVO06aOq9OgA/UcvesGVfn/tEQo mu3Xk0PT2M2Yv/P6AK+sZQJyzdtCTpy4gwxaskCpM2ytnwIgMK2tpq07kJhgJkDAP7cB etnU7600+hWP4Aw5smBBuGGpkHg6quL4HA3ALYp+VvW4Zgrz8BzYfkQo/se2FUD0nTd8 qLgICjPQ6srKSHaHD7w2dzDJ7MZiq8gn1Gvj2Pmsx/g/XIUh/4Oup6YKdZHeJ2vCqYHr cVo1WWdGzUBcMl25QZZZJ/L5zGweOazSM5MeV7AisBnYUXWvOwMKl2Vnc4weQIMu0WLY CRBA== ARC-Authentication-Results: i=1; mx.google.com; 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 q2si3061507otm.54.2020.03.07.02.09.30; Sat, 07 Mar 2020 02:09:42 -0800 (PST) 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; 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 S1726104AbgCGKJP (ORCPT + 99 others); Sat, 7 Mar 2020 05:09:15 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:55353 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbgCGKJP (ORCPT ); Sat, 7 Mar 2020 05:09:15 -0500 Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jAWOM-000531-Gg; Sat, 07 Mar 2020 11:09:10 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id D9EB8104088; Sat, 7 Mar 2020 11:09:09 +0100 (CET) From: Thomas Gleixner To: Andy Lutomirski , LKML , x86@kernel.org, kvm list , Paolo Bonzini Cc: Andy Lutomirski , stable@vger.kernel.org Subject: Re: [PATCH] x86/kvm: Disable KVM_ASYNC_PF_SEND_ALWAYS In-Reply-To: <25d5c6de22cabf6a4ecb44ce077f33aa5f10b4d4.1583547371.git.luto@kernel.org> References: <25d5c6de22cabf6a4ecb44ce077f33aa5f10b4d4.1583547371.git.luto@kernel.org> Date: Sat, 07 Mar 2020 11:09:09 +0100 Message-ID: <87o8t8a33u.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andy Lutomirski writes: > The ABI is broken and we cannot support it properly. Turn it off. > > If this causes a meaningful performance regression for someone, KVM > can introduce an improved ABI that is supportable. > > Cc: stable@vger.kernel.org > Signed-off-by: Andy Lutomirski > --- > arch/x86/kernel/kvm.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c > index 93ab0cbd304e..71f9f39f93da 100644 > --- a/arch/x86/kernel/kvm.c > +++ b/arch/x86/kernel/kvm.c > @@ -318,11 +318,16 @@ static void kvm_guest_cpu_init(void) > > pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason)); > > -#ifdef CONFIG_PREEMPTION > - pa |= KVM_ASYNC_PF_SEND_ALWAYS; > -#endif > pa |= KVM_ASYNC_PF_ENABLED; > > + /* > + * We do not set KVM_ASYNC_PF_SEND_ALWAYS. With the current > + * KVM paravirt ABI, if an async page fault occurs on an early > + * memory access in the normal (sync) #PF path or in an NMI > + * that happens early in the #PF code, the combination of CR2 > + * and the APF reason field will be corrupted. I don't think this can happen. In both cases IF == 0 and that async (think host side) page fault will be completely handled on the host. There is no injection happening in such a case ever. If it does, then yes the host side implementation is buggered, but AFAICT this is not the case. See also my reply in the other thread: https://lore.kernel.org/r/87r1y4a3gw.fsf@nanos.tec.linutronix.de Thanks, tglx