From: Christian Roessner <christian@roessner-net.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: Powernow-k8 support
Date: Tue, 13 Jun 2006 14:20:10 +0200 [thread overview]
Message-ID: <448EAD7A.2020402@roessner-net.com> (raw)
In-Reply-To: <89593ac4e4b1ffd9a19cf1bda5c600c7@cl.cam.ac.uk>
[-- Attachment #1.1.1: Type: text/plain, Size: 1281 bytes --]
Hi,
> It really depends what is hidden inside the binary-only portion. If they
> try to enable/disable interrupts in there, for example, then the driver
> is going to be unreliable. If they provide accessors for that kind of
> operation in their 'open source' wrapper, then that shouldn't be a
> problem as they will link against the versions modified for Xen. Looking
> at the functions exported by the source wrapper might give you a clue,
> or try 'objdump -d' on the binary-only portion and grep for things like
> cli, sti and popf.
I searched around inside the NVidia forum and I found 2 patches, which I
applied to the hypervisor and to nv.c. Now, CPUfreq is working fine here
and I successfully use the nvidia driver. I have attached both patches.
Maybe someone else may have the same problem, so in this thread he/she
may find all neccessary info, whatever.
Only one thing left ist the problem with the line
line 1058 /* __update_vcpu_system_time(current); */
But everything is working with this solution. What should this be for?
I have noticed one other interesting thing with Xen: openVPN is nomore
able to initialize any tunnels. Does this have something to do with the
__update_vcpu_system_time function?
Kind regards
Christian
[-- Attachment #1.1.2: patch-2.6-xen-sparse-nv.diff --]
[-- Type: text/plain, Size: 1543 bytes --]
diff -urN linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c linux-2.6-xen-sparse-nv/arch/i386/mm/hypervisor.c
--- linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c 2006-04-13 19:48:37.000000000 +0200
+++ linux-2.6-xen-sparse-nv/arch/i386/mm/hypervisor.c 2006-04-16 15:34:51.000000000 +0200
@@ -133,6 +133,7 @@
op.cmd = MMUEXT_TLB_FLUSH_LOCAL;
BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
}
+EXPORT_SYMBOL(xen_tlb_flush);
void xen_invlpg(unsigned long ptr)
{
diff -urN linux-2.6-xen-sparse/drivers/xen/core/evtchn.c linux-2.6-xen-sparse-nv/drivers/xen/core/evtchn.c
--- linux-2.6-xen-sparse/drivers/xen/core/evtchn.c 2006-04-13 19:48:37.000000000 +0200
+++ linux-2.6-xen-sparse-nv/drivers/xen/core/evtchn.c 2006-04-16 15:34:04.000000000 +0200
@@ -188,7 +188,7 @@
{
(void)HYPERVISOR_xen_version(0, NULL);
}
-EXPORT_SYMBOL_GPL(force_evtchn_callback);
+EXPORT_SYMBOL(force_evtchn_callback);
/* NB. Interrupts are disabled on entry. */
asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
diff -urN linux-2.6-xen-sparse/drivers/xen/core/features.c linux-2.6-xen-sparse-nv/drivers/xen/core/features.c
--- linux-2.6-xen-sparse/drivers/xen/core/features.c 2006-04-13 19:48:37.000000000 +0200
+++ linux-2.6-xen-sparse-nv/drivers/xen/core/features.c 2006-04-16 15:33:03.000000000 +0200
@@ -12,7 +12,7 @@
#include <xen/features.h>
u8 xen_features[XENFEAT_NR_SUBMAPS * 32] __read_mostly;
-EXPORT_SYMBOL_GPL(xen_features);
+EXPORT_SYMBOL(xen_features);
void setup_xen_features(void)
{
[-- Attachment #1.1.3: patch-nv-1.0-8756-xen-3.0.2-2.diff --]
[-- Type: text/plain, Size: 5710 bytes --]
diff -urN nv-1.0-8756/nv.c nv-1.0-8756-xen-3.0.2-2/nv.c
--- nv-1.0-8756/nv.c 2006-03-30 01:02:20.000000000 +0200
+++ nv-1.0-8756-xen-3.0.2-2/nv.c 2006-04-18 03:16:11.000000000 +0200
@@ -16,6 +16,9 @@
#include "os-agp.h"
#include "nv-vm.h"
+#define io_remap_page_range(vma, start, busaddr, size, prot) \
+ io_remap_pfn_range(vma, start, busaddr>>PAGE_SHIFT, size, prot)
+
#ifdef MODULE_ALIAS_CHARDEV_MAJOR
MODULE_ALIAS_CHARDEV_MAJOR(NV_MAJOR_DEVICE_NUMBER);
#endif
@@ -44,7 +47,11 @@
int nv_pat_enabled = 0;
+#ifdef CONFIG_XEN
+static int nv_disable_pat = 1;
+#else
static int nv_disable_pat = 0;
+#endif
NV_MODULE_PARAMETER(nv_disable_pat);
#if defined(NVCPU_X86) || defined(NVCPU_X86_64)
@@ -2087,7 +2094,11 @@
return -ENXIO;
}
+#ifdef CONFIG_XEN
+ if (io_remap_page_range(vma, vma->vm_start,
+#else
if (NV_REMAP_PAGE_RANGE(vma->vm_start,
+#endif
NV_VMA_OFFSET(vma),
NV_VMA_SIZE(vma),
vma->vm_page_prot))
@@ -2112,7 +2123,11 @@
}
}
+#ifdef CONFIG_XEN
+ if (io_remap_page_range(vma, vma->vm_start,
+#else
if (NV_REMAP_PAGE_RANGE(vma->vm_start,
+#endif
NV_VMA_OFFSET(vma),
NV_VMA_SIZE(vma),
vma->vm_page_prot))
@@ -2155,7 +2170,11 @@
NV_ATOMIC_INC(at->usage_count);
nv_up(nvl->at_lock);
+#ifdef CONFIG_XEN
+ if (io_remap_page_range(vma, vma->vm_start,
+#else
if (NV_REMAP_PAGE_RANGE(vma->vm_start,
+#endif
NV_VMA_OFFSET(vma),
NV_VMA_SIZE(vma),
vma->vm_page_prot))
diff -urN nv-1.0-8756/nv-linux.h nv-1.0-8756-xen-3.0.2-2/nv-linux.h
--- nv-1.0-8756/nv-linux.h 2006-03-30 01:02:20.000000000 +0200
+++ nv-1.0-8756-xen-3.0.2-2/nv-linux.h 2006-04-17 01:46:37.000000000 +0200
@@ -19,8 +19,8 @@
#include <linux/utsname.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
-# error This driver does not support pre-2.4 kernels!
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 7)
+# error This driver does not support 2.4 kernels older than 2.4.7!
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
# define KERNEL_2_4
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
@@ -94,6 +94,7 @@
#include <linux/spinlock.h>
#include <asm/semaphore.h>
+#include <linux/completion.h>
#include <linux/highmem.h>
#ifdef CONFIG_PROC_FS
@@ -225,9 +226,13 @@
* tiny, and the kernel panics when it is exhausted. try to warn the user that
* they need to boost the size of their pool.
*/
+#if defined(CONFIG_XEN)
+#undef CONFIG_SWIOTLB
+#else
#if defined(CONFIG_SWIOTLB) && !defined(GFP_DMA32)
#define NV_SWIOTLB 1
#endif
+#endif
/*
* early 2.6 kernels changed their swiotlb codepath, running into a
diff -urN nv-1.0-8756/nv-vm.c nv-1.0-8756-xen-3.0.2-2/nv-vm.c
--- nv-1.0-8756/nv-vm.c 2006-03-30 01:02:20.000000000 +0200
+++ nv-1.0-8756-xen-3.0.2-2/nv-vm.c 2006-04-18 02:16:21.000000000 +0200
@@ -497,7 +497,11 @@
page_ptr->phys_addr = phys_addr;
page_ptr->page_count = NV_GET_PAGE_COUNT(page_ptr);
page_ptr->virt_addr = virt_addr;
+#ifdef CONFIG_XEN
+ page_ptr->dma_addr = phys_to_machine(page_ptr->phys_addr);
+#else
page_ptr->dma_addr = page_ptr->phys_addr;
+#endif
/* lock the page for dma purposes */
nv_lock_page(page_ptr);
diff -urN nv-1.0-8756/os-agp.c nv-1.0-8756-xen-3.0.2-2/os-agp.c
--- nv-1.0-8756/os-agp.c 2006-03-30 01:02:20.000000000 +0200
+++ nv-1.0-8756-xen-3.0.2-2/os-agp.c 2006-04-17 01:46:37.000000000 +0200
@@ -284,7 +284,11 @@
page_ptr->phys_addr = (ptr->memory[i] & PAGE_MASK);
page_ptr->virt_addr = (unsigned long) __va(page_ptr->phys_addr);
+#ifdef CONFIG_XEN
+ page_ptr->dma_addr = phys_to_machine(page_ptr->phys_addr);
+#else
page_ptr->dma_addr = page_ptr->phys_addr;
+#endif
}
return RM_OK;
diff -urN nv-1.0-8756/os-interface.c nv-1.0-8756-xen-3.0.2-2/os-interface.c
--- nv-1.0-8756/os-interface.c 2006-03-30 01:02:20.000000000 +0200
+++ nv-1.0-8756-xen-3.0.2-2/os-interface.c 2006-04-17 01:46:37.000000000 +0200
@@ -58,9 +58,9 @@
//
typedef struct os_sema_s
{
- struct semaphore wait;
- spinlock_t lock;
- S032 count;
+ struct completion completion;
+ spinlock_t lock;
+ S032 count;
} os_sema_t;
//
@@ -81,7 +81,7 @@
return rmStatus;
os_sema = (os_sema_t *)*ppSema;
- sema_init(&os_sema->wait, 0);
+ init_completion(&os_sema->completion);
spin_lock_init(&os_sema->lock);
os_sema->count = 1;
@@ -126,7 +126,7 @@
{
os_sema->count--;
spin_unlock_irqrestore(&os_sema->lock, old_irq);
- down(&os_sema->wait);
+ wait_for_completion(&os_sema->completion);
}
else
{
@@ -203,7 +203,7 @@
spin_unlock_irqrestore(&os_sema->lock, old_irq);
if (doWakeup)
- up(&os_sema->wait);
+ complete(&os_sema->completion);
return RM_OK;
}
@@ -554,6 +554,8 @@
}
MicroSeconds = MilliSeconds * 1000;
+
+#if 0
tm_end.tv_usec = MicroSeconds;
tm_end.tv_sec = 0;
timeradd(&tm_aux, &tm_end, &tm_end);
@@ -593,6 +595,7 @@
MicroSeconds = 0;
} while ((jiffies = NV_USECS_TO_JIFFIES(MicroSeconds)) != 0);
}
+#endif
if (MicroSeconds > 1000)
{
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2006-06-13 12:20 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-12 16:00 Powernow-k8 support Langsdorf, Mark
2006-06-12 16:06 ` Keir Fraser
2006-06-12 16:58 ` Christian Roessner
2006-06-12 17:29 ` Keir Fraser
2006-06-13 8:49 ` Christian Roessner
2006-06-13 9:11 ` Keir Fraser
2006-06-13 9:24 ` Christian Roessner
2006-06-13 9:30 ` Keir Fraser
2006-06-13 12:20 ` Christian Roessner [this message]
2006-06-13 12:51 ` Keir Fraser
2006-06-13 14:12 ` Christian Roessner
2006-06-13 14:47 ` Keir Fraser
2006-06-13 14:57 ` Christian Roessner
2006-06-13 15:00 ` Keir Fraser
2006-06-13 15:04 ` Keir Fraser
2006-06-13 14:35 ` Christian Roessner
-- strict thread matches above, loose matches on Subject: below --
2006-06-14 21:43 Langsdorf, Mark
2006-06-15 6:14 ` Keir Fraser
2006-06-15 9:58 ` Christian Roessner
2006-06-15 10:21 ` Keir Fraser
2006-06-12 16:25 Langsdorf, Mark
2006-06-11 15:49 Christian Roessner
2006-06-11 16:11 ` Keir Fraser
2006-06-11 19:48 ` Christian Roessner
2006-06-11 21:04 ` Keir Fraser
2006-06-12 0:26 ` Christian Roessner
2006-06-12 7:49 ` Keir Fraser
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=448EAD7A.2020402@roessner-net.com \
--to=christian@roessner-net.com \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=xen-devel@lists.xensource.com \
/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.