From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D9FCC3A59D for ; Mon, 19 Aug 2019 10:31:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC78A2082A for ; Mon, 19 Aug 2019 10:31:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="h/+hClRi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726992AbfHSKbo (ORCPT ); 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; >