Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1046483pxu; Thu, 17 Dec 2020 00:20:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyselppiuYbtSgcIkP7UYES+yfhLkI1SfStODR/briTBMyxS6Q+WAJxyfn8cjbzd+kYjbcO X-Received: by 2002:a50:f1c7:: with SMTP id y7mr21857490edl.184.1608193215922; Thu, 17 Dec 2020 00:20:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608193215; cv=none; d=google.com; s=arc-20160816; b=GGk6wt5SBR+3W76lv1Ako59ZJQVAQK45UzTRVkUHM+iPeDSawJrsMkPQlFS34Pmhad 3RZrPnl2WN9YAZ6qE7/7Y+OpeA/RNuldmtz+gWUIkgGlQ4NntCMOhEIGRhPCXWwZDQJz w7XxP084Qk4BqZtQ6EtiQJ7PiFWib1vLnS9RNNPzEU5VCz+BQwL5kU8tTSgciRT0GxG8 La2+XuRL1ircViRh3mdHASvZ5z8QSnzP9bGgGeKZ2Q5dMlDkD46sSg3M0Zwq7qNOOEOs kBXV1r4JWlE8QahfDjgGL8f3w/VM+JTETq5n9nh788kb3BlJu2iV5uoGb3wqSaoXgjV8 0VQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=DoAP4nxNHrpmrhNE8HfHGjd+2WyKdw2CcSZGZ+R3/9E=; b=layaCZxMl+gaANW8VgE3WIEZcs8lsltUVtQ9IVjhzuZ1WYNtmP9x819NuAwCn2UWYK FLuXn4nM234qwVoiyZOHy1bhbB6AMlyESeNM1ljuYGuW/oh426pb6hLmd5bZP4nCxwWX vk7fftXTm03tjA68RISA4GvY4tRm+X9e4z/MOtv228prnAUEoQCt3Llt2bmvctfNuKTM oIVLcTQ9Lotr4PjEhKk7W7qDBH+JMNuzwPhWSLxcXNut+e72hIasJNG/Kw8HCHMdiMut 7GGJBiyavV3AklgQswwh7XVKH91EiinjBEQZlde4pGgQM5hTQwz6IGTvOpbwrdrZ5TrG Fidw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="fXYmHSb/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si2202282ejb.547.2020.12.17.00.19.53; Thu, 17 Dec 2020 00:20:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="fXYmHSb/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727461AbgLQITD (ORCPT + 99 others); Thu, 17 Dec 2020 03:19:03 -0500 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:27582 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbgLQITD (ORCPT ); Thu, 17 Dec 2020 03:19:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1608193143; x=1639729143; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=DoAP4nxNHrpmrhNE8HfHGjd+2WyKdw2CcSZGZ+R3/9E=; b=fXYmHSb/tOeG1aBaVeq+jWwt0vNK3/+rnCVow+JIczOhOD01tDu+Q4kn tdXMUGlJCOXBGYOth7kv9XiMRvGhSYJdQaByxBO10AB1gxB0eO59jXPAX l/n7KYukG5g+ZoepmvP/DxVSbTY3WkdiOAw5XQXkZJo/hf4/bIDY1UrgA M=; X-IronPort-AV: E=Sophos;i="5.78,426,1599523200"; d="scan'208";a="73261961" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1a-715bee71.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 17 Dec 2020 08:18:15 +0000 Received: from EX13D31EUA004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-1a-715bee71.us-east-1.amazon.com (Postfix) with ESMTPS id 973EFA07AE; Thu, 17 Dec 2020 08:18:14 +0000 (UTC) Received: from u3f2cd687b01c55.ant.amazon.com (10.43.162.144) by EX13D31EUA004.ant.amazon.com (10.43.165.161) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 17 Dec 2020 08:18:09 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , Author Redacted Subject: [PATCH 3/5] xen/xenbus/xen_bus_type: Support will_handle watch callback Date: Thu, 17 Dec 2020 09:17:25 +0100 Message-ID: <20201217081727.8253-4-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201217081727.8253-1-sjpark@amazon.com> References: <20201217081727.8253-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.144] X-ClientProxiedBy: EX13D30UWC002.ant.amazon.com (10.43.162.235) To EX13D31EUA004.ant.amazon.com (10.43.165.161) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park This commit adds support of the 'will_handle' watch callback for 'xen_bus_type' users. This is part of XSA-349 This is upstream commit be987200fbaceaef340872841d4f7af2c5ee8dc3 Cc: stable@vger.kernel.org Signed-off-by: SeongJae Park Reported-by: Michael Kurth Reported-by: Pawel Wieczorkiewicz Signed-off-by: Author Redacted Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross --- drivers/xen/xenbus/xenbus_probe.c | 3 ++- drivers/xen/xenbus/xenbus_probe.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index c560c1b8489a..ba7590d75985 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c @@ -137,7 +137,8 @@ static int watch_otherend(struct xenbus_device *dev) container_of(dev->dev.bus, struct xen_bus_type, bus); return xenbus_watch_pathfmt(dev, &dev->otherend_watch, - NULL, bus->otherend_changed, + bus->otherend_will_handle, + bus->otherend_changed, "%s/%s", dev->otherend, "state"); } diff --git a/drivers/xen/xenbus/xenbus_probe.h b/drivers/xen/xenbus/xenbus_probe.h index c9ec7ca1f7ab..2c394c6ba605 100644 --- a/drivers/xen/xenbus/xenbus_probe.h +++ b/drivers/xen/xenbus/xenbus_probe.h @@ -42,6 +42,8 @@ struct xen_bus_type { int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE], const char *nodename); int (*probe)(struct xen_bus_type *bus, const char *type, const char *dir); + bool (*otherend_will_handle)(struct xenbus_watch *watch, + const char **vec, unsigned int len); void (*otherend_changed)(struct xenbus_watch *watch, const char **vec, unsigned int len); struct bus_type bus; -- 2.17.1