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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 52DC6C4743F for ; Mon, 7 Jun 2021 10:36:24 +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 24334611C0 for ; Mon, 7 Jun 2021 10:36:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24334611C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=nuviainc.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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=1dFU/jmmu6TD9DQzgLnRX6peX1nM5uFiLtDIsAEtuIE=; b=neQIm/v2QYa9ef Im+7dgo8lUvVl/4/FyvxXAVBrDIAOrGJYeGI2/hEsDjNrH3xVj/fCyOFxAlPB/E1kxaqUJwR0YCvv yrbxsuGzFwa/5ThNRELkt0uwLvxMkjqoAKo80n4l6/Pc7drgFZGsSSfL/jpRaTV8OW+JFouA68BeE q/lmhFlxRlpHQAnKHbSOdMI+Lvm9U4qultpwz016GWLkBN0OTscIk7KB8XAm9LMpiW8Ut/w7ahS7M EXtHpSDt4p9PMc7I0FflE4hIC3yvjl18ayZHZz0UsMxQ8gmbm/rJAORGe/AhFCuRATqltZwCEuIFu atOa9OGWrBDjcqVbFhBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqCaL-002xT8-09; Mon, 07 Jun 2021 10:34:21 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqC2w-002lKk-14 for linux-arm-kernel@lists.infradead.org; Mon, 07 Jun 2021 09:59:52 +0000 Received: by mail-wr1-x436.google.com with SMTP id e11so6663593wrg.3 for ; Mon, 07 Jun 2021 02:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=p4DLt66lUCYjaFVIOgZH75INGuDN8geDg/llZgnm7Ic=; b=v+wDKQVWu9yMRQlxnrjcHW+YzayMQw8AKbw0Sotye6dq6Mi/XirZdCp+SVNLSNDUH6 KnVPIi7G03WsdOSYqvHd5Qc9rE6Ecr2yquz0U/t1CxhCeMVmY7pHgQqo5UUuKnuv66yD 3IxkiD8fgYT76I/fGm3OO6dyf8hVmZ6JUEsAxDr7wQvkbldYEDC6/ZiW9h/QUlHXjuSa KiSH4xUr3mQtUm9S97PATjYfHMsIZyny5eSguSytWJD1hwTV5gcNLx1Y6MeiDRiSzYLh /YYeUsrPtK7KK1ZWQdQmufTNGSlm2eQtRfG/TZ0qs/majukVbye/OQcd6qlqhLBo0z3g ySSQ== 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=p4DLt66lUCYjaFVIOgZH75INGuDN8geDg/llZgnm7Ic=; b=LH6SIJp9xK9TdfYhnzwMthvT/hfJyjYcz0vLSDczyB7QZNX9rS+g27+Ix+wXFWTqEL KmHD1UyIn7tzxAiI40W2qTQ47hdntcIUs2NDe2ZSfDauf4KDS2tQxcl5tqF+EupClTqb fzWiXOnWR+RVuDc0uk8P98TsbcWNnjfcpngGLxHRMqJLZ0RGM5lPZRmNWBnlSylpkoJd U0WqUeBsb+Tw1KRJSoYRru1adYQQcr8t/ABsNpIF6GPEG4lR41wBa3OWRO4QvxAa7sog j0EIUbLJAFsDAvlj9/kUeiJNOTH3zEfEU6yfFjly7ynGGIe0mI/JVMz4p2bKDZ0Ga4PZ OJSA== X-Gm-Message-State: AOAM533kQsuUvq22mmVbuvxNHl/hEy4Wo/TLqgFwuaOoL0dil1EbOIgp GwAAOb9fiIxAyS31IWv/NTSNqQ== X-Google-Smtp-Source: ABdhPJxqSJVg78qWie75iU0nfkVmt/mrlTFme0qOfok5xe8IqNIFyAUXePcJPqifJe8VM+aT7yJP6g== X-Received: by 2002:adf:fa88:: with SMTP id h8mr16381574wrr.364.1623059986701; Mon, 07 Jun 2021 02:59:46 -0700 (PDT) Received: from localhost ([82.44.17.50]) by smtp.gmail.com with ESMTPSA id 89sm16240879wri.94.2021.06.07.02.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 02:59:46 -0700 (PDT) Date: Mon, 7 Jun 2021 10:59:45 +0100 From: Jamie Iles To: Marc Zyngier Cc: Jamie Iles , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Andre Przywara , Christoffer Dall , Jintack Lim , Haibo Xu , James Morse , Suzuki K Poulose , Alexandru Elisei , kernel-team@android.com Subject: Re: [PATCH v4 00/66] KVM: arm64: ARMv8.3/8.4 Nested Virtualization support Message-ID: References: <20210510165920.1913477-1-maz@kernel.org> <87zgw7z6j6.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87zgw7z6j6.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210607_025950_989350_C0675968 X-CRM114-Status: GOOD ( 37.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 On Thu, Jun 03, 2021 at 09:39:09AM +0100, Marc Zyngier wrote: > Hi Jamie, > > Funny, your email has a "Mail-Followup-To:" field that contains > everyone but you... Not ideal! ;-) Oops, new mutt config, thanks. > On Thu, 03 Jun 2021 08:07:22 +0100, > Jamie Iles wrote: > > > > Hi Marc, > > > > On Mon, May 10, 2021 at 05:58:14PM +0100, Marc Zyngier wrote: > > > Here the bi-annual drop of the KVM/arm64 NV support code. > > > > > > Not a lot has changed since [1], except for a discovery mechanism for > > > the EL2 support, some tidying up in the idreg emulation, dropping RMR > > > support, and a rebase on top of 5.13-rc1. > > > > > > As usual, blame me for any bug, and nobody else. > > > > > > It is still massively painful to run on the FVP, but if you have a > > > Neoverse V1 or N2 system that is collecting dust, I have the right > > > stuff to keep it busy! > > > > I've been testing this series on FVP and get a crash when returning from > > __kvm_vcpu_run_vhe because the autiasp is failing. > > Ah, the joy of testing with older guests. I guess i should upgrade by > test rig and play with some newer guests at L1. > > > > > The problem is when the L1 boots and during EL2 setup sets hcr_el2 to > > HCR_HOST_NVHE_FLAGS and so enables HCR_APK|HCR_API. Then the guest > > enter+exit logic in L0 starts performing the key save restore, but as we > > didn't go through __hyp_handle_ptrauth, we haven't saved the host keys > > and invoked vcpu_ptrauth_enable() so restore the host keys back to 0. > > > > I wonder if the pointer auth keys should be saved+restored > > unconditionally for a guest when running nested rather than the lazy > > faulting that we have today? > > I'd like to try and avoid that in order to keep the basic logic as > simple as possible for the time being, and as close to the tried and > trusted flow we have today. > > > Alternatively we would need to duplicate > > the lazy logic for hcr_el2 writes. A quick hack of saving the host keys > > in __kvm_vcpu_run_vhe before sysreg_save_host_state_vhe is enough to > > allow me to boot an L1 with --nested and then an L2. > > > > Do we also need to filter out HCR_APK|HCR_API for hcr_el2 writes when > > pointer authentication hasn't been exposed to the guest? I haven't yet > > tried making ptrauth visible to the L1. > > I think this is the real thing. We should never propagate trap bits > for features we don't want to support in guests. The L1 kernel sets > these bits unconditionally, despite PtrAuth never being advertised, > which trips the host code. > > Could you try the untested hack below? That fixes the issue that I was seeing, lgtm. Thanks Marc! Jamie _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel