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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D03A9C433FE for ; Sun, 26 Sep 2021 06:27:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B51FC610A2 for ; Sun, 26 Sep 2021 06:27:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbhIZG3M (ORCPT ); Sun, 26 Sep 2021 02:29:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46008 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbhIZG3L (ORCPT ); Sun, 26 Sep 2021 02:29:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632637655; 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=1TiBTpYstMaABQ/rAwh18m9vsSq3OqvaFEu629LcCL8=; b=AT5/PG0z3EzdeorlWOjcalMkMIuqdx/kSJlyedxA9a0Z5HaOAWh19SuOyQfVfP1hscnXDo ndrzwXzzRB5LVNi85EvMVI55Hx7Hnns/fgrq4gRTKomf4x5KJinVbPpTd/gfSLSyo8Vl98 RL+yotYrs93Q304RJn+4O16zB8UkSk4= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-508-_FUZm6mAO9q_KslOyXsh_A-1; Sun, 26 Sep 2021 02:27:33 -0400 X-MC-Unique: _FUZm6mAO9q_KslOyXsh_A-1 Received: by mail-ed1-f69.google.com with SMTP id 14-20020a508e4e000000b003d84544f33eso14578377edx.2 for ; Sat, 25 Sep 2021 23:27:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=1TiBTpYstMaABQ/rAwh18m9vsSq3OqvaFEu629LcCL8=; b=29kJeY1D21v7C5mOrhpoxtgXcGdlsynafGvxJqp0rMr9NsLHu3RabO/rDFtx/MSBi2 5DP0upaZxaqN2HtOLcREPOOkuhgOG2dZuWd5wDUKU62jsXUOxJh4KD5JadU09fuCU5sB +OYLuBhTH/oNlqSxV7ZW80swWAYSYVPyAkRmheMY2R5XKxvuhhfhUTmTw/z6FgUzKbe3 oksPDtx3JrPlOhvo6SayMNZys8JgPfkCPSP1V0fY1JQC6IZHVMZ4jLBLfFOpVPfCGLxA Od4UZdIKaeNcrzkKcP/O1mVT3K1tWVCyIHiUagDUvUU1/qlW+U80ZkgbQXKa7DHpXlM8 OFLA== X-Gm-Message-State: AOAM532DNGn2f/VgC9oV/GClY6Fjc6kphajeaSbATnEBvEkjFI5jukr3 UT5SgBgHQf6lkIZA8U2BmpzzV3kfXo2dJR7Y+/KyH6U7aOUh8mogofm7HZ455xOpKK0gZIA0bnJ GYwnnpivMNp1K64BrFdUHogN9 X-Received: by 2002:a17:906:bcf5:: with SMTP id op21mr21248195ejb.114.1632637652475; Sat, 25 Sep 2021 23:27:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKIxMWhBoRL018xLqTu0jQnou9ZPZ7BoXp91FbgfoN587mWDIRzysD7Ruz1/cm6u5Gy8RhTw== X-Received: by 2002:a17:906:bcf5:: with SMTP id op21mr21248168ejb.114.1632637652217; Sat, 25 Sep 2021 23:27:32 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id dk27sm8333826edb.19.2021.09.25.23.27.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Sep 2021 23:27:31 -0700 (PDT) Message-ID: <80d90ee6-0d43-3735-5c26-be8c3d72d493@redhat.com> Date: Sun, 26 Sep 2021 08:27:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH 07/14] KVM: Don't block+unblock when halt-polling is successful Content-Language: en-US To: Marc Zyngier , Sean Christopherson Cc: Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Jing Zhang References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-8-seanjc@google.com> <878rzlass2.wl-maz@kernel.org> From: Paolo Bonzini In-Reply-To: <878rzlass2.wl-maz@kernel.org> 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 25/09/21 11:50, Marc Zyngier wrote: >> there is no need for arm64 to put/load >> the vGIC as KVM hasn't relinquished control of the vCPU in any way. > > This doesn't mean that there is no requirement for any state > change. The put/load on GICv4 is crucial for performance, and the VMCR > resync is a correctness requirement. I wouldn't even say it's crucial for performance: halt polling cannot work and is a waste of time without (the current implementation of) put/load. However, is activating the doorbell necessary? If possible, polling the VGIC directly for pending VLPIs without touching the ITS (for example by emulating IAR reads) may make sense. IIUC that must be done at EL2 though, so maybe it would even make sense to move all of halt polling to EL2 for the nVHE case. It all depends on benchmark results, of course. Sorry for the many stupid questions I'm asking lately, but I'm trying to pay more attention to ARM and understand the VGIC and EL1/EL2 split better. Paolo 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF915C433EF for ; Sun, 26 Sep 2021 06:27:40 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 2E4C7610A8 for ; Sun, 26 Sep 2021 06:27:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2E4C7610A8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6D81F4B089; Sun, 26 Sep 2021 02:27:39 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@redhat.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tcAzMLfx6ifL; Sun, 26 Sep 2021 02:27:38 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3934A4B0B3; Sun, 26 Sep 2021 02:27:38 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id ACA8A4B08F for ; Sun, 26 Sep 2021 02:27:36 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2DDPEkbUQ90r for ; Sun, 26 Sep 2021 02:27:35 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 711424B089 for ; Sun, 26 Sep 2021 02:27:35 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632637655; 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=1TiBTpYstMaABQ/rAwh18m9vsSq3OqvaFEu629LcCL8=; b=AT5/PG0z3EzdeorlWOjcalMkMIuqdx/kSJlyedxA9a0Z5HaOAWh19SuOyQfVfP1hscnXDo ndrzwXzzRB5LVNi85EvMVI55Hx7Hnns/fgrq4gRTKomf4x5KJinVbPpTd/gfSLSyo8Vl98 RL+yotYrs93Q304RJn+4O16zB8UkSk4= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-508-tCY2hFG0NSqIqsvHdrxaVw-1; Sun, 26 Sep 2021 02:27:33 -0400 X-MC-Unique: tCY2hFG0NSqIqsvHdrxaVw-1 Received: by mail-ed1-f69.google.com with SMTP id r11-20020aa7cfcb000000b003d4fbd652b9so14500756edy.14 for ; Sat, 25 Sep 2021 23:27:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=1TiBTpYstMaABQ/rAwh18m9vsSq3OqvaFEu629LcCL8=; b=z3wAVS1vQu5gL1TtcrbwKn8ay6NT/LgRFGzndi1mIR9NuEUea94tzkIsfhPOSWaujy W6nNSCtNtVqYb2qvj21RdpJZ/RfB0PGhyqCq23aibB8q77GK491A37lWY5rE+ZpuCfgl oeBgCdcxWOdC3z0w0G6NuM8O6HBretHfqCXFtIB7SgSO9HWNsni1f8M23tKT56HwOoMd XdxDZZ/aYG0Xq0byZK2LFG3XIube8ltCHHE9zLyi/zjjrsiYDyfwTwRolTeHBNopiY77 NdjuYTxQI8XVl5Ai51IidibfUBp4LLLuvOrqzsyJAOyXwDvGFa6hA/0l9PFmBqm54NjW k4Vw== X-Gm-Message-State: AOAM533KA8sgJ5949P8T2A1Fbnm5ZiSzeXV1bk3arAWgDiGgZcJUfn1p auOLNpZurgQtGWJPngQPrkuprr+bxqF0nbrDFq0r/CzcEtnnXCxw/v0n1dVjmCAZeBDnLjQ/Zn9 e17iRbG+qimv/yamKdNfzx4B/ X-Received: by 2002:a17:906:bcf5:: with SMTP id op21mr21248194ejb.114.1632637652475; Sat, 25 Sep 2021 23:27:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKIxMWhBoRL018xLqTu0jQnou9ZPZ7BoXp91FbgfoN587mWDIRzysD7Ruz1/cm6u5Gy8RhTw== X-Received: by 2002:a17:906:bcf5:: with SMTP id op21mr21248168ejb.114.1632637652217; Sat, 25 Sep 2021 23:27:32 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id dk27sm8333826edb.19.2021.09.25.23.27.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Sep 2021 23:27:31 -0700 (PDT) Message-ID: <80d90ee6-0d43-3735-5c26-be8c3d72d493@redhat.com> Date: Sun, 26 Sep 2021 08:27:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH 07/14] KVM: Don't block+unblock when halt-polling is successful To: Marc Zyngier , Sean Christopherson References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-8-seanjc@google.com> <878rzlass2.wl-maz@kernel.org> From: Paolo Bonzini In-Reply-To: <878rzlass2.wl-maz@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Cc: Wanpeng Li , kvm@vger.kernel.org, David Hildenbrand , linux-kernel@vger.kernel.org, Paul Mackerras , Claudio Imbrenda , kvmarm@lists.cs.columbia.edu, Janosch Frank , Joerg Roedel , Huacai Chen , Christian Borntraeger , Aleksandar Markovic , kvm-ppc@vger.kernel.org, David Matlack , linux-arm-kernel@lists.infradead.org, Jim Mattson , Cornelia Huck , linux-mips@vger.kernel.org, Vitaly Kuznetsov X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On 25/09/21 11:50, Marc Zyngier wrote: >> there is no need for arm64 to put/load >> the vGIC as KVM hasn't relinquished control of the vCPU in any way. > > This doesn't mean that there is no requirement for any state > change. The put/load on GICv4 is crucial for performance, and the VMCR > resync is a correctness requirement. I wouldn't even say it's crucial for performance: halt polling cannot work and is a waste of time without (the current implementation of) put/load. However, is activating the doorbell necessary? If possible, polling the VGIC directly for pending VLPIs without touching the ITS (for example by emulating IAR reads) may make sense. IIUC that must be done at EL2 though, so maybe it would even make sense to move all of halt polling to EL2 for the nVHE case. It all depends on benchmark results, of course. Sorry for the many stupid questions I'm asking lately, but I'm trying to pay more attention to ARM and understand the VGIC and EL1/EL2 split better. Paolo _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E604C433F5 for ; Sun, 26 Sep 2021 06:29:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 F0F1F60F92 for ; Sun, 26 Sep 2021 06:29:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F0F1F60F92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pvhPKaKrF1sPu+BW/H5qtkqzsLfrl8wBVaJ6lhHrfjk=; b=ZAxf+slDx7FrJI Ug+rpMIu2XguEViuzci3GEfSg65vXrguEziPZcVBtaqrwnqTwz15eB9UzHsmWjS0lDCwPpCIlSSBi 1YV1d32Y0U1WF3PfsTkgg6S5RUxF7mYSGGAPkuKDjjg/BEyHJibyKxIzWtbCr3whlSOlR8Vus7EKL a53Jm+N1RhuL+ns/LL6J64MZv8EkARoDuTNas+bUFAn0kAuI8AlXFf6zfT6lJDntlK7rdAmfif3Ox hmjUMcEPH9bwyG2GvS1dCo02XQJPyAuFGW2NYAuYfNB/N/wfrUFW+HVmsArHElj9b0Y8plolT5qF+ 4UZ6iAAX1NIxkBJLHc1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUNdY-0005d4-NB; Sun, 26 Sep 2021 06:27:44 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUNdT-0005be-FF for linux-arm-kernel@lists.infradead.org; Sun, 26 Sep 2021 06:27:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632637655; 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=1TiBTpYstMaABQ/rAwh18m9vsSq3OqvaFEu629LcCL8=; b=AT5/PG0z3EzdeorlWOjcalMkMIuqdx/kSJlyedxA9a0Z5HaOAWh19SuOyQfVfP1hscnXDo ndrzwXzzRB5LVNi85EvMVI55Hx7Hnns/fgrq4gRTKomf4x5KJinVbPpTd/gfSLSyo8Vl98 RL+yotYrs93Q304RJn+4O16zB8UkSk4= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-596-WcXIsDWQMU6BjgSdXk1roA-1; Sun, 26 Sep 2021 02:27:33 -0400 X-MC-Unique: WcXIsDWQMU6BjgSdXk1roA-1 Received: by mail-ed1-f70.google.com with SMTP id m20-20020aa7c2d4000000b003d1add00b8aso14601344edp.0 for ; Sat, 25 Sep 2021 23:27:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=1TiBTpYstMaABQ/rAwh18m9vsSq3OqvaFEu629LcCL8=; b=EWNpLdAdbZOsSsKCJ6+mFad2f6OokKfdBKptvwlOpGUr/TqAy3vXF7KqpmKN9ufaQc jqIzAnpMZP6ElW9pbH0oBzH5zSuZpFv5LUQYQWLja2havXNvCvy3v1Hg4zBl3nkRODfk ozqXT14sRxokrBs5+Jb5Zt3zFFzwwakm+DZKWvWe6aqMm2jKXdcpRJ+Co/7HgisIAnGR PhnodCeualdD+OXk+mfSF+dqslBrEMxeDEgYX+fg+LZpAvcLVF1+PSKzlL9NfO9E+HBD a64FfmN4mZxAYc5W+l1wIs3Cli4xirkCqeu3TguDlTQZRLkKVmGHNnBdx2RrFnMcRseP Yd+g== X-Gm-Message-State: AOAM531qj0xIFu3iUvpjb1eIAzlEk1nlb0B1lKHefscTySun49PF9d5p ydOSdql0alsI4BJdEjxaAz60MMzaODqKupoC8DS8UyXR+ECXVSucD+Apze3a9hp6E+dS7ZwbJEp c5zbhSoJ3IvmxR0jLOtIQttehiiMBUpj/La8= X-Received: by 2002:a17:906:bcf5:: with SMTP id op21mr21248193ejb.114.1632637652475; Sat, 25 Sep 2021 23:27:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKIxMWhBoRL018xLqTu0jQnou9ZPZ7BoXp91FbgfoN587mWDIRzysD7Ruz1/cm6u5Gy8RhTw== X-Received: by 2002:a17:906:bcf5:: with SMTP id op21mr21248168ejb.114.1632637652217; Sat, 25 Sep 2021 23:27:32 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:63a7:c72e:ea0e:6045? ([2001:b07:6468:f312:63a7:c72e:ea0e:6045]) by smtp.gmail.com with ESMTPSA id dk27sm8333826edb.19.2021.09.25.23.27.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Sep 2021 23:27:31 -0700 (PDT) Message-ID: <80d90ee6-0d43-3735-5c26-be8c3d72d493@redhat.com> Date: Sun, 26 Sep 2021 08:27:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH 07/14] KVM: Don't block+unblock when halt-polling is successful To: Marc Zyngier , Sean Christopherson Cc: Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Jing Zhang References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-8-seanjc@google.com> <878rzlass2.wl-maz@kernel.org> From: Paolo Bonzini In-Reply-To: <878rzlass2.wl-maz@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210925_232739_643169_EA758D77 X-CRM114-Status: GOOD ( 11.82 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 25/09/21 11:50, Marc Zyngier wrote: >> there is no need for arm64 to put/load >> the vGIC as KVM hasn't relinquished control of the vCPU in any way. > > This doesn't mean that there is no requirement for any state > change. The put/load on GICv4 is crucial for performance, and the VMCR > resync is a correctness requirement. I wouldn't even say it's crucial for performance: halt polling cannot work and is a waste of time without (the current implementation of) put/load. However, is activating the doorbell necessary? If possible, polling the VGIC directly for pending VLPIs without touching the ITS (for example by emulating IAR reads) may make sense. IIUC that must be done at EL2 though, so maybe it would even make sense to move all of halt polling to EL2 for the nVHE case. It all depends on benchmark results, of course. Sorry for the many stupid questions I'm asking lately, but I'm trying to pay more attention to ARM and understand the VGIC and EL1/EL2 split better. Paolo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Date: Sun, 26 Sep 2021 06:27:28 +0000 Subject: Re: [PATCH 07/14] KVM: Don't block+unblock when halt-polling is successful Message-Id: <80d90ee6-0d43-3735-5c26-be8c3d72d493@redhat.com> List-Id: References: <20210925005528.1145584-1-seanjc@google.com> <20210925005528.1145584-8-seanjc@google.com> <878rzlass2.wl-maz@kernel.org> In-Reply-To: <878rzlass2.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Marc Zyngier , Sean Christopherson Cc: Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , James Morse , Alexandru Elisei , Suzuki K Poulose , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, David Matlack , Jing Zhang On 25/09/21 11:50, Marc Zyngier wrote: >> there is no need for arm64 to put/load >> the vGIC as KVM hasn't relinquished control of the vCPU in any way. > > This doesn't mean that there is no requirement for any state > change. The put/load on GICv4 is crucial for performance, and the VMCR > resync is a correctness requirement. I wouldn't even say it's crucial for performance: halt polling cannot work and is a waste of time without (the current implementation of) put/load. However, is activating the doorbell necessary? If possible, polling the VGIC directly for pending VLPIs without touching the ITS (for example by emulating IAR reads) may make sense. IIUC that must be done at EL2 though, so maybe it would even make sense to move all of halt polling to EL2 for the nVHE case. It all depends on benchmark results, of course. Sorry for the many stupid questions I'm asking lately, but I'm trying to pay more attention to ARM and understand the VGIC and EL1/EL2 split better. Paolo