From patchwork Sat May 2 16:06:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 11523965 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C0DB139A for ; Sat, 2 May 2020 16:09:34 +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 47D1B24953 for ; Sat, 2 May 2020 16:09:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xen.org header.i=@xen.org header.b="hGqXa86a" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47D1B24953 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org 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 1jUufT-00014Q-9U; Sat, 02 May 2020 16:07:07 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jUufS-00014L-Dn for xen-devel@lists.xenproject.org; Sat, 02 May 2020 16:07:06 +0000 X-Inumbo-ID: f7b73a14-8c8e-11ea-b07b-bc764e2007e4 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f7b73a14-8c8e-11ea-b07b-bc764e2007e4; Sat, 02 May 2020 16:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=XXC8DGMWkMGF7BQd7M647PKodx+HoA9G+1TKVa1kGOs=; b=hGqXa86aIBJir8+lxov5b9R1sa J12iDNGBF2AjT2VKrsyyqxeBzi9UOjW/WxQ5PFkkPluHZrRQYMNqgQviXdz1/pgJj/YNt9KvZZai9 Y0fycBclKU47PU0E8rIBvQXvbxylVWTqh1hgCuK+4wIKdJvGlQ+rBco5/JJmj4DU5y1k=; Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jUufQ-0000pi-Oj; Sat, 02 May 2020 16:07:04 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jUufQ-00054b-Co; Sat, 02 May 2020 16:07:04 +0000 From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH for-4.14 0/3] Rework {read, write}_atomic() Date: Sat, 2 May 2020 17:06:57 +0100 Message-Id: <20200502160700.19573-1-julien@xen.org> X-Mailer: git-send-email 2.17.1 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: , Cc: Stefano Stabellini , julien@xen.org, Wei Liu , paul@xen.org, Andrew Cooper , Julien Grall , Jan Beulich , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Julien Grall Hi all, This small series is: - Hardening write_atomic() to prevent writing to const pointer - Allow {read, write}_atomic() to be used in more cases on Arm. While this was posted after the last posting date, patch #1 is necessary to avoid the cast introduced by Juergen in [1]. The rest of the patches would be good hardening to have in Xen 4.14. So I would like to request the full series to be included in Xen 4.14. Cheers, [1] <20200430152848.20275-1-jgross@suse.com> CC: paul@xen.org Julien Grall (3): xen/arm: atomic: Allow read_atomic() to be used in more cases xen/arm: atomic: Rewrite write_atomic() xen/x86: atomic: Don't allow to write atomically in a pointer to const xen/include/asm-arm/atomic.h | 77 ++++++++++++++++++++++++++---------- xen/include/asm-x86/atomic.h | 2 + 2 files changed, 59 insertions(+), 20 deletions(-)