Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp305575rdg; Thu, 12 Oct 2023 06:21:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGH1X8RY6oYUDlyNuYEZqw+JHvEg3KJi9JRcfpJNAjb8kUv2GASEMBVqdYQdG5D4y+nJKvP X-Received: by 2002:a05:6870:f703:b0:1d5:5d57:bde5 with SMTP id ej3-20020a056870f70300b001d55d57bde5mr26739326oab.56.1697116873871; Thu, 12 Oct 2023 06:21:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697116873; cv=pass; d=google.com; s=arc-20160816; b=ZJJt6PKKlZw3CAsITZw48Vy4MBffBSwqm5lGAE3/FFfzPFKAHHh46HGmB+DEkwlK6y q6/W4H4FGsJ1Omz/jLuJ96s+ys6IRrRJTOQy1/sZJZCDGhat6BqzKKQB+Y1KeigOJWCu EvaILRC8uWsCO0assbwjIuLnqR+ld7Bo+GcrX3oKLUTotWfm5bGhc/PytmArtmjN0CAI dvmFXHhpmnGeP/j4mU2miMHa5KNzx7/3KW30UJJg9bRUDe8Z674xoYbIy8JP3Yy2shjB sQR104XVjJtr5W7XNJZnLUJhQpQ/bjlf3rZOZBkkf1BACLM77msL+FFgNC5EDlPzj4DA wQiw== 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=SJJZKw4QXyxsVV++w8/o0cUom9IRcKIploB9B9mG+ps=; fh=pqgFSOu9q6BuUS6Neou6aRfdBT9yaHU/flRIEEUl+rY=; b=hh+UHqisLZ7nOox4x8HcJbHFPD7OPSztqBQAAZAlzFCSK59TyazFGB6YHpdNwRq2Cu ySZ61V1osfyG5brivwixg+gTeDfsyBDKWJ/K+CJ63nhO+Eng7Is9InSldacyiV2PpJEL Jh4ARng2+e+O9BQma85J2Fj+/cNqWn7eZYffCgAdO4n89c9G6EUOvyH+etnipMcB0dgK 1aXNRLNIT3PU3TgESq94KF3abKbJFD/wZ0gDzYVISoLnMb7MVMbDii8xR79gd/K14zaR nA/FFPHeehq/oLtr1GoSGubXJwzaxpx/sj+Qx1p2+HjPZP8P/aY6SUdbkfs96xVerXU9 0oUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=aTBzIoVe; 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 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x3-20020a056a00188300b0068fb8fa1e71si15430849pfh.207.2023.10.12.06.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 06:21:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=aTBzIoVe; 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 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 290128253FF4; Thu, 12 Oct 2023 06:21:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343765AbjJLNUz (ORCPT + 99 others); Thu, 12 Oct 2023 09:20:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233757AbjJLNUx (ORCPT ); Thu, 12 Oct 2023 09:20:53 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2069.outbound.protection.outlook.com [40.107.92.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94D71B8 for ; Thu, 12 Oct 2023 06:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N3FbMY3bf+fbyiuWjIFsZRM4hZh6LymOIA6N1Wkw1wZYf0jM0Wb+NKq5mle2cri5xh9lmyM4fu7p9Z+RB+JMLJllwyuFwt8eWT8e2jUrbhcpdJbyQDu6YNTM+k7V10EWUvWor2DLxe8830Zu5Xya66R42S6uXeVzlrgXnAQ6jqz/Xt3n1X0MVXAfKbGUscpaZFDiZfM74v03yEOwWmwRga5O/YLYAPMMXEPBjPE4z7z8jTfR0GRiiC1HzRXdeJsMCcOxvN8pOx6yi0GSA78nlwcsfqDMUu6ohaF0Y934J6Aeq61DRrO90EQEscscEY0PbCRP02tfJONbPubT+8fOlQ== 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=SJJZKw4QXyxsVV++w8/o0cUom9IRcKIploB9B9mG+ps=; b=M6qdYyGIViyR3qWsyU/xNWlBDuChXSdV3rUOfld7QuRwRyxJOXJNtNtauHbLxkVhrGp4sQnjIu6l5lAPCeZpnJ0PBdc7hsKPLg0AZDfbFNjdKoX6HXwVcpp1a69xTLdht33m3hZ780pza47DSeCOhjQkLgAo6sKjztUiRO8Lnz9Cq4iVWOs7WgAhZIREXIJa5vodnf/pBNkKUjgmZCafF2eqgG1q50yt3Gw2j295xkZxB/Fy8YjSyO1rmkVjiJVkwEHv8QJAA92Uhs8BOpQwzD7QsbPEiqKnjX6weW4W/sbYlGz+6QnzCHX3T+XSuOKiJp+ose35RdBcQjuhLPgNyA== 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=SJJZKw4QXyxsVV++w8/o0cUom9IRcKIploB9B9mG+ps=; b=aTBzIoVetvW21P3i0Yj4yb9DKVATzUKUT/KoW+98umI57wgENP5wEstkFDEyryjcK8qXzphatdoazJOV2ItZN/SkOWlU+pi/h8NZeMBI4sagruewq8jcjjg1gEBqq/3XTY+b7mclLttRrTckdMFWOoR3bUXoJq4DTT1WU/PJm314Ed5k9gAwSMkjNLpsf0zGc5AqFrfHI02B0W1BA9I7QuzbvrSvP4tgNXJV8KsSR6YdAOmBFVnEK7Q0ffgQ8KCGsdOgQB4USS69CyvtR1u8WMVA8WsJkkIjscNA3qtrSqaLAZ5Rve3DTc2ptMqhIKfOVGLWxas5f7p2tnOXycRSuA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by PH7PR12MB6395.namprd12.prod.outlook.com (2603:10b6:510:1fd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 13:20:46 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3f66:c2b6:59eb:78c2%6]) with mapi id 15.20.6863.032; Thu, 12 Oct 2023 13:20:46 +0000 Date: Thu, 12 Oct 2023 10:20:45 -0300 From: Jason Gunthorpe To: Will Deacon Cc: Lorenzo Pieralisi , Catalin Marinas , ankita@nvidia.com, maz@kernel.org, oliver.upton@linux.dev, aniketa@nvidia.com, cjia@nvidia.com, kwankhede@nvidia.com, targupta@nvidia.com, vsethi@nvidia.com, acurrid@nvidia.com, apopple@nvidia.com, jhubbard@nvidia.com, danw@nvidia.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 2/2] KVM: arm64: allow the VM to select DEVICE_* and NORMAL_NC for IO memory Message-ID: <20231012132045.GI3952@nvidia.com> References: <20230907181459.18145-1-ankita@nvidia.com> <20230907181459.18145-3-ankita@nvidia.com> <20231012123541.GB11824@willie-the-truck> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231012123541.GB11824@willie-the-truck> X-ClientProxiedBy: MN2PR22CA0014.namprd22.prod.outlook.com (2603:10b6:208:238::19) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|PH7PR12MB6395:EE_ X-MS-Office365-Filtering-Correlation-Id: 6cfd1de2-4754-406f-0437-08dbcb260b5c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r+iChhI+V4DWAie3sH43wUZHC+/67UDW94hOu3saZetfnY489OBi4NCFi9p3w+g16Xpme5R5e7lkcD6IWfFOCsr6i3gV/f+kMIzNre+4E0NYm8I2q+SQjjuR9bv6AM+Tqfji9gayXuvAkfz7f8y6JemgCFWKGhY5f2sUdaPESEBuFqm7MffCawXOdExjlCR03kNpeqskNJRMXHBVGymLag33qpFdHqvz6raq6lI/EUFCAESgzOA+yoENqurgA6YLOMCLBXHlBagjdxGP+SGOJMcmAynCq1PkkrRuetLjcBPCAdLcEL3xO8/P99a+TTwKbW1VMmaTCNCGBtBH9rOZ1LvaxN5VmYak4JUtdSKVYDnvdZ4IbXeFD9A1qxFDZ8Cu4Cq+JFiKOS2jLitXApNIrQol7a0uBDdeSvtPWBLzyHzrJt2Y5YvUXLDYQXc6RPp78daKHm8p6LVcUVZhgX0D6VvadVHO2e78ONpPdSC9g/DfC3x73sZO3R5f3+ondGPd6g5n+l/LdxOeHCoVjbO593CY4lbVLiUQsnvoEJukLIRlrMmVWqAqmXVA5tS3sp2A X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(39860400002)(376002)(396003)(366004)(230922051799003)(1800799009)(186009)(451199024)(64100799003)(1076003)(2616005)(6512007)(36756003)(33656002)(86362001)(38100700002)(26005)(2906002)(83380400001)(6486002)(6506007)(478600001)(8936002)(8676002)(4326008)(6916009)(316002)(41300700001)(66556008)(66946007)(54906003)(66476007)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QEmzUlXwxliFfPfi+RTaaI6R6FEWrTZhryi0cIQdoNjxeBb/rXVgXiyjX849?= =?us-ascii?Q?15HgrTJOPJxjeVTYqE+A9r20v5hCJf3Y/cHL9fjfycQ2NeBqJsjI+l6dLmGX?= =?us-ascii?Q?slJOx3jwjAceoDUAk4C/4u1aMkLSX+WSjifdf12rURGC0+8JA1g9A4YwJSQM?= =?us-ascii?Q?Ilr/RS/WqvaV02AqYM5MqlgG79XkMS9Ft5phgb3ioe/eht9TzJxjmyy0kdK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WK2YB9njgFqsGMB3LeoWK+aIiwZACuQGbIUz?= =?us-ascii?Q?1MoPn9lo2A5d0RaWcQupiBNW51GWmGbEZZ4UwGzqRJ51+vRWTUsmT5b9cn3X?= =?us-ascii?Q?adfq1YpQroh22jTRBohB2bl4/9yBIo8Rd2pI3pHu4V8pn1XRgqjp+SdRBnAQ?= =?us-ascii?Q?TMWPo1BmH90usgRgpq2vpohDZYLUnrpUOgS6sWAlm1qNNAtMdBjuBuTesg8I?= =?us-ascii?Q?mL/6NZKXlyElEVB1V3KCFHY5lQiDaFjfoM8kp70Wa6wPIQfYC8TBQ4BRK97x?= =?us-ascii?Q?VUqcOPiyHZ6ZIIyJMKN7XUlyhewD31450R55RMBN1Nb2Y181NNOpw5n3PEXI?= =?us-ascii?Q?uFPiP2uO6v9t0kBaxCVmIiBoyut9Ma+U5mHO0tERq2mz1+uMY72Y1/SOOR8b?= =?us-ascii?Q?h6MZJAsBuftkDS5VHj9ahRwCzTP/Vg9NSkOsuYVpw+y1qAGiVtvOBuhPo7UK?= =?us-ascii?Q?nM+VOE5GifE+qcjyk0AUBdj+0lkmwuexX1ZC0ks8?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6cfd1de2-4754-406f-0437-08dbcb260b5c X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 13:20:46.4146 (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: gxHZva/Xtq4yRA3ltfafgX1EUWNHtGlGOlvL2K0jNhkbn4+tW7SumhkJDwGpgdvl X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6395 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 12 Oct 2023 06:21:10 -0700 (PDT) On Thu, Oct 12, 2023 at 01:35:41PM +0100, Will Deacon wrote: > > Failures containability is a property of the platform > > and is independent from the memory type used for MMIO > > device memory mappings (ie DEVICE_nGnRE memory type is > > even more problematic than NormalNC in terms of containability > > since eg aborts triggered on loads cannot be made synchronous, > > which make them harder to contain); this means that, > > regardless of the combined stage1+stage2 mappings a > > platform is safe if and only if device transactions cannot trigger > > uncontained failures; reworded, the default KVM device > > stage 2 memory attributes play no role in making device > > assignment safer for a given platform and therefore can > > be relaxed. > > > > For all these reasons, relax the KVM stage 2 device > > memory attributes from DEVICE_nGnRE to NormalNC. > > The reasoning above suggests to me that this should probably just be > Normal cacheable, as that is what actually allows the guest to control > the attributes. So what is the rationale behind stopping at Normal-NC? I agree it would be very nice if the all the memory in the guest could just be cachable and the guest could select everything. However, I think Lorenzo over stated the argument. The off-list discussion was focused on NormalNC for MMIO only. Nobody raised the idea that cachable was safe from uncontained errors for MMIO. I'm looking through the conversations and I wouldn't jump to concluding that "cachable MMIO" is safe from uncontained failures. Catalin has already raised a number of conerns in the other patch about making actual "designed to be cachable memory" into KVM cachable. Regards, Jason