Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1214593pxu; Thu, 17 Dec 2020 05:08:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzITD0MjhqRAAqdkiJzjtIfl9kx7K7pyb+ejci7unIqM1dCgaZn0oN6GAc+ENTLAqRZPD6U X-Received: by 2002:a17:906:7fca:: with SMTP id r10mr35449431ejs.24.1608210490292; Thu, 17 Dec 2020 05:08:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608210490; cv=none; d=google.com; s=arc-20160816; b=yEniTqD/VlaR1CvWs+vf3A/nSL9UtSr/G6THDZV/xQpcv8VXqWQ9M2bfwYFg9j7rao nKgSmd8s+R/JieRo/5kjmM9JLr779DsdzOOC6XAnLs5Ha/H0U5vsOp3cj2Ntq7sWUvJy fzHncdBreAinIpMoQPLefGHIVHLCzp8VnpVmlkEjPIyj3moTe5C454qIWhCQccv6bIV0 LlRnuYEzlc1Tjp6lms8X14RdyszObcCCSKURzNZx+2FtQ19XSrpJ51arVppY4043KXgD ZWasWAAroUhAirzb8B7xm3y/Oo3y5sx+GG0UKdyaz6CdjJyK8X5H1/dJDPfsGY/G0Vqs pSMg== 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=uZGMd6GnIXxRytXL5PNWtDItQ2kBxHZ1DXyfaFYsHpU=; b=AivBr4tRQun949D5evfn7BC0aKMKyhSghpPf1s8KTcR3XO+m+xL5pwUzPN2AqdOrom GODjb8bVitc18h8iWUlTzEz4zxB1ePRotURaP9EEfujwEhIhLeMrGUJZp8C4HejvXUeu kMRRsa5Y4I3p4juzqq/CGQztdkhL0yMNVO8zZ/xdw6i48rhN5BrXv4D4RrH8/leoeMFu Fb2liFcRQe6A0MBrrJdPg3RE7IzPFxqQcuf90Zfp44iF6JAuEss3I1z1YqwvGPVkyl9r 83jhFn47aCUmvJkAh83+zZtfN57XJxy6u6mx4t/dgyFp2XHxGCxCPAsJ0QA05t0/67O6 ANcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b="A/QXQnCb"; 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 w6si4278442edj.604.2020.12.17.05.07.47; Thu, 17 Dec 2020 05:08:10 -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="A/QXQnCb"; 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 S1727794AbgLQNGS (ORCPT + 99 others); Thu, 17 Dec 2020 08:06:18 -0500 Received: from smtp-fw-9103.amazon.com ([207.171.188.200]:38496 "EHLO smtp-fw-9103.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726773AbgLQNGR (ORCPT ); Thu, 17 Dec 2020 08:06:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1608210377; x=1639746377; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=uZGMd6GnIXxRytXL5PNWtDItQ2kBxHZ1DXyfaFYsHpU=; b=A/QXQnCbgvUW5YuQ93POzENbJfaty96yG789+Z/Z3t0ThY7nU5+KTQEc 65v4f/u0L9hwXH8lgrFVXRZFcdQOkvXpQabxg7ppYelpkHE+AVIVVQBVg id4OkvRLDZSK7wiSio7TsUNFWBv4LXY8RspWjsq8fGw71WxL8qq25L6g9 0=; X-IronPort-AV: E=Sophos;i="5.78,428,1599523200"; d="scan'208";a="903914677" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-a70de69e.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9103.sea19.amazon.com with ESMTP; 17 Dec 2020 13:05:36 +0000 Received: from EX13D31EUA004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan2.iad.amazon.com [10.40.163.34]) by email-inbound-relay-1e-a70de69e.us-east-1.amazon.com (Postfix) with ESMTPS id 61C68A2014; Thu, 17 Dec 2020 13:05:35 +0000 (UTC) Received: from u3f2cd687b01c55.ant.amazon.com (10.43.160.66) by EX13D31EUA004.ant.amazon.com (10.43.165.161) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 17 Dec 2020 13:05:30 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , Subject: [PATCH v2 3/5] xen/xenbus/xen_bus_type: Support will_handle watch callback Date: Thu, 17 Dec 2020 14:04:59 +0100 Message-ID: <20201217130501.12702-4-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201217130501.12702-1-sjpark@amazon.com> References: <20201217130501.12702-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.66] X-ClientProxiedBy: EX13D39UWA002.ant.amazon.com (10.43.160.20) 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 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