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 X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AED1C433E0 for ; Tue, 16 Feb 2021 17:03:46 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E5A0B64DEC for ; Tue, 16 Feb 2021 17:03:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E5A0B64DEC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC3lJ-0000V4-2X for qemu-devel@archiver.kernel.org; Tue, 16 Feb 2021 12:03:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC3TJ-0006AN-Vy for qemu-devel@nongnu.org; Tue, 16 Feb 2021 11:45:10 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:38170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lC3TD-0006qj-JF for qemu-devel@nongnu.org; Tue, 16 Feb 2021 11:45:09 -0500 Received: by mail-ed1-x533.google.com with SMTP id s11so13012690edd.5 for ; Tue, 16 Feb 2021 08:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Xp8gyyw4XX+v5GfAXxip4UNdg+CNKu2z9lmgf9b+QEI=; b=SCQCIGlNZmbtz2ejbwiOgXOxelbHvmReciN0EQj3r0b4kRb8u5QIW/i16Ur02cNsfb CyRgHQQVopVIvfka7tPFSL2UavQha7ogwuiusFzj3yaLn7Sb23GFwUwKg7f6/I4Bd8z3 QdZ0N9uNYjxhtH5TmdZSCaa1wuUNVckHf8rXbJ99oqGGj/KtpTwJ3RcOyi4+ZscKJYSc 6q09Wj9sVj0t2Eca35WoMiR73f34LlMLsMoLgC/ACwmIBJc8QPCbILDC4rsEWexxywK3 4HGsXqlD6PRV9ifEJzFi7fu8TN4puzZkMlKvMZfk+SPlBcqHmrT/JZ6NfvuFxpAjHV61 mVIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Xp8gyyw4XX+v5GfAXxip4UNdg+CNKu2z9lmgf9b+QEI=; b=g7Fvp8cE6ZfVK9s4LgIW0UC/drdhRRZzrIW+snVubvEpt6H/eKmWSQ16qnsMFegawM 1cWr9w5ISQmsWO2RAwJ+UNbZxzxk+2OvDxWtnAP7I2jehr5YoLajcB5MDtufTLFstigH 50dDLrnITPkH5FeuJKlW+2W+Czb52E6KNNt4xaP7vxws2Tk1T2FvG+0kEbid+B11N+0x pe7vcDyIDbZt/oErmvmhy/uygHaB5476kIdOCxEpmjkev0ZYfK6PCGFcE1DM4hH35FHf quvMCxiHFazJuB3WB9kot0gA1k8sd6N15hsGHjd4EkBwDV3P/umZQKfwILUfNN0mLtOh xLVw== X-Gm-Message-State: AOAM533NZTpJ59b33TverUCuu119K/GfEY4Rm7ehP8raNmtq7WwDy2ow QZIgWRT5W8CvclBRyWLxoqHFm1A570QCpcapyfD3dQ== X-Google-Smtp-Source: ABdhPJxVX3B7vLefA/PltxdwERUcV7Lpfc/UrUeKoiO/osLJDfnoxHwfZK+aA0WZ1uLuOD3NMgasEr9m1yxhHfhvc9Q= X-Received: by 2002:a05:6402:3494:: with SMTP id v20mr22514439edc.146.1613493900110; Tue, 16 Feb 2021 08:45:00 -0800 (PST) MIME-Version: 1.0 References: <20210216110056.1228582-1-thuth@redhat.com> <20210216154010.3691880f.pasic@linux.ibm.com> <72e9a5b3-dd88-85de-e4a8-88a6a9c45099@redhat.com> In-Reply-To: <72e9a5b3-dd88-85de-e4a8-88a6a9c45099@redhat.com> From: Peter Maydell Date: Tue, 16 Feb 2021 16:44:48 +0000 Message-ID: Subject: Re: [PATCH] pc-bios/s390-ccw: Use memory barriers in virtio code To: Thomas Huth Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=peter.maydell@linaro.org; helo=mail-ed1-x533.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Halil Pasic , Christian Borntraeger , qemu-s390x , Cornelia Huck , QEMU Developers Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, 16 Feb 2021 at 16:15, Thomas Huth wrote: > I was just about to reply that this is certainly not necessary, since > the DIAGNOSE instruction that we use for the notification hypercall > should be serializing anyway ... but after looking at the PoP, it > actually is not marked as a serializing instruction! (while e.g. > SVC - supervisor call - is explicitly marked as serializing) > > So maybe that's worth a try: Peter, could you please apply this patch > on top an see whether it makes a difference? > > diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c > --- a/pc-bios/s390-ccw/virtio.c > +++ b/pc-bios/s390-ccw/virtio.c > @@ -54,6 +54,7 @@ static long kvm_hypercall(unsigned long nr, unsigned long param1, > register ulong r_param3 asm("4") = param3; > register long retval asm("2"); > > + virtio_mb(); > asm volatile ("diag 2,4,0x500" > : "=d" (retval) > : "d" (r_nr), "0" (r_param1), "r"(r_param2), "d"(r_param3) Doesn't really help (maybe brings the occurrence rate down a bit more, towards about 1 in 9?) -- PMM