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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 7D3D5C55199 for ; Mon, 27 Apr 2020 07:31:07 +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 4AA0C2051A for ; Mon, 27 Apr 2020 07:31:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IQ++Is4n"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="eGMXOl6g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AA0C2051A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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.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=tuqjBb0qNG+/4OzDckI0UyXSoJBTGMy0ZbwiIS76bfY=; b=IQ++Is4nxDhx+N FLvIVpUCMSmM9vr0RtAxqnuCMjzoD9InpoFIqI6qq1eFh0R+P0k4ftWEzA+u+PW3MmNpSBZEsNBwx TNCAXyww4XzGguHf5K+YH5xLekbdxz1kOVQqxngb3mgszvO+P7PRQgK1AT5nyaLCHQyelyFR7j3+v lh7gvV7K+k8viPyxDF94PXHstRuS0XNL4UnnnN4bAmMho4ISSSX33Kh8DAh0MBVguHrrcJi1WvD3M z4BEhjuk3wG+r3j8w/wpkvgTYNW74I8pbthzCrrEx/iexh40dm2KFEhZ8Iqvyv2PoXTvzGvKyI09C /fqUqIsJMzrdQsBCGrLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSyEM-0007hE-Kr; Mon, 27 Apr 2020 07:31:06 +0000 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120] helo=us-smtp-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jSyEK-0007gb-8P for linux-arm-kernel@lists.infradead.org; Mon, 27 Apr 2020 07:31:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587972662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fhbDo34NJp8lf0z2mD+gxz78VWyhT6vzLSI7DIn5U0k=; b=eGMXOl6gb52CO7gQeGRzvmmSbGtexcD36Uo2K4ODGh91VVRWiZ/NL43Xhq/7EFfGBop5s8 amZHEpgVr3D8HMkbaDYayOFNUbX9OyiXCO47rRbM2TDvEulprk5yCgl9vYC88kP+9kibhx 9ccpfnxzXkgv5MqQplWj+pzSJXDI9vY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-143-xE9ys-BJNemCctbaqWDaxQ-1; Mon, 27 Apr 2020 03:28:33 -0400 X-MC-Unique: xE9ys-BJNemCctbaqWDaxQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73EC11895A28; Mon, 27 Apr 2020 07:28:31 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.40.192.184]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D76A95C1D4; Mon, 27 Apr 2020 07:28:28 +0000 (UTC) Date: Mon, 27 Apr 2020 09:28:25 +0200 From: Andrew Jones To: Marc Zyngier Subject: Re: [PATCH] KVM: arm64: Save/restore sp_el0 as part of __guest_enter Message-ID: <20200427072825.ekcekll6f23bt2um@kamzik.brq.redhat.com> References: <20200425094321.162752-1-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200425094321.162752-1-maz@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200427_003104_514779_5B0C22B8 X-CRM114-Status: GOOD ( 12.94 ) 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: Mark Rutland , kvm@vger.kernel.org, Suzuki K Poulose , James Morse , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Apr 25, 2020 at 10:43:21AM +0100, Marc Zyngier wrote: > We currently save/restore sp_el0 in C code. This is a bit unsafe, > as a lot of the C code expects 'current' to be accessible from > there (and the opportunity to run kernel code in HYP is specially > great with VHE). > > Instead, let's move the save/restore of sp_el0 to the assembly > code (in __guest_enter), making sure that sp_el0 is correct > very early on when we exit the guest, and is preserved as long > as possible to its host value when we enter the guest. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/hyp/entry.S | 23 +++++++++++++++++++++++ > arch/arm64/kvm/hyp/sysreg-sr.c | 17 +++-------------- > 2 files changed, 26 insertions(+), 14 deletions(-) > Reviewed-by: Andrew Jones _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel