Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp372636rdb; Tue, 31 Oct 2023 09:44:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5V/pFyb2NmqjGbOwfpujcpAqJaSH/z0mgCOSPVZEuW5y4pnfkJQbSmai38ovwBvPAPZkC X-Received: by 2002:a05:6a21:788b:b0:14c:5dc3:f1c9 with SMTP id bf11-20020a056a21788b00b0014c5dc3f1c9mr12347085pzc.49.1698770653796; Tue, 31 Oct 2023 09:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698770653; cv=none; d=google.com; s=arc-20160816; b=Ku3VY+g4SmmgVuTO8p+IYBFkAaO2OXTKyVsSzkLfejdLrF5u+xBmCmx6/zLThgsVUA wHdldNGVQMM5YkNjDeoZk5sfAZ9gbP+TA+/yI55tHh4DSwNim3JqL5FiL0koRrumomKs uCSIQs+zRlHO8eWYkWOqxfxDwqbmy+sfH4Bygo8nTs2NY8PipgJGCqhWHV3CyeYNJPY+ 1GyU6baS5VbYOnHKsc1M/IAPHv0VPkkS4ulpmLyfUXAvxuEPXcZtQ2Qq6UGdxkUBOZy/ UWCTVSpXw8/YJTw+GZHV8tIrqOL2wNPNnBinKKt/P97ia5+oy6JeFVS1PDUrcm5qf/HF 5Izw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KUWzNpZFu6ZH+LPCMipXBlnOZ2iMu0xo6DdlSVTTSCM=; fh=LZ2ykGQSSxG4k3YFOhV/A9AHxAcPUrSrhqMJqtwmpEo=; b=wwP+xXURqbKUIiiHPwqBFarsTPMpTwLvokLAdPrdVIkJTXXcc3ghw3FW6YUIt2Psn5 dQfAIFu4HedS/EI3SOg3oRlgNendSgz5HgzHU0v0OFuUAOtWH/rumX4YeCNQ7Ko37j+N EGLa+fWHkp7eVWtU1Lm0a3s1T+DQrNvgywRPY/oyebK8+uJ5pQ8HF6IBd1glPSeJf6R+ 2dIgOrVBBK58lFhJHMh35UmuHDG8vuM4Pmfiy1U+vpjulb0EtEQ2mlWqGhjr+Z0cmqi2 uuP+CUqiYU1ySF5UgNxxqdN9oTWlgtJV1qMH3FM9nrsfgFQ4Oj3o0tnsIWAGVLNJ7hCL O0nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="xq/K6WUJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id fj3-20020a056a003a0300b006bd018a5bcfsi1191878pfb.340.2023.10.31.09.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 09:44:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="xq/K6WUJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 35CD28048E5B; Tue, 31 Oct 2023 09:44:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345235AbjJaQnq (ORCPT + 99 others); Tue, 31 Oct 2023 12:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345451AbjJaQno (ORCPT ); Tue, 31 Oct 2023 12:43:44 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C58E8135 for ; Tue, 31 Oct 2023 09:43:40 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5ab53b230f1so4126903a12.3 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=vger.kernel.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=xq/K6WUJT8CqcSv142B1xusTthevqQt6VrjvnoB/CJrAeL2QYkp8xFzyY1QhKEn9o0 jB3q0hvnxRPMa+81oNjJCGfntadyK2H4PI+20Z771RVjlZek59qEx55TFuo8S92jI8J0 niwZwMOcRuVyHckT0B/XE0BqEiG+FWYXQN1MCYjyAfxwXktdeg2mDnBGmmq5EV62Fxfn /+y+SwE6dFPmC101DRBtthXKgkcejhuLrjUdnYNYJ9lwkSBq+WZyv95SWWu5SNrNxsGj kMDia302Dw1tdeq17HmMWj51BKtyGrY5Ek3gshWqT4HRovXRrC7UZaEdiCPodhEMOo1w hfBg== 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=uiORWhm8zQpdzI6JDN/IO9SRBngymhcdjTyZxt9poq8bQhBj8KXjrGmINofxKbQQA3 OF30OC55bhhMDWcqJ7iyRzcCOp27jcyyEoPuKscNNXD+7uTPUcQjK4N23LamEYHx0pWj MwKMotbwKMVE1tOO0hwLvUyuqctnc+7BufX5CSyYmLXHRIWDU+Fp9EaIdW4s0RSyAAM/ HDXbfle371E8ljBCoAWzg930Hd/3VMtKLKuVIkMwXgmjsGmommFsslqhLEb0Y4ExwnAo I/HauqWZdsbranDhp37SXD7vKXQRAvgRc13cccuIManIT/CoY0yHX+P9cncuOs+Ebo7l nMcg== X-Gm-Message-State: AOJu0YyixxlceUoBLyo3qoSeMIyzrcgZPcWHDdcbtWAuc34dqPFKfqof DEo78ZbDm4ZcLNVhP+2QCi9kGA== 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231027182217.3615211-14-seanjc@google.com> X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 31 Oct 2023 09:44:10 -0700 (PDT) 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) */