Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8192970imu; Tue, 4 Dec 2018 04:37:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/WZBmJ61floJLfITmZAIp5oe47kW9bZ+MTsQMNMs/GDIQ+oo0IvKmES80WCllm6Ud7FUOWx X-Received: by 2002:a63:1904:: with SMTP id z4mr16068001pgl.135.1543927038983; Tue, 04 Dec 2018 04:37:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543927038; cv=none; d=google.com; s=arc-20160816; b=tmCLyTYCOROdWT3gmvEYYIjG5/EFvHExAcHR9aeizTHp5GCPjROVsXlZfTJJ+okJ9A V5t7cteXsMELaZjJ5fgAWhuLW6opWrYM+aCv10zVkuj0WchrqAl4SpP1dHQGLmLZRjRd esoA8gNpmk6qR2ggMGd997ZwYOVj4z99iRxA+tmoCUbh0RxGvjDGJJolAdLha8ilAv4B HdJ3DGYq/Nh+K9khBCJmjH9+pwDNmmAgSVd0sD33QCkMw8SWvbOzXQfWZkjtxtKe283D rP1GUv3iZ8q2fY+HFPkrnze49uAJEn658R4P5e9zWA9ZvAkafNZS0M+Coueop/G9SMww PS6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=WpfeHRwnTHXcZ8BVpgM7vU9KLrWD6uZNyayu138uVPI=; b=DPrtxaC5A8T3K61nP5csqpz+H2+QNlfa6FZ393IJIxODgpocugrkYjkuZYsOujT2BT IckHdrNvnTXobAs+AIf0fWbFlkZh4Z5DRCEO8Qb1Sgb3j4r/H7PHUpBhZoUeIdiyY+d0 4XIh4rZ8/0Euz+/oga34DS35UlXfU4agSmanWgzBAzTyW8zQTHJULKe5v0geTTlQaimi 7pZICPT+JhBRX/oeUSEM4o9CrSLgSgslSFgTbB3Vge9fvd2OuEUpB8/SzFwkhFDGxmwO ACCc5IvTbXncKzsjtBFzhurmm0szB+lInLuGmWlXBkTNT8G1WoRB0VqPJPg6myDCt6E0 qy8g== 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 h191si15220345pgc.302.2018.12.04.04.37.03; Tue, 04 Dec 2018 04:37:18 -0800 (PST) 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 S1726282AbeLDMgT (ORCPT + 99 others); Tue, 4 Dec 2018 07:36:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34980 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbeLDMgT (ORCPT ); Tue, 4 Dec 2018 07:36:19 -0500 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 F40943DE2F; Tue, 4 Dec 2018 12:36:18 +0000 (UTC) Received: from vitty.brq.redhat.com.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04D6D272D1; Tue, 4 Dec 2018 12:36:16 +0000 (UTC) From: Vitaly Kuznetsov To: Roman Kagan Cc: "kvm\@vger.kernel.org" , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , "linux-kernel\@vger.kernel.org" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , "x86\@kernel.org" , "Michael Kelley \(EOSG\)" Subject: Re: [PATCH v2 3/4] x86/kvm/hyper-v: direct mode for synthetic timers In-Reply-To: <20181203171220.GA2886@rkaganb.sw.ru> References: <20181126154732.23025-1-vkuznets@redhat.com> <20181126154732.23025-4-vkuznets@redhat.com> <20181203171220.GA2886@rkaganb.sw.ru> Date: Tue, 04 Dec 2018 13:36:15 +0100 Message-ID: <87muplwjsw.fsf@vitty.brq.redhat.com> 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.29]); Tue, 04 Dec 2018 12:36:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Roman Kagan writes: > On Mon, Nov 26, 2018 at 04:47:31PM +0100, Vitaly Kuznetsov wrote: >> @@ -379,6 +398,14 @@ void kvm_hv_synic_send_eoi(struct kvm_vcpu *vcpu, int vector) >> for (i = 0; i < ARRAY_SIZE(synic->sint); i++) >> if (synic_get_sint_vector(synic_read_sint(synic, i)) == vector) >> kvm_hv_notify_acked_sint(vcpu, i); >> + >> + for (i = 0; i < ARRAY_SIZE(hv_vcpu->stimer); i++) { >> + stimer = &hv_vcpu->stimer[i]; >> + if (stimer->msg_pending && stimer->config.enable && >> + stimer->config.direct_mode && >> + stimer->config.apic_vector == vector) >> + stimer_mark_pending(stimer, false); >> + } >> } > > While debugging another issue with synic timers, it just occurred to me > that with direct timers no extra processing is necessary on EOI: unlike > traditional synic timers which may have failed to deliver a message and > want to be notified when they can retry, direct timers just set the irq > directly in the apic. > > So this hunk shouldn't be needed, should it? Hm, you're probably right: kvm_apic_set_irq() fails only when apic is disabled (see APIC_DM_FIXED case in __apic_accept_irq()) and I'm not convinced we should re-try in this synthetic case. Let me test the hypothesis with Hyper-V on KVM, I'll come back with either a patch removing this over-engineered part or a reson for it to stay. Will do later this week. Thanks! -- Vitaly