Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5100imw; Tue, 12 Jul 2022 13:24:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vs9EBlDL84hun0M7xbsmxjUxx/9ber8mzTfR2AbFXMijLUo6Yw405iHZGm/yOtF2bUR3Kh X-Received: by 2002:a17:902:efd1:b0:16b:dc3b:7fbc with SMTP id ja17-20020a170902efd100b0016bdc3b7fbcmr16996plb.45.1657657459272; Tue, 12 Jul 2022 13:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657657459; cv=none; d=google.com; s=arc-20160816; b=Vqcmp6ehr9qjD6yTFdkfOoD5B0AbpEyAZaxrsArMXTZ2HSDY5GnYQrZtDgtYPVDQP/ YAGc0mFVssRPA1ST4KWifEpLqE2YXghHhSHwX0JzWQbERuCYS4r6k4nkXF/Ia98aUlDK VUH/jpETUSioXnzyGngynhlrh3PgtEuUfxY+/SeEHUdc6Xp7iStQWYQJlCjjIqaaz3KX xXRTPG9Y5r3OzbDx/i868It3ljE9iMW+c+eVsymLbwKJP6WHdZbcA9K9IfHBUpv4Yfoa spPlHkAooAOzxu8AtsGsd0Hsfl7Z2XW3zTjfHWOYvdF7sFexgC3y9o7ISMhN1M54LiaN lphQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YWGv2k9yuFt3AP6MsL8a/IqZ/XziYs7UbpcSAKtrLiE=; b=pe/rpYJJNhoN6MQQbyeDTtve8IeLpQsfW+68SYjyL8Jv8yTaULaOatboYzlt0jbMto sfDSsvffFgxdsdorm+Z9a1mp5iFkFQ9uQLeAsch2FG+sjrq3KDlXrmwHu35VfXATSX0T VPoDXy2RErX6HrKcI7+SZ94DXlCWE9zF2KaUKeLD62Xz60sOyRAQHz4pJjgTjWC3oowB oqw+8kaUwNJf6xWurA2fWN612SdnyPm9LGaDEfXrnJRqlPeqoImFLqhINXNP2RVURe3O TZu2rG90Ty72qAyUai4ySk4xs6uArwGn1scahwNr/YsvDeHwWU7ZmsGHUmxotU9vUSmE xuEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Fsxp6O0F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a636b06000000b00415dfbed12bsi12054322pgc.514.2022.07.12.13.24.06; Tue, 12 Jul 2022 13:24:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Fsxp6O0F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234743AbiGLT2L (ORCPT + 99 others); Tue, 12 Jul 2022 15:28:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235711AbiGLT1v (ORCPT ); Tue, 12 Jul 2022 15:27:51 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 904E8104F30 for ; Tue, 12 Jul 2022 12:04:05 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id z12-20020a17090a7b8c00b001ef84000b8bso12742846pjc.1 for ; Tue, 12 Jul 2022 12:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YWGv2k9yuFt3AP6MsL8a/IqZ/XziYs7UbpcSAKtrLiE=; b=Fsxp6O0FRMeMVQgNOvnAAr89jc0DaJqSSlrg79HUbsZ52e8nQC7ePBFwhxUsaibYfn f/XWli2tSuBtGj0UmqymQrRan8Mg5rHUXCVNOIT0XfecCGfL0A2qB2srgrAlcYcNszJl lWroLwTJS2Bp9X0AztYJ+YrrhaOVSDhWZGzpgY3sBK2Hj+4Wfi6hnh0nl1totQY7q8Nl Z5ezIoU2trgfmI2HEpF0h0JhDTZ/RziffwRiIAd7cHOXzCbm918phf22NH1RxL99GGrk alrScZuYxkBLBB3Wnpl7EXOQTz2pybjG8g2j0cme/n1Mv4svhZSoNOfzIBjLE++Oj5hP 3kPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YWGv2k9yuFt3AP6MsL8a/IqZ/XziYs7UbpcSAKtrLiE=; b=uNelZVHuaEdIVUwDhbbpToUJ4h2n+vJeirYdSUDw6rmoTDkj8ou2ZYhcZlyl3AGAwT omH8ZjIyFkikq4bNQNdj5dg36ItF3X1AMHCVljF7D+O5QLxK7MZ5OeQUFLrwtg9Bzifa aH/tMo1XevsiaYuBX0yO4v9HeKKW7v2PGefab1kyTXvHLRsrGFsFv5Bv4BHr04DZLwLN +5OEYJZRl7jMda908T0AHqNhbLbhv3YqxlZPytcbeHR+2BjZ2KpIQdb1Ze3FWZeJ2NAp 5zqZ8rPgZgeM5KQ9w6JGTcQoZQ/KerNIXN5t2E0xDlqjUetVf6Ryb169/cYOqBFEYiG4 ehRw== X-Gm-Message-State: AJIora/pn8Wu6Krsc8PQ61xWHOptU82u+rg3YLn+/nI9Sr93Rwnznas+ cA7LuiqGI88n9Z/RGlpftnf/3Q== X-Received: by 2002:a17:902:cecb:b0:16c:40a8:88ff with SMTP id d11-20020a170902cecb00b0016c40a888ffmr14088810plg.33.1657652644709; Tue, 12 Jul 2022 12:04:04 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id f13-20020a170902684d00b0016bcc35000asm7173381pln.302.2022.07.12.12.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 12:04:04 -0700 (PDT) Date: Tue, 12 Jul 2022 19:04:01 +0000 From: Sean Christopherson To: Zhang Jiaming Cc: pbonzini@redhat.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, liqiong@nfschina.com, renyu@nfschina.com Subject: Re: [PATCH] KVM: LAPIC: Fix a spelling mistake in comments Message-ID: References: <20220701065558.9073-1-jiaming@nfschina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 12, 2022, Sean Christopherson wrote: > On Fri, Jul 01, 2022, Zhang Jiaming wrote: > --- > arch/x86/kvm/lapic.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c > index 48740a235dee..ef5417d3ce95 100644 > --- a/arch/x86/kvm/lapic.c > +++ b/arch/x86/kvm/lapic.c > @@ -830,13 +830,16 @@ static bool kvm_apic_match_physical_addr(struct kvm_lapic *apic, u32 mda) > return mda == kvm_x2apic_id(apic); > > /* > - * Hotplug hack: Make LAPIC in xAPIC mode also accept interrupts as if > - * it were in x2APIC mode. Hotplugged VCPUs start in xAPIC mode and > - * this allows unique addressing of VCPUs with APIC ID over 0xff. > - * The 0xff condition is needed because writable xAPIC ID. Doh, this won't apply on kvm/queue, I unintentionally generated this as a delta on top of your patch. I'll remedy that before testing and officially posting. > + * Hotplug hack: Accept interrupts for vCPUs in xAPIC mode as if they > + * were in x2APIC mode if the target APIC ID can't be encoded as an > + * xAPIC ID. This allows unique addressing of hotplugged vCPUs (which > + * start in xAPIC mode) with an APIC ID that is unaddressable in xAPIC > + * mode. Match the x2APIC ID if and only if the target APIC ID can't > + * be encoded in xAPIC to avoid spurious matches against a vCPU that > + * changed its (addressable) xAPIC ID (which is writable). > */ > - if (kvm_x2apic_id(apic) > 0xff && mda == kvm_x2apic_id(apic)) > - return true; > + if (mda > 0xff) > + return mda == kvm_x2apic_id(apic); > > return mda == kvm_xapic_id(apic); > } > > base-commit: ba0d159dd8844469d4e4defff4985a7b80f956e9 > -- >