Received: by 10.192.165.156 with SMTP id m28csp535189imm; Mon, 16 Apr 2018 04:48:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/yTnzaYcNxIF1YSiQE9Hoz5StW8U4MZuhizbX7bJqOWttyBB42pFalJyTf5O8ru2kIbkGu X-Received: by 10.98.149.78 with SMTP id p75mr21263305pfd.188.1523879280598; Mon, 16 Apr 2018 04:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523879280; cv=none; d=google.com; s=arc-20160816; b=Khcd0G56cuFsRuRL9OtiPL0CF7mmbbWdSFHv4+G92ioS+16ghyl3wBZRK2VYVjo2mx rrDaYxhxYFPq4hc4i02It0hd9d5hY8gl7W7/nsZ24LuzkHUz/ZtbHFmjtgHHv3XUFu1S 23mFeY9IwuRYc68gFUdSNbMlKC/ds5J9BfHpf3py5R4Gty6T3z2icWey1O0f+rguU0mv fOHAWMSoSLfI/edXHfhd/ovGsS+hdwXnFVi94b7rC/Ycurfoti2YQeg9ixoHWA49JZXp fbHYPola/4ckp2tAIAtStZZW37Osr28/bz42LFzPMNPXEkTp7nxgsrbHsGceg6dSkVpQ 6TCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=0zphOfIhseA3mX9zTP2rfuaOw8Qe3J+UdrmilpDjP04=; b=ilUkZeAHFTc3KGF+uEaAb/HboXf5gFrtiv4KV8hKB47hEuGaQKNWRJfNHW1UbBWI2e rYSORh1woJ7XeYQkkqvVyOUJw9PXGUqAtXkB91v+JrGgjoJEyxKMqEJTWORFPPi6EB+D /V7bQLzEFPBNfhUMHWp7D8EVEsd/+5yzkUA2qWK9cmgvSEnPh5UgsIvgQY9Qfuk2AVmB DWjsiAk17j5ONT8FHn61T0X8bIENNLGPL5X/eemGYzOaEozQgwejmLuvm/JeRjhQ3Oeh pnaSXsfzR8Eza2zThunay7lpXcIfWXplvEmrd+I9iiqgIes6L4bs/EzTQqHJBWqMw8ip XYGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si9301589pgq.76.2018.04.16.04.47.46; Mon, 16 Apr 2018 04:48:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754633AbeDPJgD (ORCPT + 99 others); Mon, 16 Apr 2018 05:36:03 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50734 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754609AbeDPJgB (ORCPT ); Mon, 16 Apr 2018 05:36:01 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3976940676C0; Mon, 16 Apr 2018 09:36:01 +0000 (UTC) Received: from gondolin (unknown [10.36.118.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A2C62024CA9; Mon, 16 Apr 2018 09:35:59 +0000 (UTC) Date: Mon, 16 Apr 2018 11:35:57 +0200 From: Cornelia Huck To: Dong Jia Shi Cc: Dong Jia Shi , Halil Pasic , linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vfio-ccw: process ssch with interrupts disabled Message-ID: <20180416113557.25d4fbbb.cohuck@redhat.com> In-Reply-To: <20180416021312.GO12194@bjsdjshi@linux.vnet.ibm.com> References: <20180413140509.9042-1-cohuck@redhat.com> <20180416021312.GO12194@bjsdjshi@linux.vnet.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 16 Apr 2018 09:36:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Mon, 16 Apr 2018 09:36:01 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Apr 2018 10:13:12 +0800 Dong Jia Shi wrote: > * Cornelia Huck [2018-04-13 16:05:09 +0200]: > > > When we call ssch, an interrupt might already be pending once we > > return from the START SUBCHANNEL instruction. Therefore we need to > > make sure interrupts are disabled until after we're done with our > > processing. > Sounds right. > > > > > Note that the subchannel lock is the same as the ccwdevice lock that > > is mentioned in the documentation for ccw_device_start() and friends. > I think this is helpful hint for me to understand the correct way of > using sch->lock in our context, but not sure if the word "same" brings > confusion to the others. There are many difference between them, > considering the fact that sch->lock exists in the CSS driver for a long > time already, and it is not external interface like ccw_dev->lock, and > its usage is different with ccw_dev->lock in the existing code. > It's because vfio-ccw are offering interface to the external world based > directly on the css driver level, it makes the purpose of protecting > what should be protected with it becomes the same. > > Not a problem for me, but better with a better rewording? Huh, my intention was to clarify things, not to make them more confusing :) The documentation for ccw_device_start() and friends seems to be the only place where we explicitly state locking requirements, so that's where I came from. Maybe simply reword the first paragraph to mention the lock? "When we call ssch, an interrupt might already be pending once we return from the START SUBCHANNEL instruction. Therefore we need to make sure interrupts are disabled while holding the subchannel lock until after we're done with our processing." Or maybe things are already clear enough from the code? > > > > > Signed-off-by: Cornelia Huck > > --- > > drivers/s390/cio/vfio_ccw_fsm.c | 19 ++++++++++++------- > > 1 file changed, 12 insertions(+), 7 deletions(-) > LGTM: > Reviewed-by: Dong Jia Shi > Thanks!