lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151015151113.GK8825@leverpostej>
Date:	Thu, 15 Oct 2015 16:11:14 +0100
From:	Mark Rutland <mark.rutland@....com>
To:	Jeremy Linton <jeremy.linton@....com>
Cc:	"Suzuki K. Poulose" <Suzuki.Poulose@....com>,
	linux-arm-kernel@...ts.infradead.org, steve.capper@...aro.org,
	ard.biesheuvel@...aro.org, marc.zyngier@....com,
	catalin.marinas@....com, will.deacon@....com,
	linux-kernel@...r.kernel.org, christoffer.dall@...aro.org
Subject: Re: [PATCHv3 08/11] arm64: Check for selected granule support

On Thu, Oct 15, 2015 at 09:47:53AM -0500, Jeremy Linton wrote:
> On 10/15/2015 06:25 AM, Suzuki K. Poulose wrote:
> >+	/*
> >+	 * Check to see if the CPU supports the requested pagesize
> >+	 */
> >+	asm volatile("mrs %0, ID_AA64MMFR0_EL1" : "=r" (aa64mmfr0_el1));
> >+	aa64mmfr0_el1 >>= ID_AA64MMFR0_TGRAN_SHIFT;
> >+	if ((aa64mmfr0_el1 & 0xf) != ID_AA64MMFR0_TGRAN_SUPPORTED) {
> >+		pr_efi_err(sys_table_arg, PAGE_SIZE_STR" granule not supported by the CPU\n");
> >+		return EFI_UNSUPPORTED;
> >+	}
> 
> 
> This is definitely an improvement over my original hack job.
> 
> I would like to add, that I actually think this should be in a new
> function "check_kernel_compatibility" (or whatever) that is called
> before handle_kernel_image.

To bikeshed, perhaps efi_arch_check_system?

> That is because I don't really think it belongs in
> handle_kernel_image which is focused on relocation. Plus, if you add
> another function, you can avoid the "Failed to relocate kernel"
> error that comes out following the granule not supported message.
> Further, checks like this in the future will have a place to live.

I agree.

There are some other diagnostic utilities I'd like to add to the stub
(e.g. dumping the memory map and ID registers) that would help with
diagnosing boot issues. I started on those at Connect, but realised I
needed to first implement half of printf for those to be useful.

> Of course you will then need a matching stubbed out function for the
> normal arm kernel as well.

I'm sure there are similar things we'll want to check for 32-bit (e.g.
LPAE support), but a stub should be fine for now.

Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ