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 8982AEE7FF4 for ; Mon, 11 Sep 2023 15:59:45 +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-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=1pWaBDhgxLvF7ppGqk16mSFAESb/XGoI4slEjaMONRE=; b=K1N8eizPud2Ojp e57mxShpdcm3IFy7EIaCK23k9dKp0Ti9QQNLP8al++K9GFmSDsh0LdgEgtGlhb3fPV+ZK2B/CPZnE FI+Ulv0+y/iaSJBIlxBWwauUzqUILgdBpbpwy2+gcOKqXDP+o1AGrFR56ghbGSQ74coLq/YeH57qq jlog1gX3AeXh1X8L1Rb+pHSpMYzszIgxh0J+Oaca4qRcvtbjOJfT/05IJ5zwwjdFcg4vj79yhHIYU qHxtOmlMG43YZtXAqiaSHCZ5gx7KZHQzccRu2QSx0jEWlTVU7cZ9QM9Mjkd872Mf3xwVH+SJBxrb4 VcIcMULyCqvbj3tY0LKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qfjJr-000xHU-22; Mon, 11 Sep 2023 15:59:23 +0000 Received: from out-211.mta1.migadu.com ([2001:41d0:203:375::d3]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qfjJo-000xGp-0x for linux-arm-kernel@lists.infradead.org; Mon, 11 Sep 2023 15:59:22 +0000 Message-ID: <963a899d-d25a-368f-1465-851787c25959@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694447954; 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=UWGx8nOe8UMiBtiPfiV0PpeEd8UXtwFSIc0awgSTnuM=; b=PTq8pYHKGyxAQ1Loh2IKxBsBNTnU1jI78EQH7m5D4j7ZaoK3folTH6rtJGyjpE2fcB7SyH fkkyU6heVJkLwN5BD2gA48F0Kv9OJihdLzz4iFxMsbKc2TGg4O4wOuyrfj81awE85s4tlz xyXERjf+ougQ5lZK4ULixkULhYKsUAE= Date: Mon, 11 Sep 2023 23:57:39 +0800 MIME-Version: 1.0 Subject: Re: [PATCH 4/5] KVM: arm64: vgic-v3: Refactor GICv3 SGI generation Content-Language: en-US To: Marc Zyngier Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Xu Zhao References: <20230907100931.1186690-1-maz@kernel.org> <20230907100931.1186690-5-maz@kernel.org> <87ledd51tu.wl-maz@kernel.org> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Zenghui Yu In-Reply-To: <87ledd51tu.wl-maz@kernel.org> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230911_085921_139721_CA721E64 X-CRM114-Status: UNSURE ( 8.28 ) X-CRM114-Notice: Please train this message. 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 2023/9/11 02:18, Marc Zyngier wrote: > On Sun, 10 Sep 2023 17:25:36 +0100, > Zenghui Yu wrote: >> >> Hi Marc, >> >> I asked because it seems that in kvm/arm64 we always use >> kvm_get_vcpu(kvm, i) to obtain the kvm_vcpu pointer, even if *i* is >> sometimes essentially provided by userspace.. > > Huh, this is incredibly dodgy. I had a go at a few occurrences (see > below), but this is hardly a complete list. Another case is all kvm_get_vcpu(kvm, target_addr) in the vgic-its emulation code. As we expose GITS_TYPER.PTA=0 to guest, which indicates that the target address corresponds to the PE number specified by GICR_TYPER.Processor_Number, which is now encoded as vcpu->vcpu_id. Thanks, Zenghui _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel