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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E82A3C19F2D for ; Thu, 11 Aug 2022 06:48:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234272AbiHKGsh (ORCPT ); Thu, 11 Aug 2022 02:48:37 -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-Google-Smtp-Source: AA6agR5Ba9YTjPkLaTzT5BEMehKw/OU/+gGLQ1lTMMIGpaZjcs1rvnE8O296hVvPRv4q9RDqgjacjQ== 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 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