Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2703457ybh; Mon, 9 Mar 2020 11:14:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvcAMB3s78hcVPU9RjGg6uCi9l6ylSPq/zkPT/H1jNME/HRLuY3Rk8dwgenpT4himzLHTBV X-Received: by 2002:a05:6830:1599:: with SMTP id i25mr14112767otr.190.1583777689702; Mon, 09 Mar 2020 11:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583777689; cv=none; d=google.com; s=arc-20160816; b=fCpQP0+29+ZpBsAMK4LpSR/oOqGhe6CkUuPwARJCSKAq8y5cnBUAEZcNqeuhPWHgiE kdd2TzqFS+X/xMcMow7qJvZ7PGFiHk4tsfopkKkxgxLPMWXdGfv32VTakbbcL+ESe5xd uZkXyryYwNaQhBDVdzrFqYgoWjDb38wg4ooQ2Bx83yx7dGEiwjRkgxwHlcMst65c3by7 Y+k+EbhHEX/nanwefnCVwHN87/leMTBRFmiPkT4fYzjZamU9njDtYHay4/kdDBRQ5lem vlS9IgOfpQV5BQvYor+cz+1PU2LqNPFG9C+8P93dHj/qXC/zXnBaKHcyIpEU9mtTRJ3G RYnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=f0uvYl9b4zF1iXVWH6YVHxft9OKRJHR2pc5erUWDmVg=; b=DUxW1It1H2jP09l8vvaIeIwGtccHSwVQSxQuzaFzCc9T4R6RdYCYzL2oTHSpJcLhEO lhUhTSRmhkh0mUklogM/ZOvbTbiAIAfGg7eZmRVC1niupmcSclh3maih3pXy7xSEEAft a26Pa3dmABfHJeUy4a87l30Fe18+RxwCOXx+/6MrswB52VszYecmEeHy7Ar6eYtj/tTQ Ln3Pn7a0QPm6yAjdryjrYi9E3ODLDqSCGMgJe8p/MUZvvkOlDfn4ayXcoU3U0gHtPhDE 7yETxnky7yfcyur/2j53ISp837xwOVHamLzo47LKFvKYkzJoWU6k5y3mX/GE7BQks6LD 7Sww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JpN6DgIt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n24si1535353otk.310.2020.03.09.11.14.36; Mon, 09 Mar 2020 11:14:49 -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=@kernel.org header.s=default header.b=JpN6DgIt; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727388AbgCISOS (ORCPT + 99 others); Mon, 9 Mar 2020 14:14:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:58844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbgCISOS (ORCPT ); Mon, 9 Mar 2020 14:14:18 -0400 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B87622522 for ; Mon, 9 Mar 2020 18:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583777657; bh=GPOsnxPOWkitvcYLr873iWAuXAjAvRcZgDNyk1lxnSw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JpN6DgItReJj4bVteGdpRQHuRkryGz+QlPvJ+ob7GuABPmfHGSjjCZy1cIYhq+Ai5 v0XG8mBjVPqu3Hjl6uo0ho+Uy4cMuAjCdBYTAxLZjybdEMyNgzptrJ7CTEvDqQkCSp Z3fv5bx2ECjIIOnCVyJCI6m5hBP+bSrROSa6TK7Q= Received: by mail-wm1-f41.google.com with SMTP id g62so415810wme.1 for ; Mon, 09 Mar 2020 11:14:17 -0700 (PDT) X-Gm-Message-State: ANhLgQ1/+fvMT2sJa92fq0tOZbmls7IlE5Yx+L7O4goSV5fIVbnhm8vX qJvkeYrULanMs4lR1bLF+GUQHWlesOlTyoi2aUYeMA== X-Received: by 2002:a7b:cd83:: with SMTP id y3mr480519wmj.176.1583777656050; Mon, 09 Mar 2020 11:14:16 -0700 (PDT) MIME-Version: 1.0 References: <87ftek9ngq.fsf@nanos.tec.linutronix.de> <87a74s9ehb.fsf@nanos.tec.linutronix.de> <87wo7v8g4j.fsf@nanos.tec.linutronix.de> <877dzu8178.fsf@nanos.tec.linutronix.de> <37440ade-1657-648b-bf72-2b8ca4ac21ce@redhat.com> <871rq199oz.fsf@nanos.tec.linutronix.de> In-Reply-To: <871rq199oz.fsf@nanos.tec.linutronix.de> From: Andy Lutomirski Date: Mon, 9 Mar 2020 11:14:04 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] x86/kvm: Disable KVM_ASYNC_PF_SEND_ALWAYS To: Thomas Gleixner Cc: Paolo Bonzini , Andy Lutomirski , LKML , X86 ML , kvm list , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 9, 2020 at 2:09 AM Thomas Gleixner wrote: > > Paolo Bonzini writes: > > On 09/03/20 07:57, Thomas Gleixner wrote: > >> Thomas Gleixner writes: > >> > >> guest side: > >> > >> nmi()/mce() ... > >> > >> stash_crs(); > >> > >> + stash_and_clear_apf_reason(); > >> > >> .... > >> > >> + restore_apf_reason(); > >> > >> restore_cr2(); > >> > >> Too obvious, isn't it? > > > > Yes, this works but Andy was not happy about adding more > > save-and-restore to NMIs. If you do not want to do that, I'm okay with > > disabling async page fault support for now. > > I'm fine with doing that save/restore dance, but I have no strong > opinion either. > > > Storing the page fault reason in memory was not a good idea. Better > > options would be to co-opt the page fault error code (e.g. store the > > reason in bits 31:16, mark bits 15:0 with the invalid error code > > RSVD=1/P=0), or to use the virtualization exception area. > > Memory store is not the problem. The real problem is hijacking #PF. > > If you'd have just used a separate VECTOR_ASYNC_PF then none of these > problems would exist at all. > 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. At least until we get an async page fault due to apf_reason being paged out...