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=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 B5331C4742C for ; Fri, 13 Nov 2020 10:14:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 46AF922245 for ; Fri, 13 Nov 2020 10:14:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="My03DUfi"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="lYmI1rgk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46AF922245 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+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=olyBwqQu86edmdSxYfFOV2UyGrFlEuePUDk4kOVrWuM=; b=My03DUfivjyFnS5er6QkmN/Pg 2z7KGMyS+nP2oVY+dHAIaa82NDWi2Ngl89J4kKLVYWO3fNIAl6hhB0SSFWKc8ltebXihat61ZJ7o9 ZFX7IfyvTWqbwIZ1spQKBHM7NA+db2E9/SKsA81QtGKFIwgqB1XB6DQu0QD560OQ1p8+BP0w+cCcB 20OZOO5Z6mHMi1bKg3SYOkfEudD3MS15jXZbpwuOnX5gWvEGhgyH62M4ewpX/cjcfZJP9j1cfEYNv GJ3rDiLbo8UEwTx8escVNhF3hkWY6rsXQYsHW9zx13Hm+FhEJ1ZH6foWw9drVcb4tn12eCd35xGGd A5zg45X4w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdW4J-0008KE-FQ; Fri, 13 Nov 2020 10:12:35 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdW4G-0008JD-Ed for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 10:12:33 +0000 Received: by mail-wr1-x444.google.com with SMTP id 23so9120870wrc.8 for ; Fri, 13 Nov 2020 02:12:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gJDjgh39n5XUQdsSlJODzF3lmu+qVc9i+7tDXsYg8Oc=; b=lYmI1rgkfJohgUbWUzYrTzvBFnqb3H7VatWnBVuWNPER5WPZX93O1KeZTP5IKQkZzF C1pdq1fULPAsG0HEiDVI/4Z1NzRfCFLJZ0Bqhzs6kqOPWN3LbpWS0oRpGzRCG8j4XlBI +yeh4dyGwsmWemjzePccPvyMPXiz5fIuUAskmZts6l/+SdLvJ49xeZwETClR1lb1XJFO JR+XWyWZwyw0hWjCpxC3iGQNJJy3abM9KSLycMK1u272qcUG0qzcz7PXamrKHu3avvdJ RKfHr7s2gDJVv3AOCvFi/v1RR+G+sVLpBMrRq82ynj2QBvKwdkZotICuuJEatkof0eoA D01g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gJDjgh39n5XUQdsSlJODzF3lmu+qVc9i+7tDXsYg8Oc=; b=GoCuVk5FjwtGoo6gpHzci66zv3l5vNBnXwcsNPGyb/kLpvQatGUpZBkB/V9+FjD/gt qTwe4p57IA2svUQOHft6oXoz5jXihpPQdjiIQLT3vyg8fzpGl8/C3KeGa+oyNbP2iQhI 3X3u4icvA69XvgETGsSs8N6o9ie1f6Gv5BdXh2JVc5c8jtEw8e+wP6SFeKPXu0G6uKyc HwCpxZyIstWPDUHWOd79uk7vv7C+W9YjIFK6WFezsceRYvg+Bw/jFSyDHRQlZRapAywh xnd5qtkJLPfLW0nNY9cme11Mih9FQQcITeMdJchqKoIpvV2XDgYgLMlbZKw71xvH1np1 l9mQ== X-Gm-Message-State: AOAM531JXFDeiHBj2MS0V+t2f1q2M+ZWBYmn4km5K/j+JNR+FJUJzmek JqokAb1OlgKqk9J+flLauY2W1wQzgtq4dOS3 X-Google-Smtp-Source: ABdhPJzHFLwhcauD+vjpfG5Jw8tiASclerF6DZBMzAHJe+eB7GLPF3aqymTBfQzsQanNeXLCjblOHQ== X-Received: by 2002:adf:fa88:: with SMTP id h8mr2556482wrr.410.1605262348931; Fri, 13 Nov 2020 02:12:28 -0800 (PST) Received: from google.com ([2a01:4b00:8523:2d03:6865:9f47:ec38:7db]) by smtp.gmail.com with ESMTPSA id y4sm9405210wmj.2.2020.11.13.02.12.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 02:12:27 -0800 (PST) Date: Fri, 13 Nov 2020 10:12:27 +0000 From: David Brazdil To: Jamie Iles Subject: Re: [PATCH] kvm: arm64: correctly align nVHE percpu data Message-ID: <20201113101227.zb6ckyriobjrlkc5@google.com> References: <20201113003143.3057-1-jamie@nuviainc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201113003143.3057-1-jamie@nuviainc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201113_051232_527521_0799016D X-CRM114-Status: GOOD ( 23.07 ) 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: Marc Zyngier , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jamie, On Fri, Nov 13, 2020 at 12:31:43AM +0000, Jamie Iles wrote: > The nVHE percpu data is partially linked but the nVHE linker script did > not align the percpu section. The PERCPU_INPUT macro would then align > the data to a page boundary: > > #define PERCPU_INPUT(cacheline) \ > __per_cpu_start = .; \ > *(.data..percpu..first) \ > . = ALIGN(PAGE_SIZE); \ > *(.data..percpu..page_aligned) \ > . = ALIGN(cacheline); \ > *(.data..percpu..read_mostly) \ > . = ALIGN(cacheline); \ > *(.data..percpu) \ > *(.data..percpu..shared_aligned) \ > PERCPU_DECRYPTED_SECTION \ > __per_cpu_end = .; > > but then when the final vmlinux linking happens the hypervisor percpu > data is included after page alignment and so the offsets potentially > don't match. This manifests as one of the CPUs getting lost when > running kvm-unit-tests on EL2 entry and subsequent soft lockup. You're right - the internal alignment of these subsections can be off after linking into vmlinux. Could you just elaborate on how you managed to trigger this? Which offsets don't match? > > Fixes: 30c953911c43 ("kvm: arm64: Set up hyp percpu data for nVHE") > Cc: David Brazdil > Cc: Marc Zyngier > Cc: Will Deacon > Signed-off-by: Jamie Iles > --- > arch/arm64/kvm/hyp/nvhe/hyp.lds.S | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/kvm/hyp/nvhe/hyp.lds.S b/arch/arm64/kvm/hyp/nvhe/hyp.lds.S > index bb2d986ff696..84edca959893 100644 > --- a/arch/arm64/kvm/hyp/nvhe/hyp.lds.S > +++ b/arch/arm64/kvm/hyp/nvhe/hyp.lds.S > @@ -13,6 +13,7 @@ > > SECTIONS { > HYP_SECTION(.text) > + . = ALIGN(PAGE_SIZE); Could you add a comment so that we don't forget why it was needed? Thanks, David _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel