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 EDDCFFA3740 for ; Mon, 31 Oct 2022 09:19:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 709A84BAD6; Mon, 31 Oct 2022 05:19:02 -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=@linux.dev 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 yGg0r+kuvlVq; Mon, 31 Oct 2022 05:19:01 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 427714BAAD; Mon, 31 Oct 2022 05:19:01 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F1E734BA36 for ; Mon, 31 Oct 2022 05:18:59 -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 Glxs6RUC5sWL for ; Mon, 31 Oct 2022 05:18:58 -0400 (EDT) Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id CCC674BA0C for ; Mon, 31 Oct 2022 05:18:58 -0400 (EDT) Date: Mon, 31 Oct 2022 09:18:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1667207937; 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=UNUd2hX0hdMkIdzwLXRZNRwHJG+w0L3BFPgCSF2V2h4=; b=CaGONynma9CEbwNZEVDG+yImQsIJB5eeX0/0rXtRLfnfNR59VQBxdGKz6OlFPOb+BKcSaZ 1R55TELwMkeAGgecUypT465F9EutTVn2+LKfa+q0uToOuYVa05UhmGaWelJJn3Hobqz5kz jptzmt0+r8P9aPbHrF1iijrimPgKgtM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Gavin Shan Subject: Re: [PATCH v7 3/9] KVM: Check KVM_CAP_DIRTY_LOG_{RING, RING_ACQ_REL} prior to enabling them Message-ID: References: <20221031003621.164306-1-gshan@redhat.com> <20221031003621.164306-4-gshan@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221031003621.164306-4-gshan@redhat.com> X-Migadu-Flow: FLOW_OUT Cc: shuah@kernel.org, catalin.marinas@arm.com, kvm@vger.kernel.org, maz@kernel.org, andrew.jones@linux.dev, dmatlack@google.com, shan.gavin@gmail.com, bgardon@google.com, kvmarm@lists.linux.dev, pbonzini@redhat.com, zhenyzha@redhat.com, will@kernel.org, kvmarm@lists.cs.columbia.edu, ajones@ventanamicro.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 Mon, Oct 31, 2022 at 08:36:15AM +0800, Gavin Shan wrote: > There are two capabilities related to ring-based dirty page tracking: > KVM_CAP_DIRTY_LOG_RING and KVM_CAP_DIRTY_LOG_RING_ACQ_REL. Both are > supported by x86. However, arm64 supports KVM_CAP_DIRTY_LOG_RING_ACQ_REL > only when the feature is supported on arm64. The userspace doesn't have > to enable the advertised capability, meaning KVM_CAP_DIRTY_LOG_RING can > be enabled on arm64 by userspace and it's wrong. > > Fix it by double checking if the capability has been advertised prior to > enabling it. It's rejected to enable the capability if it hasn't been > advertised. > > Fixes: 17601bfed909 ("KVM: Add KVM_CAP_DIRTY_LOG_RING_ACQ_REL capability and config option") > Reported-by: Sean Christopherson > Suggested-by: Sean Christopherson > Signed-off-by: Gavin Shan Reviewed-by: Oliver Upton This patch should be picked up separate from this series for 6.1. The original patch went through kvmarm and I think there are a few other arm64 fixes to be sent out anyway. Marc, can you grab this? :) -- Thanks, Oliver _______________________________________________ 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 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) (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 8D9C517CDC for ; Mon, 31 Oct 2022 09:26:04 +0000 (UTC) Date: Mon, 31 Oct 2022 09:18:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1667207937; 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=UNUd2hX0hdMkIdzwLXRZNRwHJG+w0L3BFPgCSF2V2h4=; b=CaGONynma9CEbwNZEVDG+yImQsIJB5eeX0/0rXtRLfnfNR59VQBxdGKz6OlFPOb+BKcSaZ 1R55TELwMkeAGgecUypT465F9EutTVn2+LKfa+q0uToOuYVa05UhmGaWelJJn3Hobqz5kz jptzmt0+r8P9aPbHrF1iijrimPgKgtM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Gavin Shan Cc: kvmarm@lists.linux.dev, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, andrew.jones@linux.dev, ajones@ventanamicro.com, maz@kernel.org, bgardon@google.com, catalin.marinas@arm.com, dmatlack@google.com, will@kernel.org, pbonzini@redhat.com, peterx@redhat.com, seanjc@google.com, james.morse@arm.com, shuah@kernel.org, suzuki.poulose@arm.com, alexandru.elisei@arm.com, zhenyzha@redhat.com, shan.gavin@gmail.com Subject: Re: [PATCH v7 3/9] KVM: Check KVM_CAP_DIRTY_LOG_{RING, RING_ACQ_REL} prior to enabling them Message-ID: References: <20221031003621.164306-1-gshan@redhat.com> <20221031003621.164306-4-gshan@redhat.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221031003621.164306-4-gshan@redhat.com> X-Migadu-Flow: FLOW_OUT Message-ID: <20221031091844.Q9Ct15sC8xohEecIqPpUJkN0MoiS5QmV0WZa9hBn1T0@z> On Mon, Oct 31, 2022 at 08:36:15AM +0800, Gavin Shan wrote: > There are two capabilities related to ring-based dirty page tracking: > KVM_CAP_DIRTY_LOG_RING and KVM_CAP_DIRTY_LOG_RING_ACQ_REL. Both are > supported by x86. However, arm64 supports KVM_CAP_DIRTY_LOG_RING_ACQ_REL > only when the feature is supported on arm64. The userspace doesn't have > to enable the advertised capability, meaning KVM_CAP_DIRTY_LOG_RING can > be enabled on arm64 by userspace and it's wrong. > > Fix it by double checking if the capability has been advertised prior to > enabling it. It's rejected to enable the capability if it hasn't been > advertised. > > Fixes: 17601bfed909 ("KVM: Add KVM_CAP_DIRTY_LOG_RING_ACQ_REL capability and config option") > Reported-by: Sean Christopherson > Suggested-by: Sean Christopherson > Signed-off-by: Gavin Shan Reviewed-by: Oliver Upton This patch should be picked up separate from this series for 6.1. The original patch went through kvmarm and I think there are a few other arm64 fixes to be sent out anyway. Marc, can you grab this? :) -- Thanks, Oliver