Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3784199ybt; Sun, 5 Jul 2020 06:46:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxe4JeN8GTR3Rps2VGpQaPssTpbtck8wVNYfg4mRwGFfkxN9NJsO+cCXXscASfdpG6gpz21 X-Received: by 2002:a05:6402:b23:: with SMTP id bo3mr51715247edb.331.1593956766872; Sun, 05 Jul 2020 06:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593956766; cv=none; d=google.com; s=arc-20160816; b=x/f2UblCa3qblvFbUZVaA0PzxvIhHJFUj+OW3+zIIbg1abC3ov+vdcAjfbvt5S85d5 d2UZW6XbEYzCQ5AGFxqVBqJLgrqqmytm8lFd++4g4KtvZjanVDWe4C99CDF7l38kMwsV 06UJSd1xJLTHBawqhZE4WYR/QVfgQfDzGv5h1HNdyHS1BbfumWOhKL3NgTVtelqSHj3W 5ccvxp36+ssDbPM9iCG1rTdaMss1al/x7aVxd84TnWXrSyjDkrj+sgV2a6Z/teNsQX4l kbIb0eQ/KiNuU9+hDzrmKrS7ZOzjSOdvHbCoENNaPujZ4pFtA6gZ2dCyeXIOvmpCe8e1 QTxg== 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=oWvVR3NKZF3NkqfK4hGq9Vlc3uK1IGFCWhR6V+e1IHA=; b=X9UNgDvBiYW/gG4Vld+oLNnA4z8YcUghGPjfmZdNxzsF/Q5vUfEFXtpEALg4AKb9kT SxJZH/FZnf2NsjMdWRZjsD+PPL35GRcCnUyzpAu+jMfApQnKJdVRqsHhYlisqE/u9ifO uE2af74AGd0cidVMdkZ5CWDBuPBFgRhcN4bTUgeYuv8y7vtd6owFGEixtrLlv1iYPoI+ Qpb0mHGOrNlsFRNL2txN+wdMyHpu2aGJApIZtr/4dpwURVHRkhyuVyyCwoDCpFWfuuvX ETTvN3ZQMiAf1kuekte8RJM3jpnGcTzpzfbCm+FJlZTfDfiqwS/sR2RlDm1BbVratkXI ahBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tlMbk8BF; 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 l18si11176992edr.242.2020.07.05.06.45.43; Sun, 05 Jul 2020 06:46:06 -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=tlMbk8BF; 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 S1727065AbgGENp2 (ORCPT + 99 others); Sun, 5 Jul 2020 09:45:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:57592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726833AbgGENp2 (ORCPT ); Sun, 5 Jul 2020 09:45:28 -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 9BDC820723; Sun, 5 Jul 2020 13:45:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593956727; bh=GRrK3a5skX+hTzje/hiXpCqKg6Ht2lZO8SAGK4bDpLE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tlMbk8BFB3Cf38eIKF6bcjDadn6ROhQxNApdZu6PHfr/OKUANDk5dhaQJMwUGPCOU 2nmsiAFVPw/9Dq6aWsKsdxcxqev0E3HtvoPNRNvUa1US7uoNmFVgSMHHH1xUQtCHA9 aRNUg3dLB2Rzb4ZegnmWnLHShJz7crOdlq0/fg7c= 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 1js4xS-009BZX-4Z; Sun, 05 Jul 2020 14:45:26 +0100 Date: Sun, 05 Jul 2020 14:45:25 +0100 Message-ID: <87pn9adqiy.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/vhe/tlb.c b/arch/arm64/kvm/hyp/vhe/tlb.c > new file mode 100644 > index 000000000000..35e8e112ba28 > --- /dev/null > +++ b/arch/arm64/kvm/hyp/vhe/tlb.c [...] > +void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa) > +{ > + struct tlb_inv_context cxt; > + > + dsb(ishst); > + > + /* Switch to requested VMID */ > + kvm = kern_hyp_va(kvm); nit: this is now superfluous. I'll drop it locally. Thanks, M. -- Without deviation from the norm, progress is not possible.