Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1792333rwb; Tue, 29 Nov 2022 20:00:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf5NWbIaDjaR26e6bRsdzu1U11m/vTba7jTvqXnAxtYlCRGzMpZNS45N060EiNfl1MqMLJHO X-Received: by 2002:a05:6402:1118:b0:467:a8cb:10c9 with SMTP id u24-20020a056402111800b00467a8cb10c9mr39643384edv.123.1669780833777; Tue, 29 Nov 2022 20:00:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669780833; cv=none; d=google.com; s=arc-20160816; b=ky+JlN5jAdCb9moCXXWd4MXMxGNzFPdx74kxAEtWnmKyPEw2s5dMiFEP/f0ZFbBa6u JoK7new0smeCVwAuRNZAyYq7LFm62rt+R97M+faHeSBc2xXDhdGejdNeWF2wtDqsGihe 2iGFeW9XL1bKD+u7rjnCPSDT8S4SVfgaP9lFqvF/HqNNBfhcvl5VGQqBaIjOAhnOQkV4 PMhcqvet4uO93f5EFt4ILJkWrKAxQbf5pZhrZnkNXwmV1ntSXfqeowyJeSpDK44v6fwO KOhcwDia+LRNS2YL+G8g5mk3v7Drkur7Q6wSEbF21C389AzMv4b2p7bKu4bNehZFo27p dpKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=keXd344sIL2Axw294Ojzkf8vMy22zfN9agu+NIErakc=; b=zKrvwAJwO67JDasJvo6XMO2kRiSB+Zlfp84wxmzc8Wo36StXeakViu6qxPIYaqYnYc dJv+uSZsoATP68BrJAO3ho1Ol3hJCtZoLApGzP76rceut0szOOTT4d9T7kL6N/TdqBQp O8fGSwkF79GgAOGShRp/r75lNiK5OMC41z1gQ+JpULNFl0VUizxWTKD/BNhsOdG6riSe URcC4OmvJ3DTDlyosj04sbqJdzjFbT/hIvbPJNUPxGMTNf89KGzZMUBH5XkGZs1ZcLJx f4Ook7jfJz9erdDfnuIQsKi4xjkhK/ZfMv3LlA5iWrN4HeZ+FRorbwP/wPhM2bl3JcZR nC2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=q4h7YuMI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a056402355000b0046a09ce4d12si407920edd.339.2022.11.29.20.00.13; Tue, 29 Nov 2022 20:00:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=q4h7YuMI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232350AbiK3Cs0 (ORCPT + 85 others); Tue, 29 Nov 2022 21:48:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbiK3CsY (ORCPT ); Tue, 29 Nov 2022 21:48:24 -0500 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FDBA2E9F5 for ; Tue, 29 Nov 2022 18:48:21 -0800 (PST) Received: by mail-oi1-x22a.google.com with SMTP id n205so17435788oib.1 for ; Tue, 29 Nov 2022 18:48:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=keXd344sIL2Axw294Ojzkf8vMy22zfN9agu+NIErakc=; b=q4h7YuMITHQxrW7ZuaQ5CLlmfdNHlj7tkZnyFGRJ79wAUoewwbZndW8+BaQ1gcu1gh QsH6IyUquRSagctknw2PpehMpel5+mogcX84p1/1PRCOf3jR1pYc9f11tkxUTaz3nJw2 pc6+03jI0dOCB3402JK509Hhc0Fyb7567c1aZKMMIcvY9UHcYNENo+U1XiyL7AwGH75K 5JbbUvYujwKmDW8F+uZWgxl20X2uVTTdwOTrhqjZly1FTHwcOUc3mgzOnj5CdbFqWDQr 9tgvEKKwVXArDfeRCAm90yy9nFztRVXwMKTyDun3H7+7s8syW3Sn+ALJBH6mYifPNzye oO2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=keXd344sIL2Axw294Ojzkf8vMy22zfN9agu+NIErakc=; b=k1I+tNmOkvU7TibWME+RJIMixfgfYibmfvuReZyoY1bSS3LBOuzskrQfXttUeVnZmP x6dnLabqCQDwGbkXeMMycIRhpzkCcddHk5f0d13f9Cw+wDxjnilubozRwzgOSRW157Kl YSHuE7V/guWw2JeIOE8Sv/H4Oh55Ry/5NWhz0yJQ2SNOGZ9UxPrb1KF1BU5I8fDVaZfu ZLx3DYpNytfbZQ9vNbfuEslnGTS5xFEO3F+tBLgRCN79DLZQaWBFS1jMhhHEsKC5kFcE zIiNlDflZeQRY6C/PUwV95GyL6twfsDzskxY5RaMHVSMuPVbrURQ8b2CbHH+FD6IvIXO orWA== X-Gm-Message-State: ANoB5pkLFOHO+u3qu2X6CYBnSy9brl6Y0/B+SgjdqBi/M9FkraNqHZEF z2jYrciOj3sYWCMpX3tY/dfM0KR7dC/n9RMTKZWhHPV7 X-Received: by 2002:a05:6808:1c1:b0:34f:d32d:cad5 with SMTP id x1-20020a05680801c100b0034fd32dcad5mr30266295oic.262.1669776500901; Tue, 29 Nov 2022 18:48:20 -0800 (PST) MIME-Version: 1.0 References: <20221130023515.20217-1-palmer@rivosinc.com> In-Reply-To: <20221130023515.20217-1-palmer@rivosinc.com> From: Khem Raj Date: Tue, 29 Nov 2022 18:47:55 -0800 Message-ID: Subject: Re: [PATCH 1/2] RISC-V: Align the shadow stack To: Palmer Dabbelt Cc: jszhang@kernel.org, guoren@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Palmer On Tue, Nov 29, 2022 at 6:36 PM Palmer Dabbelt wrote: > > The standard RISC-V ABIs all require 16-byte stack alignment. We're > only calling that one function on the shadow stack so I doubt it'd > result in a real issue, but might as well keep this lined up. Is 16-byte alignment required on rv32 as well ? > > Fixes: 31da94c25aea ("riscv: add VMAP_STACK overflow detection") > Signed-off-by: Palmer Dabbelt > --- > arch/riscv/kernel/traps.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c > index be54ccea8c47..acdfcacd7e57 100644 > --- a/arch/riscv/kernel/traps.c > +++ b/arch/riscv/kernel/traps.c > @@ -206,7 +206,7 @@ static DEFINE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], > * shadow stack, handled_ kernel_ stack_ overflow(in kernel/entry.S) is used > * to get per-cpu overflow stack(get_overflow_stack). > */ > -long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE/sizeof(long)]; > +long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE/sizeof(long)] __aligned(16); > asmlinkage unsigned long get_overflow_stack(void) > { > return (unsigned long)this_cpu_ptr(overflow_stack) + > -- > 2.38.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv