Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp633463ybh; Sat, 7 Mar 2020 06:37:41 -0800 (PST) X-Google-Smtp-Source: ADFU+vveMGQHdNCztPKXbhDdOCNhW3jdh2Iy/fsF+TnqfvEPOGIYr2kDgil3oHD8+H/3G1smtaM9 X-Received: by 2002:a05:6808:195:: with SMTP id w21mr6199142oic.77.1583591861452; Sat, 07 Mar 2020 06:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583591861; cv=none; d=google.com; s=arc-20160816; b=ON9l49R2CUdTN5pmzIPIOb8t0F+stEgiTDmKA4MpoWIjoDPBv8e81XufU9UVNyFC4u Lew5WShdlhvojo02/LuTrqoq7kec1TRDwKJwecIfUMmisM9IyXBGZCTqIQ4Ukk0dsG2C XvLwyPD21yiQTMIWntohrkqrGz9mMjPGKrf7/qQTgp+DDCvD5PEmJkXoTLE05udJ08Zf eq3G0Je0f8SBgulYyb9GQ7M21YRwwt8gyqmEa8jtFzOde/eaFVqVqo2Xagi+RGz6jic6 a5lkd59N6VF4vGxHsfsEryvFXBfH7UHa8YA5b+tDvzH02wdEkPflLKVNCzH8p/uWX/9K Hhiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id:date:cc :in-reply-to:from:mime-version:subject:content-transfer-encoding :dkim-signature; bh=Z4Rg6QQ2ek1P6NQe6NBeu8rqSQu6+SNlYnv1B6QopIc=; b=kpUPPIaIly1YtOadvtEvqoeuCWmgriyafKttLIbF36iFRGxpq5SjWB//6YonzhJPAN dc+mcdxYJ8jXxsV3qGqRTF/6R415knAiPhphkYdVX6eC3iWhUQ5jxFmrFkWMxzNK76FY bFtdxG1tDk3KyQsjnGztl9szKgEL5jrPOTqXtCLRvTPUdDkHGi4fPYhh26EDHVc1rcsa Mx56ytvXjQHBIlOxZOfxSDA14WAqas4a5vb8cUA3a2vK6j/tGDnP9bF2XuhxCIWoATXw Kc2Z1tYm8KFz11PVAN+voI6diLfoHAscCVLVNs8zUa5EpGVu2lfp10gmNJN5+NBxeSla /OnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=dL+a1XBn; 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 h13si3067280otn.112.2020.03.07.06.37.29; Sat, 07 Mar 2020 06:37:41 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=dL+a1XBn; 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 S1726422AbgCGOgl (ORCPT + 99 others); Sat, 7 Mar 2020 09:36:41 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46693 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbgCGOgl (ORCPT ); Sat, 7 Mar 2020 09:36:41 -0500 Received: by mail-pf1-f194.google.com with SMTP id c19so298125pfo.13 for ; Sat, 07 Mar 2020 06:36:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:subject:mime-version:from:in-reply-to:cc :date:message-id:references:to; bh=Z4Rg6QQ2ek1P6NQe6NBeu8rqSQu6+SNlYnv1B6QopIc=; b=dL+a1XBn1NBkBQn11dVvHkoe9wJzQTRlgGfOLYVH54wkX8+kxpekJ6PEWKd10YxEBD /aAw1+vak/IHgDPlcP2znSwk2qM2SO0z3KrYWs+vObzzkBCankh/wiskH1Lg6bhBao+E +ue7Tnc4sEF0tzodkgAB7WyJ7ayUriP2GrPVBOmLJMPerA8aJrXMigX40/RB+V3woqJb 64XrAP5ftztYO97114EXMDVxjCSTH+hPw+sU9ELcTmKPZikE683k/WkeZg2g4idb6snl hyNR5IOsBy2pu1mE7wr6AK87EIm/3i3yrUQsOcdLorcVVmQ7nquttoRdFSZfZLzvSZkJ 90pQ== 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:subject:mime-version :from:in-reply-to:cc:date:message-id:references:to; bh=Z4Rg6QQ2ek1P6NQe6NBeu8rqSQu6+SNlYnv1B6QopIc=; b=p1TZypJlbJVsi4xt6k3nCk9HqkTB17Cgo5xDcFtaglUC00rx1+BBjz4fZFQXM1tP+b aH45dvL+7qYGRamArE4wSJ7KWuYbc8vdOHfHmv98hHzRpAbReeJDgKBBCWh2D8NRoGMD QknsziRyuygM2imYEIzy1xe9SC/p1Q+ovccUd1axjRjSI+dZ6DiKwKi0UFn0uUswHh4I KnDTyp1o/x1Ns/SlgBFEQ1QCRvIIovxOVj0Yqcxv+IRZMdJNYjdutfCBn49VhpqglldG CbS4NLZNR8+RpYaQoRYBu2mOR87p0gdhNuVFLkpXLcRxUJRvSmr3ufdhLLHVqoCATTfk BfDA== X-Gm-Message-State: ANhLgQ1o/C8nxdIxvhDfMEe7eVwyrCcqjrbG29WH3nGtoqbsBjx53J2P XKPzNM9+CtVC3zKc4jCZXot1cQ== X-Received: by 2002:a63:7c54:: with SMTP id l20mr8087166pgn.158.1583591798787; Sat, 07 Mar 2020 06:36:38 -0800 (PST) Received: from ?IPv6:2601:646:c200:1ef2:1892:9979:287d:69f2? ([2601:646:c200:1ef2:1892:9979:287d:69f2]) by smtp.gmail.com with ESMTPSA id b9sm10044706pgi.75.2020.03.07.06.36.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Mar 2020 06:36:37 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] x86/kvm: Disable KVM_ASYNC_PF_SEND_ALWAYS Mime-Version: 1.0 (1.0) X-Apple-Notify-Thread: NO X-Universally-Unique-Identifier: 366B8C02-5F63-478A-9EA9-F534EFF91F53 From: Andy Lutomirski In-Reply-To: <87o8t8a33u.fsf@nanos.tec.linutronix.de> Cc: Andy Lutomirski , LKML , x86@kernel.org, kvm list , Paolo Bonzini , stable@vger.kernel.org Date: Sat, 7 Mar 2020 06:36:35 -0800 X-Apple-Message-Smime-Encrypt: NO Message-Id: References: <87o8t8a33u.fsf@nanos.tec.linutronix.de> To: Thomas Gleixner X-Mailer: iPhone Mail (17D50) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 7, 2020, at 2:09 AM, Thomas Gleixner wrote: >=20 > =EF=BB=BFAndy Lutomirski writes: >=20 >> The ABI is broken and we cannot support it properly. Turn it off. >>=20 >> If this causes a meaningful performance regression for someone, KVM >> can introduce an improved ABI that is supportable. >>=20 >> Cc: stable@vger.kernel.org >> Signed-off-by: Andy Lutomirski >> --- >> arch/x86/kernel/kvm.c | 11 ++++++++--- >> 1 file changed, 8 insertions(+), 3 deletions(-) >>=20 >> 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) >>=20 >> pa =3D slow_virt_to_phys(this_cpu_ptr(&apf_reason)); >>=20 >> -#ifdef CONFIG_PREEMPTION >> - pa |=3D KVM_ASYNC_PF_SEND_ALWAYS; >> -#endif >> pa |=3D KVM_ASYNC_PF_ENABLED; >>=20 >> + /* >> + * 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. >=20 > I don't think this can happen. In both cases IF =3D=3D 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. Indeed. But read v2 please. >=20 > See also my reply in the other thread: >=20 > https://lore.kernel.org/r/87r1y4a3gw.fsf@nanos.tec.linutronix.de >=20 > Thanks, >=20 > tglx