From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Matlack Date: Tue, 31 Oct 2023 09:43:32 -0700 Subject: [PATCH v13 13/35] KVM: Introduce per-page memory attributes In-Reply-To: <20231027182217.3615211-14-seanjc@google.com> References: <20231027182217.3615211-1-seanjc@google.com> <20231027182217.3615211-14-seanjc@google.com> Message-ID: List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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) */ 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) */ 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 331F8C4332F for ; Tue, 31 Oct 2023 16:43:51 +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=qA5nhCiLkbWbiTwzZ3BDeGCRqnRKB8cORzxfsIKtP2w=; b=dhWk4JauZlfwXv lYtpuAn4hfZaewKJc8/CAzcNULI9TkuwTCDPRYarOnY9zr0DEMFEIFcy1i/UB/W9PyRGkQWCzR2u4 L2JQtiWY0W4DIeKcMqYUw+d6W5d9ymFKtHETfXUD8fpZk4/St2hN/UnukGm7eUJZTEl8olg/Ulg3p XD0D62aGCyFEADBDJRqLX7C/w1JYmqYRotWsavICEG8UlXzyjjdmKKPVR5ham8f71gjfKS/2V7rav DH0qB7jMv0e49rNxyLlqeuTm83+EB5/d1H6bgu+sRKcOqCDCXFX6ZnlCQHaODs1vohCoBC8jqPIz4 Y4FL5pd74ayoSqoAtF4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qxrqE-005iL8-1C; Tue, 31 Oct 2023 16:43:46 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qxrqB-005iJQ-1r for linux-riscv@lists.infradead.org; Tue, 31 Oct 2023 16:43:44 +0000 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6bd96cfb99cso5185236b3a.2 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.infradead.org; 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=rOVVdfTC9dzKfUXR/5F33NahGavPWVNlhX7+GLuMdo33niHSX0hrXvdAoWe4vtZQDW 2YomWcvTxn+DZ3lTCJFPbnoB78xbg++bSbCtsoxn02TKc0vAahU82eoHV6gxmtkEYIIB e29Q4vWBgxNofP3A0HTrVLmKa5eG9GB9OJVYEV77osBDfMtkYgiSo1f5lTDOZFn4a8Bn CWazNLB5vIAW3C/LkO9LwCuZPw9LbiYDxtIyYlJyIAnYtMh74tzE5DApndn5vsXps3gc 4eF2cKremh3SDcL8wnkbG03iuUmq3GYNz4cywPqnqYbT76oaKfbk3zeNiZT28gfqRreN hCUg== 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=N83TLxiJMkmEHmtSrUyG81F6K08OrxCjSqcGaLe6dKC+ZNjnyhCuJn+PMVCsxwsEjJ VOio8F219H60VxqFwmuQbGFiXvTJlaoAAB4Z5duhS5vIGTFf4JXTfD7Vr7jm/nCKMdVp K1pDZyvWmSSJVbJMqUnqscEuzqh3CGJrpcgp7B0ea7EciXsDSTUWMH/K45CBURl08TlN OrtbyKgShtzV8foPvhEoWt/SWbvbNKhB8omPoF+2u5Rr+c4Jp/IkjybPIcIoOiamag1l vtfq6bYjCGk1Wx+9vE+gGIkY1moMwH0Dbezv0T50T/VCzstrwnXuQ9dImTO6mKwuEyG3 w/Qw== X-Gm-Message-State: AOJu0Yyc0roSL7lCbClKQj8YCrW1txknALdvJB2ckKqD+qjEiAAhPp0G F6/S7xuq8CBghAifAWMidNAckQ== 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231027182217.3615211-14-seanjc@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231031_094343_609721_C78DB393 X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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) */ _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 8607EC4167B for ; Tue, 31 Oct 2023 16:44:36 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=Fy012kC2; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4SKbZq1304z3cVF for ; Wed, 1 Nov 2023 03:44:35 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=Fy012kC2; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=google.com (client-ip=2607:f8b0:4864:20::530; helo=mail-pg1-x530.google.com; envelope-from=dmatlack@google.com; receiver=lists.ozlabs.org) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4SKbYr2q3Xz3c5Y for ; Wed, 1 Nov 2023 03:43:43 +1100 (AEDT) Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5bcf83a8f6cso37787a12.2 for ; Tue, 31 Oct 2023 09:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698770620; x=1699375420; darn=lists.ozlabs.org; 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=Fy012kC2MddLIClUmA89vrfdj1IulQKs4mz8tDaPbJSGi6BU0TrIw7vxiismgJaSs4 UVacM2AlVW4RVnyYCkd3GwnAoxqc4i/7+A+FgyXJ1CdwM/i5YmDLxaSQdysVZF3Akw2Z SqfrieAmevXs5DRrgtr43gwSq7VC6+zSgdpaD08RlozSGCKp9911QK6MwrVmMxElgXJV yT07b2AgV/TnxGEFtLJ0bpfASWqcjSPJ+oscaia8poKxYPLH6zV+uEujF5DKVvW1d5Rg MOYmsRmCEYPZRQI75DqFocjK6j7kLxH46PEj5pwt5CMnaz2tIzs36SydhbBtbAmJA2IH 3xwQ== 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=fS/APuclHIW1S1/qQUDzONISdQizTTrwl8zQC9xOoJmmAPWngergX0plQc4P42jIIS t+ochZVCXRyOkevheMfl86Mr2g6iW9ZrfM4/w4SsdJNZNIVDekNGMB3vXzeVDsaMcOuj N6Aqkb00e0/ug+Qc3/mmWvPxEi66X6jr+D8jWWuQGH3bcQoeWy7gS3wZvY8seKN0KO6F HmnzLE6LrBg0fEsmTgqt3rmebodTwXISmYZGpkiZBtaCGilEBhshX/PVJg1yH8oQnfZf tbsaEI7N1iDjafKSXdH5PxCw1NITzdry6RCVQNvQHh3vWk9FuaLlqedYri0Ml+gBLhWS eqcA== X-Gm-Message-State: AOJu0Yxea6hA9mDi5qpT5gPu4tGr+982FfNqg6ATJzO936SSuwqhCLV1 lxA5cgyu8N9c4V2TUg/O8puITw== 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 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231027182217.3615211-14-seanjc@google.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Chao Peng , linux-riscv@lists.infradead.org, Isaku Yamahata , Marc Zyngier , Huacai Chen , Xiaoyao Li , "Matthew Wilcox \(Oracle\)" , Wang , Fuad Tabba , Yu Zhang , Maciej Szmigiero , Albert Ou , Vlastimil Babka , Michael Roth , Ackerley Tng , Alexander Viro , Paul Walmsley , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Isaku Yamahata , Christian Brauner , Quentin Perret , Li am Merwick , linux-mips@vger.kernel.org, Oliver Upton , Jarkko Sakkinen , Palmer Dabbelt , "Kirill A . Shutemov" , kvm-riscv@lists.infradead.org, Anup Patel , linux-fsdevel@vger.kernel.org, Paolo Bonzini , Andrew Morton , Vishal Annapurve , linuxppc-dev@lists.ozlabs.org, Xu Yilun , Anish Moorthy Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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) */ 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 07ABCC4167D for ; Tue, 31 Oct 2023 16:44:13 +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=1MEITYI/cCPu8eXjqz8A2LOCg41Dx+mfaLt+ulzzbx4=; b=tCRvVFxSpyZpBa ZaJKW3NeD51J7yZ5EG/h2zuQ5MG4e51ywvNtkPYtMNNAI+TRGGxkbZeabjKxk8M4dJLS8gCJv+yHQ fbVZsEDP3G2d8806s5p4l25us6rxB1tzBeBGxh1OhR94z55c4Q6lz7gYUBzmdrDxL56yfosiYzGfr AbVJk2ZYj7A6sMth9V2eWv/7TSazmuY3+SGLS9PXc+9mKYYexA6DNZxm2E3nleY3y2j5Jtxtr9X0w 90jBcn2DdhmOvc/s36iW/wFA/wc3XCQ+3jkX8CTBA9I4YPDE7e7oJWKGTWCxSgHl+ShJJ2oB7kKIC 7TAbvasXu+pmnM1l0H/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qxrqE-005iLc-3A; Tue, 31 Oct 2023 16:43:46 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qxrqC-005iJO-0N for linux-arm-kernel@lists.infradead.org; Tue, 31 Oct 2023 16:43:45 +0000 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5b999980689so1719250a12.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.infradead.org; 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=rOVVdfTC9dzKfUXR/5F33NahGavPWVNlhX7+GLuMdo33niHSX0hrXvdAoWe4vtZQDW 2YomWcvTxn+DZ3lTCJFPbnoB78xbg++bSbCtsoxn02TKc0vAahU82eoHV6gxmtkEYIIB e29Q4vWBgxNofP3A0HTrVLmKa5eG9GB9OJVYEV77osBDfMtkYgiSo1f5lTDOZFn4a8Bn CWazNLB5vIAW3C/LkO9LwCuZPw9LbiYDxtIyYlJyIAnYtMh74tzE5DApndn5vsXps3gc 4eF2cKremh3SDcL8wnkbG03iuUmq3GYNz4cywPqnqYbT76oaKfbk3zeNiZT28gfqRreN hCUg== 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=D26Csy7iU/X0Js+9ZOv4MTaaNACJqgbaxbGgGajdwFDQ7g5izwT8pbrZXVTivJACtz rX8ReS5QkobOZ15CivsP2y9s6Qy+OUlKRZIjwUFpswi7oCmQBhv+4D+hvFtIG9MQRtL9 KN1N2iC5hoaZ/T3j3lLWvyqO6ITf89GDPjSB2IZwI4in6oT2K83RyrAgxxQ211D4eFnS rOUEUIvYukzvixF7weN74HzwaVy84QflmFEwvoRoPnEl0InGwgmStdT84jcclLXzUl3e 90rHTFM/xByzZH2KjI/WFGF2OYd/2shLbc5rIK+RWkueO2ZM0P0y/VDSzRi3ccPDMNrh KQEw== X-Gm-Message-State: AOJu0Yx9Aav+FZwkZInf+2pIqaSKmcVOOY+GBvyXOmfXDPk022IxXNcT SzLdmQIWVV53uKGVT3blfNicRw== 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231027182217.3615211-14-seanjc@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231031_094344_154330_AECB835E X-CRM114-Status: GOOD ( 13.07 ) 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 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) */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel