Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3149085rwo; Thu, 3 Aug 2023 23:27:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFUmaIz8cqvl7yU9SlDmRWfZ1LXpA4CLAX8B0xjdAw3p0xWj6a3v9SXWKPETeGpoYd+dSv X-Received: by 2002:a17:90a:b894:b0:267:ed84:c74d with SMTP id o20-20020a17090ab89400b00267ed84c74dmr782744pjr.22.1691130449330; Thu, 03 Aug 2023 23:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691130449; cv=none; d=google.com; s=arc-20160816; b=r3huca+yamEJOol2Blz4NG5x7SsN3cXiNCOVk3aBuauj68I6tnjOiIoFZ0fMjAlCW1 uwBa5iPnJTNR3AGgpaOoCKgNwSDXQhfkQLqCdRBfTUkCEsxvXSvNp8LZZm05mwpWpPE2 /r2R+OypGG/Yj/LFj2esn6mjxFTSEyL+MtIWQb9PdAy0YBuEnRQbfawexfx9MI54sC8s jTvD4tRljInxeYRSxmI/LTxx7yctTtvz7xUR7tWNLBRHymj1+v1F1+n+HL0h1PGcCFVx sdlderiEyuLgJL2v6A1Hi1CzOcjxOyWvzSXYWel2iMPeufojVbVeh0c3EcP+zL+1C70j oDzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=oJ4pxRLiN5sUOZD7cytQsMLgGLCAcQk4FTwEMDZWVqk=; fh=RjkpvTSHLKZu6wFLl0F04R+PXYpEQ8sllbSNs21ZdJc=; b=j+cpXndumrqiTRvt2ICXo0FcyXbrk5xMYX4Oeo//vJ84bj0woVcG9EdY8e4hOgatoH QBod3iaU5FxsoobICrXipKeVAb/1REULuqS5UUJHMSL5GbPccMWUaf3t6w43n23hBn2Y GOI0yJCKvbdGOynVUagNryi+OB3mDUXuTqZsR9yKM+8N+C4Yv/5gq2PRoW4R+BWxTy1S QLN8frly5EVWdv8KmTAxi9vutPtiFMt4kPHOvrTZ32Yhjf+s2HYVJnGsmjAtNh5iKBXl +keSJo+oFiM3uaRHUKB+hAsp7884b11aF6GeU1XCObogUrKGta2HzRRPA1jKYcIH9KT7 zOkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DDN0LdeS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mm23-20020a17090b359700b00268928f5dfbsi1304254pjb.120.2023.08.03.23.27.17; Thu, 03 Aug 2023 23:27:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DDN0LdeS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231609AbjHDFsJ (ORCPT + 99 others); Fri, 4 Aug 2023 01:48:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbjHDFsE (ORCPT ); Fri, 4 Aug 2023 01:48:04 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6F6A30D5; Thu, 3 Aug 2023 22:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691128083; x=1722664083; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=qUPFpNRJFHWbyQNHSkm00uWou7NNHfy0yV5vWVrDgkE=; b=DDN0LdeS37yCyHDxF5U+I0WCrQW2m4PxQs7JpvV5jp7LEPpcPJhBqv1B tQgFTHML1SjrrxCUtdG+g3oSJn9syVt1gev7l2q9Iou2MNy37Ld+p7qUj x15py7lFaUxiHG1vLFe+1MXfgtX3c8lFYLc4ldag1MFldfmJooSSsokEG zlmnYokoe7zyLry6brvPxL+fgLoQ5iYfN4WsP1JTeJr9G/MU5wdlslPay ktawGe+puWVtTSon1qcHsLbS1iPG9EGLqnfwffFVA10BE/MVckPsluaz1 e1ExOe0U9g3TNPfKBns6at49d8jPAhM+JIpOsGrlO3LHM4kBwt5VwLflk A==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="349664475" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="349664475" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 22:48:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="1060595126" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="1060595126" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP; 03 Aug 2023 22:47:56 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qRnfF-00CEBQ-0v; Fri, 04 Aug 2023 08:47:53 +0300 Date: Fri, 4 Aug 2023 08:47:53 +0300 From: Andy Shevchenko To: Sunil V L Cc: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Len Brown , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , Daniel Lezcano , Thomas Gleixner , Anup Patel , Marc Zyngier , Bjorn Helgaas , Robert Moore , Haibo Xu , Andrew Jones , Conor Dooley , Atish Kumar Patra , Ard Biesheuvel , Alexandre Ghiti Subject: Re: [RFC PATCH v1 04/21] RISC-V: ACPI: Enhance acpi_os_ioremap with MMIO remapping Message-ID: References: <20230803175916.3174453-1-sunilvl@ventanamicro.com> <20230803175916.3174453-5-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230803175916.3174453-5-sunilvl@ventanamicro.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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, Aug 03, 2023 at 11:28:59PM +0530, Sunil V L wrote: > Enhance the acpi_os_ioremap() to support opregions in MMIO > space. Also, have strict checks using EFI memory map > to allow remapping the RAM similar to arm64. > > Cc: Ard Biesheuvel > Cc: Alexandre Ghiti You may use --cc to the command line when forming patches. Also we usually consider Cc: as a part of the tag block, meaning no blank line should be here. > Signed-off-by: Sunil V L ... > #include > #include > #include > +#include Can you squeeze it to have some order, like to be after io.h (taking into account given context)? ... > + if (memblock_is_map_memory(phys) || > + !memblock_is_region_memory(phys, size)) { > + pr_warn(FW_BUG "requested region covers kernel memory @ %p\n", > + &phys); How %p can be useful here (it's mangled), but also wouldn't this give a hint to an attacker about the kernel memory location and diminish the KASLR protection? (IIRC after boot we always have the same salt for the mangling the pointers when printing, so at least theoretically it might be possible to bruteforce the printing algo to give a clue about the kernel address.) > + return NULL; > + } -- With Best Regards, Andy Shevchenko