Re: [PATCH 2/4] x86: Add UV bios call infrastructure v2

Previous thread: [PATCH 1/4] x86: Add UV EFI table entry v2 by Russ Anderson on Friday, September 26, 2008 - 1:02 pm. (2 messages)

Next thread: [PATCH 3/4] x86: Add UV partition call v2 by Russ Anderson on Friday, September 26, 2008 - 1:03 pm. (1 message)
From: Russ Anderson
Date: Friday, September 26, 2008 - 1:02 pm

[PATCH 2/4] Add UV bios call infrastructure

Add the EFI callback function and associated wrapper code.
Initialize SAL system table entry info at boot time.

Signed-off-by: Russ Anderson <rja@sgi.com>
Signed-off-by: Paul Jackson <pj@sgi.com>

---
 arch/x86/kernel/bios_uv.c        |  101 ++++++++++++++++++++++++++++++---------
 arch/x86/kernel/genx2apic_uv_x.c |    1 
 include/asm-x86/efi.h            |   14 +++++
 include/asm-x86/uv/bios.h        |   73 +++++++++++++++-------------
 4 files changed, 136 insertions(+), 53 deletions(-)

Index: linux/arch/x86/kernel/bios_uv.c
===================================================================
--- linux.orig/arch/x86/kernel/bios_uv.c	2008-09-26 14:13:24.000000000 -0500
+++ linux/arch/x86/kernel/bios_uv.c	2008-09-26 14:13:36.000000000 -0500
@@ -1,8 +1,6 @@
 /*
  * BIOS run time interface routines.
  *
- *  Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
- *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
@@ -16,33 +14,94 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ *  Copyright (c) 2008 Silicon Graphics, Inc.  All Rights Reserved.
+ *  Copyright (c) Russ Anderson
  */
 
+#include <linux/efi.h>
+#include <asm/efi.h>
+#include <linux/io.h>
 #include <asm/uv/bios.h>
 
-const char *
-x86_bios_strerror(long status)
+struct uv_systab uv_systab;
+
+s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
 {
-	const char *str;
-	switch (status) {
-	case  0: str = "Call completed without error";	break;
-	case -1: str = "Not implemented";		break;
-	case -2: str = "Invalid argument";		break;
-	case -3: str = "Call completed with ...
From: Huang Ying
Date: Friday, September 26, 2008 - 6:21 pm

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=

efi_call_virt<n> and efi_call_phys<n> is the API instead of efi_call<n>.
And please put the implementation without CONFIG_EFI defined out of

#ifdef CONFIG_X86_32
<...>
#else
<...>
#endif

Best Regards,
Huang Ying

From: Ingo Molnar
Date: Saturday, September 27, 2008 - 9:10 am

ok - i'll wait for v3 of this patchset.

	Ingo
--

From: Russ Anderson
Date: Sunday, September 28, 2008 - 8:01 am

#define efi_call_virt6(f, a1, a2, a3, a4, a5, a6)                       \
        efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
                  (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6))

efi_call_virt6() uses efi.systab->runtime->f.
My call needs to use uv_systab, not efi.systab.

How about something like this?

#define efi_call_uv_virt6(a1, a2, a3, a4, a5, a6)                       \
        efi_call6((void *)(__va(uv_systab.function)), (u64)(a1), (u64)(a2), \


-- 
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          rja@sgi.com
--

From: Russ Anderson
Date: Monday, September 29, 2008 - 7:31 am

After thinking about this, if a new runtime call was added to
efi_runtime_services_t, then the existing efi_call_virt<n> could be
used.  This would remove the need to create uv_systab.  I'll post
a patch shortly.



-- 
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          rja@sgi.com
--

From: huang ying
Date: Thursday, October 2, 2008 - 1:05 am

Please don't touch efi_runtime_services_t, if you do not go through
UEFI standard procedure. It can not be extended in a non-standard way.
Thinking about someone else adds another new field to
efi_runtime_services_t in a conflict way.

Best Regards,
Huang Ying
--

From: huang ying
Date: Thursday, October 2, 2008 - 1:02 am

Hi, Russ,


Yes. efi_call_virt6() is tied with standard EFI runtime services, so
it may be not suitable for your need. What you need is just to do
calling convention converting, like efi_call6 does. So I think it is
better to just use your current implementation.

Acked-by: Huang Ying <ying.huang@intel.com>

Best Regards,
Huang Ying
--

From: Russ Anderson
Date: Thursday, October 2, 2008 - 8:34 am

-- 
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          rja@sgi.com
--

From: Ingo Molnar
Date: Friday, October 3, 2008 - 2:10 am

ok - could you please resend the lot with all the Acked-by's in place? 
(and with all the bits that are being objected left out)

	Ingo
--

Previous thread: [PATCH 1/4] x86: Add UV EFI table entry v2 by Russ Anderson on Friday, September 26, 2008 - 1:02 pm. (2 messages)

Next thread: [PATCH 3/4] x86: Add UV partition call v2 by Russ Anderson on Friday, September 26, 2008 - 1:03 pm. (1 message)