From patchwork Thu Apr 6 20:56:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 80522 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1301349vqo; Thu, 6 Apr 2023 14:08:00 -0700 (PDT) X-Google-Smtp-Source: AKy350YhIQb908ws+bJtQZotRoe+40OlafX7bJmyAdsW5piabGSGP6fknOrUBtpN2eMwG+xt3Hu8 X-Received: by 2002:a17:90b:3503:b0:240:ac43:2014 with SMTP id ls3-20020a17090b350300b00240ac432014mr24160pjb.10.1680815280585; Thu, 06 Apr 2023 14:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680815280; cv=none; d=google.com; s=arc-20160816; b=nr514FX9NwWz+Dg/EDdBBzzX2FdYEAzm0jfLxQGB+kKQRNejQOG0bU0rXkfbj5IiA0 TnBWcEpcs/1IsPuN96QXXcEg7MrgwRffHUMh732f1BRM/AckSQvowaMv0Fk5hTlJrJlr Va0Zm04nckYD9GErtk5qTDyynMQKwhx1z/VflQRnlx44QfTIKp7ISs5sSw7qhs7B92j6 VwrmBbxlw2sI7TgLj6Oywl7GEeHJzlGygdn0SRVt3EayuJK9X3hY1du3ZJa7cPhjOLRc 7bVD4sn3AlKAdo6Y/2dbt8sSzf9qLeb0/DBk9ypnNVIQwOkK07Z2RCzXaTlNwoOHAkSn gFrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=YjBvEYxvpoeX2vPb3Ms2POZwrN+eVBkKCaru7XNe9yQ=; b=k/mqP3QGnOAj9qfh1E+9U5s9LFHzGb2SiWekecfBapI5GhtlmtU3TbuE0aWE4D6lJH aGV6RcCu1lG8oL2afCuVAq3BhogoO1iWvemmBy7IfjRGqetbQ9H/hCFka28grbOfMbbL mSsRyR24/bIDeciQNh2QjdGU/NxeZw8lgpat7x5Mu85cpi0KB60TZIkxnrYkFtjFYTsQ p7pdUUIoq9AT85wd7jUo2DrRSqdaEZ4NhO03GYHrw8R1PUyL1molKDpwwsBvGfBB/9Dl 5aMnGpkJSU83BF1353PZHn3SeqEearBdacS36oyGc7AgTbF0Q7kiTJJLdiGuHBXm6K8a 8R3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=omVAmUwn; dkim=neutral (no key) header.i=@linutronix.de header.b=S3Esd2nK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a170902ea0e00b001a05347d088si2625255plg.201.2023.04.06.14.07.47; Thu, 06 Apr 2023 14:08:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=omVAmUwn; dkim=neutral (no key) header.i=@linutronix.de header.b=S3Esd2nK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237645AbjDFU4h (ORCPT + 99 others); Thu, 6 Apr 2023 16:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjDFU4c (ORCPT ); Thu, 6 Apr 2023 16:56:32 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F6704ED6; Thu, 6 Apr 2023 13:56:31 -0700 (PDT) Date: Thu, 06 Apr 2023 20:56:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1680814590; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YjBvEYxvpoeX2vPb3Ms2POZwrN+eVBkKCaru7XNe9yQ=; b=omVAmUwnm8OA3akiYZAjbE48QfH+Kda2Li0M1rtO2Hd+Z5Slrsr4ejMRigY4fFlksK2fOg +6Q9pfhqi4+mBpsq219Esmok7x7zNKnU3sD1ZoKiSxrpeyrlDuHoB8n+z9cErOtg95t+k2 A3DxCVPy1Y9q4Da+AmeIZzMY4ZVJF3dXNg8h1Bw0Mr74wl+LBtb/pu+UyUOuYLxTIvFO60 ldb+G2CRMq4GlTDb378p24lwCMUAS6aTtzD/f629MAnY2e2neW1d63Hi2Sko7PM8C4y1k0 FZnNUKUE/PV44hDPs6DJm6ZOy0VhWfTAaj1xF1IN3IzUHMgJigSa5Gp+3qnh0w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1680814590; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YjBvEYxvpoeX2vPb3Ms2POZwrN+eVBkKCaru7XNe9yQ=; b=S3Esd2nKhGlgqSmT91zLCrJ/rFcFrWmtgD+DLVd8tu5VrJZhPDNCakL2YmjNBYDRueMM96 eZNDNJwAO3LYpVDQ== From: "tip-bot2 for Kirill A. Shutemov" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/mm] x86/mm/iommu/sva: Fix error code for LAM enabling failure due to SVA Cc: Dmitry Vyukov , "Kirill A. Shutemov" , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <168081458969.404.10805285525053802154.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762462563338930880?= X-GMAIL-MSGID: =?utf-8?q?1762462563338930880?= The following commit has been merged into the x86/mm branch of tip: Commit-ID: fca1fdd2b0a6fcd491ec520afac80bc72b4c811e Gitweb: https://git.kernel.org/tip/fca1fdd2b0a6fcd491ec520afac80bc72b4c811e Author: Kirill A. Shutemov AuthorDate: Mon, 03 Apr 2023 14:10:19 +03:00 Committer: Dave Hansen CommitterDate: Thu, 06 Apr 2023 13:44:58 -07:00 x86/mm/iommu/sva: Fix error code for LAM enabling failure due to SVA Normally, LAM and SVA are mutually exclusive. LAM enabling will fail if SVA is already in use. Correct error code for the failure. EINTR is nonsensical there. Fixes: 23e5d9ec2bab ("x86/mm/iommu/sva: Make LAM and SVA mutually exclusive") Reported-by: Dmitry Vyukov Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Dmitry Vyukov Link: https://lore.kernel.org/all/CACT4Y+YfqSMsZArhh25TESmG-U4jO5Hjphz87wKSnTiaw2Wrfw@mail.gmail.com Link: https://lore.kernel.org/all/20230403111020.3136-2-kirill.shutemov%40linux.intel.com --- arch/x86/kernel/process_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index b46924c..bc2ac56 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -758,7 +758,7 @@ static int prctl_enable_tagged_addr(struct mm_struct *mm, unsigned long nr_bits) if (mm_valid_pasid(mm) && !test_bit(MM_CONTEXT_FORCE_TAGGED_SVA, &mm->context.flags)) - return -EINTR; + return -EINVAL; if (mmap_write_lock_killable(mm)) return -EINTR;