Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4137281pxk; Tue, 22 Sep 2020 11:09:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOyMVsxtmmlLOLf7OMrQTnDXrj+thYcFZABz8KNIdhgiJ4a5whz/kgJ/Z0f9J2mEkmqNCg X-Received: by 2002:a50:da84:: with SMTP id q4mr5172038edj.238.1600798182404; Tue, 22 Sep 2020 11:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600798182; cv=none; d=google.com; s=arc-20160816; b=QVfW5PhZ4Q4pIsVxP7+iIfyACl9aNkPckHow5Qkx8AAyCU8BTWpTbIgUoBczFYsP8/ l36PZjGyxep/zdmU6oBbuwhMVR7VZn1U5Ju6O+n0OEdnOmU4fU6V+RaaVQe8GXLGI55B r7sZVJOPR5Dm0G0ZNw+a+0cwttMC3/cIqxJQcO6rU82kHTlbXRTli0LEfE63nKK6GQO4 BvdTW2JgE9/HXBjFiKHBpWjZLYrtJNzNDqi/5aigQLYvbR04IpqI5/948e2EH1Eu4eS8 f0crLO4FePXgz0MgfIbSienutFkDpHKQ+FV6xFw1aGd5m9puK2rZwu/TrpAeFjdGZ1LZ KvJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6y72uZ7YdWD1XXfQ+XTc3NqqPVXw5bQyVkymr14fQGQ=; b=N9N1iUJF9ilCI7/az2qBzlO7sCVuNh4yoPb6iTz1Z0uGuSdlgxUZyRRTHvVjATF6oB Cx5JxwbdwbPujWLh4BDtO2AZukN5MURjC1NWlIhs0vPo+IFsFep/5YzyoQnb51avemeW ZXQaotJ+v21vDVJtSB6woUgisKwkWPO6iEnXuXPQbg1az7pRTDJYx+3MI29NA9s4XCWc MebN//RsQG6FRRud8+bIj6DPrYaaWuhPt9iz9F2dh9wMYogqQ9HAy/yKTAdqh0pid9S4 e5U81qYHnhOrGVk6ThLA92ccjQBHT5XHtOzf2Jbfja80W97Dtn4qCGjhyJThYwEC/5sm r8CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CRd63rpN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si11164926edo.487.2020.09.22.11.09.17; Tue, 22 Sep 2020 11:09:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CRd63rpN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726614AbgIVSHt (ORCPT + 99 others); Tue, 22 Sep 2020 14:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbgIVSHt (ORCPT ); Tue, 22 Sep 2020 14:07:49 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6E82C061755 for ; Tue, 22 Sep 2020 11:07:48 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id g4so18099667wrs.5 for ; Tue, 22 Sep 2020 11:07:48 -0700 (PDT) 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=6y72uZ7YdWD1XXfQ+XTc3NqqPVXw5bQyVkymr14fQGQ=; b=CRd63rpNjyrzDcmAXaGmKY+nIczGjjMJGpL77E2ju9oloTgn2/h43kyf7RWLd6TSb1 drxGmpeR76PV5D4kIrtMak0BTXiG5QqFMzjzRfQlbfXHW05r/mynwAVi8WOU7EzJz668 1OQ4vm0VTMoo+qE1KCxXK/ZC2MaA+0D0xpWJECvrWvULe4ay+hp8jpleCDlSQl6ynXDm hdn5fKFjis/9QrlFTJZ65bXGTQnbSyH4tgejSXC753c+nYjHnfeoxaGtt5vIr7zmYhnN eQl+KORPu/uRAmRcXz71wLELsQ70yI9fMXN5m2dnfT3ZLENatNSfDyQyWqxnCJ+hp3Lj Jh9A== 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=6y72uZ7YdWD1XXfQ+XTc3NqqPVXw5bQyVkymr14fQGQ=; b=RQi6xGKxvA/RV+rjvl6gAdFvfBu1ePaFRWcYMppQ6nbiimcvTRo1FFbgVHB/LzEUl9 gV5vQoyzJbg7gc5RRFLevC1/nQ+lbEpbSdyu5dEKz1KROh0OjDLJFiMKMu5dFHyrEkrW zRb1f1ZRDE51uAGByVuV01Gxa6mgv+t8pDgLna/RTR7kiZP1OQg162+T01BciWyadRXe bM8la7/z8NkUVMECrAuqRv6+LC//z5pTHq896GUAsJJq35EF+WRtPqB5u25c1JoHkz1F +xHLwqQaChAAFq8NEAbhkbKzztXuybRN6BXJfjXNUsKphha7l2hqklsJ4EDLoJkHBCAi 8uGA== X-Gm-Message-State: AOAM5329EZyGRjnOcTH4ynsCu+QsZMbP/L6ZVhsg0II+063zzjLlz/8R vE0gUZZtGDfozGtnQaZkRAqc1Q== X-Received: by 2002:a5d:46cf:: with SMTP id g15mr6822937wrs.107.1600798067242; Tue, 22 Sep 2020 11:07:47 -0700 (PDT) Received: from google.com ([2a01:4b00:8523:2d03:55c2:2cdf:ff31:96a3]) by smtp.gmail.com with ESMTPSA id e1sm28558820wrp.49.2020.09.22.11.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 11:07:46 -0700 (PDT) Date: Tue, 22 Sep 2020 19:07:45 +0100 From: David Brazdil To: Will Deacon Cc: kvmarm@lists.cs.columbia.edu, Catalin Marinas , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Dennis Zhou , Tejun Heo , Christoph Lameter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v3 07/11] kvm: arm64: Duplicate arm64_ssbd_callback_required for nVHE hyp Message-ID: <20200922180745.m6bjgjzz6cwercgf@google.com> References: <20200916173439.32265-1-dbrazdil@google.com> <20200916173439.32265-8-dbrazdil@google.com> <20200918115911.GB31096@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200918115911.GB31096@willie-the-truck> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > u64 *ptr; > > > > - ptr = per_cpu_ptr(&arm64_ssbd_callback_required, cpu); > > + ptr = per_cpu_ptr_nvhe(arm64_ssbd_callback_required, cpu); > > err = create_hyp_mappings(ptr, ptr + 1, PAGE_HYP); > > if (err) > > return err; > > + > > + /* Copy value from kernel to hyp. */ > > + *ptr = per_cpu(arm64_ssbd_callback_required, cpu); > > Hmm. Is this correct for late arriving CPUs, where we don't know whether > a callback is required at the point we do the copy? > > That sounds fiddly to resolve, but this _might_ all be moot because I'm > about to post a series that allows us to remove the hyp mapping of this > variable entirely. So leave this for now, but maybe stick a comment in > that it doesn't work for late cpus. Ah, good point. I'll move the value copy at the end of cpu_init_hyp_mode(). It must be known at that point. And if your series gets rid of this completely, even better.