Message ID | 20220322013310.1880100-1-oupton@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D16B3C433F5 for <linux-arm-kernel@archiver.kernel.org>; Tue, 22 Mar 2022 01:35:03 +0000 (UTC) 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:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=uMwGsY1Om2IdvMXCdbKypZRapCTFy5Sg/QOupn5+dyM=; b=bcB45bSlTID35YWc3wvcplny3k 4vSpubby9wOdiGtiWfSCyP0Te4yJdzPz/yMOn1mYRoUso4BUgH+pB39PC12d/LFnRJaBKvH4FteT7 ClnIJ9NwiW5t6u4LTDkTj6YOvaPJKtNk1XItcl+Z4kCY2xkliUhz8wb/K7rbiw/EAA7Y6WRKI+T6C 8kBYWvddklz0TVUGmJR5fvPfxA9N8rsMwIuRiTXaADGq5VvInzHNmAv2z26Spp5RccJsAKK8BAxxw QjCxrjjg1Rjg88LGsJpsMx3GNOD39j2m6VyOLKTOd4dvQyVc5CVgcjV6BJKlC1UFeb5hItgjIrtMm xgP6r28A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWTOg-009bBi-5m; Tue, 22 Mar 2022 01:33:18 +0000 Received: from mail-il1-x149.google.com ([2607:f8b0:4864:20::149]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWTOc-009bBC-8n for linux-arm-kernel@lists.infradead.org; Tue, 22 Mar 2022 01:33:16 +0000 Received: by mail-il1-x149.google.com with SMTP id t16-20020a056e02061000b002c7ddaa0006so7154110ils.7 for <linux-arm-kernel@lists.infradead.org>; Mon, 21 Mar 2022 18:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=qjnBCMCBFj8PplPtYytxZfhoVlLYfUvFpjjjdycnFWE=; b=pII/Xw7Dal4aBB+0PLm2RyxWxoqjmtvsNRZQUUfR8ns77VDJYyDzs2nROTIb/UUqAA pOLPYNJLawy0NMA2CTpM/hp7vTo7rIebJsWKYgdAdRvsxw9rBxbE5a2hL+ma38I9AtbL xJlNHTMBF+w4lcS3PXcjeCxP1olVlxESHzW0LMS1qpFdc72NqG7R+mndkElUfBpFX7oV c0/MgLBIHNm2lFKCG/S3LAAHjSMU9Zlct80kEqajjVsWN0oBRQwd9zgVqwYl4Ecs1z8R mRwQw5elwVXfc1hf9Mm1hfeyorNWbGBLLqTIJwPApN5eRiuoSnQ10XVgqx8O4VkWvWoC 7Ldg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=qjnBCMCBFj8PplPtYytxZfhoVlLYfUvFpjjjdycnFWE=; b=stR7ra+IURP5zDYV5ImRZs7YRw1KeF3n1M28eAl7gaAchWna9HdbopzPaytqcJf1Y4 cTxBrJkykiaDE++TAtEph+YLT9hOTXojRy0Z7vp0uEC7sI0rviMOQuKKP3ecgYTi5Eeq 1otwVA+xw2ti7Nde8xYRO8CbnerjvSrJPEoOmRWGVZ20upawb4C0q6GgOqq6tY/lG7Lf pAeC95ASVSxdFT34ahOsUsXo66VGvJ7ij9p3kvhcKuBw1H02lIyCTqTTLhruk0P56Lum l+MapCiBerPj6Wf7JZYAFSFHShKnPvFyXt8rpC+MDQ2kAboVhpwseWRrGR1RdmMVJoOy ILGg== X-Gm-Message-State: AOAM5323upDdIl6TyNlUbP1eGslTT4ITK5cQRwgzV9vwBOrS1GsAxXXh nmeMbzZLgxwlNhA0hRJ3z1yeHrKxP+E= X-Google-Smtp-Source: ABdhPJwbCwwXb7MoS1YP0fzzPvJ9s+3FAN1k0iq644mgxX1DYCS9sZ9azTh6FyvitRYmbm8F1GECFravlPg= X-Received: from oupton.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:404]) (user=oupton job=sendgmr) by 2002:a05:6602:73c:b0:649:5e22:f3ee with SMTP id g28-20020a056602073c00b006495e22f3eemr8149186iox.156.1647912792555; Mon, 21 Mar 2022 18:33:12 -0700 (PDT) Date: Tue, 22 Mar 2022 01:33:10 +0000 In-Reply-To: <20220318193831.482349-1-oupton@google.com> Message-Id: <20220322013310.1880100-1-oupton@google.com> Mime-Version: 1.0 References: <20220318193831.482349-1-oupton@google.com> X-Mailer: git-send-email 2.35.1.894.gb6a874cedc-goog Subject: [PATCH] KVM: arm64: Drop unneeded minor version check from PSCI v1.x handler From: Oliver Upton <oupton@google.com> To: kvmarm@lists.cs.columbia.edu Cc: kvm@vger.kernel.org, Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>, Alexandru Elisei <alexandru.elisei@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, linux-arm-kernel@lists.infradead.org, Peter Shier <pshier@google.com>, Ricardo Koller <ricarkol@google.com>, Reiji Watanabe <reijiw@google.com>, Paolo Bonzini <pbonzini@redhat.com>, Will Deacon <will@kernel.org>, Oliver Upton <oupton@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220321_183314_338248_918044DB X-CRM114-Status: GOOD ( 13.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
KVM: arm64: Drop unneeded minor version check from PSCI v1.x handler
|
expand
|
diff --git a/arch/arm64/kvm/psci.c b/arch/arm64/kvm/psci.c index 0d771468b708..7cd3fe62275f 100644 --- a/arch/arm64/kvm/psci.c +++ b/arch/arm64/kvm/psci.c @@ -315,9 +315,6 @@ static int kvm_psci_1_x_call(struct kvm_vcpu *vcpu, u32 minor) unsigned long val; int ret = 1; - if (minor > 1) - return -EINVAL; - val = kvm_psci_check_allowed_function(vcpu, psci_fn); if (val) goto out;
We already sanitize the guest's PSCI version when it is being written by userspace, rejecting unsupported version numbers. Additionally, the 'minor' parameter to kvm_psci_1_x_call() is a constant known at compile time for all callsites. Though it is benign, the additional check against the PSCI kvm_psci_1_x_call() is unnecessary and likely to be missed the next time KVM raises its maximum PSCI version. Drop the check altogether and rely on sanitization when the PSCI version is set by userspace. No functional change intended. Signed-off-by: Oliver Upton <oupton@google.com> --- Sorry for not sending this with the other ones. I took another read and do not believe this check is necessary + might hurt when we raise the PSCI version again. Applies on top of the series [1], which itself is based on kvmarm/next at commit: 21ea45784275 ("KVM: arm64: fix typos in comments") [1]: http://lore.kernel.org/r/20220318193831.482349-1-oupton@google.com arch/arm64/kvm/psci.c | 3 --- 1 file changed, 3 deletions(-)