Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2943657pxp; Tue, 22 Mar 2022 08:58:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSwkrss7gIiVi/2XC5GD/Qd4mLVb0ylOndmCj/RRZV5TLK/VZFRA1PygJbpPLlNqR59FNg X-Received: by 2002:a17:907:8688:b0:6d2:c19:e1a0 with SMTP id qa8-20020a170907868800b006d20c19e1a0mr25410173ejc.249.1647964691693; Tue, 22 Mar 2022 08:58:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1647964691; cv=pass; d=google.com; s=arc-20160816; b=ck1/hvNbv/PME8mdz10dDgprHmfTH4FvytBg7TdxO4vjslONfdP5tAwjoRkEmZqmGc JrKMBrje2j2PsyT+jYp4cxcYa/C9+bX4ad5GR02I+FzZSsd9TB01MINbCoh6fSoKYapS wkZ61tVM5fRGyIHV1IhGQVUHHYakcwCcj4IoiMG6O76INoj0/wbYA5EHvqlU6gAkD+f3 51vS3gXSlPvBOw4IMGfASyBSowowKtVilvuBIsMBFJGHpfM+0KwCwza87EbnSIPLlqSp h05E47fi4kOgrdL2rElZtjtARPk2j2Q1DiRzmtk5khJOj8+eQdH2aU6OincbA7feqEwq 5bEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P/sICpqMA2qREnwegtdbMpQ4pqTJRjQiPrcVvjVTI5Q=; b=IHMcXSzvlJ8BzxhP++WNVRIm46sqYkyM4MuFp8tl/V2pbFPmDmOmGt5LcR2BYbcwSb HEsmV6u1kSI42DOR2KuDP4Y7jsyyRYlp3YqOqeqpJXghPYeyC64UaxhDCOGkmC4Mdq8b ugGH8LUp3LtkRZvgzbroxMVMJgDrFsN7fGddlBMUbQdHbt5dhLchIUvc23QuNPgz04bH hRYpYPtc8lpRwW7sZWEMbuUJ37HR11Im2BCkRIImbjMKBG1nKIpfMOaE1KKfwGo65dp7 ODO0m6mCrzJ77rtTds/RnA81fE7pMzGuQLcODLUQoBHMAMcnjFPlVo0vrASAbWELl2Eg I5RA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="bQ8VocR/"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ky19-20020a170907779300b006df76385c38si9535041ejc.216.2022.03.22.08.57.45; Tue, 22 Mar 2022 08:58:11 -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=@Nvidia.com header.s=selector2 header.b="bQ8VocR/"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234693AbiCVMQ6 (ORCPT + 99 others); Tue, 22 Mar 2022 08:16:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234745AbiCVMQz (ORCPT ); Tue, 22 Mar 2022 08:16:55 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2068.outbound.protection.outlook.com [40.107.237.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A53EF75212 for ; Tue, 22 Mar 2022 05:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G3UXT5aW3jITjUtJrwEktGdfKeh8Udy9mF4yaMacGU0vj/TsGanjyf7Q3MfJ/U+X/TETwSBhovI41o8I+B/31DBQhssf4yfWptN6EPRMhhn19JbxdY7s+t4Bz6HdYiQpNKtauBWPs9AmCkuOSYmP46Lnkx2/4DfHBcYSqNs/u9TTZ8kyk/Zom4XULwwJB0rSOHFeZxH2VBHUSePfWcmrlf14SEihSgRUv5Duh6AyKw/Ufs0/LBPRLHvHj3gR9q+X7lF+x1/dYpWu5paQcLsqVtlpRwKs6SaHdwsMFY7isxwUro+0vh7pfGmjUMWv2maJorQ9eqXOYTiE1bwaJWpj5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=P/sICpqMA2qREnwegtdbMpQ4pqTJRjQiPrcVvjVTI5Q=; b=a36efj8E7vgXeDgDcONVycTUOgXS+u9UhPPW1YtNYETxGSLMFg2vx55R3sj8ZeH4ypRkoYVE2rVO8Rcdl/N0h6eQnJgOto7YNEIqIrjM07uaPofA3ukv4RWIkvC6SCIsjoeWycqHJjU0THnRO9cQFgElRkB+72HyMheF52FLd8F+Y7PSPo744ROzN86GjGtl9KJEi1f0VNlkSew3eStfhZAxG5irhJ3qek82OeYnocgd0WKbU/M1iYyWpIWzPgl0scjhXjF9KB8kkprXruPLwmoaXOKKzreEZyEVMUBLlzlyHEL5ADVQAF2mv2nCs2JJtNU0GSdQYocMDdx4lvLRTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P/sICpqMA2qREnwegtdbMpQ4pqTJRjQiPrcVvjVTI5Q=; b=bQ8VocR/9wanL7MPrrFwSy8SBDTfmzjjrdTC8DiMmDtCzVPzYkPC5rRNQv/wU18gCNhkCNDHd1l68iJt81+ZIp5iCfFcgBmkD1m38ewXUEkkUZrby7n9VIJTyHHJ38+QUFB2PlW74/EZ1RAJbK5v8vUyzBSJ7+n5Vfw1bwSbb9idFHJhOZFquQ6OiDWJx0aVi3gPeYxz83f5eqKXYhk2Jirx5i/m92zQMRU05OzBvmVG+qO8uW46WH9Px3y1py6jcHeqMytpvdxcJb3Kx9dcWusF5B9g+3qMT3bwUEvW5p0OmYm/SMRy7DNOIgVmxeGGGCNJOVQF1PrE5P9DKQkijw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) by MW2PR12MB2393.namprd12.prod.outlook.com (2603:10b6:907:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Tue, 22 Mar 2022 12:15:21 +0000 Received: from MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::11a0:970a:4c24:c70c]) by MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::11a0:970a:4c24:c70c%5]) with mapi id 15.20.5081.023; Tue, 22 Mar 2022 12:15:21 +0000 Date: Tue, 22 Mar 2022 09:15:20 -0300 From: Jason Gunthorpe To: Lu Baolu Cc: Jean-Philippe Brucker , "Tian, Kevin" , Joerg Roedel , Christoph Hellwig , "Raj, Ashok" , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Eric Auger , "Liu, Yi L" , "Pan, Jacob jun" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH RFC 10/11] iommu: Make IOPF handling framework generic Message-ID: <20220322121520.GB11336@nvidia.com> References: <20220320064030.2936936-1-baolu.lu@linux.intel.com> <20220320064030.2936936-11-baolu.lu@linux.intel.com> <20220321124346.GP11336@nvidia.com> <64fa931b-ea2d-f425-5baa-654216bac779@linux.intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64fa931b-ea2d-f425-5baa-654216bac779@linux.intel.com> X-ClientProxiedBy: MN2PR20CA0029.namprd20.prod.outlook.com (2603:10b6:208:e8::42) To MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a770cedc-b401-4519-f5bb-08da0bfda2eb X-MS-TrafficTypeDiagnostic: MW2PR12MB2393:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kz3wPfPVZjrwnbovWe1vPE1Hvd6oTgmJ+SX3dFQQygP1OUVsuOAsB1fv80uNpbrLRAXea9RDHC7qAtGo2768ecGnOTgU9m9Wlzi415Kw81Fnk/0YLyNwHbTI0D2kjk1Y8mGSDEjy9sdr5BFW2IQY+9VwWTBxvQqOUYFrUazP31GFihOvB8Pa4f/TjHF7e4NEEHikRqnYQPdV02CJ7v492M/IcH7oMkkJTrn5X80HjImyggsipPAFRioi24uGRKg+BgLpZ7ppUP/raqvcC7nAQC+Vhh47a3ShJ6RV0AUaxFKhpN7i7eYof1cAFLMfa4R0Vy/8T642ocTtxYiDBbLrH/+fBqwOrDsG/WQKZcBzk/E/bNjL6tZ0dT4/OvMSR6Z9gBCSkKQbm2Q7xfGRuVPcy/Cu+CgV5XPHNNtm1DkuArBARcQGtGPH5a2GHMKpznYMyRCZMToOHuVACJW/P+CRHoWsAM53Yj+OklPhfegUkhAUjcgnpmBXI+UWxYiB0Gpy3wNWjw7sp4ib2X0OxyZrrmdmbm0anHRiksF4SLlmOTxVLWFw3F5vy/YEwCKfXu9YT4txM/9LzCWy+3Vb59arShJI4zmfgsA4LTlV04gTHohiqDhr52LW6flhJFrJX9zM+v6zReQIl5XIpJQtT3WsTkxwrIf3CFzHYJfFhWvMeb6WuYGqHhz1k7Id+C/lpwjh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4192.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6486002)(6512007)(8936002)(66556008)(66476007)(508600001)(86362001)(4326008)(6506007)(8676002)(66946007)(33656002)(53546011)(38100700002)(36756003)(186003)(2616005)(6916009)(1076003)(26005)(83380400001)(54906003)(316002)(5660300002)(2906002)(7416002)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?OyvP5SaPyxBapWwc4lw1TY63szSLIsQD3zMWeeP62KsS8sXPM9CytXvv/ecL?= =?us-ascii?Q?el1phWXk7i+aRnVGmc627SMVdN+7G8H8HFoJNIOUd1+BNJfwX0EuxL4IgVVn?= =?us-ascii?Q?d5TdA+SezjiNDgzVfvllDRcFnHFv4X/3b9A7F/s+0Z4OTiIojBswPMHsk9fi?= =?us-ascii?Q?aJRAcQEUSbmULiayyZUQ7ARUlPjJZ1ik402jL1ZB+VOzFYIKTncHWiTBTiyu?= =?us-ascii?Q?aXYyNpmGqSQ+NTSuEqMAKAGBIebdsZ9jYVw1rGTZXq39jQmg4Dyc9LgffhDk?= =?us-ascii?Q?J8+k/FYRPvsH9NF+Mr2ZCEnq38M5ocoCjU2+DQGBL6Lx+p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CLybB4b8pJemieRsVjHIaRO/r+mtNQ6JDLsUz5nZW?= =?us-ascii?Q?Fs4+QN1Xq4MtM/61awpJAzGSUKQM6bkzKautT9vxA9fKkuWstpao90o5sYpc?= =?us-ascii?Q?SpUkFpwpWvMChNhtx3P3lKKqwiFTSHenaSA2+fILDBiUBdP9hpMHnLJWGoyF?= =?us-ascii?Q?EOvy3SN2OkHL6mvaOcUQOADcmPbfsj0Da5gv+Z/yCHZse5tAfZS0dIAbIELM?= =?us-ascii?Q?SB/t/QAZvD8V2LMdFbzVhDaGSj9eX6AP?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a770cedc-b401-4519-f5bb-08da0bfda2eb X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4192.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2022 12:15:21.5600 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NogS9V4zAEikSB6J9W+PPVI1dsv79NlJiKd0OX3g+98Vp3N/fLk+NY8jloP8otmV X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2393 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, Mar 22, 2022 at 01:03:14PM +0800, Lu Baolu wrote: > On 2022/3/21 20:43, Jason Gunthorpe wrote: > > On Mon, Mar 21, 2022 at 11:42:16AM +0000, Jean-Philippe Brucker wrote: > > > > > I tend to disagree with that last part. The fault is caused by a specific > > > device accessing shared page tables. We should keep that device > > > information throughout the fault handling, so that we can report it to the > > > driver when things go wrong. > > SVA faults should never be reported to drivers?? > > > > When things go wrong, the corresponding response code will be responded > to the device through iommu_page_response(). The hardware should then > report the failure to the device driver and the device driver will > handle it in the device-specific way. There's no need to propagate the > I/O page faults to the device driver in any case. Do I understand it > right? Something like that, I would expect fault failure to be similar to accessing somethiing that is not in the iommu map. An Error TLP like thing toward the device and whatever normal device-specific error propagation happens. SVA shouldn't require any special support in the using driver beyond turing on PRI/ATS Jason