From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3E55E80289 for ; Mon, 6 Mar 2017 08:06:17 -0800 (PST) Received: by mail-wm0-x22d.google.com with SMTP id t193so68593475wmt.1 for ; Mon, 06 Mar 2017 08:06:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=p8Rk4i7tvgLqNYQOONCYWq7j8afyWMW8Odsbx6qq16g=; b=OZ0QfL0MUeIpN2HnRbXAiDJa4evUlLkRjmz71EiVH1pbsnPTxPNsW5QRWhNgHf8ZFC iaULa6CgNqJqjmsksh9m1/Q8zC6AcxWUhXuG88n5glkCjKmUadbPM06IhIt0CU+qHCK0 /znB5ecSSWWQr4W/mESj733fqgPmGG0VKYyKM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=p8Rk4i7tvgLqNYQOONCYWq7j8afyWMW8Odsbx6qq16g=; b=ZTmdB9j6t+Dafr5qdm+mLiCjqpVUxSXWnI7+66k8Wtx+mAKw7xJFz90UtRXH+VGSp7 XS/OHtbcQ7FuNJ59s1RpW9PjcOx2xAy32HFpQ0YPBzldHKL5hfPxFkjzxa5kAXX5hRy4 ldft0ve87Seuh5s6J1bxYgtSpXOVOJZ1PKe/c+4mw18Lq5BZIMS5U2tmIKxB+E5tj4Oh 7KOciK7GhZeFv7COA6q7CXKlgG002FTVXYwieThhVLddSK32jCU4EL16GmDdM/OwNn/Y BTvAvkn9Ykykw/80of0dfKXTJ0VwtfrX14CO/DTMewykOSvoB7w6Sq8678GKB7EejHrq i8MQ== X-Gm-Message-State: AMke39nrWBmeG2wCKA8WJENABxL1rceOf0PaIq8fOlpeKbfGFH7tNgE5dDJ/FU4XpM2pCCHg X-Received: by 10.28.197.77 with SMTP id v74mr14824621wmf.30.1488816375194; Mon, 06 Mar 2017 08:06:15 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id y49sm5320061wry.18.2017.03.06.08.06.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 08:06:14 -0800 (PST) Date: Mon, 6 Mar 2017 16:06:12 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, lersek@redhat.com Message-ID: <20170306160612.GY16034@bivouac.eciton.net> References: <1488385903-30267-1-git-send-email-ard.biesheuvel@linaro.org> <1488385903-30267-4-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1488385903-30267-4-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 3/5] ArmPkg/ArmMmuLib: remove VirtualMask arg from ArmSetMemoryAttributes X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 16:06:17 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Mar 01, 2017 at 04:31:41PM +0000, Ard Biesheuvel wrote: > We no longer make use of the ArmMmuLib 'feature' to create aliased > memory ranges with mismatched attributes, and in fact, it was only > wired up in the ARM version to begin with. > > So remove the VirtualMask argument from ArmSetMemoryAttributes()'s > prototype, and remove the dead code that referred to it. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm > --- > ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c | 2 +- > ArmPkg/Include/Library/ArmMmuLib.h | 3 +-- > ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 3 +-- > ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 25 +++++--------------- > 4 files changed, 9 insertions(+), 24 deletions(-) > > diff --git a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c > index d0a3fedd3aa7..8150486217cf 100644 > --- a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c > +++ b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c > @@ -210,7 +210,7 @@ CpuSetMemoryAttributes ( > if (EFI_ERROR (Status) || (RegionArmAttributes != ArmAttributes) || > ((BaseAddress + Length) > (RegionBaseAddress + RegionLength))) > { > - return ArmSetMemoryAttributes (BaseAddress, Length, EfiAttributes, 0); > + return ArmSetMemoryAttributes (BaseAddress, Length, EfiAttributes); > } else { > return EFI_SUCCESS; > } > diff --git a/ArmPkg/Include/Library/ArmMmuLib.h b/ArmPkg/Include/Library/ArmMmuLib.h > index d3a302fa8125..fb7fd006417c 100644 > --- a/ArmPkg/Include/Library/ArmMmuLib.h > +++ b/ArmPkg/Include/Library/ArmMmuLib.h > @@ -66,8 +66,7 @@ EFI_STATUS > ArmSetMemoryAttributes ( > IN EFI_PHYSICAL_ADDRESS BaseAddress, > IN UINT64 Length, > - IN UINT64 Attributes, > - IN EFI_PHYSICAL_ADDRESS VirtualMask > + IN UINT64 Attributes > ); > > #endif > diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c > index 77f108971f3e..8bd1c6fad95f 100644 > --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c > +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c > @@ -450,8 +450,7 @@ EFI_STATUS > ArmSetMemoryAttributes ( > IN EFI_PHYSICAL_ADDRESS BaseAddress, > IN UINT64 Length, > - IN UINT64 Attributes, > - IN EFI_PHYSICAL_ADDRESS VirtualMask > + IN UINT64 Attributes > ) > { > EFI_STATUS Status; > diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c > index 93980d6d12db..1112660b434e 100644 > --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c > +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c > @@ -469,8 +469,7 @@ EFI_STATUS > UpdatePageEntries ( > IN EFI_PHYSICAL_ADDRESS BaseAddress, > IN UINT64 Length, > - IN UINT64 Attributes, > - IN EFI_PHYSICAL_ADDRESS VirtualMask > + IN UINT64 Attributes > ) > { > EFI_STATUS Status; > @@ -575,11 +574,6 @@ UpdatePageEntries ( > // Mask in new attributes and/or permissions > PageTableEntry |= EntryValue; > > - if (VirtualMask != 0) { > - // Make this virtual address point at a physical page > - PageTableEntry &= ~VirtualMask; > - } > - > if (CurrentPageTableEntry != PageTableEntry) { > Mva = (VOID *)(UINTN)((((UINTN)FirstLevelIdx) << TT_DESCRIPTOR_SECTION_BASE_SHIFT) + (PageTableIndex << TT_DESCRIPTOR_PAGE_BASE_SHIFT)); > if ((CurrentPageTableEntry & TT_DESCRIPTOR_PAGE_CACHEABLE_MASK) == TT_DESCRIPTOR_PAGE_CACHEABLE_MASK) { > @@ -606,8 +600,7 @@ EFI_STATUS > UpdateSectionEntries ( > IN EFI_PHYSICAL_ADDRESS BaseAddress, > IN UINT64 Length, > - IN UINT64 Attributes, > - IN EFI_PHYSICAL_ADDRESS VirtualMask > + IN UINT64 Attributes > ) > { > EFI_STATUS Status = EFI_SUCCESS; > @@ -680,7 +673,7 @@ UpdateSectionEntries ( > // has this descriptor already been coverted to pages? > if (TT_DESCRIPTOR_SECTION_TYPE_IS_PAGE_TABLE(CurrentDescriptor)) { > // forward this 1MB range to page table function instead > - Status = UpdatePageEntries ((FirstLevelIdx + i) << TT_DESCRIPTOR_SECTION_BASE_SHIFT, TT_DESCRIPTOR_SECTION_SIZE, Attributes, VirtualMask); > + Status = UpdatePageEntries ((FirstLevelIdx + i) << TT_DESCRIPTOR_SECTION_BASE_SHIFT, TT_DESCRIPTOR_SECTION_SIZE, Attributes); > } else { > // still a section entry > > @@ -689,9 +682,6 @@ UpdateSectionEntries ( > > // mask in new attributes and/or permissions > Descriptor |= EntryValue; > - if (VirtualMask != 0) { > - Descriptor &= ~VirtualMask; > - } > > if (CurrentDescriptor != Descriptor) { > Mva = (VOID *)(UINTN)(((UINTN)FirstLevelTable) << TT_DESCRIPTOR_SECTION_BASE_SHIFT); > @@ -717,8 +707,7 @@ EFI_STATUS > ArmSetMemoryAttributes ( > IN EFI_PHYSICAL_ADDRESS BaseAddress, > IN UINT64 Length, > - IN UINT64 Attributes, > - IN EFI_PHYSICAL_ADDRESS VirtualMask > + IN UINT64 Attributes > ) > { > EFI_STATUS Status; > @@ -736,8 +725,7 @@ ArmSetMemoryAttributes ( > "SetMemoryAttributes(): MMU section 0x%lx length 0x%lx to %lx\n", > BaseAddress, ChunkLength, Attributes)); > > - Status = UpdateSectionEntries (BaseAddress, ChunkLength, Attributes, > - VirtualMask); > + Status = UpdateSectionEntries (BaseAddress, ChunkLength, Attributes); > > FlushTlbs = TRUE; > } else { > @@ -756,8 +744,7 @@ ArmSetMemoryAttributes ( > "SetMemoryAttributes(): MMU page 0x%lx length 0x%lx to %lx\n", > BaseAddress, ChunkLength, Attributes)); > > - Status = UpdatePageEntries (BaseAddress, ChunkLength, Attributes, > - VirtualMask); > + Status = UpdatePageEntries (BaseAddress, ChunkLength, Attributes); > } > > if (EFI_ERROR (Status)) { > -- > 2.7.4 >