Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2255310ybh; Mon, 9 Mar 2020 02:09:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv6UcJuwhEtk3KVuMkHVf2SoYJNL3clnJH7B3KgjMZKeoFgmCc8XkNgtzjeb1QyF5l7+Lpg X-Received: by 2002:a05:6808:4cd:: with SMTP id a13mr10727166oie.137.1583744998880; Mon, 09 Mar 2020 02:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583744998; cv=none; d=google.com; s=arc-20160816; b=WiN5TNom9XgjHkWiaftqq+UuO7GtT5gUBdwO+GCBjBPN/e7qgB96CCzkWw66fhlBAf wkWp2OceTQUdtLTgmx2TYc2Xhob8aU5kxYZVMCWunq72OQAW/WubjYMf5KT0z5f2Q6f4 ofXZVh1TtwrM6PoF8cRlj2DrrC+I/vBQ/KQu2bvsl1xboz9fXe934Z0hhkbiPFT4O0+9 XtllJGeAGITIb5rsUit8Cayewq5CAMA+ME0REDU7336cjFUzFhnvjSupl/h4im3HNucf HCrCamYIt4FcleLlS4mWRfe5eMMJcNPvG/DpjNjDeGA6JuvSjYofwfVz9MsSLBtet8mo uQYA== 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=X+VHDHS/dbanTbHshUwanrcmU/zIZj7Tfe8lTgOP8co=; b=W0PFhwm8nYce6YZUfEh5FasPWuTepogWgT+b2WLEX0Z2vcptuDne2zKWwUIW6sSUTF J9M72d+bHMEde8vzVWaQxpEog1gLavkAZKAKqU0zXIr8J7vQHu4a27nKZ/sLZAiZDOP9 YteZ0jSn5lVY22jc+kZww7Py5ArAJdblIlbic18Nr9CvYvDMCGEt6ae31YwOIMqXHP8t uH9Yk2RiirY+uJi83KCZ3mygMxg97cGKSUhYwiNwYrbw2McR/UDcIL7M2EVG2+Glegry u0FOpU+woOCaYTkFY0/Fk4zHC2gLvNwN4x+/mI1Xiq2TDML8F0qfpT6+83/1qYjrFX0n +6aA== 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 x4si5403168oto.217.2020.03.09.02.09.46; Mon, 09 Mar 2020 02:09:58 -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; 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 S1726640AbgCIJJF (ORCPT + 99 others); Mon, 9 Mar 2020 05:09:05 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58275 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbgCIJJF (ORCPT ); Mon, 9 Mar 2020 05:09:05 -0400 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 1jBEPF-0004Dh-IA; Mon, 09 Mar 2020 10:09:01 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id A737310408A; Mon, 9 Mar 2020 10:09:00 +0100 (CET) From: Thomas Gleixner To: Paolo Bonzini , Andy Lutomirski Cc: LKML , X86 ML , kvm list , stable Subject: Re: [PATCH v2] x86/kvm: Disable KVM_ASYNC_PF_SEND_ALWAYS In-Reply-To: <37440ade-1657-648b-bf72-2b8ca4ac21ce@redhat.com> 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> Date: Mon, 09 Mar 2020 10:09:00 +0100 Message-ID: <871rq199oz.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 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. Thanks, tglx