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]
Date:	Wed, 14 Oct 2015 18:24:18 +0100
From:	Mark Rutland <mark.rutland@....com>
To:	"Suzuki K. Poulose" <suzuki.poulose@....com>
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	catalin.marinas@....com, will.deacon@....com,
	steve.capper@...aro.org, marc.zyngier@....com,
	ard.biesheuvel@...aro.org, christoffer.dall@...aro.org
Subject: Re: [PATCHv3 08/11] arm64: Check for selected granule support

> @@ -613,10 +614,28 @@ ENDPROC(__secondary_switched)
>   *  x0  = SCTLR_EL1 value for turning on the MMU.
>   *  x27 = *virtual* address to jump to upon completion
>   *
> - * other registers depend on the function called upon completion
> + * Other registers depend on the function called upon completion.
> + *
> + * Checks if the selected granule size is supported by the CPU.
> + * If it doesn't park the CPU

Nit: "If it isn't, park the CPU."

>   */
> +#if	defined(CONFIG_ARM64_64K_PAGES)
> +
> +#define id_aa64mmfr0_tgran_shift	ID_AA64MMFR0_TGRAN64_SHIFT
> +#define id_aa64mmfr0_tgran_on		ID_AA64MMFR0_TGRAN64_ON
> +
> +#else
> +
> +#define id_aa64mmfr0_tgran_shift	ID_AA64MMFR0_TGRAN4_SHIFT
> +#define id_aa64mmfr0_tgran_on		ID_AA64MMFR0_TGRAN4_ON

Any reason for not using upper-case names for the macros?

Given they're local you could just call them TGRAN_SHIFT and TRGRAN_ON
to make the asm slightly nicer.

> +
> +#endif
>  	.section	".idmap.text", "ax"
>  __enable_mmu:
> +	mrs	x1, ID_AA64MMFR0_EL1
> +	ubfx	x2, x1, #id_aa64mmfr0_tgran_shift, 4
> +	cmp	x2, #id_aa64mmfr0_tgran_on
> +	b.ne	__no_granule_support
>  	ldr	x5, =vectors
>  	msr	vbar_el1, x5
>  	msr	ttbr0_el1, x25			// load TTBR0
> @@ -634,3 +653,8 @@ __enable_mmu:
>  	isb
>  	br	x27
>  ENDPROC(__enable_mmu)
> +
> +__no_granule_support:
> +	wfe
> +	b __no_granule_support
> +ENDPROC(__no_granule_support)

Other than the above, this loogs fine to me.

In future it would be nice if we could somehow signal that these dead
CPUs are trapped in the kernel -- we should have some kind of canary
mechanism for that. That needn't block this patch, though.

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