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=-16.0 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,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 E830BC4338F for ; Wed, 11 Aug 2021 05:56: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 A0F9A60E93 for ; Wed, 11 Aug 2021 05:56:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A0F9A60E93 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=OAXfFMHCOAcht2oGoHCDK623nymfU7Vt+Ib+IaT3FhY=; b=hm2wyO3KfQF/GIoXvKZGj2QACH HMmXvAq9WruVaRziLqLNC7xSFFCdHQ0Wy0a6VVQjwEPUHDDRjt7WaYNMk5qCoPxl+k3rl9jcBqLoS UxzrfHK+6+gEc77oehD5i1N6v5AZZnXykX/ukhu29TYqyR4KPuHKHL16R5Ns63VZ5ob2lcIVIHox/ hpcscxF6jS1E2gNAKynauUSENMim3WOs/NJjri9uAezXhXJ1S0ek+W5+7G2QqsAUCEzhKO8ogQoLu QAv1B6L3ff2eNQiic5xBMYCOg4Zta8TjC7XFvuLJoI1w/vFSpZKIGV5MFj5Ha7qh6qobEHszY6pNH wjYFNLPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDhBw-005fU5-Sl; Wed, 11 Aug 2021 05:54:17 +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 1mDhBs-005fTL-DD for linux-arm-kernel@lists.infradead.org; Wed, 11 Aug 2021 05:54:14 +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 2D6431FB; Tue, 10 Aug 2021 22:54:08 -0700 (PDT) Received: from [10.163.67.241] (unknown [10.163.67.241]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1EA133F718; Tue, 10 Aug 2021 22:54:04 -0700 (PDT) Subject: Re: [PATCH 3/5] KVM: arm64: Drop check_kvm_target_cpu() based percpu probe To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Marc Zyngier , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org References: <1628578961-29097-1-git-send-email-anshuman.khandual@arm.com> <1628578961-29097-4-git-send-email-anshuman.khandual@arm.com> <20210810132822.GC2946@willie-the-truck> From: Anshuman Khandual Message-ID: Date: Wed, 11 Aug 2021 11:24:57 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210810132822.GC2946@willie-the-truck> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210810_225412_556877_B4026BE7 X-CRM114-Status: GOOD ( 18.74 ) 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 8/10/21 6:58 PM, Will Deacon wrote: > On Tue, Aug 10, 2021 at 12:32:39PM +0530, Anshuman Khandual wrote: >> kvm_target_cpu() never returns a negative error code, so check_kvm_target() >> would never have 'ret' filled with a negative error code. Hence the percpu >> probe via check_kvm_target_cpu() does not make sense as its never going to >> find an unsupported CPU, forcing kvm_arch_init() to exit early. Hence lets >> just drop this percpu probe (and also check_kvm_target_cpu()) altogether. >> >> Cc: Marc Zyngier >> Cc: James Morse >> Cc: Alexandru Elisei >> Cc: Suzuki K Poulose >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: kvmarm@lists.cs.columbia.edu >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Anshuman Khandual >> --- >> arch/arm64/kvm/arm.c | 14 -------------- >> 1 file changed, 14 deletions(-) >> >> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c >> index 19560e457c11..16f93678c17e 100644 >> --- a/arch/arm64/kvm/arm.c >> +++ b/arch/arm64/kvm/arm.c >> @@ -2010,11 +2010,6 @@ static int finalize_hyp_mode(void) >> return 0; >> } >> >> -static void check_kvm_target_cpu(void *ret) >> -{ >> - *(int *)ret = kvm_target_cpu(); >> -} >> - >> struct kvm_vcpu *kvm_mpidr_to_vcpu(struct kvm *kvm, unsigned long mpidr) >> { >> struct kvm_vcpu *vcpu; >> @@ -2074,7 +2069,6 @@ void kvm_arch_irq_bypass_start(struct irq_bypass_consumer *cons) >> int kvm_arch_init(void *opaque) >> { >> int err; >> - int ret, cpu; >> bool in_hyp_mode; >> >> if (!is_hyp_mode_available()) { >> @@ -2089,14 +2083,6 @@ int kvm_arch_init(void *opaque) >> kvm_info("Guests without required CPU erratum workarounds can deadlock system!\n" \ >> "Only trusted guests should be used on this system.\n"); >> >> - for_each_online_cpu(cpu) { >> - smp_call_function_single(cpu, check_kvm_target_cpu, &ret, 1); >> - if (ret < 0) { >> - kvm_err("Error, CPU %d not supported!\n", cpu); >> - return -ENODEV; >> - } >> - } > > Looks like kvm_target_cpu() *could* return an error at one time of day (at > least on 32-bit), but agreed that this checking is no longer needed: > > Acked-by: Will Deacon > > Perhaps it's worth making the return type of kvm_target_cpu() a u32 to > make it a bit more explicit that you shouldn't be returning an error code > there? Sure, will change the return type to u32. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel