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=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 3D9A6C433ED for ; Thu, 20 May 2021 17:47:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCA866124C for ; Thu, 20 May 2021 17:47:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCA866124C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uzNFIOBusBgaOKMW245ahDO8YZonwujZ1OIS7ijqrZw=; b=QnQTLjo2Cz175CXiYMzwxpTmsI 9qs8ag3NZFVvuMZml3XlWrEM5Drte+D8TgsfstGPjcEmu/8KWAEuOJfNnzLo9zdB0r4mj6RMq619Z JaEe7iqtGJZn8+VLWbCqEUJSNFCDhhF6/RvZT+0xJ/WqmZKwi0TScqewmx2u2N/H1AfBX/8LX8dLn /7CzZhxXlce/b+SLj12cigptj4Om4IbH6sytzZU5vAIbQe0ND4wxENfDeM40DWiaTYiKNRCtrrVRf 9xf4Jvo9DJVaX5vMQ+pd8YEyXzIv6noYOooaRecMEolf+fZlKUDbaH3k6TtRABbmmZRaM4ITgaUgi FH75eBWA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljmk4-0028nv-Tw; Thu, 20 May 2021 17:45:53 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljmk1-0028m5-D9 for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 17:45:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=IxnB0pLfoxZsDZc0nxk+bT3YUxBojjvlti5wGeaCTSk=; b=2nI9xv7IAvF/xRB/eBE6AN4taE V4Cp7tyQzCgBxFU9aQr1RySThnU0eVsRTdwTT16ZZETMGVHBHgTYFskwzZhIA6eO3yxqMfA7vDDIl KWetpgrHM8/+j6a72hgJ0D5/jipHUh6dtdsXou1EQxJDiJkocN00lzWMJtQ5aeYVoAihLMFXCFblC H89kk98pF5Gw18cwE7qLEKlBbn1DKXu8pri/WdDNs6N5P1SXhSVuc7oHSxjQtyqTnqvdsdZGrucdd Z8bp9DHk/PdhDlZaoaOH4OAd6dgTCsXzCGzkVIVXzDQH5sohpFBHYlxT/+xqMA/U7/poFu41/Z7L7 OfthNNnQ==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljmjx-00GY90-Tq for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 17:45:47 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2AC0411B3; Thu, 20 May 2021 10:45:39 -0700 (PDT) Received: from [192.168.0.110] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CF6BF3F719; Thu, 20 May 2021 10:45:37 -0700 (PDT) Subject: Re: [PATCH v3 2/9] KVM: arm64: Handle physical FIQ as an IRQ while running a guest To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Cc: James Morse , Suzuki K Poulose , Eric Auger , Hector Martin , Mark Rutland , kernel-team@android.com References: <20210510134824.1910399-1-maz@kernel.org> <20210510134824.1910399-3-maz@kernel.org> From: Alexandru Elisei Message-ID: <2311e75e-589c-4602-e81f-c639e7a33bd9@arm.com> Date: Thu, 20 May 2021 18:46:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210510134824.1910399-3-maz@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_104546_060562_9CCF0585 X-CRM114-Status: GOOD ( 20.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Marc, On 5/10/21 2:48 PM, Marc Zyngier wrote: > As we we now entertain the possibility of FIQ being used on the host, > treat the signalling of a FIQ while running a guest as an IRQ, > causing an exit instead of a HYP panic. I've mulling over this, and I can't find anything wrong with it. Any FIQs for which there is no handler registered by the interrupt controller will panic in the default_handle_fiq() FIQ handler, similar to the current KVM behaviour. And if there is a handler registered (only AIC does it for now), then a FIQ will be handled just like any other interrupt instead of KVM panic'ing when the host can handle it just fine. I've briefly considered creating a new return code from __kvm_vcpu_run, ARM_EXCEPTION_FIQ, but I really don't see any reason for it, since it will serve the same purpose as ARM_EXCEPTION_IRQ, which is to resume the guest without any special exit handling. It makes sense to me for KVM to handle FIQs just like IRQs, now that the kernel treats them the same: Reviewed-by: Alexandru Elisei Thanks, Alex > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/hyp-entry.S | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S > index 5f49df4ffdd8..9aa9b73475c9 100644 > --- a/arch/arm64/kvm/hyp/hyp-entry.S > +++ b/arch/arm64/kvm/hyp/hyp-entry.S > @@ -76,6 +76,7 @@ el1_trap: > b __guest_exit > > el1_irq: > +el1_fiq: > get_vcpu_ptr x1, x0 > mov x0, #ARM_EXCEPTION_IRQ > b __guest_exit > @@ -131,7 +132,6 @@ SYM_CODE_END(\label) > invalid_vector el2t_error_invalid > invalid_vector el2h_irq_invalid > invalid_vector el2h_fiq_invalid > - invalid_vector el1_fiq_invalid > > .ltorg > > @@ -179,12 +179,12 @@ SYM_CODE_START(__kvm_hyp_vector) > > valid_vect el1_sync // Synchronous 64-bit EL1 > valid_vect el1_irq // IRQ 64-bit EL1 > - invalid_vect el1_fiq_invalid // FIQ 64-bit EL1 > + valid_vect el1_fiq // FIQ 64-bit EL1 > valid_vect el1_error // Error 64-bit EL1 > > valid_vect el1_sync // Synchronous 32-bit EL1 > valid_vect el1_irq // IRQ 32-bit EL1 > - invalid_vect el1_fiq_invalid // FIQ 32-bit EL1 > + valid_vect el1_fiq // FIQ 32-bit EL1 > valid_vect el1_error // Error 32-bit EL1 > SYM_CODE_END(__kvm_hyp_vector) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel