Received: by 10.223.185.111 with SMTP id b44csp458411wrg; Fri, 9 Mar 2018 07:47:45 -0800 (PST) X-Google-Smtp-Source: AG47ELuaPnNu6Lle7NMvr5D8Bm6aIJwkK0X5uMMC7Hnd9+YoF0fbk4g3BxuXlUuycrxrAj4dR/rJ X-Received: by 10.99.173.79 with SMTP id y15mr24520419pgo.136.1520610465326; Fri, 09 Mar 2018 07:47:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520610465; cv=none; d=google.com; s=arc-20160816; b=JEKxLRsBUOnzuLdm6UQx8N6YS2WVcdge2fF9apw2MqjD2GAIwYXlTPaEpWLXh2N3NT Z+6yQZsOz0/tAAMiv7/qZmmW63dcBbSuj34p4xGJz89Q2t4jrO09fSBVHiW/tBetJzTD 5LKfwzxoKg6Hv00KSRLwAVFjkOoPPsEq87jAtXFggkWeqTR1Uyy9squUTanocQMMgk5+ 22BzDKhcKcb2lygRkX/PwTeBz+YjEN1UDwQfN22cH61EwX2dedzuh74m0RunKWlgpp17 2CmrMUrAg31sZhMb2kEA4V0549kQibY4gvhfJxEtkYIoKcBCcQ16AaRQcwsEWzfQL8sW nrmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ifYoTkvD4Xb3C9TngVg7vxHlh6Z85oImwWQtowWhvYc=; b=TYTG9ew7fHHMc2MoMlhiw0R3XGutZTbEytqbYkF9W2gJE8lqMDJEqP2/uYlcJBRcr6 gqFD8riQR55CbLDkMM18AoiONErKJ7hYnNGWfYlzeAOMA61iQ6cNsT18/nkjPcrnVc2K O46R8+6MWV3ju2MfYZchIJMXUO65xLKH3ANEy5aoG6VGj49GximNcBPpdz4ySCj0ih2T XB1yK4HlQH4oLWDBxTcRkZjdaUbH3vAEORRmI2Rox4iVyp1P/t61K9YGgIiNGx++mYv6 EXATXO4adEEAX6A39EvBgdKyeVEZO2bUCQKfXwomGJ99gDW0pliAhA4IVvNnrkzeVcDb AvkQ== 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 v4-v6si1051934plb.179.2018.03.09.07.47.30; Fri, 09 Mar 2018 07:47:45 -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 S932165AbeCIPqA (ORCPT + 99 others); Fri, 9 Mar 2018 10:46:00 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39010 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751096AbeCIPp7 (ORCPT ); Fri, 9 Mar 2018 10:45:59 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 911D3D142C; Fri, 9 Mar 2018 15:45:58 +0000 (UTC) Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 4114510AF9E7; Fri, 9 Mar 2018 15:45:56 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Fri, 09 Mar 2018 16:45:16 +0100 Date: Fri, 9 Mar 2018 16:45:16 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Vitaly Kuznetsov Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Paolo Bonzini , "K. Y. Srinivasan" , "Michael Kelley (EOSG)" , Roman Kagan , "Denis V . Lunev" Subject: Re: [PATCH v2 2/3] x86/kvm/hyper-v: remove stale entries from vec_bitmap/auto_eoi_bitmap on vector change Message-ID: <20180309154516.GA21100@flask> References: <20180301141514.3482-1-vkuznets@redhat.com> <20180301141514.3482-3-vkuznets@redhat.com> <20180308210804.GN12290@flask> <87muzhe0ls.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87muzhe0ls.fsf@vitty.brq.redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 09 Mar 2018 15:45:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 09 Mar 2018 15:45:58 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rkrcmar@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-03-09 16:21+0100, Vitaly Kuznetsov: > Radim Krčmář writes: > > This looks like it solves the problem when we get two SINTs with the > > same vector back-to-back , but shouldn't these bits really be cleared on > > EOI (either auto or manual)? > > Hmm, > > I was trying to address the following issue: guest programs SynIC's > SINTx with some vector but later re-programs it with a different > one. Without the patch synic->vec_bitmap and synic->auto_eoi_bitmap keep > stale data. If there's no concurrent interrupt than we're safe, but what > happens if there is one... > > kvm_hv_synic_send_eoi() already goes through all SINTx but we already > updated vector so it won't find any. We could've added something like > 'old_vector' but what if the request with this vector came _after_ we > re-programed SynIC (and, so, it wasn't meant to be serviced by SynIC?)? I now read that TLFS puts the responsitiblity on guest OS when toggling auto-EOI, so let's assume that the OS is to blame for disabling/changing vectors with pending interrupts as well. Applied all, thanks.