All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Kirill A. Shutemov" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Dmitry Vyukov <dvyukov@google.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/mm] x86/mm/iommu/sva: Fix error code for LAM enabling failure due to SVA
Date: Thu, 06 Apr 2023 20:56:29 -0000	[thread overview]
Message-ID: <168081458969.404.10805285525053802154.tip-bot2@tip-bot2> (raw)
In-Reply-To: <CACT4Y+YfqSMsZArhh25TESmG-U4jO5Hjphz87wKSnTiaw2Wrfw@mail.gmail.com>

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 <kirill.shutemov@linux.intel.com>
AuthorDate:    Mon, 03 Apr 2023 14:10:19 +03:00
Committer:     Dave Hansen <dave.hansen@linux.intel.com>
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 <dvyukov@google.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
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;

  parent reply	other threads:[~2023-04-06 20:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 11:25 [PATCHv16 00/17] Linear Address Masking enabling Kirill A. Shutemov
2023-03-12 11:25 ` [PATCHv16 01/17] x86/mm: Rework address range check in get_user() and put_user() Kirill A. Shutemov
2023-03-12 11:25 ` [PATCHv16 02/17] x86: Allow atomic MM_CONTEXT flags setting Kirill A. Shutemov
2023-03-12 11:25 ` [PATCHv16 03/17] x86: CPUID and CR3/CR4 flags for Linear Address Masking Kirill A. Shutemov
2023-03-12 11:25 ` [PATCHv16 04/17] x86/mm: Handle LAM on context switch Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 05/17] mm: Introduce untagged_addr_remote() Kirill A. Shutemov
2023-03-14 23:35   ` Edgecombe, Rick P
2023-03-12 11:26 ` [PATCHv16 06/17] x86/uaccess: Provide untagged_addr() and remove tags before address check Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 07/17] x86/mm: Reduce untagged_addr() overhead for systems without LAM Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 08/17] x86/mm: Provide arch_prctl() interface for LAM Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 09/17] mm: Expose untagging mask in /proc/$PID/status Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 10/17] iommu/sva: Replace pasid_valid() helper with mm_valid_pasid() Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 11/17] x86/mm/iommu/sva: Make LAM and SVA mutually exclusive Kirill A. Shutemov
2023-04-03  6:18   ` Dmitry Vyukov
2023-04-03  9:44     ` Kirill A. Shutemov
2023-04-03  9:56       ` Dmitry Vyukov
2023-04-03 10:17         ` Kirill A. Shutemov
2023-04-03 10:22           ` Dmitry Vyukov
2023-04-03 10:27             ` Kirill A. Shutemov
2023-04-06 20:56             ` tip-bot2 for Kirill A. Shutemov [this message]
2023-03-12 11:26 ` [PATCHv16 12/17] selftests/x86/lam: Add malloc and tag-bits test cases for linear-address masking Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 13/17] selftests/x86/lam: Add mmap and SYSCALL " Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 14/17] selftests/x86/lam: Add io_uring " Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 15/17] selftests/x86/lam: Add inherit " Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 16/17] selftests/x86/lam: Add ARCH_FORCE_TAGGED_SVA " Kirill A. Shutemov
2023-03-12 11:26 ` [PATCHv16 17/17] selftests/x86/lam: Add test cases for LAM vs thread creation Kirill A. Shutemov
2023-03-17 17:18 ` [PATCHv16 00/17] Linear Address Masking enabling Alexander Potapenko
2023-03-17 17:21   ` Alexander Potapenko
2023-03-17 17:28     ` Dave Hansen
2023-03-22 12:48       ` Alexander Potapenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=168081458969.404.10805285525053802154.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dvyukov@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.