Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1284863ybl; Wed, 21 Aug 2019 12:58:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMFdqzLPblievRoWUrG9L8nf+/fhGYUl9grZ1hBPZOvrLWQvWU1D4cNImagAqwMHbeP6ha X-Received: by 2002:a17:90a:4485:: with SMTP id t5mr1668999pjg.65.1566417483928; Wed, 21 Aug 2019 12:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566417483; cv=none; d=google.com; s=arc-20160816; b=xAU8tVkvUw6FBni3ycqtmFhClSFhD9XlP+pb2edaD3HCKhD9KVlLlAWy1Ks0hfGmEt TvP1eXoujzfHzZYi0BWfOdnjxu4vvFi0cikVjLUtFYg0T5aRvWDPl0dV81HAn15tfGqu MnseLwF32WXIt1BgoRfDB/3MFb0Szv5QpPqxBEeC8ZYTUnf1mrG/nsM+qkbMNgQGfi7z vYY/PMjCE2UHUz0dkLCcvHKYNyzX3p9zBVxWJbyJgDZYTlQ4LSG1ieyMFnxJiq12Lgz0 MSD10xnw1l3smeB3oO4aqS4T+SfBPJbcf8VivcL22a2YNyE5YF7zQpdJQ/AS6ZZ7A3O0 OJIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=tIK/8QHpkDFkqwtgLg9iwfWHI23FfFcu/WYNnVm2k20=; b=xrBhNQnNS2AWF45EbpfY7CgyudZ/ckWI8qrqUs3AG6I9QNwIFKEfwlDW4e+7I62WQX wrxZx7Fb145kXmo9THj7B3T2Rs/2N+s3f2d0ZFmtKs1ys2vAxunBVIMFTLzGVVFw7ln6 x1nESqCKRmeob4IQYMVWWiwlmAo7t0NNSyCrDjdCp/SQ9cKpJEpNDoLJEgMh3wHlv5R4 cFk2b9wBT0q49S5uSMZLr1BTWfrOrXXKxx9EucaRnkv53kLDK4yLYcrKuLGn5Qa3IobI vi1Nal0Htof9n8cPa0CBEBsOcsAgkh8Yg9/b6lZdjWibZNiX8wr8ZGkQ5Vp52mkSL1ac Z+tg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y190si16587180pfy.62.2019.08.21.12.57.48; Wed, 21 Aug 2019 12:58:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730167AbfHUTyg (ORCPT + 99 others); Wed, 21 Aug 2019 15:54:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47234 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726903AbfHUTyg (ORCPT ); Wed, 21 Aug 2019 15:54:36 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D34F63175295; Wed, 21 Aug 2019 19:54:35 +0000 (UTC) Received: from gigantic.usersys.redhat.com (helium.bos.redhat.com [10.18.17.132]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4182C194B2; Wed, 21 Aug 2019 19:54:35 +0000 (UTC) From: Bandan Das To: Thomas Gleixner Cc: Ingo Molnar , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/apic: reset LDR in clear_local_APIC References: Date: Wed, 21 Aug 2019 15:54:34 -0400 In-Reply-To: (Thomas Gleixner's message of "Wed, 21 Aug 2019 20:22:21 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 21 Aug 2019 19:54:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thomas Gleixner writes: > Bandan, > > On Wed, 21 Aug 2019, Bandan Das wrote: >> Thomas Gleixner writes: >> So, in KVM: if we make sure that the logical destination map isn't filled up if the virtual >> apic is not enabled by software, it really doesn't matter whether the LDR for an inactive CPU >> has a stale value. >> >> In x86/apic: if we make sure that the LDR is 0 or reset, >> recalculate_apic_map() will never consider including this cpu in the >> logical map. > ? >> In short, as I mentioned in the patch description, this is really a KVM >> bug but it doesn't hurt to clear out the LDR in the guest and then, it >> wouldn't need a hypervisor fix. > > I still needs a hypervisor fix. Taking disabled APICs into account is a bug > which has also other consequeces than that particular one. So please don't > claim that. It's wrong. > > If that prevents the APIC bug from triggering on unfixed hypervisors, then > this is a nice side effect, but not a solution. > Agreed and fwiw, the kvm fix has been queued already. >> Is this better ? > > That's way better. > > So can you please create two patches: > > 1) Make that bogus bigsmp ldr init empty > > That one wants a changelog along these lines: > > - Setting LDR for physical destination mode is pointless > - Setting multiple bits in the LDR is wrong > > Mention how this was discovered and caused the KVM APIC bug to be > triggered. Also mention that the change is not there to paper over > the KVM APIC bug. The change fixes a bug in the bigsmp APIC code. > > 2) Clear LDR in in that apic reset function > > That one wants a changelog along these lines: > > - Except for x2apic the LDR should be cleared as any other APIC > register > > Mention how this was discovered. Again the change is not there to > paper over the KVM APIC bug. It's for correctness sake and valid on > its own. > > Thanks, > Will do as you suggested. Thank you for the review. Bandan > tglx > >