Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3727565ybt; Sun, 5 Jul 2020 05:03:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/Mb48yEsblLPuaDgjNGPlEGZRW3iqBSMdNpH1W/mKPVhtZM2aPXLQZiHpteU9BAqdVfRQ X-Received: by 2002:aa7:d6cf:: with SMTP id x15mr48994499edr.164.1593950607408; Sun, 05 Jul 2020 05:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593950607; cv=none; d=google.com; s=arc-20160816; b=Pv5mxIYYqElOucWlAps7xSpGCGvykvl47Gd+qbZkb7x02eXo+FEs0pkiimUlyeHjRe zC7SxHZLt1Uaquq0rAg4iIAwNJ85s6M3r5y1bt4GU9nr/70q/zyY0w/R+A0E1+NEZ1Qy 5rHJw1YOGTZ8XpuTG40HWyQoU96Rm1cXwIxanZB6YxRk27SPQFet02jmuPU45hofhvbO DLEOnfas1YWPL9BzIs7LtTpXJjXMKRVDRzsvWVZ0fwOIZn6vczilia+fDZUr8tYhknYY Tgcaqc5tg0q1owAcuLZKLTJMYP0EaQTK/4xL8T1rbtWCEo6aswq8j+hmNjNGMUBnU+he nRQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date:dkim-signature; bh=+lSVKI8rTKeimlazs+6ED1i6sXvgVZZqm1//VB77W0s=; b=ts7kpQ6Z8W6qDrz0a2YdC1qZgFlZId8cmIqckC+lYERlpNz1wGTMX1yU3yxLgvFgn3 yIHM9JJWoTqkcB1x6U3waJcfydIsvjO6BdpLQ1lVPR3wd2FV6PaEYCr6nuyrjE4vIsy7 +cryU6FK2ZNLUF3gu4qZrO1UqxBIqH5UBT5OskWj7nKIn5QJciZkUDo2N5dNhOW5e4rL XOB+U16JzYRW1j7NXix/wiXS5Cx/2WwAIiIjACjQuJIL4fcJ6dudMXiGIzS6eHfPQX66 RSIo1rpj4NcM4yXibQIRtujfpR5siQRb1VGjEb+RZj+93K0zU+q20rXv1FFEIHx11y68 dk4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qUDLk+Ti; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id me25si11527936ejb.164.2020.07.05.05.03.04; Sun, 05 Jul 2020 05:03:27 -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=@kernel.org header.s=default header.b=qUDLk+Ti; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbgGEMAO (ORCPT + 99 others); Sun, 5 Jul 2020 08:00:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:58326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726454AbgGEMAN (ORCPT ); Sun, 5 Jul 2020 08:00:13 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B4C4720708; Sun, 5 Jul 2020 12:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593950412; bh=Hrki0NWbQnR7mFDJ86LIf/24cbRDX0SnjCAQfKCMf88=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qUDLk+TioO8qTy6bLwzuhK91dy/Jhc9T383RiyVLYx5MZpH3sY8Kdq2JlP1BAQf1B NDMyjsOkTIdBD38VpLqV/rjb17LE0W8VQWGhV43kMpjRLO0O0GFEe/FLnpS3zO7duQ G30D2gqEmI+J8C3FkfYibJHLOvfWTzYozou6/G50= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1js3Jb-009AjB-3s; Sun, 05 Jul 2020 13:00:11 +0100 Date: Sun, 05 Jul 2020 13:00:10 +0100 Message-ID: <87r1tqdved.wl-maz@kernel.org> From: Marc Zyngier To: David Brazdil Cc: Will Deacon , Catalin Marinas , James Morse , Julien Thierry , Suzuki K Poulose , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, android-kvm@google.com, kernel-team@android.com Subject: Re: [PATCH v4 08/15] arm64: kvm: Duplicate hyp/tlb.c for VHE/nVHE In-Reply-To: <20200625131420.71444-9-dbrazdil@google.com> References: <20200625131420.71444-1-dbrazdil@google.com> <20200625131420.71444-9-dbrazdil@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: dbrazdil@google.com, will@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, android-kvm@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Jun 2020 14:14:13 +0100, David Brazdil wrote: > > tlb.c contains code for flushing the TLB, with code shared between VHE/nVHE. > Because common code is small, duplicate tlb.c and specialize each copy for > VHE/nVHE. > > Signed-off-by: David Brazdil > --- > arch/arm64/kernel/image-vars.h | 14 +-- > arch/arm64/kvm/hyp/Makefile | 2 +- > arch/arm64/kvm/hyp/nvhe/Makefile | 2 +- > arch/arm64/kvm/hyp/{ => nvhe}/tlb.c | 94 +--------------- > arch/arm64/kvm/hyp/vhe/Makefile | 2 +- > arch/arm64/kvm/hyp/vhe/tlb.c | 162 ++++++++++++++++++++++++++++ > 6 files changed, 178 insertions(+), 98 deletions(-) > rename arch/arm64/kvm/hyp/{ => nvhe}/tlb.c (62%) > create mode 100644 arch/arm64/kvm/hyp/vhe/tlb.c [...] > diff --git a/arch/arm64/kvm/hyp/tlb.c b/arch/arm64/kvm/hyp/nvhe/tlb.c > similarity index 62% > rename from arch/arm64/kvm/hyp/tlb.c > rename to arch/arm64/kvm/hyp/nvhe/tlb.c > index d063a576d511..9513ad41db9a 100644 > --- a/arch/arm64/kvm/hyp/tlb.c > +++ b/arch/arm64/kvm/hyp/nvhe/tlb.c > @@ -4,8 +4,6 @@ > * Author: Marc Zyngier > */ > > -#include > - > #include > #include > #include > @@ -16,52 +14,8 @@ struct tlb_inv_context { > u64 sctlr; > }; nit: You seem to have overlooked that some of the tlb_inv_context fields are now unused. I plan to squash the following patch in: diff --git a/arch/arm64/kvm/hyp/nvhe/tlb.c b/arch/arm64/kvm/hyp/nvhe/tlb.c index 6fe190bb930a..d4475f8340c4 100644 --- a/arch/arm64/kvm/hyp/nvhe/tlb.c +++ b/arch/arm64/kvm/hyp/nvhe/tlb.c @@ -9,9 +9,7 @@ #include struct tlb_inv_context { - unsigned long flags; u64 tcr; - u64 sctlr; }; static void __tlb_switch_to_guest(struct kvm *kvm, struct tlb_inv_context *cxt) Otherwise, this looks good to me. Thanks, M. -- Without deviation from the norm, progress is not possible.