From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5963DC001DE for ; Sun, 23 Jul 2023 04:58:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNRA3-0006AE-Rz; Sun, 23 Jul 2023 00:57:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNR9b-00068i-Qf for qemu-devel@nongnu.org; Sun, 23 Jul 2023 00:57:11 -0400 Received: from mga18.intel.com ([134.134.136.126]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNR9Z-0001w5-R8 for qemu-devel@nongnu.org; Sun, 23 Jul 2023 00:57:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690088229; x=1721624229; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=Gb4dpqtPbqE71HOGlII8XtpcKD2dtbfy/LDRwRcT3T0=; b=gsDmS1cQezfpnMs9CxE8w/fx4C/WrH5Dw3IPmYXDKNPxA/9/qrcqmNsN kAIslApcsfYfgmTLo470bUsxTOFkQfZ2STe6MSb1kBt1P2GHI+BM2FDH7 1aOVtc5DclOB0p8MYYhWk7kDi67mEOLrSO+2HzS819Jg9ZEQE+FYJJldk mNe0j/dYcOJ6he2my3H2aUGSw3J7WJerPxoKno38P0gVuVMribf+AW7RG /X91+5kXyLedpYsDcLBGtPUdkLISDy5lL++RMvQFkPSAago/Z3RQVxjrX kPvdAJOYbfQ7arYmAmVQccBVULhK/pwVd6eo5x+Taco7pl3F34T3sK/dA A==; X-IronPort-AV: E=McAfee;i="6600,9927,10779"; a="352142983" X-IronPort-AV: E=Sophos;i="6.01,226,1684825200"; d="scan'208";a="352142983" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2023 21:57:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10779"; a="760407171" X-IronPort-AV: E=Sophos;i="6.01,226,1684825200"; d="scan'208";a="760407171" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga001.jf.intel.com with ESMTP; 22 Jul 2023 21:57:07 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 22 Jul 2023 21:57:06 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Sat, 22 Jul 2023 21:57:06 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.106) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Sat, 22 Jul 2023 21:57:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SZWLYvfU7R0A9co3riIOXXdsmky8LjxWX1tWGGytCQYlPle+lwzXVhDs7dojnNNYA/1JgEz78p9i1YbVxPzHH6ygzo6WCpBBeXpI4hi9/5zlLVP8l3YwK58swk6dPOmE+xzcTE4x3bTWp4nZLsViAMiJK9bgW2a40pGXRIgiy2fGEfGA0bZbgtDA7DSWhGhwFZVkP08/GOsVHWkJmkbBR2yFmHG6MLkdLI+hGSnThAT58zROL4gmKKnfJeOtBOS7D6Zb9JgnsRW8JXsvrnSMln2ueku59aVa/vK9ziLjimGmDdvh2dFJUcjAoMP8gHzTSmWbj3AczVmCC7B09f2xEg== 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=KxrQ8nR4qwKpiXGK6sWPcUibhmJjvBQdd5I9yQLKp3I=; b=coYksCBkOYIRmk9Qt9QpiK6QXitHlEQKzTnTfb9TfGSCEpseaLQxGujOjhs0+tEJ9sgtWSQ9ASe+PdRQXObIGYf4ED7CCS0Gla8xbdvuiVWVbfhT0TvMYrB0MxbAgE1wn6meKu+0KpiPMwCNijNMbsUMxoFDpWMYTmHhAkE1QmgA8kfCDIRDXyCjrUhS+w/+EieDhuf0+1Umo5ZVA23KQlXLH5gsrrDuDzK0qU6oNO6l0XiN76Vl5QWrDBnUdV9yEm+oTwF5N9UdyEG/QP+oA/Wwgs+cMTJS34aaSXU+X2vV7AykudUzNjUAeYQQVb4HYVFm+ctXs1hQ0Vdz/ZQLpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SA1PR11MB6733.namprd11.prod.outlook.com (2603:10b6:806:25c::17) by SA0PR11MB4672.namprd11.prod.outlook.com (2603:10b6:806:96::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Sun, 23 Jul 2023 04:57:04 +0000 Received: from SA1PR11MB6733.namprd11.prod.outlook.com ([fe80::6da5:f747:ba54:6938]) by SA1PR11MB6733.namprd11.prod.outlook.com ([fe80::6da5:f747:ba54:6938%6]) with mapi id 15.20.6609.030; Sun, 23 Jul 2023 04:57:04 +0000 Date: Sat, 22 Jul 2023 21:57:00 -0700 From: Ira Weiny To: , CC: , , , , , , , , , , Fan Ni Subject: Re: [Qemu PATCH 0/9] Enabling DCD emulation support in Qemu Message-ID: <64bcb31c9a8dc_760de2941@iweiny-mobl.notmuch> References: Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SJ0PR13CA0004.namprd13.prod.outlook.com (2603:10b6:a03:2c0::9) To SA1PR11MB6733.namprd11.prod.outlook.com (2603:10b6:806:25c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR11MB6733:EE_|SA0PR11MB4672:EE_ X-MS-Office365-Filtering-Correlation-Id: f75df93a-5634-4d65-a1d1-08db8b39420f X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GU0ldQ+nb7hjwyxLeHhgEQfUjKi6gBYL6Ee+NzYWPTRnHrvaZLYpE8d+oB+Q2IhGOGDtWaOF+BoAsEiyGQBAJEIEOA8WTdloN1eSCEklKVq5aVB1972VKVDKU83qbLPP07dUNa1kL/VmFCVTS0PaSuwxxmtKgrEOB5UhUZbHcqb+2FtXxWq7z/lXqN0PFiYrO7cUsYVOKC74035tcs4uODd6/g/LpWucrpJzKZxWjksYNqR2jkQ8Qh9F3R9uBq4NkH7qTa/2En40yEA0YpbV9mcZkNwm2A15unpj3AYcnfBUUOLCDfPl9/BCN1+pJMGKjqIYzWJnQcY1K0sdiEDHKxeqAvdpa+rtYZ5IljsJ7PVqaKJABrVl1XDGcgWPa4pl4CJ0k+0bLDh0QkQgIKL6cZx6QjDehLcyYsuKgLqxoqtRYRA5FkbzzrZZn0SsV/PRgUeNuAgSnz9fAMFEO3w5GI411ARLBwYtN7X3cqgqtPq1iAGZpG5YCgR5oh4PsDBt+ln26BQcJDwZn2Zc+5eSbey1vIbQsLXSldZll1D/u2U9Etu1RbmDIp+pVI7gZavDXRorcjtUuLySYtyns6SWxQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR11MB6733.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(136003)(39860400002)(366004)(451199021)(38100700002)(83380400001)(8936002)(8676002)(7416002)(44832011)(5660300002)(478600001)(66556008)(66476007)(4326008)(316002)(66946007)(41300700001)(26005)(186003)(6506007)(45080400002)(966005)(6486002)(6512007)(6666004)(9686003)(2906002)(86362001)(82960400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?yXdeNleoULDktR0EttF2pfciTOCN8jUTjV+VhVCh04WJrotzbgysFLPkYGfo?= =?us-ascii?Q?gjG8IVwkdNr8ZRzfOJHa0Vuk/YmlsHzKL26F7qVV1XdxRiLP40Yr3bMQRtzy?= =?us-ascii?Q?Kulc2GtsK+N+nOrcu7CbfFRL/1Lrtv6Dgni53baVlDCVm+kY+CHMZG4de6HF?= =?us-ascii?Q?XJ7qj19zKEo5fxOM5RWSo748cC6U4nY6ms7J0AFmKQnZcZhNiriGIikTK7f0?= =?us-ascii?Q?vwuk7XyMJC46nQM2UG8Xyu27gZWcol3StHYr53QbrK4qYW86prZSgXHE4j8h?= =?us-ascii?Q?PNEnSpiUD3Eo9n74vVXTg/sKxd/4T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ii?Q?u83gMEebVSkEZfsMGrv5VIdnqF72C79xERgB5xULlh7/HS1IxHQxWjmMYUwC?= =?us-ascii?Q?djEFm/RdQbsh/hUbz4K+j/13HmXBd8ACzhtLrJkTXWrFmAuR8bPxmznSILe7?= =?us-ascii?Q?bIHFzAFjcYkYQ+GOgIjg8s+8eyvT2GYIx6SGX8oSkxAgbKtr73Xi8sIOLDjD?= =?us-ascii?Q?3aJuAIqPkCp+nOmCcriB6AztNkpS13xuGUro0rvo6Xtc9RybT17RgqIjTUAT?= =?us-ascii?Q?Q0FPqacsrn16/rg0B+IPCcCKZpfaFuEfGOa+wCmWQiMuBIxZi9Czz4lZkXC5?= =?us-ascii?Q?NlnbRwaAeXVxqZZNuOHTbGrXQGODRXA/2GPzzEo66iNm84WAmSs6gbjq/Jol?= =?us-ascii?Q?nTzqSnknYcYs5z6uVyevohrpmHV1VoK800/F/uZ7?= X-MS-Exchange-CrossTenant-Network-Message-Id: f75df93a-5634-4d65-a1d1-08db8b39420f X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB6733.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2023 04:57:04.3048 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TSMtYMywkq8WZINKpfa4Q1PUFBFFVmxAoXNjMBU0ZVsAet65TlbypEO9npD9+USWnQEAlTShr91/BQe1vSgDeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4672 X-OriginatorOrg: intel.com Received-SPF: pass client-ip=134.134.136.126; envelope-from=ira.weiny@intel.com; helo=mga18.intel.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org nifan@ wrote: > From: Fan Ni > > The patch series provides dynamic capacity device (DCD) emulation in Qemu. > More specifically, it provides the following functionalities: > 1. Extended type3 memory device to support DC regions and extents. > 2. Implemented DCD related mailbox command support in CXL r3.0: 8.2.9.8.9. > 3. ADD QMP interfaces for adding and releasing DC extents to simulate FM > functions for DCD described in cxl r3.0: 7.6.7.6.5 and 7.6.7.6.6. > 4. Add new ct3d properties for DCD devices (host backend, number of dc > regions, etc.) > 5. Add read/write support from/to DC regions of the device. > 6. Add mechanism to validate accessed to DC region address space. > Sorry I see them in this other thread now. https://lore.kernel.org/all/SG2PR06MB3397F3E74A083607F7492FA4B23EA@SG2PR06MB3397.apcprd06.prod.outlook.com/ Thanks, Ira > A more detailed description can be found from the previously posted RFC[1]. > > Compared to the previously posted RFC[1], following changes have been made: > 1. Rebased the code on top of Jonathan's branch > https://gitlab.com/jic23/qemu/-/tree/cxl-2023-05-25. > 2. Extracted the rename of mem_size to a separated patch.(Jonathan) > 3. Reordered the patch series to improve its readability.(Jonathan) > 4. Split the validation of accesses to DC region address space as a separate > patch. > 5. Redesigned the QMP interfaces for adding and releasing DC extents to make > them easier to understand and act like existing QMP interfaces (like the > interface for cxl-inject-uncorrectable-errors). (Jonathan) > 6. Updated dvsec range register setting to support DCD devices without static > capacity. > 7. Fixed other issues mentioned in the comments (Jonathan&Nathan Fontenot). > 8. Fixed the format issues and checked with checkpatch.pl under qemu code dir. > > > The code is tested with the DCD patch series at the kernel side[2]. The test > is similar to those mentioned in the cover letter of [1]. > > > [1]: https://lore.kernel.org/all/20230511175609.2091136-1-fan.ni@samsung.com/ > [2]: https://lore.kernel.org/linux-cxl/649da378c28a3_968bb29420@iweiny-mobl.notmuch/T/#t > > Fan Ni (9): > hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output > payload of identify memory device command > hw/cxl/cxl-mailbox-utils: Add dynamic capacity region representative > and mailbox command support > include/hw/cxl/cxl_device: Rename mem_size as static_mem_size for > type3 memory devices > hw/mem/cxl_type3: Add support to create DC regions to type3 memory > devices > hw/mem/cxl_type3: Add host backend and address space handling for DC > regions > hw/mem/cxl_type3: Add DC extent list representative and get DC extent > list mailbox support > hw/cxl/cxl-mailbox-utils: Add mailbox commands to support add/release > dynamic capacity response > hw/cxl/events: Add qmp interfaces to add/release dynamic capacity > extents > hw/mem/cxl_type3: Add dpa range validation for accesses to dc regions > > hw/cxl/cxl-mailbox-utils.c | 421 +++++++++++++++++++++++++++- > hw/mem/cxl_type3.c | 539 +++++++++++++++++++++++++++++++++--- > hw/mem/cxl_type3_stubs.c | 6 + > include/hw/cxl/cxl_device.h | 49 +++- > include/hw/cxl/cxl_events.h | 16 ++ > qapi/cxl.json | 49 ++++ > 6 files changed, 1034 insertions(+), 46 deletions(-) > > -- > 2.39.2 >