Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp64403lfe; Fri, 15 Apr 2022 19:43:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSMsV7gBWgxHDMOzv35qeKtRMEEqoKlA+QZAj6lcqyLXMqmkWzmB6SuADCgov+jqwvyacd X-Received: by 2002:a63:1821:0:b0:39c:c771:dc2 with SMTP id y33-20020a631821000000b0039cc7710dc2mr1379106pgl.507.1650076982418; Fri, 15 Apr 2022 19:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650076982; cv=none; d=google.com; s=arc-20160816; b=aWEsOASRnJLNbP9kIZqOsP6XJi6nUxiCmVCfWMZ1nipV3/8QVjj6b0/vbeD1La5SR+ HJ/qMVwJcAIpZ2sUSktvZ4r5zD6IOWgNnM/u1wJKR4SBvHdmEjFZF+YDLMTvhVhpIvmk AJ/hK70nuK8zXbTLT09dpEmJdJwKLloNsAP2E16a5u4C3ZcokH67hgdSK/5DfLVxgVUQ r9xPzL4tIypTeB6y247GthBSyD4+bMAMAl+0ApW8lotnnUOiafOz87pRQkpK5lezpD4I WijMruakMyNi67JAuBF499mdnerWrw9x5khEgCfKdNSX9I2arHriCxm1lxtihe9iaQDs 3ZjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sC0w0c5sZQ7I2NKXJXP7xBl/6xzYAi7J1QI4oFL37F0=; b=gueEpTCbOP4T9Od1WkYq9OiLe/1auftPhhbMP1eZWKVWeZkxEngT1sJgXeWEQRgrX2 +RPyi3Bj9ADp4rcOu0+KrVqQJUGC7DYpc7gSq9g+6zHOZ/vcSjRXJPngyPubCV6R3yJo v6Zt02dI5Q2TCQ8KDEHqTnSjdmZOA34vXgPCJAdHwQJwbx8nnAkvD2aaSl1mEcNZw9MH AdnQ6eldmO3bq19M8pi6gPHjDsi0JjKFcD0LdXFJXc9cwBQ9TfGUVl1ENDfDoYfv4TBj OKHB+EC6Zy59C9TLaey/YDzLNyiunQ9ocs0Nn/0cuZ/M1O2wshILhqQ4yCNk32GL40L8 ZjUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OwL4J0kx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u12-20020a17090341cc00b0015636e142c9si3290168ple.80.2022.04.15.19.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:43:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OwL4J0kx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9721118DABF; Fri, 15 Apr 2022 18:50:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242260AbiDNKZL (ORCPT + 99 others); Thu, 14 Apr 2022 06:25:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbiDNKZJ (ORCPT ); Thu, 14 Apr 2022 06:25:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2F5776677; Thu, 14 Apr 2022 03:22:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3C12461E59; Thu, 14 Apr 2022 10:22:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96B63C385B2; Thu, 14 Apr 2022 10:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649931764; bh=UP2ZdlXMZjXTQwi2bJVC42wnwXESiNxV1SL51CcDxJ4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OwL4J0kxyO6/5LiiQ7Fj4OWwPgPnYkCayAcCWbenxuYiR+T0tK5VcfU6yj7iPNDe8 1ji7CgCJiaVHoDuF9HKf/Oh0Xs9Q+p4eukEtKLVZ5bCHMWQR4q0vVaGtbI/aiYsbPb qq4vw4cKxN4d6J5QrHuR2MOkRKjKMY4wCsQo0HEaqPz5X8wKNWnS3gW9ZNezd/eZFM Qbox1JvOQvUUyMNH0L7kr3XAhc2hBdDlLiTM3Vv9rovjsyaTLZhQ2to83DIcBiAdoM DKwPiibbJbfioGbgjHs4mPbEivr+cLG9G+DY6H7g9y9E/ADZc8f3TtxI/ysKmUKTRK g6Tjh7RJXoMdg== Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-dacc470e03so4805887fac.5; Thu, 14 Apr 2022 03:22:44 -0700 (PDT) X-Gm-Message-State: AOAM533vkO99tEOYGZYmsC9jH+/jJpuMfJnbZiCA2PqQbYcWjPeszpBs TE1Kz03nhmD1veQdeUynbvIvwIdtNr3YjzAzgwU= X-Received: by 2002:a05:6870:eaa5:b0:da:b3f:2b45 with SMTP id s37-20020a056870eaa500b000da0b3f2b45mr1308766oap.228.1649931763538; Thu, 14 Apr 2022 03:22:43 -0700 (PDT) MIME-Version: 1.0 References: <20220414101314.1250667-1-mawupeng1@huawei.com> In-Reply-To: <20220414101314.1250667-1-mawupeng1@huawei.com> From: Ard Biesheuvel Date: Thu, 14 Apr 2022 12:22:31 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/9] introduce mirrored memory support for arm64 To: Wupeng Ma Cc: Andrew Morton , Catalin Marinas , Will Deacon , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , X86 ML , hpa@zyccr.com, Darren Hart , Andy Shevchenko , Mike Rapoport , "Paul E. McKenney" , Peter Zijlstra , Joerg Roedel , songmuchun@bytedance.com, macro@orcam.me.uk, Frederic Weisbecker , W_Armin@gmx.de, John Garry , Sean Christopherson , Thomas Bogendoerfer , Anshuman Khandual , chenhuacai@kernel.org, David Hildenbrand , gpiccoli@igalia.com, Mark Rutland , Kefeng Wang , Linux Doc Mailing List , Linux Kernel Mailing List , Linux ARM , linux-efi , linux-ia64@vger.kernel.org, platform-driver-x86@vger.kernel.org, Linux Memory Management List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Apr 2022 at 11:54, Wupeng Ma wrote: > > From: Ma Wupeng > > Commit b05b9f5f9dcf ("x86, mirror: x86 enabling - find mirrored memory ranges") > introduced mirrored memory support for x86. This support rely on UEFI to > report mirrored memory address ranges. See UEFI 2.5 spec pages 157-158: > > http://www.uefi.org/sites/default/files/resources/UEFI%202_5.pdf > > Memory mirroring is a technique used to separate memory into two separate > channels, usually on a memory device, like a server. In memory mirroring, > one channel is copied to another to create redundancy. This method makes > input/output (I/O) registers and memory appear with more than one address > range because the same physical byte is accessible at more than one > address. Using memory mirroring, higher memory reliability and a higher > level of memory consolidation are possible. > > Arm64 can support this too. So mirrored memory support is added to support > arm64. > > Efi_fake_mem is used for testing mirrored features and will not be used in > production environment. This test features can fake memory's attribute > values. > > The reason why efi_fake_mem support is put first is that memory's attribute > is reported by BIOS which is hard to simulate. With this support, any arm64 > machines with efi support can easily test mirrored features. > > The main purpose of this patchset is to introduce mirrored support for > arm64 and we have already fixed the problems we had which is shown in > patch #5 to patch #7 and try to bring total isolation in patch #8 which > will disable mirror feature if kernelcore is not specified. > > In order to test this support in arm64: > - patch this patchset > - add efi_fake_mem=8G@0:0x10000 in kernel parameter to simulate mirrored > memroy between phy addr 0-8G. > - add kernelcore=mirror in kernel parameter > - start you kernel > As I explained before: - NAK to EFI fake_mem support on arm64 - NAK to the whole series until you come up with a proposal on how to locate the static kernel image itself into more reliable memory, as there is really no point to any of this otherwise.