From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Jennifer Herbert <jennifer.herbert@citrix.com>,
Tim Deegan <tim@xen.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCHv6 1/3] xen: use ticket locks for spin locks
Date: Tue, 19 May 2015 11:27:24 +0100 [thread overview]
Message-ID: <555B100C.9050804@citrix.com> (raw)
In-Reply-To: <555A2611020000780007B4B1@mail.emea.novell.com>
On 18/05/15 16:49, Jan Beulich wrote:
>>>> On 18.05.15 at 17:33, <david.vrabel@citrix.com> wrote:
>> On 18/05/15 11:16, Jan Beulich wrote:
>>>>>> On 14.05.15 at 13:21, <david.vrabel@citrix.com> wrote:
>>>> void _spin_lock(spinlock_t *lock)
>>>> {
>>>> + spinlock_tickets_t tickets = { .tail = 1, };
>>>
>>> This breaks the build on gcc 4.3.x (due to tail being a member of an
>>> unnamed structure member of a union).
>>
>> I don't have a gcc that old to hand but isn't the error here that .tail
>> is part of the structure that isn't the first member of a union?
>
> No, the error is "unknown field 'tail' specified in initializer", and ...
>
>> Does this fix your gcc 4.3 build?
>
> ... hence this doesn't help. Iirc you just can't have initializers for
> unnamed fields or their descendants.
How about this?
diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index c8dc8ba..29149d1 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -132,7 +132,7 @@ static always_inline u16
observe_head(spinlock_tickets_t *t)
void _spin_lock(spinlock_t *lock)
{
- spinlock_tickets_t tickets = { .tail = 1, };
+ spinlock_tickets_t tickets = SPINLOCK_TICKET_INC;
LOCK_PROFILE_VAR;
check_lock(&lock->debug);
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index 311685a..9286543 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -132,6 +132,8 @@ typedef union {
};
} spinlock_tickets_t;
+#define SPINLOCK_TICKET_INC { .head_tail = 0x10000, }
+
typedef struct spinlock {
spinlock_tickets_t tickets;
u16 recurse_cpu:12;
next prev parent reply other threads:[~2015-05-19 10:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 11:21 [PATCHv6 0/3] Use ticket locks for spinlocks David Vrabel
2015-05-14 11:21 ` [PATCHv6 1/3] xen: use ticket locks for spin locks David Vrabel
2015-05-14 11:33 ` Tim Deegan
2015-05-18 10:16 ` Jan Beulich
2015-05-18 15:33 ` David Vrabel
2015-05-18 15:49 ` Jan Beulich
2015-05-19 10:27 ` David Vrabel [this message]
2015-05-19 10:38 ` Jan Beulich
2015-05-19 12:52 ` [PATCHv1] spinlock: fix build with older GCC David Vrabel
2015-05-14 11:21 ` [PATCHv6 2/3] x86, arm: remove asm/spinlock.h from all architectures David Vrabel
2015-05-14 11:21 ` [PATCHv6 3/3] x86: reduce struct hvm_domain size David Vrabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=555B100C.9050804@citrix.com \
--to=david.vrabel@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=jennifer.herbert@citrix.com \
--cc=keir@xen.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.