Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp611155rdb; Thu, 22 Feb 2024 13:46:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWkw+cFrUtBAm3NA0OKHg5wNDXnLXZZvjACkfo8yBme7Q1sHgkISkqeOy4YiUOIaFY7TTbpy1DrIDkaRjQJPzxkB3076azrIDxN/KGpYA== X-Google-Smtp-Source: AGHT+IE7yoIFV2Kj2vAemTNSiOiXkWwigP/4cD/M5ZwxrkW6HbTm2utaE+Ey6W/BJd28MPtyLOLq X-Received: by 2002:a05:6a20:b291:b0:1a0:ce00:87ce with SMTP id ei17-20020a056a20b29100b001a0ce0087cemr121057pzb.35.1708638415715; Thu, 22 Feb 2024 13:46:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708638415; cv=pass; d=google.com; s=arc-20160816; b=RenL6jNemk3/GyavBuWt+YWIKtuIXNf8u40sgQhdkwQ01r+8FYI8SeKIaUQ+PjHxxp ivL0XuCs/DclLIjzGGlMn6cJULdXa4Pvhyl5LygAEafqQ6PGyY8YDc2Gspx0wXDCWpJJ uhdEasXUtkW4ccAyL5p2CxSQOnmxN3pXjTF/4bdmCJWi79vf9c+EDkiht4GEyBoSTwAM ZSCIn2rMPNqLHyF7AtcJZtGF7Bb5ESowx4ab5bHQ91wvlu5AAAPEzl2SCIzIz+2Tg2lt uQWwRF0BrB27inGwrpMNpx+TdLKvga1+DAaDwLzpBJYK4m/m8Nv0diWlBVWARj1zC8uy jPiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=YtxCaMm2553SkupuI9XJeFwENX6MIeYRxtADotfCGT4=; fh=jceXL+9B3yMSrTq0oq+G8nNenXTE7Se0OqaoKfZiYJo=; b=Ar0Lf1AS0Dq6BA7dcUqjTMllxY7PUmJ6yxwUWfIBba3Hfot4XF3g9Wg71ktHZ+4PRT HbW9HCmXS2JvHeSO6cREkepCwRCvd+3Q2WDdcdunYQwKicI+OcFEBqjlYSQ5k2P6zoXt QeQ0JyovGq9c+UdD1zzy6Ot+WgGSC3QYnsm7XBWK3LNo3FkESlwIjcEmbooz4kgLKjpP fb2UvJckyXe9vn4HedwE1BY0iYXh7VtO4a/qlhLhHD72GB+Vgx7sdWOmkHLg/T4hwTwt ECfJcsdRryGmbkSNxhLLD5iL27+fduthyfuGzGnlTY/zUYCqwCsR2JpmAEyxDGTIsskz tLZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DchUr+ws; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-77417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77417-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a22-20020a637056000000b005dc4328dc23si6491381pgn.780.2024.02.22.13.46.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:46:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DchUr+ws; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-77417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77417-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 53AF1B20B9F for ; Thu, 22 Feb 2024 21:38:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 422DC13BACD; Thu, 22 Feb 2024 21:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DchUr+ws" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA44813BAC8 for ; Thu, 22 Feb 2024 21:37:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637855; cv=none; b=OoOSD+szXZAKHewRne7G49ri2drVBcV8SLznhl/E/azaqzDHUmKoDj0KB2W1zr+sVo62ExXdlD9Uxyl2SL/wh+U7P6a9RMUreTNgNwPOhhWoeCPWjwDqGtn3MAkSSq7VdyWLLfstXGCfO7ItPsMZu98WA+GVR+8ObBxbexc7F5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708637855; c=relaxed/simple; bh=eTl3BaSXL1EOcleF8Llz7TJCP6iZbj2tst9XjTceF1k=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QjkGYIhLGeO5Xr0jwxAh6T9bo8dJl86839qqE+ZdkcHrWV8qPCFuL0RJ633KCvXjLQd1S2WdO0ugA98AB1IAkS2cVmsWpv/W8PnVJy429GRgtkv9yHt5HkHiHy7EkECSekDO/iBRh0eXafQSKudB2i5ObEIoXqFBVgUtPcl1raY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=DchUr+ws; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708637852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YtxCaMm2553SkupuI9XJeFwENX6MIeYRxtADotfCGT4=; b=DchUr+ws7T1euXx7Dly/bs4sFyxfsm14leurL3SjjYPO0luTyJ2ZvAqlNFdi+1v83AXFrp Gn//u+7sZOCKpnmiTXB/PyItjzveasfgfgowoJvquhSZ6qVhu5uf7ukUo1UNn7y9oRCHdN dSXC/gw0znGImhWHimuzIIEobBVPSDI= Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-83-_Ov9caJoNZGK6h5npaDTjQ-1; Thu, 22 Feb 2024 16:37:30 -0500 X-MC-Unique: _Ov9caJoNZGK6h5npaDTjQ-1 Received: by mail-io1-f69.google.com with SMTP id ca18e2360f4ac-7c7857e6d5dso13523839f.1 for ; Thu, 22 Feb 2024 13:37:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708637849; x=1709242649; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YtxCaMm2553SkupuI9XJeFwENX6MIeYRxtADotfCGT4=; b=rXiKHyxRhPb8J4NpaBvUtF0BifB7ftWWjBiabyWVg4dpsKIW7HNU9PPAyLlo2z///m I80pX1pl32Eh55eqBx/bukLYNmMjbgmYM8uhXt/DiSfzDqM8AR+XQxTqu5UzT1/bBk4L JKTtpCegL2d1Lzy8GOrre3l6rJNmIWjwpmg6QxbjhJh3Uhd0Cas0uGF4k/4mPXxqCcXk /vS+zGr8RUNFVRcTaVLanoO4QLJ+ncsY13Nm94glqxmefpW5boJJ/oCWlQUFj1FkRhFF t9XyyscPTZns1S0RnqEEZZS9j3torlP+C5UAcp4zS7x6bb2u8bipYCbaw9fw9dOwVgBZ D+Xw== X-Forwarded-Encrypted: i=1; AJvYcCWmahnYVzJC20rUMBkwHrPLKfbYiZjCrs6TgJlT37xbY3GOHOL14r7dFad9iqkWJgEIhwCBy/iRul5jVN7ex6vm3OyW4KOoTkp60b9B X-Gm-Message-State: AOJu0Yz6rrXm7VBTE9IAo4UBDL6mwkE+NHPSn0WMM6ZaXxtKUxnGqyao DZfBaPJ6xDfbkTEilxBU1zpzvgCRN24yIXJx06zo+dvH+Vg60rnnfuDi8df6x/nNZIqMSybiUOu JwDgYsR2SWhQ19cdz/0Ub3YyqpUJruaOeDgpIAhRf1pJAL4LnxUHcAv4F0TuO+XkTAi/btA== X-Received: by 2002:a5e:8a09:0:b0:7c7:4e71:7911 with SMTP id d9-20020a5e8a09000000b007c74e717911mr154283iok.18.1708637849417; Thu, 22 Feb 2024 13:37:29 -0800 (PST) X-Received: by 2002:a5e:8a09:0:b0:7c7:4e71:7911 with SMTP id d9-20020a5e8a09000000b007c74e717911mr154269iok.18.1708637849173; Thu, 22 Feb 2024 13:37:29 -0800 (PST) Received: from redhat.com ([38.15.36.11]) by smtp.gmail.com with ESMTPSA id l14-20020a056638220e00b004743021012asm2117827jas.2.2024.02.22.13.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 13:37:27 -0800 (PST) Date: Thu, 22 Feb 2024 14:37:05 -0700 From: Alex Williamson To: "Ricardo B. Marliere" Cc: Kirti Wankhede , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH] vfio: mdev: make mdev_bus_type const Message-ID: <20240222143705.6cede313.alex.williamson@redhat.com> In-Reply-To: <20240208-bus_cleanup-vfio-v1-1-ed5da3019949@marliere.net> References: <20240208-bus_cleanup-vfio-v1-1-ed5da3019949@marliere.net> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 08 Feb 2024 17:02:04 -0300 "Ricardo B. Marliere" wrote: > Now that the driver core can properly handle constant struct bus_type, > move the mdev_bus_type variable to be a constant structure as well, > placing it into read-only memory which can not be modified at runtime. > > Cc: Greg Kroah-Hartman > Suggested-by: Greg Kroah-Hartman > Signed-off-by: Ricardo B. Marliere > --- > drivers/vfio/mdev/mdev_driver.c | 2 +- > drivers/vfio/mdev/mdev_private.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/vfio/mdev/mdev_driver.c b/drivers/vfio/mdev/mdev_driver.c > index 7825d83a55f8..b98322966b3e 100644 > --- a/drivers/vfio/mdev/mdev_driver.c > +++ b/drivers/vfio/mdev/mdev_driver.c > @@ -40,7 +40,7 @@ static int mdev_match(struct device *dev, struct device_driver *drv) > return 0; > } > > -struct bus_type mdev_bus_type = { > +const struct bus_type mdev_bus_type = { > .name = "mdev", > .probe = mdev_probe, > .remove = mdev_remove, > diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev/mdev_private.h > index af457b27f607..63a1316b08b7 100644 > --- a/drivers/vfio/mdev/mdev_private.h > +++ b/drivers/vfio/mdev/mdev_private.h > @@ -13,7 +13,7 @@ > int mdev_bus_register(void); > void mdev_bus_unregister(void); > > -extern struct bus_type mdev_bus_type; > +extern const struct bus_type mdev_bus_type; > extern const struct attribute_group *mdev_device_groups[]; > > #define to_mdev_type_attr(_attr) \ > > --- > base-commit: 78f70c02bdbccb5e9b0b0c728185d4aeb7044ace > change-id: 20240208-bus_cleanup-vfio-75a6180b5efe > > Best regards, Applied to vfio next branch for v6.9. Thanks, Alex