Received: by 10.223.185.116 with SMTP id b49csp6886313wrg; Wed, 28 Feb 2018 18:06:34 -0800 (PST) X-Google-Smtp-Source: AG47ELs7b+i1x7gX2ldSTvlzqX7ZJMFR9749puw4f8AQZyQK1ebRuWqWH/gvFEkB3mhgcsQAL0mn X-Received: by 2002:a17:902:5a44:: with SMTP id f4-v6mr242182plm.116.1519869994771; Wed, 28 Feb 2018 18:06:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519869994; cv=none; d=google.com; s=arc-20160816; b=X1U6EwDwbTMXWrFCmnDgN2Alo4ot8Nn1NbTgjl+O1UYEQ/eXVJ4czkxCzrc+M4mp5e qXzGrEVFjWrUpEnEsJ4ixIEmcZ8S6+aOaE+AOaa5ATMly7s6i0nfmx4p5jZKp60SyPJg 7xuZqYznH2J6O23Jq5twYxt3UOLlYKiCiAWRcwwrOecLz4ibx1hdOIMcO19fNgBH+vxd 8hKjzJCuhbizyQFrayA5fyfOsn4cdbsUFVwdnspn8VCxFZy0dId9kY9azcQE7PFv0dL+ LU3BKUrrq/bjII4xTY4kwxBgZmrhdIvzzcRMemenTBcePSoE3IKHbVzLquHyswoXJpZh fd9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:dmarc-filter:arc-authentication-results; bh=KE8uGlGFF2gU/Y25ox0yLICC1GoYRzWyoaVr9BRUjP0=; b=V39DfgNtpwCtXpKueGvLpW1Npt0cUjEuYx31EWrdbgAXi3vRKe+dslGFejZm3Sy9uP AEc2txwNlkMsvPEA9BT+3Ub4tIoJLGd/+UB2IErHWeUEp/SHBDw2sIzP2GTG8295bkiR Zl2+Bt5mAkFsGfIfLsrVfzmwe0ZHjRxVG81WurHliX9XkrCXg3UpB9vOdhWYNPxnpxDJ MXavD7hKoiZKzDBvez390rG5LyCS1zbgU2+C9GymZ+B5FELqbEauW2UCDRbkBKDBWJ6t +uivI/h38vIlggV9XVNhvsEgumYmtnZv0dbH2RJi6t+j2y2KrBW1XvfGbIlCkPIgur0s fNsA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11-v6si939344plg.498.2018.02.28.18.06.18; Wed, 28 Feb 2018 18:06:34 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935721AbeCACFh (ORCPT + 99 others); Wed, 28 Feb 2018 21:05:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:44986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932134AbeCACFg (ORCPT ); Wed, 28 Feb 2018 21:05:36 -0500 Received: from [10.135.48.227] (unknown [12.248.85.146]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C102B21771; Thu, 1 Mar 2018 02:05:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C102B21771 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=sstabellini@kernel.org Date: Wed, 28 Feb 2018 18:05:34 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: jgross@suse.com, boris.ostrovsky@oracle.com cc: sstabellini@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] pvcalls-front: 64-bit align flags Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are using test_and_* operations on the status and flag fields of struct sock_mapping. However, these functions require the operand to be 64-bit aligned on arm64. Currently, only status is 64-bit aligned. Make status and flags explicitly 64-bit aligned. Signed-off-by: Stefano Stabellini --- Changes in v2: - use __attribute__((aligned(8))) - add comments diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c index ca5b773..582929e 100644 --- a/drivers/xen/pvcalls-front.c +++ b/drivers/xen/pvcalls-front.c @@ -73,20 +73,25 @@ struct sock_mapping { wait_queue_head_t inflight_conn_req; } active; struct { - /* Socket status */ + /* + * Socket status, needs to be 64-bit aligned due to the + * test_and_* functions which have this requirement on arm64. + */ #define PVCALLS_STATUS_UNINITALIZED 0 #define PVCALLS_STATUS_BIND 1 #define PVCALLS_STATUS_LISTEN 2 - uint8_t status; + uint8_t status __attribute__((aligned(8))); /* * Internal state-machine flags. * Only one accept operation can be inflight for a socket. * Only one poll operation can be inflight for a given socket. + * flags needs to be 64-bit aligned due to the test_and_* + * functions which have this requirement on arm64. */ #define PVCALLS_FLAG_ACCEPT_INFLIGHT 0 #define PVCALLS_FLAG_POLL_INFLIGHT 1 #define PVCALLS_FLAG_POLL_RET 2 - uint8_t flags; + uint8_t flags __attribute__((aligned(8))); uint32_t inflight_req_id; struct sock_mapping *accept_map; wait_queue_head_t inflight_accept_req;