Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757219AbZA2Jax (ORCPT ); Thu, 29 Jan 2009 04:30:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753149AbZA2Jah (ORCPT ); Thu, 29 Jan 2009 04:30:37 -0500 Received: from gw.goop.org ([64.81.55.164]:51175 "EHLO mail.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752880AbZA2Jag (ORCPT ); Thu, 29 Jan 2009 04:30:36 -0500 Message-ID: <4981773A.1050403@goop.org> Date: Thu, 29 Jan 2009 01:30:34 -0800 From: Jeremy Fitzhardinge User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Rusty Russell CC: Ingo Molnar , linux-kernel@vger.kernel.org, Xen-devel , the arch/x86 maintainers , Ian Campbell , Zachary Amsden , Ravikiran Thirumalai Subject: Re: [PATCH 4 of 7] x86/paravirt: selectively save/restore regs around pvops calls References: <5849eb6475c1bbe5a6ca.1233182104@abulafia.goop.org> <200901291917.26601.rusty@rustcorp.com.au> In-Reply-To: <200901291917.26601.rusty@rustcorp.com.au> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1141 Lines: 30 Rusty Russell wrote: > On Thursday 29 January 2009 09:05:04 Jeremy Fitzhardinge wrote: > >> +#define PV_SAVE_REGS(set) \ >> + COND_PUSH(set, CLBR_RAX, rax); \ >> + COND_PUSH(set, CLBR_RCX, rcx); \ >> + COND_PUSH(set, CLBR_RDX, rdx); \ >> + COND_PUSH(set, CLBR_RSI, rsi); \ >> + COND_PUSH(set, CLBR_RDI, rdi); \ >> + COND_PUSH(set, CLBR_R8, r8); \ >> + COND_PUSH(set, CLBR_R9, r9); \ >> + COND_PUSH(set, CLBR_R10, r10); \ >> + COND_PUSH(set, CLBR_R11, r11) >> > > It's kind of messy. Can we do something clever here with token pasting? > I tried a few things, but no. Passing in just RAX, and then pasting CLBR_##reg works, and the assembler accepts %RAX - but - the asm code also #defines RAX , so the assembler ends up seeing %48. I considered renaming all the CLBR_ defines to CLBR_rax, but that looks unhappy too. So I stayed with this. J -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/