From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDDD8C352A4 for ; Wed, 12 Feb 2020 20:59:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77885206D7 for ; Wed, 12 Feb 2020 20:59:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZrlRzZ1c"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="hqtkQWWM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 77885206D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=egZkTccImEU98LmXcsGIDOSygZEJq9mRkuFIv9gX544=; b=ZrlRzZ1cIStpFo fZKdxLplJPsSe3A9KC/3kJT6MtrKajMGgptd8kcEL74D0F+Rqpw0ZnNFNNPi9181dHI9y42JkaZUV UamldlwMZXlmn/5SAtXbDtE7stxTq5xzBlWxkw/hUPZ0ZPWd5mw3hdw0T1fOKrsPHwq+cJKK7PEIk QlkOxmlPt7dk69ZjUNndaDhIStcVxKm66/16udwoj+5eFCtzELl/Z6LfORHxEcqpkbK1TSnHSaPEz WbmBpBKBU/f3wqBB/QD5Jeb68CGa2pirfZ6g/7Mpo2v/VBs5ZJzmriAGtVjNnLrL0Yy9YlA75jmFZ zhEckqzGPQiaooVhfY2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1z6h-0003uW-7R; Wed, 12 Feb 2020 20:59:39 +0000 Received: from mail-vs1-xe44.google.com ([2607:f8b0:4864:20::e44]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1z6e-0003tV-4w for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2020 20:59:37 +0000 Received: by mail-vs1-xe44.google.com with SMTP id 7so2134018vsr.10 for ; Wed, 12 Feb 2020 12:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dNT84lBczGzzOgb9OnM5Fdxg6SAeViGOzJlzxW7UwtM=; b=hqtkQWWMamX0OQO403fEmerDtGachsfSTpAQbGxOovOjrH4I6JJGU7ulCB6ab4JoT3 KAyC6liLk8dJENInpS9tXLd0C/e4cO0xsfrq3v5JmxMDWdQPH4RtbIyUaPUEmFFncsnu NTRkAxc5qKDuK8ZfwFSsDYyfi27+i3eqlWyAZMw88Gui9+TfOwUOVnUpQC+aVOuJacyq 8T1BF/3aw0pTkYZ2HCojO8/QDLI6PFgcL/LPPiCxdXK9F4wYD6vIQ7uMQfgPEsyj2YE5 xyfVe+8nvsIELQ09/BO6sp4lG11/JqoDsbV7KjcyH1H3MR+bLO9ZJQVegNEKcfhvaktJ 6iJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dNT84lBczGzzOgb9OnM5Fdxg6SAeViGOzJlzxW7UwtM=; b=devfxbX9EDXMa073yytQoEGY34OAJMFVcPdmObpRZDRe6e8ey58Xu6Vw/ME4XKwVP7 5FUB57EXmnr3bHkZLnceZLe5cjTtLKR8zVY25lReLs2FCwzzm0vSUiqVrsTREIw/0nbj l15tDBIPoiI4HsdgIVUPwJ1ENqKvp/mHlVAscxlVXRXPBGB3sdRGl75oPtJZTTdj9Yfi NJu29Et/3xHWpR2EUJ3aUCprwVRfMmhVq2FYzPI4Kt7KR+wyPSw/RPVZT60Rp4oV9ULp NniqKJMDDxUHrnqCnp+LvrwtcQ2FDbzofzQAO4wl18QsMB2EeIOSK/58hzFITizdKzKr eavA== X-Gm-Message-State: APjAAAU3pU0gbp7stmlbxJ76WaH+3UcYewdabEEA777vF6tqzqJQf0L9 kUys+uhYMUSTOEltfRGrYp3TTrwZ3AW7vW3Vq2Sa3Q== X-Google-Smtp-Source: APXvYqwlqtMeW4JdpzouZL0DVTK633mlJLfXjD51WE9+E3ZvoUcyD8yDdtL0O1xkdRc9tJh+2nQxwQKr0i+z+9CR1Hg= X-Received: by 2002:a67:2c15:: with SMTP id s21mr298736vss.104.1581541173587; Wed, 12 Feb 2020 12:59:33 -0800 (PST) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20200128184934.77625-1-samitolvanen@google.com> <20200128184934.77625-12-samitolvanen@google.com> In-Reply-To: From: Sami Tolvanen Date: Wed, 12 Feb 2020 12:59:22 -0800 Message-ID: Subject: Re: [PATCH v7 11/11] arm64: scs: add shadow stacks for SDEI To: James Morse X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200212_125936_214421_757D5F2B X-CRM114-Status: GOOD ( 15.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kees Cook , Ard Biesheuvel , Masahiro Yamada , Catalin Marinas , Jann Horn , Nick Desaulniers , LKML , Steven Rostedt , Miguel Ojeda , clang-built-linux , Masami Hiramatsu , Marc Zyngier , Kernel Hardening , Laura Abbott , Will Deacon , Dave Martin , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Feb 11, 2020 at 5:57 AM James Morse wrote: > > Hi Sami, > > On 28/01/2020 18:49, Sami Tolvanen wrote: > > This change adds per-CPU shadow call stacks for the SDEI handler. > > Similarly to how the kernel stacks are handled, we add separate shadow > > stacks for normal and critical events. > > Reviewed-by: James Morse > Tested-by: James Morse Thank you for taking the time to test this, James! > > diff --git a/arch/arm64/kernel/scs.c b/arch/arm64/kernel/scs.c > > index eaadf5430baa..dddb7c56518b 100644 > > --- a/arch/arm64/kernel/scs.c > > +++ b/arch/arm64/kernel/scs.c > > > +static int scs_alloc_percpu(unsigned long * __percpu *ptr, int cpu) > > +{ > > + unsigned long *p; > > + > > + p = __vmalloc_node_range(PAGE_SIZE, SCS_SIZE, > > + VMALLOC_START, VMALLOC_END, > > + GFP_SCS, PAGE_KERNEL, > > + 0, cpu_to_node(cpu), > > + __builtin_return_address(0)); > > (What makes this arch specific? arm64 has its own calls like this for the regular vmap > stacks because it plays tricks with the alignment. Here the alignment requirement comes > from the core SCS code... Would another architecture implement these > scs_alloc_percpu()/scs_free_percpu() differently?) You are correct, these aren't necessarily specific to arm64. However, right now, we are not allocating per-CPU shadow stacks anywhere else, so this was a natural place for the helper functions. Would you prefer me to move these to kernel/scs.c instead? Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel