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 408DBC433FE for ; Tue, 1 Nov 2022 20:23:28 +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=bvkDm2b9FVWkZ4gU3p4lPxR0dMn9omcly/9pAZYd/9g=; b=tcyQ1/ZplK+kfe aJO+ozhEw/I7uXdsSdOq5BYUpvBMrZKv+OeKEL9MYPwtufiqw4rf2dhrXdVmkzyeXqGTzznMYw7X9 76f2Fc0ULayC+mEHH5cMv9HEZOLf9rNnXYPgGkjjzbaEra/q0w6mOlAajf3ZGTGJ7Bqd6p1nL/MvA jUOqUZ5tTurL7C0KBR/qsw9qZ2oak7hfGC4GbZgk9q/zoQoPLIGFa43YaSxU8H+HBKaikf4llm+sD xmGBE8JMvZ8xADgjCuMkRryEmrVltz3dUifQBbv8d9y5BNqiwkAAL9Nrh3NR0r/ydXhrwgCZF0Se9 LBDZBymZ3WYv40c2Widw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opxmB-006tv4-Kn; Tue, 01 Nov 2022 20:22:23 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opxm8-006tuO-7U for linux-arm-kernel@lists.infradead.org; Tue, 01 Nov 2022 20:22:21 +0000 Received: by mail-pf1-x433.google.com with SMTP id b185so14495016pfb.9 for ; Tue, 01 Nov 2022 13:22:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; 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=xVkJZtEBpIeuzqQn3nnjuzEWSUM1mVqhj+nnH0c1tQc=; b=M4X/osJ6VqZpKNtuP99fp4hNhqecoTugRL5QfWaIhyUxA9c53vT2gzUsKKGIv4cq+D N4IonfyyypScYrsv8ODBCuTAKMU/o3MuedyC4XY7mQxji9pS70V0SKgDvwYFSfWhghQ5 DSHIteFpQ5DT8H/yuhvbuDJ+aT14g2LOoyFC7UtDqZDOCQSYZGT07KnHz1DlHeril/bj KZ6lYlB1F8nR11PVom9zZllOxYKCdv33fJC9+NNvtrvNHgsPRLMmiaeyoIMyvL0/2rzw cm6ucLucJ1hX/EB3aXe+tUxGs+j1hQ/M65oNHUJ7CRlwtvLEnlMzSzEVZREE3HFHamlW wBrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=xVkJZtEBpIeuzqQn3nnjuzEWSUM1mVqhj+nnH0c1tQc=; b=J4jJUdjhEhoTWnpykZSwo9CmuUHama2R0rcP/VZ8IMgGzSxkXUTICIbr+1RxPnvqNi WBELUW4fjuokg3GRtEQLo4SVMaMfWoZVYBOKddgQaS8D/IpYpMRjGN2v35y+qImUaxco kUdRphMG0tRREA4uve4osswCkHcYg1sInfJO0naqVK1gfeni0++vjRmBhT1HchOvykqy j7R/ujfPECFTkLFls0dM00oqV1fBeud3H/duNTzQC7szfh7OXJ6SQu3TIDo2rOQx7rA8 Lx49HWW3Zmu4uVtWlydiLiDY8coIoE5Ie4RxiGBGootAESHbxE6IWgMp7e5kWbb5nsTh Xw4w== X-Gm-Message-State: ACrzQf3idPcAH78xGDzyLRu4cuV1IEmCDOB6qcVPs71nKGsREIIdEDil K957wIyhYTFX72BsTcOdPXaaUA== X-Google-Smtp-Source: AMsMyM7fD/Ym5AIcfwQwPvEeDSThfT/5hUO484wIK3KagW5eWCNhPeqPpcfATaT8FOx4g4d/EWqTBw== X-Received: by 2002:a05:6a00:2481:b0:56b:dc84:7ad1 with SMTP id c1-20020a056a00248100b0056bdc847ad1mr21687157pfv.43.1667334139000; Tue, 01 Nov 2022 13:22:19 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id x5-20020a170902ec8500b00187022627d8sm6816709plg.62.2022.11.01.13.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 13:22:18 -0700 (PDT) Date: Tue, 1 Nov 2022 20:22:15 +0000 From: Sean Christopherson To: Oliver Upton Cc: Marc Zyngier , James Morse , Alexandru Elisei , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Reiji Watanabe , Ricardo Koller , David Matlack , Quentin Perret , Ben Gardon , Gavin Shan , Peter Xu , Will Deacon , kvmarm@lists.linux.dev Subject: Re: [PATCH v3 08/15] KVM: arm64: Protect stage-2 traversal with RCU Message-ID: References: <20221027221752.1683510-1-oliver.upton@linux.dev> <20221027221752.1683510-9-oliver.upton@linux.dev> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221027221752.1683510-9-oliver.upton@linux.dev> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221101_132220_288752_5FFD0FD7 X-CRM114-Status: GOOD ( 10.82 ) 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 Thu, Oct 27, 2022, Oliver Upton wrote: > The use of RCU is necessary to safely change the stage-2 page tables in > parallel. RCU isn't strictly necessary, it's simply _a_ way to ensure readers have gone away prior to freeing memory. E.g. another method (used on x86 at least), is to disable IRQs when walking page tables without holding mmu_lock, and then requiring paths that free page tables to effectively do an IPI shootdown of all CPUs that are reading page tables. And "safely change" is misleading. RCU doesn't allow safely _changing_ page tables; if RCU did, then patch 10 wouldn't need to implement atomic updates. Protecting page table walks with RCU is purely about ensuring readers have gone away prior to freeing the backing memory, an entirely different mechanism is needed to allow parallel updates, e.g. the CMPXCHG + KVM_INVALID_PTE_LOCKED approach to ensure only one walker "owns" the detached page table. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel