From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E63451D522 for ; Tue, 31 Oct 2023 16:43:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HdSWA33D" Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-5b999980689so1719251a12.1 for ; Tue, 31 Oct 2023 09:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698770620; x=1699375420; darn=lists.linux.dev; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=KUWzNpZFu6ZH+LPCMipXBlnOZ2iMu0xo6DdlSVTTSCM=; b=HdSWA33Denqbij/zQK54FOjzePD6VfH6Krii9NbcJsHSdqN/xFFtUvkZ3N23rLHxYn yh8MpDoRZEAFvIDS2AyBaH/XIqIhY3DHqmEUnQLFRtYBpAN1Hpgl+8mBSEDQC1GtDbnO aM7NUE2O0/ng3rYtT8mZhteB9r6JbLUUMPD37fiJSAr/Yqu2PQ3/51M2CBj940hBVrzl sqYs/5+sGh9WGQSvs2JH/Z2rTADG9RJYxBwa61zcf6LprRQP30IxhXezp/H95GhD4eK+ MEfE578Dqv8egX2Tk4psUg1YE/JuezuYg7Q9I+5lMAmJKEGu3GoKWhy8CoC+E8fZef/U X3iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698770620; x=1699375420; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KUWzNpZFu6ZH+LPCMipXBlnOZ2iMu0xo6DdlSVTTSCM=; b=b532iqKgSA+VlGu0ssB7pMwzZ+fYKxpSUTlfNaV3uKpKnwi3QlcRutKmjvSdjjpTh1 /sW0bHFVuL7cDIJa4lcVNfqp8WVpQr1dBapehiaPgEH6Z69rR5nTnMQlD2Dn2JH/vWi7 S6Z3GX49m+MuxnTJnDE8XWAQrE5K+ZuMsnS6J4TbjiaSUxg2m21yjggmJNhjCrzy34K9 JFVrvObAP3DUacgAe7U0P3P3pfVOJmFzgSUwpRLUqfYls2QflqcLtC7kYDebXASK6mol FY3AkSS4caQk4VNmvShLzxjVxTM5/6AJ50LdmoLEACv1UjEGnX/zsDoMrhwTughVQ4rL KsNA== X-Gm-Message-State: AOJu0YwQmanbHbsReQt/fS5fC/w2pmdTMEfuhf1zZLb9/2TgM+Fso4e8 +uv3OchzQ1Wohe6SlfvVdUdjHA== X-Google-Smtp-Source: AGHT+IEij7+ydhlYjhr1xlKLUtNUJw25BFH2l+RQ8zeBA7dBnKRXxZXchV1bLlBIgwVsc3GuzIJ3dQ== X-Received: by 2002:a05:6a20:a10b:b0:15d:7e2a:cc77 with SMTP id q11-20020a056a20a10b00b0015d7e2acc77mr12395968pzk.48.1698770620059; Tue, 31 Oct 2023 09:43:40 -0700 (PDT) Received: from google.com (175.199.125.34.bc.googleusercontent.com. [34.125.199.175]) by smtp.gmail.com with ESMTPSA id fb17-20020a056a002d9100b006b1e8f17b85sm1451493pfb.201.2023.10.31.09.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 09:43:39 -0700 (PDT) Date: Tue, 31 Oct 2023 09:43:32 -0700 From: David Matlack To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xiaoyao Li , Xu Yilun , Chao Peng , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , Yu Zhang , Isaku Yamahata , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" Subject: Re: [PATCH v13 13/35] KVM: Introduce per-page memory attributes Message-ID: References: <20231027182217.3615211-1-seanjc@google.com> <20231027182217.3615211-14-seanjc@google.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: <20231027182217.3615211-14-seanjc@google.com> On 2023-10-27 11:21 AM, Sean Christopherson wrote: > From: Chao Peng > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 89c1a991a3b8..df573229651b 100644 > --- a/include/linux/kvm_host.h > +++ b/include/linux/kvm_host.h > @@ -808,6 +809,9 @@ struct kvm { > > #ifdef CONFIG_HAVE_KVM_PM_NOTIFIER > struct notifier_block pm_notifier; > +#endif > +#ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES > + struct xarray mem_attr_array; Please document how access to mem_attr_array is synchronized. If I'm reading the code correctly I think it's... /* Protected by slots_locks (for writes) and RCU (for reads) */