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=-9.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 B2561C433E1 for ; Sun, 16 Aug 2020 19:27:13 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 7ADFE2067C for ; Sun, 16 Aug 2020 19:27:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B1f4/swo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ADFE2067C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k7OIo-0008Hz-U0; Sun, 16 Aug 2020 19:26:46 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1k7OIn-0008Hu-1g for xen-devel@lists.xenproject.org; Sun, 16 Aug 2020 19:26:45 +0000 X-Inumbo-ID: 11b3f3cd-43aa-41d8-85a1-bd2406004c03 Received: from mail-lj1-x243.google.com (unknown [2a00:1450:4864:20::243]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 11b3f3cd-43aa-41d8-85a1-bd2406004c03; Sun, 16 Aug 2020 19:26:43 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id 185so15127796ljj.7 for ; Sun, 16 Aug 2020 12:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=IfaWM6cbh1R6sU631oDIMXW/dlgywxw9xrY1l4klwqQ=; b=B1f4/swoxIQPR26dfLlTPbusUOY/AzzEwxNadyU/nTdfP5P1091cWJdDa9rW5GzWOh H8YfW3wEW/Pmr67In4BhQF56NzvNzNNOMAlV2a2WfjRcXF0E1t+7GxRkk5gowXKXAU+g xpThJHGQjJrLp2MnZvON5fzU9kYK7c3/mNIk5+TcE4eonoTVYQJdIScYTIunVHvsTF7J mWysmOS3oh+TuJfbPrWgjyIovRGLLs1WzEQ0VZhYq9WhzklAFyGKWZMlZyvpgPyuH2Vt vvL0upvK2yr0+KTm+OHnlLSGUzEIU6WNP4hu7bFCswzFN0X79gJ3WlteTlSrfHzkoZ5c gJKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=IfaWM6cbh1R6sU631oDIMXW/dlgywxw9xrY1l4klwqQ=; b=f5pzLMWyrKwfRVc4n3Bvuhhe25sYnTuo9uIB4P1+utubdyl12ttL8fsYfyNtfEj1sO 9MX2Hw5vMvlac/qdjNgQjKXtmn4XK/znxMfjbEHsQFY77KsUWWESarDpNQl9Z++ve8Gb mUTUPyYf1jdG3dmk7pwbjHFPKp3uW7AxBnA7RmcNtNwkJXSeIsjKfqhcODJLErhrKSfJ oLs5o1b+0317dxTBk7ER6AUr2YJlrQsIbBx84YAFiaYU7CXCn4yVmdZYs8Y2z1Cjl4GF 1iutgLqBhEB8TE13NZBghgL5orCVu91IsHdo3Cdj4M5n4sei9b/M/FjJ5V+NcHCCpIKC g9oQ== X-Gm-Message-State: AOAM532HENA10lTbNwJalsOhlTfra1ALQDPH5lXGsMDadsBBFN2UqDk9 Y4EVH/5V1dGl6sBbuJR4D4s= X-Google-Smtp-Source: ABdhPJyEecuB/QKde1W+x86GQx0D7qTXPDrFbNOQv9rZfSym3NDQU+g6rLEXeUf6eelY8DjsjVjT2g== X-Received: by 2002:a05:651c:1194:: with SMTP id w20mr6204249ljo.362.1597606002425; Sun, 16 Aug 2020 12:26:42 -0700 (PDT) Received: from [192.168.1.2] ([212.22.223.21]) by smtp.gmail.com with ESMTPSA id 14sm4387692lfr.17.2020.08.16.12.26.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Aug 2020 12:26:41 -0700 (PDT) Subject: Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64() To: Julien Grall , xen-devel@lists.xenproject.org Cc: Julien Grall , Stefano Stabellini , Volodymyr Babchuk , Jan Beulich , Andrew Cooper , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Oleksandr Tyshchenko References: <20200815172143.1327-1-julien@xen.org> From: Oleksandr Message-ID: Date: Sun, 16 Aug 2020 22:26:35 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200815172143.1327-1-julien@xen.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 15.08.20 20:21, Julien Grall wrote: Hi Julien > From: Julien Grall > > The IOREQ code is using cmpxchg() with 64-bit value. At the moment, this > is x86 code, but there is plan to make it common. > > To cater 32-bit arch, introduce two new helpers to deal with 64-bit > cmpxchg. > > The Arm 32-bit implementation of cmpxchg64() is based on the __cmpxchg64 > in Linux v5.8 (arch/arm/include/asm/cmpxchg.h). > > Signed-off-by: Julien Grall > Cc: Oleksandr Tyshchenko > --- > xen/include/asm-arm/arm32/cmpxchg.h | 68 +++++++++++++++++++++++++++++ > xen/include/asm-arm/arm64/cmpxchg.h | 5 +++ > xen/include/asm-arm/guest_atomics.h | 22 ++++++++++ > xen/include/asm-x86/guest_atomics.h | 2 + > xen/include/asm-x86/x86_64/system.h | 2 + > 5 files changed, 99 insertions(+) Thank you for doing this. I have successfully build-tested your patch with IOREQ series on Arm32/Arm64 (of course before that I had changed cmpxchg to guest_cmpxchg64 in hvm_send_buffered_ioreq()). -- Regards, Oleksandr Tyshchenko