Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4592804rwl; Mon, 3 Apr 2023 07:08:55 -0700 (PDT) X-Google-Smtp-Source: AKy350bn+kR0ey4zPOviMHmRvkOySPEEHbFxF3LijpYMp2Y4bwgygs1vafBLBDEAYA873WY0UpEt X-Received: by 2002:aa7:8bc2:0:b0:623:2bba:dd9 with SMTP id s2-20020aa78bc2000000b006232bba0dd9mr34125214pfd.14.1680530934922; Mon, 03 Apr 2023 07:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680530934; cv=none; d=google.com; s=arc-20160816; b=XrfsX6yNhbQBpY3AJNLOkBv9Hg1/B54fh2M5R/sNJ/KDWm2xRceqQ32bVvzEl2+RBV q+8pB4rAUX2q8um4e6s+GTNdwte0I+COOoCpDim34xbtSE4tQkyLaz0mF5JOvKyUbs/T YVi1nmNszLr47y5IU9+eJHKjAxCMVpBtNoTsiaOBwvMFRgwq+YRij7aWCsbdog+CVVFt pUsIxyMr3fgeYzJGXo7ZygNpmv8/Eyy/u4CpaubTMvN2DWD9xChN1cHBayAOodJ9Vn1d L6GV6/pMVqSCd9+K6uDf2z1i+ifgVGPVcJIbFdUrNFRYlzmYPvnktggKYpAGSmsXTICz eGgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/5Zx2eZQePqnyU3jO2bDpJxc2Hq5psZfequ5YzrYbHY=; b=eZaIo8xY9pvCIy13UNpPZDRoWm1c1nA/j1SRVoMrpt8x2NsusFFo51lpsPrywCUVC3 RVbKY3b5cePh4SzCSejI2djUYVd4hDpfictGWu/ayr724cvvcG6S/0300VX++8lvVvo2 EPv35P4RO+D91bVYBLMcSu174LfblgmSnskflPEukB3cQe3tNMRTK3+VXGxLHQmcTiUz SKgNYBnhDkfCL+D4tGlNxsGjAQQlPqYF2OT9gzycZAtQtSK0S2EwYdbvHRjHhhSBw2gR mmosWbz0Akej8TDEeSwj/PMHzmvnQTjdn198UySlk5U0CsBf0WY30h0I2U/ms2X7Ytod eCKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=RSURZppH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g185-20020a636bc2000000b005138ea6bf60si7886738pgc.422.2023.04.03.07.08.41; Mon, 03 Apr 2023 07:08:54 -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=@google.com header.s=20210112 header.b=RSURZppH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232699AbjDCN4B (ORCPT + 99 others); Mon, 3 Apr 2023 09:56:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjDCNz7 (ORCPT ); Mon, 3 Apr 2023 09:55:59 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D7F8DF for ; Mon, 3 Apr 2023 06:55:57 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id bx10so12110248ljb.8 for ; Mon, 03 Apr 2023 06:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680530155; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/5Zx2eZQePqnyU3jO2bDpJxc2Hq5psZfequ5YzrYbHY=; b=RSURZppHyMHfLXYJ6cYrt3X4//roop14nutqpZ39uquOsLcXxvXqdBcpklyZtcDDvQ o0tkT3Vixuiy1rWcQD2Rp2cOlp3rpDjfIcVgFp8RR8N/Mw5X0QkzgXV/QScmcpX9lhMO 7+DD0cC7giFYmGphfYV4r49q2zer4yj9kIfylLe7iDXdyyCQibiph9Ml39aGgdVbSQU+ dR2aZn4re1Nyq/opJCqjCk1mWcE9M/fSt+ajjqm9i0MjGZFJKyD9aA3ixtk/D9oLhcps y2hQO7YzJ0RQnuSI6nWfbbZkHjMMp1VG+knz146+pTABVf0QlN5esfWoIhVNsv+Ik0lB J/zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680530155; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/5Zx2eZQePqnyU3jO2bDpJxc2Hq5psZfequ5YzrYbHY=; b=EIEB+UPQuJeXJ2UUbUqtkZQ3xrFI2nQO0QE4YkhYue2+GpgtPA6Uq1V4UPNI/kIIAT dH3q+4ifxI5pR5PFgJBPejzppu+4eminz6LcTJYP257TkqoaRKZVmJnNcB/wAK2N/uag KAsRjox+txCPqZH9qVy29dDDcde2suNURQuUG7WGQ67KV4So0NYNPKwuOoh3AUdIbFhU TLpFrRhOTrvBSIGRWuoBr6snBzPz5mUCgZ3oj/plBoL0cBuwdVhzYei0nRY5slnD1Pjv l1w88INUwb2hheZFTcsGJZTHxC+CuQUUwkh50wiJoUzXUa7yre0oAGTc4jlDT7zi+R/L vbNA== X-Gm-Message-State: AAQBX9cMsgnQiaURpYzvcVZ0UtmVYyKpAE18cthI4HYKdC3V0mlLpJzj fqy52tegvpmAM8FhVE6Q9f0qd3w/NxNaeuBhUxzsUg== X-Received: by 2002:a2e:7004:0:b0:299:c8c4:c9f1 with SMTP id l4-20020a2e7004000000b00299c8c4c9f1mr10719258ljc.8.1680530154972; Mon, 03 Apr 2023 06:55:54 -0700 (PDT) MIME-Version: 1.0 References: <20230403111020.3136-1-kirill.shutemov@linux.intel.com> <20230403111020.3136-2-kirill.shutemov@linux.intel.com> In-Reply-To: <20230403111020.3136-2-kirill.shutemov@linux.intel.com> From: Dmitry Vyukov Date: Mon, 3 Apr 2023 15:55:43 +0200 Message-ID: Subject: Re: [PATCH 1/2] x86/mm/iommu/sva: Fix error code for LAM enabling failure due to SVA To: "Kirill A. Shutemov" Cc: Dave Hansen , Andy Lutomirski , Peter Zijlstra , x86@kernel.org, Kostya Serebryany , Andrey Ryabinin , Andrey Konovalov , Alexander Potapenko , Taras Madan , "H . J . Lu" , Andi Kleen , Rick Edgecombe , Bharata B Rao , Jacob Pan , Ashok Raj , Linus Torvalds , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 On Mon, 3 Apr 2023 at 13:10, Kirill A. Shutemov wrote: > > 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. > > Signed-off-by: Kirill A. Shutemov > Fixes: 23e5d9ec2bab ("x86/mm/iommu/sva: Make LAM and SVA mutually exclusive") > Reported-by: Dmitry Vyukov Reviewed-by: Dmitry Vyukov > --- > 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 74c7e84a94d8..c7dfd727c9ec 100644 > --- a/arch/x86/kernel/process_64.c > +++ b/arch/x86/kernel/process_64.c > @@ -760,7 +760,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; > -- > 2.39.2 >