Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1253923pxu; Mon, 23 Nov 2020 16:05:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPdgO+Sg2v9VYWSVqdINPlQGTrt/G5rjIuOvePwb2WM3E3hDM1s7jUVn7uMj+E5iIREJFf X-Received: by 2002:a17:907:411b:: with SMTP id nw19mr1864845ejb.150.1606176341434; Mon, 23 Nov 2020 16:05:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606176341; cv=none; d=google.com; s=arc-20160816; b=ZZR1jNOdsMbTLqDtZs3LZosZzHaqij8reaVYDWsAn/Xq4/6wtaMfn0M+avyFY6IHFD nsUwT6uSl9sRVx7Joefly3ib5iwj5qIsi2eCYp273bPzvwqlb9gFyPji2Xk9HA7+oxZJ 2PixBfd9rLbDHv5pNaA960sSckEUpd2xp1ds9tr0RV4iNIFU8OGfdgUvqeWbsZszyV49 W7QrDpjtWMZj1rqQNr596NJPT/6DoSX+5OfktBs4VS/c59XamFotGECB/aSnwOzyJZ0S a4pA3DVfSzA9gDxSSDaP2/6lQFqsApyPc0jb9eO0lO8mE+dr2DdO2KK3s6DkcLNZrcXU 6XxQ== 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=/kdqFZeAVjbR1EcrIlFEOxJOMeoTF+Ogzz6G56OSu8M=; b=oJhgF9H5axogRQBK7Mj2ubmug1uHIlaoULKeid7mis2sUDpH00mek3HmGnkqS7tLfa KqoshiY3o3V3enyimPkGQpHIQxWb5+iIKPAUTfSS4jfisvzX/SajyHAibjcGpiKgjocV h9VwWB4DzZgE/2yQ+DS+gtpa04m2HJR+Tnte7uNB35S6L4cN+XGMDRKV4f6wfhLXajB4 7zX3YfbQJrDWEURZMpFiEdIIft5HjEeo7MX6cFMh4AeUO1fjwGQlSWxCVNSsdxPNCvkT jb/wzY2veOKtMwnueXg8jLsRLJ//ymCgAtXf1GDYC6Cjxxut+j2w0bLNCTg1wCbEyU9V 93/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rTTjlgTI; 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 z24si5826583ejx.378.2020.11.23.16.05.17; Mon, 23 Nov 2020 16:05:41 -0800 (PST) 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=rTTjlgTI; 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 S1732502AbgKWNWb (ORCPT + 99 others); Mon, 23 Nov 2020 08:22:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733009AbgKWNWa (ORCPT ); Mon, 23 Nov 2020 08:22:30 -0500 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CBB1C061A4D for ; Mon, 23 Nov 2020 05:22:28 -0800 (PST) Received: by mail-oi1-x243.google.com with SMTP id j15so14302096oih.4 for ; Mon, 23 Nov 2020 05:22:28 -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=/kdqFZeAVjbR1EcrIlFEOxJOMeoTF+Ogzz6G56OSu8M=; b=rTTjlgTIUFSWUW/IC4OxUfYnSqKXdJJ9kqYLU/ZqrJAAi87J+7NiREj6ube4ANvu1g LsHbqdqUqsv1WvcxkWTewmx3DHXB3cakd8AOodJlcSbrVphhStsCFNaDA0bWkye3lKjm AcQllA7rtoChNr8xdo732cLNI+Hy+0pe5oXbIrBYCjn3BPQmXgi82/O1h35cWJqz9T2/ edQbz0xLSKOG16+/9MKx49RjIACs+K8INOB7JtBQwPP8geXDKG9gyx9eckuCQ6gpNpdk Y9AZ333KWpIZr4Kza7TJAOnmVPkXgStofyfEhZK7IKJCMoly0/9ynQdr/CGbnQIOU6mh C0xg== 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=/kdqFZeAVjbR1EcrIlFEOxJOMeoTF+Ogzz6G56OSu8M=; b=q5RS/RD2EqoKrQ7CBLIDrR+yW9+yhGKLgQ2q4o8e7FvtW2WKoP+/wMR+qF81Hfscaz sr3/4NpLyiMyjIkRX0WrvK93uxXuX9rlzbmwFkhaVZkojyoa+sE4r++cwAdPxv53q/cp pcgkL+8/7xiqxMcMVL77hwC+VeP2X2rx2TpF4CCa4ND8wRRvHjQBcNQWqLqquY5qziN0 D999mGiVVUdJb17U5ULMiqF28ElEBy6BlBKqt4aGjMW5sPEsaaCp3jU63GWy8il15gmD fZVdY4p1VE3CfLT0lSnQxY1v1wpGFn/+DAbvzrtkGg/i0263Ct3LAGe04XqRixwlnWns oYiw== X-Gm-Message-State: AOAM532Srxi8RBDdz6U3siJjuMWic3u/QHYxWJ2YSatNH67UiIUloP/S QfGa3z6YPlXRdGuAfJzThxTpiA== X-Received: by 2002:a05:6808:301:: with SMTP id i1mr15073703oie.49.1606137747765; Mon, 23 Nov 2020 05:22:27 -0800 (PST) Received: from google.com ([2a01:4b00:8523:2d03:acac:b2ef:c7d:fd8a]) by smtp.gmail.com with ESMTPSA id s185sm7344774oia.18.2020.11.23.05.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 05:22:26 -0800 (PST) Date: Mon, 23 Nov 2020 13:22:23 +0000 From: David Brazdil To: Quentin Perret Cc: Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Rob Herring , Frank Rowand , "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , open list , "open list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , kernel-team@android.com, android-kvm@google.com Subject: Re: [RFC PATCH 13/27] KVM: arm64: Enable access to sanitized CPU features at EL2 Message-ID: <20201123132223.oohevce4izuoaqi3@google.com> References: <20201117181607.1761516-1-qperret@google.com> <20201117181607.1761516-14-qperret@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201117181607.1761516-14-qperret@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +int copy_ftr_reg(u32 id, struct arm64_ftr_reg *dst) > +{ > + struct arm64_ftr_reg *regp = get_arm64_ftr_reg(id); > + > + if (!regp) > + return -EINVAL; > + > + memcpy(dst, regp, sizeof(*regp)); > + > + return 0; > +} > + > #define read_sysreg_case(r) \ > case r: return read_sysreg_s(r) > > diff --git a/arch/arm64/kernel/image-vars.h b/arch/arm64/kernel/image-vars.h > index dd8ccc9efb6a..c35d768672eb 100644 > --- a/arch/arm64/kernel/image-vars.h > +++ b/arch/arm64/kernel/image-vars.h > @@ -116,6 +116,8 @@ __kvm_nvhe___memcpy = __kvm_nvhe___pi_memcpy; > __kvm_nvhe___memset = __kvm_nvhe___pi_memset; > #endif > > +_kvm_nvhe___flush_dcache_area = __kvm_nvhe___pi___flush_dcache_area; > + Could you help my understand why we need this? * Why do we need PI routines in the first place? Would my series that fixes relocations in hyp code remove the need? * You added these aliases for the string routines because you were worried somebody would change the implementation in arch/arm64/lib, right? But this cache flush function is defined in hyp/nvhe. So why do we need to point to the PI alias if we control the implementation?