From patchwork Sun Sep 1 21:12:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11125755 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D811B1398 for ; Sun, 1 Sep 2019 21:13:05 +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 B645A22CF7 for ; Sun, 1 Sep 2019 21:13:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AUHRmfSz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B645A22CF7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Y9H7W0zVxRqWHO4CC/3cufcp/f678cFYlGpnJ8wc7/Y=; b=AUHRmfSzBpTS9r tjmoYA6L3Dzx/SAD5Rmc7PVjeW6OSoVakCMDtkwD1ZnqUYK4CP8uhYSLDKWRuy0tS9BKh4YH62/WN FO0Is4QA9yCDGclK9CZWixUoYzRn75XYazidRIYG07jQ1QNgaLVo586PSTP1b+rY0SKh/TqspHDJS w+ICppKFjlVyp1196C0CLPtcCxRenjLWW+W0nhaMTttdykssfLYqjlJBqmvDRz6UnwF/LoYsl6HcQ TX1QmtUGlohtfjII03O5wdz+CJwRAo+9z80Ma+yKSSuTDWTjSUw9eR/e7cQBLS+iylxALh6hkTpHS wraRDqT49VvV02YdnvCA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i4X9k-0006EO-78; Sun, 01 Sep 2019 21:13:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i4X9h-0006CN-FF for linux-arm-kernel@lists.infradead.org; Sun, 01 Sep 2019 21:13:02 +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 552DE28; Sun, 1 Sep 2019 14:12:56 -0700 (PDT) Received: from why.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 180C73F718; Sun, 1 Sep 2019 14:12:54 -0700 (PDT) From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Subject: [PATCH 0/3] arm64: KVM: Kiss hyp_alternate_select() goodbye Date: Sun, 1 Sep 2019 22:12:34 +0100 Message-Id: <20190901211237.11673-1-maz@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190901_141301_556613_31DB3AB9 X-CRM114-Status: UNSURE ( 8.02 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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: James Morse , Julien Thierry , Suzuki K Poulose Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org hyp_alternate_select() is a leftover from the my second attempt at supporting VHE (the first one was never merged, thankfully), and is now an irrelevant relic. It was a way to patch function pointers without having to dereference memory, a bit like static keys for function calls. Lovely idea, but since Christoffer mostly separated the VHE and !VHE hypervisor paths, most of the uses of hyp_alternate_select() are gone. What is left is two instances that are better replaced by already existing static keys. One of the instances becomes cpus_have_const_cap(), and the rest is a light sprinkling of has_vhe(). So off it goes. Marc Zyngier (3): arm64: KVM: Drop hyp_alternate_select for checking for ARM64_WORKAROUND_834220 arm64: KVM: Replace hyp_alternate_select with has_vhe() arm64: KVM: Kill hyp_alternate_select() arch/arm64/include/asm/kvm_hyp.h | 24 --------------------- arch/arm64/kvm/hyp/switch.c | 17 ++------------- arch/arm64/kvm/hyp/tlb.c | 36 +++++++++++++++++++------------- 3 files changed, 24 insertions(+), 53 deletions(-) Reviewed-by: Christoffer Dall Reviewed-by: Andrew Jones