Received: by 2002:a05:7412:8d08:b0:f9:2d0a:d759 with SMTP id bj8csp239492rdb; Sun, 17 Dec 2023 09:34:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrAkHsi3yU/Gt1Ia/2z6Ghhb824jypl49xkKQmZLO6ib4TUMhabIv6sl7fLzStW8V8PDY4 X-Received: by 2002:a05:6808:120c:b0:3b8:b063:505e with SMTP id a12-20020a056808120c00b003b8b063505emr18165461oil.95.1702834474027; Sun, 17 Dec 2023 09:34:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702834473; cv=none; d=google.com; s=arc-20160816; b=k/Z+srCnVzOBj+sFFPjZqTNZiZNTsbh1vazDK3iZO5tQBUOlqEEc+cqdNY6RSJrxSd HtRMaEuAHPOVhDrgsu6m/9RcQABDfNKzVjF0phasMVUDgDRJl2EO6CgRqwwHYyM+7EO8 O0E/oGhlbOIBdnlJHx78lC/Y5bRvjkZbusK6TIRcXUKkhDf7JUi3DWg4IOHQeJctckc5 tRuVMP4wTOmGktKav6VBkTp8CZ/B3BpGGhiOMYSYysavTSKDotLKyeQpyfktU44TfeIs PZnMI4ZZf5U7b2vJLS/0prJbW80/3lm/QpgkgdRwQUnX+0Dgg/AR5nATg2l5OdiBCNQe txWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=EC2ZiWMVE0bsblf0ibQ54FvtheWVnlzmW2NNfQKBpw8=; fh=PPS7r75Er+86of0ZGKnin0zZdsUZtJPCOT+z8FcvOo4=; b=RBrvvawlzsJoK2WDXhwCGc+I3xzFqyuSVros8ZJVG8tWAWG+tqZ7hyn+BJysHMxVYl l+PMtC1NyHFN7qMHD19ZYlYtp3dzCLI6VcB9q+08GejtQb+hqrvBNs7Yo6+PyOpoIKY3 jSulZM1zhnqZrXLwdhM1UYWVheqNeopoEUV+Xxp/o2FYwdvbVPWrGYIeXfG/lIAOVoEk Tf4ONDGqDAJXj74zNm04B1UnT78UEntTJ98mvVEma+/t/fyHlXkzZOqz4L/eSnBQfW5l P8/ReqSHAH6XfIWDOB2POZT599mSiBa3w4jR1nXH2+tPbPzybCsVAn1DKS/mJbo+yxhz 9Oag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LaqKKaN4; spf=pass (google.com: domain of linux-kernel+bounces-2743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s26-20020a63215a000000b005c600ffa335si16069973pgm.217.2023.12.17.09.34.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 09:34:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LaqKKaN4; spf=pass (google.com: domain of linux-kernel+bounces-2743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D652E283A75 for ; Sun, 17 Dec 2023 17:34:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0CAE46B90; Sun, 17 Dec 2023 17:33:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="LaqKKaN4" X-Original-To: linux-kernel@vger.kernel.org Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00F4746BA3 for ; Sun, 17 Dec 2023 17:33:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Sun, 17 Dec 2023 17:33:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702834395; 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: in-reply-to:in-reply-to:references:references; bh=EC2ZiWMVE0bsblf0ibQ54FvtheWVnlzmW2NNfQKBpw8=; b=LaqKKaN4EeFoK3k+Hr2niESb0jzOaUpU6BVyUO+geV3UBeR5UxBKxSEgAEihoTJyr76kza nTodzcGM+A5rKHpVIzvjy1fWb/VuxAolzy3NqFAjsfXrHwf9l1QUnji2LNoANoT1fgQL3R uGt0WWHNLmHluVe4HJ1RdJ3OPxtfNkc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Marc Zyngier Cc: Kunkun Jiang , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Jean-Philippe Brucker , "moderated list:ARM SMMU DRIVERS" , kvmarm@lists.linux.dev, open list , "wanghaibin.wang@huawei.com" Subject: Re: [bug report] GICv4.1: vSGI remains pending across the guest reset Message-ID: References: <7e7f2c0c-448b-10a9-8929-4b8f4f6e2a32@huawei.com> <87a5q983zc.wl-maz@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a5q983zc.wl-maz@kernel.org> X-Migadu-Flow: FLOW_OUT On Sun, Dec 17, 2023 at 11:26:15AM +0000, Marc Zyngier wrote: [...] > But this has *nothing* to do with the guest. This is the *host* > userspace performing a write to the redistributor view, which has > different semantics. Which is why your earlier description made no > sense to me. > > I think the problem is slightly larger than what you describe. A write > to ISPENDR0 should be propagated to the ITS for any values of the > latch, just like this happens on enabling HW-backed SGIs. > > Can you please give this a go? What do you think about using this as an opportunity for a bit of cleanup? It'd be nice unify the various MMIO and uaccess handlers for SPENDING + CPENDING while being careful about the arch_timer interrupt. clear = ~val; vgic_uaccess_write_spending(val); vgic_uaccess_write_cpending(clear); Happy to take your fix too, especially in case I missed something obvious :) [*] https://git.kernel.org/pub/scm/linux/kernel/git/oupton/linux.git/log/?h=kvm-arm64/vsgi-spending-fixes -- Thanks, Oliver