Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 05 Jul 2018 21:44:02 -0000 Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fbC2j-0005AW-5b for speck@linutronix.de; Thu, 05 Jul 2018 23:44:01 +0200 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5F319818BAF8 for ; Thu, 5 Jul 2018 21:43:54 +0000 (UTC) Received: from [10.36.117.13] (ovpn-117-13.ams2.redhat.com [10.36.117.13]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8B65111DCFD for ; Thu, 5 Jul 2018 21:43:53 +0000 (UTC) Subject: [MODERATED] Re: ***UNCHECKED*** Re: [patch V5 05/10] KVM magic # 5 References: <20180702154426.910579106@linutronix.de> <20180702160528.906801335@linutronix.de> <46b8ee53-ad99-4c1c-f3c6-5aedd1edc168@redhat.com> <93694461-5f26-c3c8-afdc-b54900373346@suse.de> From: Paolo Bonzini Message-ID: <9a27324d-8572-e9b7-1830-d72eab9d78e4@redhat.com> Date: Thu, 5 Jul 2018 23:43:52 +0200 MIME-Version: 1.0 In-Reply-To: <93694461-5f26-c3c8-afdc-b54900373346@suse.de> Content-Type: multipart/mixed; boundary="2x2vyrqqUZm0pYver51G2PYvFr7kZ3FYj"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --2x2vyrqqUZm0pYver51G2PYvFr7kZ3FYj Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 03/07/2018 16:29, speck for Alexander Graf wrote: >=20 >=20 > On 03.07.18 10:23, speck for Paolo Bonzini wrote: >> On 02/07/2018 23:19, speck for Alexander Graf wrote: >>>> + vcpu->arch.l1tf_flush_l1d =3D true; >>> This means we flush when an external interrupt is the trap reason, bu= t >>> we may as well get the interrupt only after interrupts are enabled ag= ain >>> from vcpu_enter_guest(), no? How is an interrupt executing "normally"= >>> any different from an interrupt that causes a #vmexit? >>> >>> Or in other words: Is it worth it to have anything but always/never a= s >>> an option? Has anyone done benchmarks? >> >> Yes, and "always" is terrible. :(( See my reply to Boris a couple day= s >> ago. A good long term plan is to switch from blacklist to whitelist, >> and run the whitelisted vmexits with interrupts disabled; another >=20 > Doesn't that basically kill real time latency because you're now doing = a > full VMEXIT/VMENTER/VMEXIT dance just to get an interrupt? But then > again I guess flushing your L1 doesn't help to reduce jitter either ...= vmexits are rare, and most of them take 1000-2000 clock cycles, i.e. less than a microseconds, so the likelihood of getting an interrupt during the vmexit is relatively small. These short vmexits (mostly things like CPUID, very simple MSRs including LAPIC timer/tsc_deadline, probably ioeventfd too) would also be the ones that are whitelisted, so now you're just likely to have a vmexit/vmenter/vmexit to serve interrupts, after it'd be always like that= =2E Paolo >> possibility is to set a flag whenever softirqs run, and I'll send an R= FC >> on top of the basic pieces. >=20 > What about non-softirqs? >=20 >=20 > Alex >=20 --2x2vyrqqUZm0pYver51G2PYvFr7kZ3FYj--