Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2526006ybl; Mon, 19 Aug 2019 03:32:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcudquHt5iY5i5Y6jZir2vfJRtFPOHSpLMqlSQYn8usR//j9jK0R2zyjPUqg2wvuaT1Vw1 X-Received: by 2002:a62:be02:: with SMTP id l2mr23891082pff.63.1566210769557; Mon, 19 Aug 2019 03:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566210769; cv=none; d=google.com; s=arc-20160816; b=l2zl5ZIKN9FgHcCVbY82Z+5xuRM5xRVx3nYuvj1CbQkDMBSUGt4qmu+bSayKIXV0u3 LkRnxL5FB+KKUo4d8T9LMYwN6ja56xZQKnrGOpVX6nma9xrUQCOle6EC9h0IjxduG2cj CT1283o7CyWaeaS+lGmIUeLuTDbjfJJUwpTkdXbZUCp2ifjxocWYkhWs2VQW1RsbNLE3 z9+Q5pcVYuzB8R1K2R33aG96+kH6oeRYXvqKtfp04ADNtxvUV/Qaopl+Eb+QyMuZjpPo NoOllDkLWf9/5JeHbu2HSIMpATmwkPobtpRFWFAPQGNFtSFSZi2INcP8oq//xIQhyT8V oi3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=iE0NNemVcAdpNEuhQpJ7J7AH4HxsWqskXskDpZuRxZQ=; b=tHt0ECsbCIpg8ysCF5rzg1gmCGkLInsTCoEknyXgvDVoUj7vHQwFfGnXu67JBJNapR 6noGT416hVDPWQhnaLk+m+jHfPpXlp1MWB9+yfs4k9IbbEhRIfkQlQyKdf4pTSKxODw+ 3NTRHN/RFVOWG7H6/EQ97z2+KZMERWh2fQ88IFgqPZFhAlKg4NMEFlkEmJWfxwUrYruO 9C6TMbeLR3CyD3I5UtvPC2vcq/KyoNJ1pMrPJG8Q169i7qLPtz2pXMjDHowJ2jRyBOSd 1AHoLpck2YC9YIPgQTpz0mxJvyNIAZoLgJinTH4F8dvdn/kx/cXMiWcE3rwA/X/ynfsd YJIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="h/+hClRi"; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si9371299plt.26.2019.08.19.03.32.33; Mon, 19 Aug 2019 03:32:49 -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; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="h/+hClRi"; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726956AbfHSKbo (ORCPT + 99 others); Mon, 19 Aug 2019 06:31:44 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:21854 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbfHSKbn (ORCPT ); Mon, 19 Aug 2019 06:31:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1566210702; x=1597746702; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=iE0NNemVcAdpNEuhQpJ7J7AH4HxsWqskXskDpZuRxZQ=; b=h/+hClRieRI4s3RbEFAXYhw0I9JXcntVFTe7IknlLBqAX9kVpfItpXYd xMXQQvxcbL7GlB76EJaFQFb6l2lpEhE2jQ0nzNdghVJaIG11400OMkEDU ZFpyU4dBaHnjQbcsfk2HClU34QYrct0ecPmGH2xobdmEqO717U5sKF58Q U=; X-IronPort-AV: E=Sophos;i="5.64,403,1559520000"; d="scan'208";a="695087115" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 19 Aug 2019 10:31:33 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-2c665b5d.us-east-1.amazon.com (Postfix) with ESMTPS id A217DA07B3; Mon, 19 Aug 2019 10:31:30 +0000 (UTC) Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 19 Aug 2019 10:31:30 +0000 Received: from 38f9d3867b82.ant.amazon.com (10.43.161.214) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 19 Aug 2019 10:31:27 +0000 Subject: Re: [PATCH v2 10/15] kvm: x86: hyperv: Use APICv deactivate request interface To: "Suthikulpanit, Suravee" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" CC: "pbonzini@redhat.com" , "rkrcmar@redhat.com" , "joro@8bytes.org" , "jschoenh@amazon.de" , "karahmed@amazon.de" , "rimasluk@amazon.com" , "Grimm, Jon" References: <1565886293-115836-1-git-send-email-suravee.suthikulpanit@amd.com> <1565886293-115836-11-git-send-email-suravee.suthikulpanit@amd.com> From: Alexander Graf Message-ID: <2b26daff-6970-cca4-8553-962a6d829bdd@amazon.com> Date: Mon, 19 Aug 2019 12:31:24 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1565886293-115836-11-git-send-email-suravee.suthikulpanit@amd.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.161.214] X-ClientProxiedBy: EX13D27UWA002.ant.amazon.com (10.43.160.30) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.08.19 18:25, Suthikulpanit, Suravee wrote: > Since disabling APICv has to be done for all vcpus on AMD-based system, > adopt the newly introduced kvm_make_apicv_deactivate_request() intereface. typo > > Signed-off-by: Suravee Suthikulpanit > --- > arch/x86/kvm/hyperv.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c > index a39e38f..4f71a39 100644 > --- a/arch/x86/kvm/hyperv.c > +++ b/arch/x86/kvm/hyperv.c > @@ -772,9 +772,17 @@ int kvm_hv_activate_synic(struct kvm_vcpu *vcpu, bool dont_zero_synic_pages) > > /* > * Hyper-V SynIC auto EOI SINT's are > - * not compatible with APICV, so deactivate APICV > + * not compatible with APICV, so request double space > + * to deactivate APICV permanently. > + * > + * Since this requires updating > + * APIC_ACCESS_PAGE_PRIVATE_MEMSLOT, > + * also take srcu lock. > */ > - kvm_vcpu_deactivate_apicv(vcpu); > + vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); > + kvm_make_apicv_deactivate_request(vcpu, true); > + srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); Overall, I'm not terribly happy with the srcu locks. Can't we handle the memslot changes outside of the lock region, inside the respective request handlers somehow? Alex > + > synic->active = true; > synic->dont_zero_synic_pages = dont_zero_synic_pages; > return 0; >