From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-fw-9101.amazon.com ([207.171.184.25]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fNzkf-0002zY-8A for speck@linutronix.de; Wed, 30 May 2018 13:58:49 +0200 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-74cf8b49.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id w4UBwe5r042804 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL) for ; Wed, 30 May 2018 11:58:40 GMT Subject: [MODERATED] Re: [PATCH 1/2] L1TF KVM 1 References: <20180529194214.2600-1-pbonzini@redhat.com> <20180529194240.7F1336110A@crypto-ml.lab.linutronix.de> <99e589e5-6385-2e3e-aac4-6a5d6955a505@redhat.com> From: Martin Pohlack Message-ID: Date: Wed, 30 May 2018 13:58:33 +0200 MIME-Version: 1.0 In-Reply-To: <99e589e5-6385-2e3e-aac4-6a5d6955a505@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On 30.05.2018 11:01, speck for Paolo Bonzini wrote: > On 30/05/2018 01:54, speck for Andrew Cooper wrote: >> Other bits I don't understand are the 64k limit in the first place, why >> it gets walked over in 4k strides to begin with (I'm not aware of any >> prefetching which would benefit that...) and why a particularly >> obfuscated piece of magic is used for the 64byte strides. > > That is the only part I understood, :) the 4k strides ensure that the > source data is in the TLB. Why that is needed is still a mystery though. I think the reasoning is that you first want to populate the TLB for the whole flush array, then fence, to make sure TLB walks do not interfere with the actual flushing later, either for performance reasons or for preventing leakage of partial walk results. Not sure about the 64K, it likely is about the LRU implementation for L1 replacement not being perfect (but pseudo LRU), so you need to flush more than the L1 size (32K) in software. But I have also seen smaller recommendations for that (52K). Martin