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, HEADER_FROM_DIFFERENT_DOMAINS,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 3D0DCC4708F for ; Fri, 4 Jun 2021 14:09:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 210A26140F for ; Fri, 4 Jun 2021 14:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230250AbhFDOLC (ORCPT ); Fri, 4 Jun 2021 10:11:02 -0400 Received: from foss.arm.com ([217.140.110.172]:39948 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbhFDOLB (ORCPT ); Fri, 4 Jun 2021 10:11:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6678B2B; Fri, 4 Jun 2021 07:09:15 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.6.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4CE513F774; Fri, 4 Jun 2021 07:09:12 -0700 (PDT) Date: Fri, 4 Jun 2021 15:09:09 +0100 From: Mark Rutland To: Will Deacon Cc: kvmarm@lists.cs.columbia.edu, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Christoffer Dall , Paolo Bonzini , Fuad Tabba , Quentin Perret , Sean Christopherson , David Brazdil , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/4] KVM: arm64: Extend comment in has_vhe() Message-ID: <20210604140909.GB69333@C02TD0UTHF1T.local> References: <20210603183347.1695-1-will@kernel.org> <20210603183347.1695-3-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210603183347.1695-3-will@kernel.org> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Jun 03, 2021 at 07:33:45PM +0100, Will Deacon wrote: > has_vhe() expands to a compile-time constant when evaluated from the VHE > or nVHE code, alternatively checking a static key when called from > elsewhere in the kernel. On face value, this looks like a case of > premature optimization, but in fact this allows symbol references on > VHE-specific code paths to be dropped from the nVHE object. > > Expand the comment in has_vhe() to make this clearer, hopefully > discouraging anybody from simplifying the code. > > Cc: David Brazdil > Signed-off-by: Will Deacon Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/virt.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h > index 7379f35ae2c6..3218ca17f819 100644 > --- a/arch/arm64/include/asm/virt.h > +++ b/arch/arm64/include/asm/virt.h > @@ -111,6 +111,9 @@ static __always_inline bool has_vhe(void) > /* > * Code only run in VHE/NVHE hyp context can assume VHE is present or > * absent. Otherwise fall back to caps. > + * This allows the compiler to discard VHE-specific code from the > + * nVHE object, reducing the number of external symbol references > + * needed to link. > */ > if (is_vhe_hyp_code()) > return true; > -- > 2.32.0.rc0.204.g9fa02ecfa5-goog > 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, HEADER_FROM_DIFFERENT_DOMAINS,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 882DBC07E94 for ; Fri, 4 Jun 2021 14:09:28 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 0576C6140C for ; Fri, 4 Jun 2021 14:09:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0576C6140C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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 86BBE4B09E; Fri, 4 Jun 2021 10:09:27 -0400 (EDT) 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 HxTPE04BBhif; Fri, 4 Jun 2021 10:09:22 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id A83264B0F6; Fri, 4 Jun 2021 10:09:22 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9F0A24B0EB for ; Fri, 4 Jun 2021 10:09:21 -0400 (EDT) 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 nFvSd6xnC3oT for ; Fri, 4 Jun 2021 10:09:16 -0400 (EDT) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 53AF54B09E for ; Fri, 4 Jun 2021 10:09:16 -0400 (EDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6678B2B; Fri, 4 Jun 2021 07:09:15 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.6.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4CE513F774; Fri, 4 Jun 2021 07:09:12 -0700 (PDT) Date: Fri, 4 Jun 2021 15:09:09 +0100 From: Mark Rutland To: Will Deacon Subject: Re: [PATCH 2/4] KVM: arm64: Extend comment in has_vhe() Message-ID: <20210604140909.GB69333@C02TD0UTHF1T.local> References: <20210603183347.1695-1-will@kernel.org> <20210603183347.1695-3-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210603183347.1695-3-will@kernel.org> Cc: kvm@vger.kernel.org, Marc Zyngier , linux-arm-kernel@lists.infradead.org, Sean Christopherson , Paolo Bonzini , 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 Thu, Jun 03, 2021 at 07:33:45PM +0100, Will Deacon wrote: > has_vhe() expands to a compile-time constant when evaluated from the VHE > or nVHE code, alternatively checking a static key when called from > elsewhere in the kernel. On face value, this looks like a case of > premature optimization, but in fact this allows symbol references on > VHE-specific code paths to be dropped from the nVHE object. > > Expand the comment in has_vhe() to make this clearer, hopefully > discouraging anybody from simplifying the code. > > Cc: David Brazdil > Signed-off-by: Will Deacon Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/virt.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h > index 7379f35ae2c6..3218ca17f819 100644 > --- a/arch/arm64/include/asm/virt.h > +++ b/arch/arm64/include/asm/virt.h > @@ -111,6 +111,9 @@ static __always_inline bool has_vhe(void) > /* > * Code only run in VHE/NVHE hyp context can assume VHE is present or > * absent. Otherwise fall back to caps. > + * This allows the compiler to discard VHE-specific code from the > + * nVHE object, reducing the number of external symbol references > + * needed to link. > */ > if (is_vhe_hyp_code()) > return true; > -- > 2.32.0.rc0.204.g9fa02ecfa5-goog > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 88894C07E94 for ; Fri, 4 Jun 2021 14:12:12 +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 4B4B6611AD for ; Fri, 4 Jun 2021 14:12:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B4B6611AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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=1A2ZJ7H/eiGe8hXdTOiC4Hiay+NcuqaqwRa88PA/cy4=; b=w0h/vzvKqjZJDm tdfg0lY6LVijTvgyJL6jnPaNsoYgMcQIRPz5phvUxykBex8v2sI3k6l9axn9TVZZdX8RhF35BaiIB 2LAC8ypkdH3zbfSr+UKeLwbtq83IXP5CJ+KK87tqx1GpHNrlOaHtS/on4M3Pn3fH+O5xDV7wE7bMA Yq+2LaUSLh7ak72mIVhgYK5313xYh4mZr2K+a1FnWJX5S1vRhBHYYwFk0J1d21xiKM/noxizKLBp+ 6DgunRsNM7SrXs357fC4+3KOJkq8ozrkG3m3+X5BGDfRKB1mKazdQXv42a9K00THd1y/W5pu9rANz qjd0nKogufTjeukwVx+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpAWc-00DsWf-1C; Fri, 04 Jun 2021 14:10:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lpAVg-00DsB9-Oe for linux-arm-kernel@lists.infradead.org; Fri, 04 Jun 2021 14:09:20 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6678B2B; Fri, 4 Jun 2021 07:09:15 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.6.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4CE513F774; Fri, 4 Jun 2021 07:09:12 -0700 (PDT) Date: Fri, 4 Jun 2021 15:09:09 +0100 From: Mark Rutland To: Will Deacon Cc: kvmarm@lists.cs.columbia.edu, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Christoffer Dall , Paolo Bonzini , Fuad Tabba , Quentin Perret , Sean Christopherson , David Brazdil , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/4] KVM: arm64: Extend comment in has_vhe() Message-ID: <20210604140909.GB69333@C02TD0UTHF1T.local> References: <20210603183347.1695-1-will@kernel.org> <20210603183347.1695-3-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210603183347.1695-3-will@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210604_070916_894955_3C916346 X-CRM114-Status: GOOD ( 19.50 ) 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 07:33:45PM +0100, Will Deacon wrote: > has_vhe() expands to a compile-time constant when evaluated from the VHE > or nVHE code, alternatively checking a static key when called from > elsewhere in the kernel. On face value, this looks like a case of > premature optimization, but in fact this allows symbol references on > VHE-specific code paths to be dropped from the nVHE object. > > Expand the comment in has_vhe() to make this clearer, hopefully > discouraging anybody from simplifying the code. > > Cc: David Brazdil > Signed-off-by: Will Deacon Acked-by: Mark Rutland Mark. > --- > arch/arm64/include/asm/virt.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h > index 7379f35ae2c6..3218ca17f819 100644 > --- a/arch/arm64/include/asm/virt.h > +++ b/arch/arm64/include/asm/virt.h > @@ -111,6 +111,9 @@ static __always_inline bool has_vhe(void) > /* > * Code only run in VHE/NVHE hyp context can assume VHE is present or > * absent. Otherwise fall back to caps. > + * This allows the compiler to discard VHE-specific code from the > + * nVHE object, reducing the number of external symbol references > + * needed to link. > */ > if (is_vhe_hyp_code()) > return true; > -- > 2.32.0.rc0.204.g9fa02ecfa5-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel