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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72CEDC4332F for ; Wed, 4 May 2022 03:33:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 01F7249EC3; Tue, 3 May 2022 23:33:06 -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=@google.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 6qdxwTVeWtUA; Tue, 3 May 2022 23:33:04 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id DF1BB4A19A; Tue, 3 May 2022 23:33:04 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id BCBBA4A19A for ; Tue, 3 May 2022 23:33:03 -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 urbB2eVae5e0 for ; Tue, 3 May 2022 23:33:01 -0400 (EDT) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 7240E49EC3 for ; Tue, 3 May 2022 23:33:01 -0400 (EDT) Received: by mail-io1-f50.google.com with SMTP id c125so300626iof.9 for ; Tue, 03 May 2022 20:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MD7nPH76Zo4gzIjG6XroEYb+307Sv2T97DW30QPZNvQ=; b=GCl3tUY0CxUSs2045e7bW3K3OMlsoVKLkDorqwMDkmosI+DarqkAsVZ4JutaruMtaq VqOHlcJ06uzrO/wmARYsqy4RSsfaqwdhzD3Op9C9DJ5u3WeNoYMrxGWQJqnxWPKqFL+m QRzSecp35sYjpDFlnSHnjh/mzL55frzR8ayJsgdjMS8lI8QEEt6j4UwSDAa+YE+WH32M rV3TlIsrbFgDRyNTLm2bHTDSK86J1SDHWbQss+MyAldJlcz7OomuzVdYQ23f3ar+122V j7OlhJvOkCtMEdVkoOKHFBAlv4QIa6gkZRCnrkWY8IjFhbXMImgVlCcrzHCLhXwUXHth NoIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MD7nPH76Zo4gzIjG6XroEYb+307Sv2T97DW30QPZNvQ=; b=oknuAoFyZZKBgluLOok0fxy/cltn4aewE3w4BQ7jLTNeMDwoSEk6pvOj4PlcnITrfs kOjoOcp20pKZd5zbs9J1/IbKqYeTcnFm1A9ACRLZJSYAZyu0VeWC3Q05F/5qmuTodDjc 22P+gSr6tSzwbK7c8sglsQjYdp7AK+sKReCjNgKyP1JrrB8iaPyzjOuos9qtK/u29UYb AORZnVVYetEq5NqKen6XvSrnHgbqr5k//7L6id8r2Smq744aB33CBB0m4PM5OmhCK4uO COwKijW+ZKVinZtsIKIgQJFdaZ4gUBy3/qg7ftjxC8ddJcYws+PD/lyGOqajFaqUvApd WOdQ== X-Gm-Message-State: AOAM530VeGDEx3r0wJcnhoE0xV0W+Xfo4IIyQ3GopIo0uYIZy2iEFiIK 0g0c0T8mQKR9qZFH0IuKL4Aafw== X-Google-Smtp-Source: ABdhPJy7vKJ/E6XbgDQRiEIsUnMlj/99SQ3gJhSHQZ0B1pirVzABIhS85iAuFB/rJZ2xJyY7/WLvCg== X-Received: by 2002:a6b:2b0b:0:b0:65a:4c08:7063 with SMTP id r11-20020a6b2b0b000000b0065a4c087063mr6885026ior.92.1651635180562; Tue, 03 May 2022 20:33:00 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id v18-20020a056e0213d200b002cbed258dcfsm3913760ilj.0.2022.05.03.20.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 20:32:59 -0700 (PDT) Date: Wed, 4 May 2022 03:32:56 +0000 From: Oliver Upton To: Marc Zyngier Subject: Re: [PATCH] KVM: arm64: vgic-v3: Consistently populate ID_AA64PFR0_EL1.GIC Message-ID: References: <20220503211424.3375263-1-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220503211424.3375263-1-maz@kernel.org> Cc: linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel@android.com 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Tue, May 03, 2022 at 10:14:24PM +0100, Marc Zyngier wrote: > When adding support for the slightly wonky Apple M1, we had to > populate ID_AA64PFR0_EL1.GIC==1 to present something to the guest, > as the HW itself doesn't advertise the feature. > > However, we gated this on the in-kernel irqchip being created. > This causes some trouble for QEMU, which snapshots the state of > the registers before creating a virtual GIC, and then tries to > restore these registers once the GIC has been created. Obviously, > between the two stages, ID_AA64PFR0_EL1.GIC has changed value, > and the write fails. > > The fix is to actually emulate the HW, and always populate the > field if the HW is capable of it. > > Fixes: 562e530fd770 ("KVM: arm64: Force ID_AA64PFR0_EL1.GIC=1 when exposing a virtual GICv3") > Cc: stable@vger.kernel.org > Signed-off-by: Marc Zyngier > Reported-by: Peter Maydell Reviewed-by: Oliver Upton _______________________________________________ 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BCC77C433F5 for ; Wed, 4 May 2022 03:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mMTp9Oaj2Jk3whxb4LvaoaAz/u2K/iCVztiI60Fw77k=; b=JuMfXIJ9y9N+GK qbiDFGp6Y/gfcLyw0YFk16RkbF+j0ybr2u+HGWbaivHb82qduvIy8FJNSFwS7EGIEviCIq7eUEU00 riI8pgQUwcHeOCpX3IBFaPTnnLgBMMyQSj387zddhiQ+OEbR9b38Qc3VjRKmWtkd106LZbFjJKgLb WyNnd0NmBmX/dDkGz8PlncG3rHeCPV9EqlH8O3W6nIFjd3AspidQlo5PzhZpukwOGSY22IhiQvxGM j2qy/lC3KmJkApohNgABGXiC891OELQNQw3/Ej6xdZqbi4nCyQ+e/Uhagmhmo8Wd/K5nhFZNGjEMS wuEyKoutxYl40ykAU/NQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nm5lM-008djb-MC; Wed, 04 May 2022 03:33:17 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nm5lD-008ddw-Oa for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 03:33:10 +0000 Received: by mail-io1-xd2b.google.com with SMTP id z26so305475iot.8 for ; Tue, 03 May 2022 20:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MD7nPH76Zo4gzIjG6XroEYb+307Sv2T97DW30QPZNvQ=; b=GCl3tUY0CxUSs2045e7bW3K3OMlsoVKLkDorqwMDkmosI+DarqkAsVZ4JutaruMtaq VqOHlcJ06uzrO/wmARYsqy4RSsfaqwdhzD3Op9C9DJ5u3WeNoYMrxGWQJqnxWPKqFL+m QRzSecp35sYjpDFlnSHnjh/mzL55frzR8ayJsgdjMS8lI8QEEt6j4UwSDAa+YE+WH32M rV3TlIsrbFgDRyNTLm2bHTDSK86J1SDHWbQss+MyAldJlcz7OomuzVdYQ23f3ar+122V j7OlhJvOkCtMEdVkoOKHFBAlv4QIa6gkZRCnrkWY8IjFhbXMImgVlCcrzHCLhXwUXHth NoIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MD7nPH76Zo4gzIjG6XroEYb+307Sv2T97DW30QPZNvQ=; b=1FLIaW0kdKY+vZ63JvQbzE0fhj2ebL/zCMVWm+OXiZU0+hgIzlYxrapMUkHNHnx989 HpuASfK6P+r2HjrXQqpQWeaRGBWCnjM7xNSF4gjdYUgOvg5H4o11LqjHdaAoReGBLBrZ x/Rlz+zlbZl2DYgKqhqmLxIe02KRGmBV+SW/PLoeIBWqAB26sf7bVMonT9VPjpNi92vj Or036+iEQVCuhjaLG97FjVHBe09OHXDbwb47EOXrCG+6rTOrM0Ne86Hrb9cB/oyALh+i CXBIW2nt0gZL/ZnK/sEbLf7YujLIrwIkA+Iw7AdYV20qiNshg2sjlx5xklZ370HbjsER o9PQ== X-Gm-Message-State: AOAM533NDlWNqcbHIEpI3iW7g9rXzCX9wFlxb3iDSgxqDHA3HL9ukRNI CPK73Z4v/0tlyaf/QIh0F0hewA== X-Google-Smtp-Source: ABdhPJy7vKJ/E6XbgDQRiEIsUnMlj/99SQ3gJhSHQZ0B1pirVzABIhS85iAuFB/rJZ2xJyY7/WLvCg== X-Received: by 2002:a6b:2b0b:0:b0:65a:4c08:7063 with SMTP id r11-20020a6b2b0b000000b0065a4c087063mr6885026ior.92.1651635180562; Tue, 03 May 2022 20:33:00 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id v18-20020a056e0213d200b002cbed258dcfsm3913760ilj.0.2022.05.03.20.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 20:32:59 -0700 (PDT) Date: Wed, 4 May 2022 03:32:56 +0000 From: Oliver Upton To: Marc Zyngier Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kernel@android.com, stable@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: vgic-v3: Consistently populate ID_AA64PFR0_EL1.GIC Message-ID: References: <20220503211424.3375263-1-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220503211424.3375263-1-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220503_203307_840218_4E129A3E X-CRM114-Status: GOOD ( 15.87 ) 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 On Tue, May 03, 2022 at 10:14:24PM +0100, Marc Zyngier wrote: > When adding support for the slightly wonky Apple M1, we had to > populate ID_AA64PFR0_EL1.GIC==1 to present something to the guest, > as the HW itself doesn't advertise the feature. > > However, we gated this on the in-kernel irqchip being created. > This causes some trouble for QEMU, which snapshots the state of > the registers before creating a virtual GIC, and then tries to > restore these registers once the GIC has been created. Obviously, > between the two stages, ID_AA64PFR0_EL1.GIC has changed value, > and the write fails. > > The fix is to actually emulate the HW, and always populate the > field if the HW is capable of it. > > Fixes: 562e530fd770 ("KVM: arm64: Force ID_AA64PFR0_EL1.GIC=1 when exposing a virtual GICv3") > Cc: stable@vger.kernel.org > Signed-off-by: Marc Zyngier > Reported-by: Peter Maydell Reviewed-by: Oliver Upton _______________________________________________ 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 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 2617CC433F5 for ; Wed, 4 May 2022 03:33:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344324AbiEDDgi (ORCPT ); Tue, 3 May 2022 23:36:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343717AbiEDDgg (ORCPT ); Tue, 3 May 2022 23:36:36 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B7D81C10B for ; Tue, 3 May 2022 20:33:01 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id r27so329486iot.1 for ; Tue, 03 May 2022 20:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MD7nPH76Zo4gzIjG6XroEYb+307Sv2T97DW30QPZNvQ=; b=GCl3tUY0CxUSs2045e7bW3K3OMlsoVKLkDorqwMDkmosI+DarqkAsVZ4JutaruMtaq VqOHlcJ06uzrO/wmARYsqy4RSsfaqwdhzD3Op9C9DJ5u3WeNoYMrxGWQJqnxWPKqFL+m QRzSecp35sYjpDFlnSHnjh/mzL55frzR8ayJsgdjMS8lI8QEEt6j4UwSDAa+YE+WH32M rV3TlIsrbFgDRyNTLm2bHTDSK86J1SDHWbQss+MyAldJlcz7OomuzVdYQ23f3ar+122V j7OlhJvOkCtMEdVkoOKHFBAlv4QIa6gkZRCnrkWY8IjFhbXMImgVlCcrzHCLhXwUXHth NoIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MD7nPH76Zo4gzIjG6XroEYb+307Sv2T97DW30QPZNvQ=; b=JtiHpUd91siXtWVG5ETTkqgTXAr10QzSX3dkrlfoYPjT1GaGy7hPku6EJuVbT3rLUy KxIDVlto81Tyob6vhq6cusIrkoJxcIV1TAcJUVDevMysK+RMUEJZcEA0Jh/y8rHbSzvT oA35A9hg0h3An43wSX93KSrjxBkz/G854tnjUMVj9yUc8JxW6uHln8XAm4zLXodHUkAk ZhWMJNfY7GP6xPxvnd2bUMtnXDK4U4bSrPjxiP9Sw+OuXbgzvGrs7OBwV9gK3KsODePN GrAA5ysS+0lmt86rNHAoq8sZPUfh/xnvWbeAlc/OMTRRmX4MfGKyBSReV9wj2AbRH40N wZtw== X-Gm-Message-State: AOAM532bV9dzpLxXCzqhqsiRRtUu0bd+7QUv5T6oHfwPZO4sJmWrcLpo E1cX0FYu9BMnEergP7FuRG9Q+cZGpAv1sg== X-Google-Smtp-Source: ABdhPJy7vKJ/E6XbgDQRiEIsUnMlj/99SQ3gJhSHQZ0B1pirVzABIhS85iAuFB/rJZ2xJyY7/WLvCg== X-Received: by 2002:a6b:2b0b:0:b0:65a:4c08:7063 with SMTP id r11-20020a6b2b0b000000b0065a4c087063mr6885026ior.92.1651635180562; Tue, 03 May 2022 20:33:00 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id v18-20020a056e0213d200b002cbed258dcfsm3913760ilj.0.2022.05.03.20.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 20:32:59 -0700 (PDT) Date: Wed, 4 May 2022 03:32:56 +0000 From: Oliver Upton To: Marc Zyngier Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kernel@android.com, stable@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: vgic-v3: Consistently populate ID_AA64PFR0_EL1.GIC Message-ID: References: <20220503211424.3375263-1-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220503211424.3375263-1-maz@kernel.org> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, May 03, 2022 at 10:14:24PM +0100, Marc Zyngier wrote: > When adding support for the slightly wonky Apple M1, we had to > populate ID_AA64PFR0_EL1.GIC==1 to present something to the guest, > as the HW itself doesn't advertise the feature. > > However, we gated this on the in-kernel irqchip being created. > This causes some trouble for QEMU, which snapshots the state of > the registers before creating a virtual GIC, and then tries to > restore these registers once the GIC has been created. Obviously, > between the two stages, ID_AA64PFR0_EL1.GIC has changed value, > and the write fails. > > The fix is to actually emulate the HW, and always populate the > field if the HW is capable of it. > > Fixes: 562e530fd770 ("KVM: arm64: Force ID_AA64PFR0_EL1.GIC=1 when exposing a virtual GICv3") > Cc: stable@vger.kernel.org > Signed-off-by: Marc Zyngier > Reported-by: Peter Maydell Reviewed-by: Oliver Upton