From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752741AbbHaWCA (ORCPT ); Mon, 31 Aug 2015 18:02:00 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:33282 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751381AbbHaWBy (ORCPT ); Mon, 31 Aug 2015 18:01:54 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Andy Lutomirski Date: Mon, 31 Aug 2015 15:01:34 -0700 Message-ID: Subject: Re: Why is irq_stack_union a union? To: Brian Gerst Cc: "linux-kernel@vger.kernel.org" , X86 ML , Steven Rostedt , Andi Kleen Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 31, 2015 at 2:47 PM, Brian Gerst wrote: > On Mon, Aug 31, 2015 at 5:00 PM, Andy Lutomirski wrote: >> Why not just a struct? Also, why is this all tangled up in gsbase initialization? > > It has to do with the fact that the GCC stackprotector is hardcoded to > look for the canary at %gs:40. Since we also use %gs for the percpu > segment, we have to make sure that the canary is placed at the start > of the percpu section. Overlaying it onto the bottom of the IRQ stack > and was the most convenient way to do it, with a side benefit that > overflowing the stack will trip the canary. Would a struct not make more sense, then? --Andy > > -- > Brian Gerst -- Andy Lutomirski AMA Capital Management, LLC