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=-13.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 AAF81C56202 for ; Mon, 23 Nov 2020 14:32:30 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id F164D2080A for ; Mon, 23 Nov 2020 14:32:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="GpZ/3A6V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F164D2080A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 3D1C14BA38; Mon, 23 Nov 2020 09:32:29 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qaxs6X1AVjt7; Mon, 23 Nov 2020 09:32:28 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2CD604BAC1; Mon, 23 Nov 2020 09:32:28 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F19944BA38 for ; Mon, 23 Nov 2020 09:32:26 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WtvB+gZTIuNm for ; Mon, 23 Nov 2020 09:32:24 -0500 (EST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id C27CD4BA28 for ; Mon, 23 Nov 2020 09:32:24 -0500 (EST) 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 7E1292083E; Mon, 23 Nov 2020 14:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606141943; bh=lDofIwi2BtW6n3G9yyz3mKUtQ/dbkrPPmWz16CrGPi0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GpZ/3A6VL9vrcXWbAJ7FguzGnep2k7UBr7K5iTyCQKc76oA3A9XrwGdRmKY+lRWuE Xf1jUB6+kgy8MCtw871AyjjXzjtXYFD3ZyRwIx8Y9y4TVuGYloOGFcTcl4dOeevuVd 1wpFK4aJvsTBHW6U3613MGfSfdmVVXrMGx2MUh8I= 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) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1khCtB-00CyXO-Bu; Mon, 23 Nov 2020 14:32:21 +0000 Date: Mon, 23 Nov 2020 14:32:20 +0000 Message-ID: <87k0uc5ekr.wl-maz@kernel.org> From: Marc Zyngier To: David Brazdil Subject: Re: [PATCH v2 07/24] kvm: arm64: Refactor handle_trap to use a switch In-Reply-To: <20201116204318.63987-8-dbrazdil@google.com> References: <20201116204318.63987-1-dbrazdil@google.com> <20201116204318.63987-8-dbrazdil@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: dbrazdil@google.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, dennis@kernel.org, tj@kernel.org, cl@linux.com, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, qperret@google.com, ascull@google.com, qwandor@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 Cc: kernel-team@android.com, Lorenzo Pieralisi , Andrew Walbran , Catalin Marinas , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tejun Heo , Dennis Zhou , Christoph Lameter , Will Deacon , kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, 16 Nov 2020 20:43:01 +0000, David Brazdil wrote: > > Small refactor so that nVHE's handle_trap uses a switch on the Exception > Class value of ESR_EL2 in preparation for adding a handler of SMC32/64. nit: SMC32 seems to be a leftover from the previous version. > > Signed-off-by: David Brazdil > --- > arch/arm64/kvm/hyp/nvhe/hyp-main.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c > index 411b0f652417..19332c20fcde 100644 > --- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c > +++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c > @@ -16,9 +16,9 @@ > > DEFINE_PER_CPU(struct kvm_nvhe_init_params, kvm_init_params); > > -static void handle_host_hcall(unsigned long func_id, > - struct kvm_cpu_context *host_ctxt) > +static void handle_host_hcall(struct kvm_cpu_context *host_ctxt) > { > + unsigned long func_id = host_ctxt->regs.regs[0]; > unsigned long ret = 0; > > switch (func_id) { > @@ -109,11 +109,12 @@ static void handle_host_hcall(unsigned long func_id, > void handle_trap(struct kvm_cpu_context *host_ctxt) > { > u64 esr = read_sysreg_el2(SYS_ESR); > - unsigned long func_id; > > - if (ESR_ELx_EC(esr) != ESR_ELx_EC_HVC64) > + switch (ESR_ELx_EC(esr)) { > + case ESR_ELx_EC_HVC64: > + handle_host_hcall(host_ctxt); > + break; > + default: > hyp_panic(); > - > - func_id = host_ctxt->regs.regs[0]; > - handle_host_hcall(func_id, host_ctxt); > + } > } > -- > 2.29.2.299.gdc1121823c-goog > > Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm