From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bryan O'Donoghue Subject: Re: [PATCH 1/2] x86: Add Isolated Memory Regions for Quark X1000 Date: Thu, 08 Jan 2015 15:11:35 +0000 Message-ID: <54AE9E27.2050307@nexus-software.ie> References: <1419873783-5161-1-git-send-email-pure.logic@nexus-software.ie> <1419873783-5161-2-git-send-email-pure.logic@nexus-software.ie> <54AE8136.2060400@nexus-software.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from outbound-smtp05.blacknight.com ([81.17.249.38]:57043 "EHLO outbound-smtp05.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753114AbbAHPLi (ORCPT ); Thu, 8 Jan 2015 10:11:38 -0500 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp05.blacknight.com (Postfix) with ESMTPS id C3B1198D5C for ; Thu, 8 Jan 2015 15:11:36 +0000 (UTC) In-Reply-To: Sender: platform-driver-x86-owner@vger.kernel.org List-ID: To: "Ong, Boon Leong" Cc: "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" , "dvhart@infradead.org" , "platform-driver-x86@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "andy.shevchenko@gmail.com" > Suggest to split the imr_del() into 2 functions:- > (1) by address + size > (2) by IMR index > At current implementation, it does not support (2) only because it fails at > imr_check_range(). Hi Boon Leong. I'll have a think about that :) Just on imr_del() though, it does support removal by way of index. +static void __init intel_galileo_imr_init(void) +{ + unsigned long base = virt_to_phys(&_text); + unsigned long size = virt_to_phys(&_sinittext) - base - IMR_ALIGN; + int i, ret; + + /* Tear down all existing unlocked IMRs */ + for (i = 0; i <= QUARK_X1000_IMR_NUM; i++) + imr_del(i, 0, 0); That's what the platform code has to do for every unlocked IMR, to make sure there are no stale IMRs left that could conflict with the EFI memory map ! -- BOD