Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp266813rwb; Thu, 11 Aug 2022 00:42:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR66hx0CdPTRBobsgwWzFVBKBVp+ZLNYUalvUOAhhmY5f7UcU6CJ64Q7u5v6XJP3tmT9knyK X-Received: by 2002:a17:907:7fa7:b0:731:51b4:5020 with SMTP id qk39-20020a1709077fa700b0073151b45020mr13589503ejc.352.1660203754456; Thu, 11 Aug 2022 00:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660203754; cv=none; d=google.com; s=arc-20160816; b=zF1oSK5GA+LP4SYMvl6r9UuOs5Fu1SYfknweimOCdDvd4MTj4sENtxy6h8V5g4z8uJ rY1gK720uFmmUtTEz+dXMjCoKPAzGUTbzOo4FJzkqClcb5BEcXkMQ36+k7PB950AtzNP yGe6JJyWe3zfmqyCT3ktxdevQTjDMq1Aj0NBXnXtT5GnoQenvv0ZZnw70DBKbA2mzXN3 olRhfUHBq+Bh+rthGL1MsqmXo4KmguoVoGo193z0f3etE2WCrB6fgYUZUbz7+wJIeKn5 BS5jca3NyEoR7KJ8G8wUZ8AwZRikNL5LzDsUZxhqe4aSAK3LEF3s6XsGwUtvoHv/EijP Zvig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=UUY4oNhCDV5ex2akqHR3TnYfzZigpKeeFYzIPsZyWj4=; b=do7SZIso4prhUu37hjJ62SnZbBDWmVTBgAguJgfsnhqxbutb9w6Srf3Qz7yrgk7Uxm Z04CH9IVfUpxJoFPZ2sgoHe0rJ46XrCGNGVn3h9Gj1ETi/B1FBqBSQCqD/XdmB7L9KnY ZQFmK55Dt63WQC7NH4SD2Ah6ryI3B+JhxOlh+choQyN52Q4R+zOn8InNep1IqZJXW7Hm H9VZCqkhHWgFjiwaW9iD/o9VVIifrJvVi3fObDSAzIF20/pBtZokZMiGO37PR1T1iVb5 G6ArMooOCElQXqWaONBj/5tZ5C7t4CyNfJ3g9An6XeASCKfK7HAmkN+fIkwsWB+nP8o1 Hpyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GMiC1waY; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd22-20020a170907629600b0072ee922047asi7097009ejc.590.2022.08.11.00.42.07; Thu, 11 Aug 2022 00:42:34 -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=@redhat.com header.s=mimecast20190719 header.b=GMiC1waY; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234270AbiHKGsg (ORCPT + 99 others); Thu, 11 Aug 2022 02:48:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234088AbiHKGsf (ORCPT ); Thu, 11 Aug 2022 02:48:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 67F398B98A for ; Wed, 10 Aug 2022 23:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660200513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UUY4oNhCDV5ex2akqHR3TnYfzZigpKeeFYzIPsZyWj4=; b=GMiC1waYQKfQeG75Wsp+B7Pv9Jq4Zbbqvae4vRDRtLSohWesW9x/4ombHiI8hFyAvJwV+p YjJdrd4mHb8s7+KTGOyWxv4dbhUCSvO2UMYNtLbEnvipVlkAo0Ci/Sqd5/x7CRGAIAmIJK Kkg+NftwDzLsIVMdPBhweU2tnH+wCHI= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-370-RefDHaKNOECJadoosXPY9w-1; Thu, 11 Aug 2022 02:48:31 -0400 X-MC-Unique: RefDHaKNOECJadoosXPY9w-1 Received: by mail-ed1-f71.google.com with SMTP id b6-20020a056402278600b0043e686058feso10306540ede.10 for ; Wed, 10 Aug 2022 23:48:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=UUY4oNhCDV5ex2akqHR3TnYfzZigpKeeFYzIPsZyWj4=; b=oMt20MBviMo2GDWdIx7Ue+glh/fxVZ8fqpDloPp8DsMnpUwHR0kO3iDBJuhPVfutu5 ugeE6PyIB6o6MNOy3d+ozw2Ik8eSebGav3L5FHfTm01Gds9OpGH9dBnA0746iNCrmLXx U/3fF3tapyyRjsmQ8mC4BRTSHzhN5ySsM0DQlqNGv6273HD2CoZHmOvAysuEBlm/g7mg MuxRV8qMPUMhD7KmdW7khWiJec1dEnxV/7Q+Fs+EjpOS16ppKdcLADwRW5H8RndyMSik P5IIrCu5FUkpSksIPxNwZOCUE8klwfGw73wE1TKM3wOOkDan8IvUjN6SRmEvIpQr1KeW cYtw== X-Gm-Message-State: ACgBeo2nFCEMXyqFwkxVxX8WdkhJHOICIgNIGRXmS8F9V/rVJ0q2G/xm 4QH7s9Lam885bxe1GGcluagDEwWfa3miGnsWiVpWueVqALcnALlTQiFd48VfciB623cZVGDk/v+ nCSRlSq2vF3F909aN/4BU/gYF X-Received: by 2002:a05:6402:14b:b0:43d:a7dd:4376 with SMTP id s11-20020a056402014b00b0043da7dd4376mr29192334edu.89.1660200510619; Wed, 10 Aug 2022 23:48:30 -0700 (PDT) X-Received: by 2002:a05:6402:14b:b0:43d:a7dd:4376 with SMTP id s11-20020a056402014b00b0043da7dd4376mr29192311edu.89.1660200510368; Wed, 10 Aug 2022 23:48:30 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:9af8:e5f5:7516:fa89? ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.googlemail.com with ESMTPSA id s19-20020a056402015300b0043af8007e7fsm8697671edu.3.2022.08.10.23.48.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Aug 2022 23:48:29 -0700 (PDT) Message-ID: Date: Thu, 11 Aug 2022 08:48:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2 0/5] KVM: Fix oneshot interrupts forwarding Content-Language: en-US To: Dmytro Maluka , Marc Zyngier , eric.auger@redhat.com Cc: "Dong, Eddie" , "Christopherson,, Sean" , "kvm@vger.kernel.org" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "x86@kernel.org" , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , Alex Williamson , "Liu, Rong L" , Zhenyu Wang , Tomasz Nowicki , Grzegorz Jaszczyk , "upstream@semihalf.com" , Dmitry Torokhov References: <20220805193919.1470653-1-dmy@semihalf.com> <87o7wsbngz.wl-maz@kernel.org> <8ff76b5e-ae28-70c8-2ec5-01662874fb15@redhat.com> <87r11ouu9y.wl-maz@kernel.org> <72e40c17-e5cd-1ffd-9a38-00b47e1cbd8e@semihalf.com> From: Paolo Bonzini In-Reply-To: <72e40c17-e5cd-1ffd-9a38-00b47e1cbd8e@semihalf.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 8/10/22 19:02, Dmytro Maluka wrote: > 1. If vEOI happens for a masked vIRQ, notify resamplefd as usual, > but also remember this vIRQ as, let's call it, "pending oneshot". > > 2. A new physical IRQ is immediately generated, so the vIRQ is > properly set as pending. > > 3. After the vIRQ is unmasked by the guest, check and find out that > it is not just pending but also "pending oneshot", so don't > deliver it to a vCPU. Instead, immediately notify resamplefd once > again. > > In other words, don't avoid extra physical interrupts in the host > (rather, use those extra interrupts for properly updating the pending > state of the vIRQ) but avoid propagating those extra interrupts to the > guest. > > Does this sound reasonable to you? Yeah, this makes sense and it lets the resamplefd set the "pending" status in the vGIC. It still has the issue that the interrupt can remain pending in the guest for longer than it's pending on the host, but that can't be fixed? Paolo