* Re: [PATCH v2 3/3] drivers: cleanup Kconfig stuff
From: felipe.contreras @ 2010-10-20 8:53 UTC (permalink / raw)
To: Roger Quadros
Cc: linux-usb@vger.kernel.org, linux-omap, linux-main, Greg KH,
Felipe Balbi, Tony Lindgren
In-Reply-To: <4CBE9E69.6060803@nokia.com>
On Wed, Oct 20, 2010 at 10:46 AM, Roger Quadros <roger.quadros@nokia.com> wrote:
> On 10/19/2010 05:33 PM, ext Felipe Contreras wrote:
>> On Tue, Oct 19, 2010 at 4:40 PM, Roger Quadros<roger.quadros@nokia.com>
>> wrote:
>>>>
>>>> @@ -843,6 +841,7 @@ config USB_CDC_COMPOSITE
>>>> config USB_G_NOKIA
>>>> tristate "Nokia composite gadget"
>>>> depends on PHONET
>>>> + depends on USB_GADGET_MUSB_HDRC
>>>
>>> This is wrong. Is there a build problem or run-time problem without this?
>>
>> Try:
>> CONFIG_USB_G_NOKIA=y
>> CONFIG_USB_GADGET_MUSB_HDRC=n
>>
>> At least g_nokia doesn't seem to work correctly on my N900.
>>
> It won't work on N900 because N900 has MUSB USB gadget controller and it
> needs to be selected somehow while building for N900.
>
> You should set CONFIG_USB_GADGET_MUSB_HDRC to y somewhere else while
> building for N900 and not here because g_nokia is not MUSB specific.
How do you expect people to know that? The Kconfig should define what
USB_G_NOKIA needs to work, so that people can enable those things
without go Googling hunting for a workable defconfig. Right now people
can build g_nokia modules that don't work, and that shouldn't be
allowed by the Kconfig.
--
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 5/8] KVM: Add kvm_get_irq_routing_entry() func
From: Avi Kivity @ 2010-10-20 8:53 UTC (permalink / raw)
To: Sheng Yang; +Cc: Marcelo Tosatti, kvm, Michael S. Tsirkin
In-Reply-To: <1287563192-29685-6-git-send-email-sheng@linux.intel.com>
On 10/20/2010 10:26 AM, Sheng Yang wrote:
> We need to query the entry later.
>
>
> +struct kvm_kernel_irq_routing_entry *kvm_get_irq_routing_entry(struct kvm *kvm,
> + int gsi)
> +{
> + int count = 0;
> + struct kvm_kernel_irq_routing_entry *ei = NULL;
> + struct kvm_irq_routing_table *irq_rt;
> + struct hlist_node *n;
> +
> + rcu_read_lock();
> + irq_rt = rcu_dereference(kvm->irq_routing);
> + if (gsi< irq_rt->nr_rt_entries)
> + hlist_for_each_entry(ei, n,&irq_rt->map[gsi], link)
> + count++;
> + rcu_read_unlock();
> + if (count == 1)
> + return ei;
> +
> + return NULL;
> +}
> +
I believe this is incorrect rcu usage. rcu_read_lock() prevents ei from
being destroyed under us, but rcu_read_unlock() removes that protection,
and a future dereference of ei may access freed memory.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply
* [PATCH] audio/device.h: use lower case in profile UUIDs
From: Daniel Örstadius @ 2010-10-20 8:52 UTC (permalink / raw)
To: linux-bluetooth
[-- Attachment #1: Type: text/plain, Size: 29 bytes --]
Hi,
Please review.
/Daniel
[-- Attachment #2: 0001-audio-device.h-use-lower-case-in-profile-UUIDs.patch --]
[-- Type: text/x-patch, Size: 2329 bytes --]
From 4b7952b51b6b6663bdacbd0ab0f21f9d1f2b2720 Mon Sep 17 00:00:00 2001
From: Daniel Orstadius <daniel.orstadius@nokia.com>
Date: Tue, 19 Oct 2010 17:41:27 +0300
Subject: [PATCH] audio/device.h: use lower case in profile UUIDs
BlueZ seems to use lower case when emitting signals containing
UUIDs retrived from a remote device.
The definitions affected by this patch look to be used for example
if the remote connects an audio profile which BlueZ has not
discovered (perhaps it had not yet browsed the service records of
the remote).
In that case the format of the stored and emitted UUID should be
consistent with the UUIDs received during service discovery.
---
audio/device.h | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/audio/device.h b/audio/device.h
index 6ec3938..35af788 100644
--- a/audio/device.h
+++ b/audio/device.h
@@ -22,21 +22,21 @@
*
*/
-#define GENERIC_AUDIO_UUID "00001203-0000-1000-8000-00805F9B34FB"
+#define GENERIC_AUDIO_UUID "00001203-0000-1000-8000-00805f9b34fb"
-#define HSP_HS_UUID "00001108-0000-1000-8000-00805F9B34FB"
-#define HSP_AG_UUID "00001112-0000-1000-8000-00805F9B34FB"
+#define HSP_HS_UUID "00001108-0000-1000-8000-00805f9b34fb"
+#define HSP_AG_UUID "00001112-0000-1000-8000-00805f9b34fb"
-#define HFP_HS_UUID "0000111E-0000-1000-8000-00805F9B34FB"
-#define HFP_AG_UUID "0000111F-0000-1000-8000-00805F9B34FB"
+#define HFP_HS_UUID "0000111e-0000-1000-8000-00805f9b34fb"
+#define HFP_AG_UUID "0000111f-0000-1000-8000-00805f9b34fb"
-#define ADVANCED_AUDIO_UUID "0000110D-0000-1000-8000-00805F9B34FB"
+#define ADVANCED_AUDIO_UUID "0000110d-0000-1000-8000-00805f9b34fb"
-#define A2DP_SOURCE_UUID "0000110A-0000-1000-8000-00805F9B34FB"
-#define A2DP_SINK_UUID "0000110B-0000-1000-8000-00805F9B34FB"
+#define A2DP_SOURCE_UUID "0000110a-0000-1000-8000-00805f9b34fb"
+#define A2DP_SINK_UUID "0000110b-0000-1000-8000-00805f9b34fb"
-#define AVRCP_REMOTE_UUID "0000110E-0000-1000-8000-00805F9B34FB"
-#define AVRCP_TARGET_UUID "0000110C-0000-1000-8000-00805F9B34FB"
+#define AVRCP_REMOTE_UUID "0000110e-0000-1000-8000-00805f9b34fb"
+#define AVRCP_TARGET_UUID "0000110c-0000-1000-8000-00805f9b34fb"
/* Move these to respective .h files once they exist */
#define AUDIO_SOURCE_INTERFACE "org.bluez.AudioSource"
--
1.6.0.4
^ permalink raw reply related
* Re: (XEN) Xen BUG at page_alloc.c:385
From: Dietmar Hahn @ 2010-10-20 8:50 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel
In-Reply-To: <4CBDBDEE020000780001E053@vpn.id2.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 948 bytes --]
Am 19.10.2010 schrieb "Jan Beulich <JBeulich@novell.com>":
> >>> On 19.10.10 at 14:16, Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> wrote:
> > (XEN) Xen BUG at page_alloc.c:385
> >
> > The code line is:
> > BUG_ON(pg[i].count_info != PGC_state_free);
> > Is it possible in any way that a free page is in use? Or is it always a
> > failure somewhere in the code like a multiple use of the same page?
>
> Free pages are never in use for anything, so getting this BUG_ON()
> to trigger means e.g. something modified a page's state after it was
> already passed back to the allocator.
>
> Did you check that this is not another manifestation of the problem
> fixed by c/s 22135 (we have a backport of this in our tree, but it's
> not clear whether yours already has this).
Sorry I wasn't aware of this fix and the backport is not in our source.
Thanks.
Dietmar.
>
> Jan
--
Company details: http://ts.fujitsu.com/imprint.html
[-- Attachment #1.2: Type: text/html, Size: 5276 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply
* Re: [PATCH 3/3] Add egl_shader_runner to ease OpenGL ES 2.0 test case development
From: Shuang He @ 2010-10-20 8:50 UTC (permalink / raw)
To: piglit@lists.freedesktop.org
Cc: intel-gfx, Romanick, Ian D, Graunke, Kenneth W
In-Reply-To: <1287477758-13800-1-git-send-email-shuang.he@intel.com>
Do you have any comment? :-) , or I'd try to commit them tomorrow
Thanks
--Shuang
On 2010-10-19 16:42, He, Shuang wrote:
> ---
> tests/CMakeLists.txt | 3 +
> tests/gles2/CMakeLists.txt | 22 ++
> tests/gles2/egl_shader_runner.c | 762 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 787 insertions(+), 0 deletions(-)
> create mode 100644 tests/gles2/CMakeLists.txt
> create mode 100644 tests/gles2/egl_shader_runner.c
>
> diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
> index 3d3a892..58f8070 100644
> --- a/tests/CMakeLists.txt
> +++ b/tests/CMakeLists.txt
> @@ -13,6 +13,9 @@ add_subdirectory (spec)
>
> IF(OPENGL_egl_LIBRARY)
> add_subdirectory (egl)
> + IF(OPENGL_gles2_LIBRARY)
> + add_subdirectory (gles2)
> + ENDIF(OPENGL_gles2_LIBRARY)
> ENDIF(OPENGL_egl_LIBRARY)
>
> IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
> diff --git a/tests/gles2/CMakeLists.txt b/tests/gles2/CMakeLists.txt
> new file mode 100644
> index 0000000..28c5bc7
> --- /dev/null
> +++ b/tests/gles2/CMakeLists.txt
> @@ -0,0 +1,22 @@
> +add_definitions ( -DSOURCE_DIR="${piglit_SOURCE_DIR}/" )
> +
> +include_directories(
> + ${OPENGL_INCLUDE_PATH}
> + ${piglit_SOURCE_DIR}/tests/util/egl
> +)
> +
> +link_directories (
> + ${piglit_SOURCE_DIR}/tests/util/egl
> + ${piglit_SOURCE_DIR}/tests/util/eglut
> +)
> +
> +link_libraries (
> + ${OPENGLES_gles2_LIBRARY}
> + ${OPENGL_egl_LIBRARY}
> + pigliteglut
> + pigliteglutil
> +)
> +
> +
> +add_executable (egl_shader_runner egl_shader_runner.c ../util/shader-load.c)
> +target_link_libraries(egl_shader_runner X11)
> diff --git a/tests/gles2/egl_shader_runner.c b/tests/gles2/egl_shader_runner.c
> new file mode 100644
> index 0000000..9a42d56
> --- /dev/null
> +++ b/tests/gles2/egl_shader_runner.c
> @@ -0,0 +1,762 @@
> +/*
> + * Copyright © 2010 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +#define _GNU_SOURCE
> +#if defined(_MSC_VER)
> +#define bool BOOL
> +#define true 1
> +#define false 0
> +#else
> +#include<stdbool.h>
> +#endif
> +#include<string.h>
> +#include<ctype.h>
> +#include "piglit-egl-util.h"
> +#include<GLES2/gl2.h>
> +
> +int piglit_width = 250, piglit_height = 250;
> +
> +static float gles_version = 0.0;
> +static float essl_version = 0.0;
> +
> +const char *path = NULL;
> +const char *test_start = NULL;
> +
> +GLuint vertex_shaders[256];
> +unsigned num_vertex_shaders = 0;
> +GLuint fragment_shaders[256];
> +unsigned num_fragment_shaders = 0;
> +
> +/**
> + * List of strings loaded from files
> + *
> + * Some test script sections, such as "[vertex shader file]", can supply shader
> + * source code from multiple disk files. This array stores those strings.
> + */
> +
> +char *shader_strings[256];
> +GLsizei shader_string_sizes[256];
> +unsigned num_shader_strings = 0;
> +GLuint prog;
> +
> +enum states {
> + none = 0,
> + requirements,
> + vertex_shader,
> + vertex_shader_file,
> + vertex_program,
> + fragment_shader,
> + fragment_shader_file,
> + fragment_program,
> + test,
> +};
> +
> +
> +enum comparison {
> + equal = 0,
> + not_equal,
> + less,
> + greater_equal,
> + greater,
> + less_equal
> +};
> +
> +
> +void
> +compile_glsl(GLenum target, bool release_text)
> +{
> + GLuint shader = glCreateShader(target);
> + GLint ok;
> + unsigned i;
> +
> + glShaderSource(shader, num_shader_strings,
> + (const GLchar **) shader_strings, shader_string_sizes);
> +
> + glCompileShader(shader);
> +
> + glGetShaderiv(shader, GL_COMPILE_STATUS,&ok);
> +
> + if (!ok) {
> + GLchar *info;
> + GLint size;
> +
> + glGetShaderiv(shader, GL_INFO_LOG_LENGTH,&size);
> + info = malloc(size);
> +
> + glGetShaderInfoLog(shader, size, NULL, info);
> +
> + fprintf(stderr, "Failed to compile %s: %s\n",
> + target == GL_FRAGMENT_SHADER ? "FS" : "VS",
> + info);
> +
> + free(info);
> + piglit_report_result(PIGLIT_FAILURE);
> + }
> +
> + if (release_text) {
> + for (i = 0; i< num_shader_strings; i++)
> + free(shader_strings[i]);
> + }
> +
> + switch (target) {
> + case GL_VERTEX_SHADER:
> + vertex_shaders[num_vertex_shaders] = shader;
> + num_vertex_shaders++;
> + break;
> + case GL_FRAGMENT_SHADER:
> + fragment_shaders[num_fragment_shaders] = shader;
> + num_fragment_shaders++;
> + break;
> + }
> +}
> +
> +
> +/**
> + * Copy a string until either whitespace or the end of the string
> + */
> +const char *
> +strcpy_to_space(char *dst, const char *src)
> +{
> + while (!isspace(*src)&& (*src != '\0'))
> + *(dst++) = *(src++);
> +
> + *dst = '\0';
> + return src;
> +}
> +
> +
> +/**
> + * Skip over whitespace upto the end of line
> + */
> +const char *
> +eat_whitespace(const char *src)
> +{
> + while (isspace(*src)&& (*src != '\n'))
> + src++;
> +
> + return src;
> +}
> +
> +
> +/**
> + * Skip over non-whitespace upto the end of line
> + */
> +const char *
> +eat_text(const char *src)
> +{
> + while (!isspace(*src)&& (*src != '\0'))
> + src++;
> +
> + return src;
> +}
> +
> +
> +/**
> + * Compare two values given a specified comparison operator
> + */
> +bool
> +compare(float ref, float value, enum comparison cmp)
> +{
> + switch (cmp) {
> + case equal: return value == ref;
> + case not_equal: return value != ref;
> + case less: return value< ref;
> + case greater_equal: return value>= ref;
> + case greater: return value> ref;
> + case less_equal: return value<= ref;
> + }
> +
> + assert(!"Should not get here.");
> +}
> +
> +
> +/**
> + * Get the string representation of a comparison operator
> + */
> +const char *
> +comparison_string(enum comparison cmp)
> +{
> + switch (cmp) {
> + case equal: return "==";
> + case not_equal: return "!=";
> + case less: return "<";
> + case greater_equal: return ">=";
> + case greater: return ">";
> + case less_equal: return "<=";
> + }
> +
> + assert(!"Should not get here.");
> +}
> +
> +
> +void
> +load_shader_file(const char *line)
> +{
> + GLsizei *const size =&shader_string_sizes[num_shader_strings];
> + char buf[256];
> + char *text;
> +
> + strcpy_to_space(buf, line);
> +
> + text = piglit_load_text_file(buf, (unsigned *) size);
> + if ((text == NULL)&& (path != NULL)) {
> + const size_t len = strlen(path);
> +
> + memcpy(buf, path, len);
> + buf[len] = '/';
> + strcpy_to_space(&buf[len + 1], line);
> +
> + text = piglit_load_text_file(buf, (unsigned *) size);
> + }
> +
> + if (text == NULL) {
> + strcpy_to_space(buf, line);
> +
> + printf("could not load file \"%s\"\n", buf);
> + piglit_report_result(PIGLIT_FAILURE);
> + }
> +
> + shader_strings[num_shader_strings] = text;
> + num_shader_strings++;
> +}
> +
> +
> +/**
> + * Parse a binary comparison operator and return the matching token
> + */
> +const char *
> +process_comparison(const char *src, enum comparison *cmp)
> +{
> + char buf[32];
> +
> + switch (src[0]) {
> + case '=':
> + if (src[1] == '=') {
> + *cmp = equal;
> + return src + 2;
> + }
> + break;
> + case '<':
> + if (src[1] == '=') {
> + *cmp = less_equal;
> + return src + 2;
> + } else {
> + *cmp = less;
> + return src + 1;
> + }
> + case '>':
> + if (src[1] == '=') {
> + *cmp = greater_equal;
> + return src + 2;
> + } else {
> + *cmp = greater;
> + return src + 1;
> + }
> + case '!':
> + if (src[1] == '=') {
> + *cmp = not_equal;
> + return src + 2;
> + }
> + break;
> + }
> +
> + strncpy(buf, src, sizeof(buf));
> + buf[sizeof(buf) - 1] = '\0';
> + printf("invalid comparison in test script:\n%s\n", buf);
> + piglit_report_result(PIGLIT_FAILURE);
> +
> + /* Won't get here. */
> + return NULL;
> +}
> +
> +
> +/**
> + * Parse and check a line from the requirement section of the test
> + */
> +void
> +process_requirement(const char *line)
> +{
> + char buffer[4096];
> +
> + /* There are three types of requirements that a test can currently
> + * have:
> + *
> + * * Require that some GL extension be supported
> + * * Require some particular versions of GL
> + * * Require some particular versions of GLSL
> + *
> + * The tests for GL and GLSL versions can be equal, not equal,
> + * less, less-or-equal, greater, or greater-or-equal. Extension tests
> + * can also require that a particular extension not be supported by
> + * prepending ! to the extension name.
> + */
> + if (strncmp("GL_OES_", line, 7) == 0) {
> + strcpy_to_space(buffer, line + 7);
> + piglit_require_extension(buffer);
> + } else if (strncmp("!GL_OES_", line, 8) == 0) {
> + strcpy_to_space(buffer, line + 8);
> + piglit_require_not_extension(buffer);
> + } else if (strncmp("ESSL", line, 4) == 0) {
> + enum comparison cmp;
> + float version;
> +
> + line = eat_whitespace(line + 4);
> +
> + line = process_comparison(line,&cmp);
> +
> + version = strtod(line, NULL);
> + if (!compare(version, essl_version, cmp)) {
> + printf("Test requires GLSL ES version %s %.1f. "
> + "Actual version is %.1f.\n",
> + comparison_string(cmp),
> + version,
> + essl_version);
> + piglit_report_result(PIGLIT_SKIP);
> + }
> + } else if (strncmp("GLES", line, 4) == 0) {
> + enum comparison cmp;
> + float version;
> +
> + line = eat_whitespace(line + 4);
> +
> + line = process_comparison(line,&cmp);
> +
> + version = strtod(line, NULL);
> + if (!compare(version, gles_version, cmp)) {
> + printf("Test requires GL version %s %.1f. "
> + "Actual version is %.1f.\n",
> + comparison_string(cmp),
> + version,
> + gles_version);
> + piglit_report_result(PIGLIT_SKIP);
> + }
> + }
> +}
> +
> +
> +void
> +leave_state(enum states state, const char *line)
> +{
> + switch (state) {
> + case none:
> + break;
> +
> + case requirements:
> + break;
> +
> + case vertex_shader:
> + shader_string_sizes[0] = line - shader_strings[0];
> + num_shader_strings = 1;
> + compile_glsl(GL_VERTEX_SHADER, false);
> + break;
> +
> + case vertex_shader_file:
> + compile_glsl(GL_VERTEX_SHADER, true);
> + break;
> +
> + case vertex_program:
> + break;
> +
> + case fragment_shader:
> + shader_string_sizes[0] = line - shader_strings[0];
> + num_shader_strings = 1;
> + compile_glsl(GL_FRAGMENT_SHADER, false);
> + break;
> +
> + case fragment_shader_file:
> + compile_glsl(GL_FRAGMENT_SHADER, true);
> + break;
> +
> + case fragment_program:
> + break;
> +
> + case test:
> + break;
> +
> + default:
> + assert(!"Not yet supported.");
> + }
> +}
> +
> +
> +void
> +link_and_use_shaders(void)
> +{
> + unsigned i;
> + GLenum err;
> + GLint ok;
> +
> + if ((num_vertex_shaders == 0)
> +&& (num_fragment_shaders == 0))
> + return;
> +
> + prog = glCreateProgram();
> +
> + for (i = 0; i< num_vertex_shaders; i++) {
> + glAttachShader(prog, vertex_shaders[i]);
> + }
> +
> + for (i = 0; i< num_fragment_shaders; i++) {
> + glAttachShader(prog, fragment_shaders[i]);
> + }
> +
> + glLinkProgram(prog);
> +
> + for (i = 0; i< num_vertex_shaders; i++) {
> + glDeleteShader(vertex_shaders[i]);
> + }
> +
> + for (i = 0; i< num_fragment_shaders; i++) {
> + glDeleteShader(fragment_shaders[i]);
> + }
> +
> + glGetProgramiv(prog, GL_LINK_STATUS,&ok);
> + if (!ok) {
> + GLchar *info;
> + GLint size;
> +
> + glGetProgramiv(prog, GL_INFO_LOG_LENGTH,&size);
> + info = malloc(size);
> +
> + glGetProgramInfoLog(prog, size, NULL, info);
> +
> + fprintf(stderr, "Failed to link:\n%s\n",
> + info);
> +
> + free(info);
> + piglit_report_result(PIGLIT_FAILURE);
> + }
> +
> + glUseProgram(prog);
> +
> + err = glGetError();
> + if (err) {
> + GLchar *info;
> + GLint size;
> +
> + printf("GL error after linking program: 0x%04x\n", err);
> +
> + glGetProgramiv(prog, GL_INFO_LOG_LENGTH,&size);
> + info = malloc(size);
> +
> + glGetProgramInfoLog(prog, size, NULL, info);
> + fprintf(stderr, "Info log: %s\n", info);
> +
> + piglit_report_result(PIGLIT_FAILURE);
> + }
> +}
> +
> +
> +void
> +process_test_script(const char *script_name)
> +{
> + unsigned text_size;
> + char *text = piglit_load_text_file(script_name,&text_size);
> + enum states state = none;
> + const char *line = text;
> +
> + if (line == NULL) {
> + printf("could not read file \"%s\"\n", script_name);
> + piglit_report_result(PIGLIT_FAILURE);
> + }
> +
> + while (line[0] != '\0') {
> + if (line[0] == '[') {
> + leave_state(state, line);
> +
> + if (strncmp(line, "[require]", 9) == 0) {
> + state = requirements;
> + } else if (strncmp(line, "[vertex shader]", 15) == 0) {
> + state = vertex_shader;
> + shader_strings[0] = NULL;
> + } else if (strncmp(line, "[vertex shader file]", 20) == 0) {
> + state = vertex_shader_file;
> + shader_strings[0] = NULL;
> + num_shader_strings = 0;
> + } else if (strncmp(line, "[fragment shader]", 17) == 0) {
> + state = fragment_shader;
> + shader_strings[0] = NULL;
> + } else if (strncmp(line, "[fragment shader file]", 22) == 0) {
> + state = fragment_shader_file;
> + shader_strings[0] = NULL;
> + num_shader_strings = 0;
> + } else if (strncmp(line, "[test]", 6) == 0) {
> + test_start = strchrnul(line, '\n');
> + if (test_start[0] != '\0')
> + test_start++;
> + return;
> + }
> + } else {
> + switch (state) {
> + case none:
> + break;
> +
> + case requirements:
> + process_requirement(line);
> + break;
> +
> + case vertex_shader:
> + case vertex_program:
> + case fragment_shader:
> + case fragment_program:
> + if (shader_strings[0] == NULL)
> + shader_strings[0] = (char *) line;
> + break;
> +
> + case vertex_shader_file:
> + case fragment_shader_file:
> + line = eat_whitespace(line);
> + if ((line[0] != '\n')&& (line[0] != '#'))
> + load_shader_file(line);
> + break;
> +
> + case test:
> + break;
> + }
> + }
> +
> + line = strchrnul(line, '\n');
> + if (line[0] != '\0')
> + line++;
> + }
> +
> + leave_state(state, line);
> +}
> +
> +
> +void
> +get_floats(const char *line, float *f, unsigned count)
> +{
> + unsigned i;
> +
> + for (i = 0; i< count; i++)
> + f[i] = strtod(line, (char **)&line);
> +}
> +
> +void
> +set_uniform(const char *line)
> +{
> + char name[512];
> + float f[16];
> + GLuint prog;
> + GLint loc;
> + const char *type;
> +
> + glGetIntegerv(GL_CURRENT_PROGRAM, (GLint *)&prog);
> +
> + type = eat_whitespace(line);
> + line = eat_text(type);
> +
> + line = strcpy_to_space(name, eat_whitespace(line));
> + loc = glGetUniformLocation(prog, name);
> + if (loc< 0) {
> + printf("cannot get location of uniform \"%s\"\n",
> + name);
> + piglit_report_result(PIGLIT_FAILURE);
> + }
> +
> + if (strncmp("float", type, 5) == 0) {
> + get_floats(line, f, 1);
> + glUniform1fv(loc, 1, f);
> + return;
> + } else if (strncmp("int", type, 3) == 0) {
> + int val = atoi(line);
> + glUniform1i(loc, val);
> + return;
> + } else if (strncmp("vec", type, 3) == 0) {
> + switch (type[3]) {
> + case '2':
> + get_floats(line, f, 2);
> + glUniform2fv(loc, 1, f);
> + return;
> + case '3':
> + get_floats(line, f, 3);
> + glUniform3fv(loc, 1, f);
> + return;
> + case '4':
> + get_floats(line, f, 4);
> + glUniform4fv(loc, 1, f);
> + return;
> + }
> + }
> +
> + strcpy_to_space(name, type);
> + printf("unknown uniform type \"%s\"", name);
> + piglit_report_result(PIGLIT_FAILURE);
> +
> + return;
> +}
> +
> +static GLboolean
> +string_match(const char *string, const char *line)
> +{
> + return (strncmp(string, line, strlen(string)) == 0);
> +}
> +
> +enum piglit_result
> +piglit_egl_display(void)
> +{
> + const char *line;
> + bool pass = true;
> + GLbitfield clear_bits = 0;
> +
> + if (test_start == NULL)
> + return PIGLIT_SUCCESS;
> +
> + line = test_start;
> + while (line[0] != '\0') {
> + float c[32];
> + int x, y, w, h, tex, level;
> +
> + line = eat_whitespace(line);
> +
> + if (string_match("clear color", line)) {
> + get_floats(line + 11, c, 4);
> + glClearColor(c[0], c[1], c[2], c[3]);
> + clear_bits |= GL_COLOR_BUFFER_BIT;
> + } else if (string_match("clear", line)) {
> + glClear(clear_bits);
> + } else if (string_match("draw rect", line)) {
> + get_floats(line + 9, c, 4);
> + piglit_draw_rect(c[0], c[1], c[2], c[3]);
> + } else if (string_match("probe rgba", line)) {
> + get_floats(line + 10, c, 6);
> + if (!piglit_probe_pixel_rgba((int) c[0], (int) c[1],
> +& c[2])) {
> + pass = false;
> + }
> + } else if (sscanf(line,
> + "relative probe rgba ( %f , %f ) "
> + "( %f , %f , %f , %f )",
> + c + 0, c + 1,
> + c + 2, c + 3, c + 4, c + 5) == 6) {
> + x = c[0] * piglit_width;
> + y = c[1] * piglit_width;
> + if (x>= piglit_width)
> + x = piglit_width - 1;
> + if (y>= piglit_height)
> + y = piglit_height - 1;
> +
> + if (!piglit_probe_pixel_rgba(x, y,&c[2])) {
> + pass = false;
> + }
> + } else if (string_match("probe rgb", line)) {
> + get_floats(line + 9, c, 5);
> + if (!piglit_probe_pixel_rgb((int) c[0], (int) c[1],
> +& c[2])) {
> + pass = false;
> + }
> + } else if (sscanf(line,
> + "relative probe rgb ( %f , %f ) "
> + "( %f , %f , %f )",
> + c + 0, c + 1,
> + c + 2, c + 3, c + 4) == 5) {
> + x = c[0] * piglit_width;
> + y = c[1] * piglit_width;
> + if (x>= piglit_width)
> + x = piglit_width - 1;
> + if (y>= piglit_height)
> + y = piglit_height - 1;
> +
> + if (!piglit_probe_pixel_rgb(x, y,&c[2])) {
> + pass = false;
> + }
> + } else if (string_match("probe all rgba", line)) {
> + get_floats(line + 14, c, 4);
> + pass = pass&&
> + piglit_probe_rect_rgba(0, 0, piglit_width,
> + piglit_height, c);
> + } else if (string_match("probe all rgb", line)) {
> + get_floats(line + 13, c, 3);
> + pass = pass&&
> + piglit_probe_rect_rgb(0, 0, piglit_width,
> + piglit_height, c);
> + } else if (sscanf(line,
> + "texture rgbw %d ( %d , %d )",
> +&tex,&w,&h) == 3) {
> + glActiveTexture(GL_TEXTURE0 + tex);
> + piglit_rgbw_texture(GL_RGBA, w, h, GL_FALSE, GL_FALSE);
> + glEnable(GL_TEXTURE_2D);
> + } else if (sscanf(line,
> + "texture checkerboard %d %d ( %d , %d ) "
> + "( %f , %f , %f , %f ) "
> + "( %f , %f , %f , %f )",
> +&tex,&level,&w,&h,
> + c + 0, c + 1, c + 2, c + 3,
> + c + 4, c + 5, c + 6, c + 7) == 12) {
> + glActiveTexture(GL_TEXTURE0 + tex);
> + piglit_checkerboard_texture(0, level,
> + w, h,
> + w / 2, h / 2,
> + c + 0, c + 4);
> + glEnable(GL_TEXTURE_2D);
> + } else if (string_match("uniform", line)) {
> + set_uniform(line + 7);
> + } else if ((line[0] != '\n')&& (line[0] != '\0')
> +&& (line[0] != '#')) {
> + printf("unknown command \"%s\"", line);
> + piglit_report_result(PIGLIT_FAILURE);
> + }
> +
> + line = strchrnul(line, '\n');
> + if (line[0] != '\0')
> + line++;
> + }
> +
> + /* XXX eglutSwapBuffers() */
> +
> + if (piglit_automatic) {
> + /* Free our resources, useful for valgrinding. */
> + glDeleteProgram(prog);
> + glUseProgram(0);
> + }
> + return pass ? PIGLIT_SUCCESS : PIGLIT_FAILURE;
> +}
> +
> +
> +void
> +piglit_egl_init(int argc, char **argv)
> +{
> + const char *essl_version_string;
> +
> + /* OpenGL ES version string is in the form of :
> + * OpenGL<space>ES<space><version number><space><vendor-specific information>
> + */
> + gles_version = strtod((char *) glGetString(GL_VERSION)+10, NULL);
> +
> + essl_version_string = (char *)
> + glGetString(GL_SHADING_LANGUAGE_VERSION);
> +
> + /* OpenGL ES SHADING_LANGUAGE_VERSION string is in the form of :
> + * OpenGL<space>ES<space><GLSL><space>ES<space><version number><space>
> + *<vendor-specific information>
> + */
> + essl_version = (essl_version_string == NULL)
> + ? 0.0 : strtod(essl_version_string+18, NULL);
> +
> + if (argc> 2)
> + path = argv[2];
> +
> + process_test_script(argv[1]);
> + link_and_use_shaders();
> +}
> --
> 1.7.2.3
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH] KVM Test: Set bootstatuspolicy to ignoreallfailures for Win2008 and r2 in autounattend.xml
From: Michael Goldish @ 2010-10-20 8:49 UTC (permalink / raw)
To: Feng Yang; +Cc: autotest, kvm
In-Reply-To: <1287554006-13373-1-git-send-email-fyang@redhat.com>
On 10/20/2010 07:53 AM, Feng Yang wrote:
> Windows 2008 image is easy to go to startup repair screen, which make
> many of our cases fail. This patch will disable startup repair screen
> in win2008 which caused by shutdown failures.
>
> Signed-off-by: Feng Yang <fyang@redhat.com>
Shouldn't it be easier to add the line to setuprss.bat? Or do you
specifically want to target win2008?
> .../kvm/unattended/win2008-32-autounattend.xml | 10 +++++++---
> .../kvm/unattended/win2008-64-autounattend.xml | 10 +++++++---
> .../kvm/unattended/win2008-r2-autounattend.xml | 10 +++++++---
> 3 files changed, 21 insertions(+), 9 deletions(-)
>
> diff --git a/client/tests/kvm/unattended/win2008-32-autounattend.xml b/client/tests/kvm/unattended/win2008-32-autounattend.xml
> index 89af07f..7e8e160 100644
> --- a/client/tests/kvm/unattended/win2008-32-autounattend.xml
> +++ b/client/tests/kvm/unattended/win2008-32-autounattend.xml
> @@ -149,16 +149,20 @@
> <Order>5</Order>
> </SynchronousCommand>
> <SynchronousCommand wcm:action="add">
> + <CommandLine>%WINDIR%\System32\cmd /c bcdedit /set {current} bootstatuspolicy ignoreallfailures</CommandLine>
> + <Order>6</Order>
> + </SynchronousCommand>
> + <SynchronousCommand wcm:action="add">
> <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
> - <Order>6</Order>
> + <Order>7</Order>
> </SynchronousCommand>
> <SynchronousCommand wcm:action="add">
> <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
> - <Order>7</Order>
> + <Order>8</Order>
> </SynchronousCommand>
> <SynchronousCommand wcm:action="add">
> <CommandLine>%WINDIR%\System32\cmd /c ping 10.0.2.2 -n 20 && A:\finish.exe</CommandLine>
> - <Order>8</Order>
> + <Order>9</Order>
> </SynchronousCommand>
> </FirstLogonCommands>
> <OOBE>
> diff --git a/client/tests/kvm/unattended/win2008-64-autounattend.xml b/client/tests/kvm/unattended/win2008-64-autounattend.xml
> index 98f5589..fce6582 100644
> --- a/client/tests/kvm/unattended/win2008-64-autounattend.xml
> +++ b/client/tests/kvm/unattended/win2008-64-autounattend.xml
> @@ -158,17 +158,21 @@
> <Order>5</Order>
> </SynchronousCommand>
> <SynchronousCommand wcm:action="add">
> - <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
> + <CommandLine>%WINDIR%\System32\cmd /c bcdedit /set {current} bootstatuspolicy ignoreallfailures</CommandLine>
> <Order>6</Order>
> </SynchronousCommand>
> <SynchronousCommand wcm:action="add">
> - <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
> + <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
> <Order>7</Order>
> </SynchronousCommand>
> <SynchronousCommand wcm:action="add">
> - <CommandLine>%WINDIR%\System32\cmd /c ping 10.0.2.2 -n 20 && A:\finish.exe</CommandLine>
> + <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
> <Order>8</Order>
> </SynchronousCommand>
> + <SynchronousCommand wcm:action="add">
> + <CommandLine>%WINDIR%\System32\cmd /c ping 10.0.2.2 -n 20 && A:\finish.exe</CommandLine>
> + <Order>9</Order>
> + </SynchronousCommand>
> </FirstLogonCommands>
> <OOBE>
> <HideEULAPage>true</HideEULAPage>
> diff --git a/client/tests/kvm/unattended/win2008-r2-autounattend.xml b/client/tests/kvm/unattended/win2008-r2-autounattend.xml
> index b624d10..948e9a1 100644
> --- a/client/tests/kvm/unattended/win2008-r2-autounattend.xml
> +++ b/client/tests/kvm/unattended/win2008-r2-autounattend.xml
> @@ -158,17 +158,21 @@
> <Order>5</Order>
> </SynchronousCommand>
> <SynchronousCommand wcm:action="add">
> - <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
> + <CommandLine>%WINDIR%\System32\cmd /c bcdedit /set {current} bootstatuspolicy ignoreallfailures</CommandLine>
> <Order>6</Order>
> </SynchronousCommand>
> <SynchronousCommand wcm:action="add">
> - <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
> + <CommandLine>%WINDIR%\System32\cmd /c E:\setuprss.bat</CommandLine>
> <Order>7</Order>
> </SynchronousCommand>
> <SynchronousCommand wcm:action="add">
> - <CommandLine>%WINDIR%\System32\cmd /c ping 10.0.2.2 -n 20 && A:\finish.exe</CommandLine>
> + <CommandLine>%WINDIR%\System32\cmd /c netsh interface ip set address "Local Area Connection" dhcp</CommandLine>
> <Order>8</Order>
> </SynchronousCommand>
> + <SynchronousCommand wcm:action="add">
> + <CommandLine>%WINDIR%\System32\cmd /c ping 10.0.2.2 -n 20 && A:\finish.exe</CommandLine>
> + <Order>9</Order>
> + </SynchronousCommand>
> </FirstLogonCommands>
> <OOBE>
> <HideEULAPage>true</HideEULAPage>
^ permalink raw reply
* net{space,xbig} TCLK determination
From: Simon Guinot @ 2010-10-20 8:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20101020050820.GD12979@mail.wantstofly.org>
Hi Lennert,
On Wed, Oct 20, 2010 at 07:08:20AM +0200, Lennert Buytenhek wrote:
> Hi,
>
> The net{space,xbig} board support files have this:
>
> static void netspace_v2_timer_init(void)
> {
> kirkwood_tclk = 166666667;
> orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
> }
>
> This is a pretty ugly hack -- if kirkwood_find_tclk() is not
> determining the right TCLK on these boards, then that would be the
> real bug, and it should be fixed there, and not by putting hacks
> like these in board support files.
In the Marvell LSP, TCLK detection is based on the Sample at Reset
Register bit 21. There is no description about this bit usage in the
Kirkwood functional specification document.
The given result _seems_ to be correct for the boards on my desk, but
I have no idea how this way is reliable...
I simply don't have the needed platform knowledge to solve this issue.
So, if you want me to fix kirkwood_find_tclk(), you will have to give
more hints.
The lacie_v2_timer_init() function is maybe a ugly hack but that is
the only I found. My concern was to avoid breaking TCLK detection for
other boards.
Thanks,
Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101020/a2471756/attachment.sig>
^ permalink raw reply
* Re: [PATCH v2 3/3] drivers: cleanup Kconfig stuff
From: felipe.contreras @ 2010-10-20 8:47 UTC (permalink / raw)
To: Kevin Hilman
Cc: Tony Lindgren, Felipe Balbi, balbi, linux-usb, linux-omap,
linux-main, Greg KH
In-Reply-To: <87fww1u3fw.fsf@deeprootsystems.com>
On Wed, Oct 20, 2010 at 3:13 AM, Kevin Hilman
<khilman@deeprootsystems.com> wrote:
> Tony Lindgren <tony@atomide.com> writes:
>> So if you have something that's needed on almost every omap,
>> you can select it there.
>
> One thing I don't like about this is that there is currently no way to
> 'select' as a module.
>
> In order to get to a minimal kernel, in theory, we don't need regulator,
> i2c, MFD, or twl4030* built in. They should all be built as modules.
> Yes, there are some assumptions made today that some of these things are
> built in, and then are used from init code, but that is broken.
>
> If someone is looking for a good omap-kernel-janitors project, I would
> suggest getting to a *really* minimal OMAP2+ kernel with everything
> possible built as modules to be a very good project.
Yes, one use-case would be to select things as modules by default only
if ARCH_OMAP2PLUS_TYPICAL is selected.
But not everyone needs many of these things, I expect to be able to do
ARCH_OMAP2PLUS_TYPICAL=n, and manually enable USB stuff
USB_MUSB_HDRC=y, without having to know the dependencies myself.
That was the idea: simplify the defconfigs so that they are truly
minimal (they boot), and then people can add whatever they need (like
USB).
--
Felipe Contreras
^ permalink raw reply
* RE: [PATCH 1/1] Add Sim Access Plugin
From: Waldemar.Rymarkiewicz @ 2010-10-20 8:47 UTC (permalink / raw)
To: suraj
Cc: linux-bluetooth, marcel, Suraj.Sumangala, johan.hedberg,
joakim.xj.ceder, arunkr.singh
In-Reply-To: <4CBEAA45.4010702@Atheros.com>
Hi Suraj,
>> create mode 100644 sap/sap-ste.c
>I am assuming that this is the ST specific plugin. May be you=20
>can just keep the dummy plugin only so that someone can use=20
>that as a reference.
In fact, you are right. Will remove this for the time being.=20
>> create mode 100644 sap/sap.h
>> create mode 100644 sap/server.c
>> create mode 100644 sap/server.h
>
>I guess it would be better if you can split this into multiple=20
>patches so that it would be easier to review.
Ok.=20
Regards,
/Waldek
^ permalink raw reply
* Re: [PATCHv4 4/4] iommu: create new api to set valid da range
From: Hiroshi DOYU @ 2010-10-20 8:45 UTC (permalink / raw)
To: felipe.contreras
Cc: x0095840, felipe.contreras, david.cohen, linux-kernel, linux-omap
In-Reply-To: <AANLkTimSQabHv3AOFFR4m3POjmuGvN18u7TNsPyauH8D@mail.gmail.com>
From: "ext felipe.contreras@gmail.com" <felipe.contreras@gmail.com>
Subject: Re: [PATCHv4 4/4] iommu: create new api to set valid da range
Date: Wed, 20 Oct 2010 10:35:50 +0200
> On Wed, Oct 20, 2010 at 5:48 AM, Fernando Guzman Lugo <x0095840@ti.com> wrote:
>> Some IOMMUs cannot use the whole 0x0 - 0xFFFFFFFF range.
>> With this new API the valid range can be set.
>>
>> Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
>
> I don't see the point in having an API. It could be done through
> platform data, and the usage of 0xFFFFF000 instead of ULONG_MAX is
> independent of this.
Using platform data is better, but why dropping da_end?
^ permalink raw reply
* Re: [PATCH 2/2] Revert napi_poll fix for bonding driver
From: David Miller @ 2010-10-20 8:45 UTC (permalink / raw)
To: amwang; +Cc: nhorman, netdev, bonding-devel, fubar, andy
In-Reply-To: <4CBE9FA0.6010900@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Wed, 20 Oct 2010 15:52:00 +0800
> On 10/20/10 01:04, nhorman@tuxdriver.com wrote:
>> Signed-off-by: Neil Horman<nhorman@tuxdriver.com>
...
> Reviewed-by: WANG Cong <amwang@redhat.com>
Also applied, thanks.
^ permalink raw reply
* Re: [PATCH 1/2] Remove netpoll blocking from uninit path
From: David Miller @ 2010-10-20 8:45 UTC (permalink / raw)
To: amwang; +Cc: nhorman, netdev, bonding-devel, fubar, andy
In-Reply-To: <4CBE9E7F.60107@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Wed, 20 Oct 2010 15:47:11 +0800
> On 10/20/10 01:04, nhorman@tuxdriver.com wrote:
>> From: Neil Horman<nhorman@tuxdriver.com>
>>
>> Some recent testing in netpoll with bonding showed this backtrace
...
>> Signed-off-by: Neil Horman<nhorman@tuxdriver.com>
>
> Reviewed-by: WANG Cong <amwang@redhat.com>
Applied.
Neil, please add proper subsystem prefixes to your subject
lines, I've had to add them by hand as I add your patches.
Thanks.
^ permalink raw reply
* Re: Compat-wireless N900
From: Grazvydas Ignotas @ 2010-10-20 8:44 UTC (permalink / raw)
To: George
Cc: Luciano Coelho, Luis R. Rodriguez, Bob Copeland,
Denis 'GNUtoo' Carikli, linux-wireless@vger.kernel.org
In-Reply-To: <4CBE9C4F.7050806@gmx.net>
On Wed, Oct 20, 2010 at 10:37 AM, George <george.news@gmx.net> wrote:
> On 19/10/2010 17:18, Grazvydas Ignotas wrote:
>>>
>>> I have also set the debug ALL mode to see if I get something that can
>>> help
>>> you out on finding the problem.
>>>
>>> When uploading only wl1251 nothing appears in dmesg. But when uploading
>>> module spi, I got the following info: http://pastebin.com/ysdTSDnB
>>
>> You need both wl1251 and spi. This is normal output, you should get
>> wlan0 interface at this point.
>> --
>
> Yes, that is what I was expecting from the begining but although phy0 should
> appear in /sys/class/ieee80211, this directory is empty :(
Hm, maybe try enabling CONFIG_MAC80211_DEBUG* stuff in config.mk in
compat_wireless.
^ permalink raw reply
* Re: [PATCH 2/2]x86: spread tlb flush vector between nodes
From: Shaohua Li @ 2010-10-20 8:44 UTC (permalink / raw)
To: Andi Kleen; +Cc: lkml, Ingo Molnar, hpa@zytor.com, Chen, Tim C
In-Reply-To: <20101020073027.GA20124@basil.fritz.box>
On Wed, 2010-10-20 at 15:30 +0800, Andi Kleen wrote:
> Hi Shaohua,
>
> > + if (nr_online_nodes > NUM_INVALIDATE_TLB_VECTORS)
> > + nr_node_vecs = 1;
> > + else
> > + nr_node_vecs = NUM_INVALIDATE_TLB_VECTORS/nr_online_nodes;
>
> Does this build without CONFIG_NUMA? AFAIK nr_online_nodes is only
> defined for a numa kernel.
yes it's ok without CONFIG_NUMA
> > +
> > +static int tlb_cpuhp_notify(struct notifier_block *n,
> > + unsigned long action, void *hcpu)
> > +{
> > + switch (action & 0xf) {
> > + case CPU_ONLINE:
> > + case CPU_DEAD:
> > + calculate_tlb_offset();
>
> I still think the notifier is overkill and a static mapping at boot time
> would be fine.
this hasn't much overhead, so please keep it. I'm afraid static mapping
calculation for hotplug cpu will introduce more complex.
^ permalink raw reply
* Re: Context settings after ssh login
From: imsand @ 2010-10-20 8:42 UTC (permalink / raw)
To: Justin P. Mattock; +Cc: imsand, Daniel J Walsh, Chad Sellers, selinux
In-Reply-To: <4CBDC997.6030800@gmail.com>
> On 10/19/2010 08:47 AM, imsand@puzzle.ch wrote:
>>> On 10/19/2010 07:42 AM, imsand@puzzle.ch wrote:
>>>>> On 10/07/2010 09:11 AM, Daniel J Walsh wrote:
>>>>>
>>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>>> Hash: SHA1
>>>>>>
>>>>>> On 10/07/2010 10:40 AM, Chad Sellers wrote:
>>>>>>
>>>>>>> On 10/6/10 3:29 AM, "imsand@puzzle.ch"<imsand@puzzle.ch> wrote:
>>>>>>>
>>>>>>>
>>>>>>>>> On 10/05/2010 11:43 PM, imsand@puzzle.ch wrote:
>>>>>>>>>
>>>>>>>>>>> On 10/05/2010 06:38 AM, imsand@puzzle.ch wrote:
>>>>>>>>>>>
>>>>>>>>>>>>> On 10/04/2010 11:30 PM, imsand@puzzle.ch wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On 10/04/2010 01:03 AM, imsand@puzzle.ch wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hello
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I'm working on SUSE SLES11SP1 and encounter the following
>>>>>>>>>>>>>>>> problem.
>>>>>>>>>>>>>>>> Setting the context of the User after ssh login doesn't
>>>>>>>>>>>>>>>> work
>>>>>>>>>>>>>>>> if
>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>> SELinux Username and the Linux Username aren't identical.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> --------------
>>>>>>>>>>>>>>>> Here is an example (SElinux User=mat_u, Linux User=mat_u):
>>>>>>>>>>>>>>>> Oct 4 09:41:54 testsrv.example sshd[15829]: Accepted
>>>>>>>>>>>>>>>> keyboard-interactive/pam for mat_u from 131.102.233.125
>>>>>>>>>>>>>>>> port
>>>>>>>>>>>>>>>> 54714
>>>>>>>>>>>>>>>> ssh2
>>>>>>>>>>>>>>>> Oct 4 09:41:54 testsrv.example sshd[15829]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> Open Session
>>>>>>>>>>>>>>>> Oct 4 09:41:54 testsrv.example sshd[15829]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> Open Session
>>>>>>>>>>>>>>>> Oct 4 09:41:54 testsrv.example sshd[15829]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> Username= mat_u SELinux User = user_u Level= (null)
>>>>>>>>>>>>>>>> Oct 4 09:41:54 testsrv.example sshd[15829]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> set mat_u security context to user_u:user_r:user_t
>>>>>>>>>>>>>>>> Oct 4 09:41:54 testsrv.example sshd[15829]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> set mat_u key creation context to user_u:user_r:user_t
>>>>>>>>>>>>>>>> ---
>>>>>>>>>>>>>>>> mat_u@testsrv.example:~> id
>>>>>>>>>>>>>>>> uid=6575(mat_u) gid=100(users)
>>>>>>>>>>>>>>>> groups=16(dialout),33(video),100(users)
>>>>>>>>>>>>>>>> context=mat_u:staff_r:staff_t
>>>>>>>>>>>>>>>> mat_u@testsrv.example:~> newrole -r sysadm_r
>>>>>>>>>>>>>>>> mat_u@testsrv.example:~> id
>>>>>>>>>>>>>>>> uid=6575(mat_u) gid=100(users)
>>>>>>>>>>>>>>>> groups=16(dialout),33(video),100(users)
>>>>>>>>>>>>>>>> context=mat_u:sysadm_r:sysadm_t
>>>>>>>>>>>>>>>> --------------------
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> So, this is okey. The user's context after login is
>>>>>>>>>>>>>>>> "mat_u:staff_r:staff_t"
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> But, if the Linux User is different from the SELinux User,
>>>>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>> default
>>>>>>>>>>>>>>>> user's will be chosen instead.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Here is the example (SELinux User=mat_u, Linux User=mat):
>>>>>>>>>>>>>>>> ---------------------
>>>>>>>>>>>>>>>> Oct 4 09:46:22 testsrv.example sshd[16185]: Accepted
>>>>>>>>>>>>>>>> keyboard-interactive/pam for mat from 131.102.233.125 port
>>>>>>>>>>>>>>>> 54726
>>>>>>>>>>>>>>>> ssh2
>>>>>>>>>>>>>>>> Oct 4 09:46:22 testsrv.example sshd[16185]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> Open Session
>>>>>>>>>>>>>>>> Oct 4 09:46:22 testsrv.example sshd[16185]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> Open Session
>>>>>>>>>>>>>>>> Oct 4 09:46:22 testsrv.example sshd[16185]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> Username= mat SELinux User = mat_u Level= (null)
>>>>>>>>>>>>>>>> Oct 4 09:46:22 testsrv.example sshd[16185]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> set mat security context to mat_u:staff_r:staff_t
>>>>>>>>>>>>>>>> Oct 4 09:46:22 testsrv.example sshd[16185]:
>>>>>>>>>>>>>>>> pam_selinux(sshd:session):
>>>>>>>>>>>>>>>> set mat key creation context to mat_u:staff_r:staff_t
>>>>>>>>>>>>>>>> ---
>>>>>>>>>>>>>>>> mat_u@testsrv.example:~> id
>>>>>>>>>>>>>>>> uid=6575(mat) gid=100(users)
>>>>>>>>>>>>>>>> groups=16(dialout),33(video),100(users)
>>>>>>>>>>>>>>>> context=user_u:user_r:user_t
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> mat_u@testsrv.example:~> newrole -r sysadm_r
>>>>>>>>>>>>>>>> user_u:sysadm_r:sysadm_t is not a valid context
>>>>>>>>>>>>>>>> ---------------------
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> As you can see, the pam_selinux module recognizes that the
>>>>>>>>>>>>>>>> new
>>>>>>>>>>>>>>>> context
>>>>>>>>>>>>>>>> should be "mat_u:staff_r:staff_t", but for some reason the
>>>>>>>>>>>>>>>> real
>>>>>>>>>>>>>>>> context
>>>>>>>>>>>>>>>> is
>>>>>>>>>>>>>>>> user_u:user_r:user_t. Changing the context with newrole
>>>>>>>>>>>>>>>> doesn't
>>>>>>>>>>>>>>>> work
>>>>>>>>>>>>>>>> either...
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> The user mappings should be okey:
>>>>>>>>>>>>>>>> ------
>>>>>>>>>>>>>>>> semanage user -l | grep mat
>>>>>>>>>>>>>>>> mat_u staff_r sysadm_r
>>>>>>>>>>>>>>>> testsrv.example:~ # semanage login -l | grep mat
>>>>>>>>>>>>>>>> mat
>>>>>>>>>>>>>>>> -------
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Any idea out there? Do I miss something?
>>>>>>>>>>>>>>>> kind regards
>>>>>>>>>>>>>>>> Matthias
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>> This message was distributed to subscribers of the selinux
>>>>>>>>>>>>>>>> mailing
>>>>>>>>>>>>>>>> list.
>>>>>>>>>>>>>>>> If you no longer wish to subscribe, send mail to
>>>>>>>>>>>>>>>> majordomo@tycho.nsa.gov
>>>>>>>>>>>>>>>> with
>>>>>>>>>>>>>>>> the words "unsubscribe selinux" without quotes as the
>>>>>>>>>>>>>>>> message.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> you can specify the context in
>>>>>>>>>>>>>>> /etc/selinux/policy/contexts/users/whatroleyouused
>>>>>>>>>>>>>>> (under sshd) I normally set user_r:user_t:s0
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Justin P. Mattock
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>> This message was distributed to subscribers of the selinux
>>>>>>>>>>>>>>> mailing
>>>>>>>>>>>>>>> list.
>>>>>>>>>>>>>>> If you no longer wish to subscribe, send mail to
>>>>>>>>>>>>>>> majordomo@tycho.nsa.gov
>>>>>>>>>>>>>>> with
>>>>>>>>>>>>>>> the words "unsubscribe selinux" without quotes as the
>>>>>>>>>>>>>>> message.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>> The file looks like:
>>>>>>>>>>>>>> cat /etc/selinux/refpolicy/contexts/users/mat_u
>>>>>>>>>>>>>> system_r:local_login_t staff_r:staff_t sysadm_r:sysadm_t
>>>>>>>>>>>>>> system_r:remote_login_t staff_r:staff_t
>>>>>>>>>>>>>> system_r:sshd_t staff_r:staff_t sysadm_r:sysadm_t
>>>>>>>>>>>>>> system_r:crond_t staff_r:cronjob_t
>>>>>>>>>>>>>> system_r:xdm_t staff_r:staff_t
>>>>>>>>>>>>>> staff_r:staff_su_t staff_r:staff_t
>>>>>>>>>>>>>> staff_r:staff_sudo_t staff_r:staff_t
>>>>>>>>>>>>>> sysadm_r:sysadm_su_t sysadm_r:sysadm_t
>>>>>>>>>>>>>> sysadm_r:sysadm_sudo_t sysadm_r:sysadm_t
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> So, theoretical this should be okey, isn't it?
>>>>>>>>>>>>>> And as you can see in the log from above (set mat key
>>>>>>>>>>>>>> creation
>>>>>>>>>>>>>> context
>>>>>>>>>>>>>> to
>>>>>>>>>>>>>> mat_u:staff_r:staff_t) it "tries" to switch to staff but for
>>>>>>>>>>>>>> some
>>>>>>>>>>>>>> reason
>>>>>>>>>>>>>> it doesn't work..
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>> if your sshd'ing and the context is staff_r:staff_t then it's
>>>>>>>>>>>>> correct,
>>>>>>>>>>>>> I
>>>>>>>>>>>>> usually change this to user_r:user_t just cause I'm paranoid.
>>>>>>>>>>>>> Also there is some options that you can set in /etc/pam.d to
>>>>>>>>>>>>> do
>>>>>>>>>>>>> other
>>>>>>>>>>>>> checks etc..
>>>>>>>>>>>>>
>>>>>>>>>>>>> Justin P. Mattock
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>> no it's not and that't the problem:)
>>>>>>>>>>>> If I sshd'ing with mat_u it's always "user_r:user_t" even
>>>>>>>>>>>> "staff_r:staff_t" is specified (see above). But it's correct
>>>>>>>>>>>> if
>>>>>>>>>>>> the
>>>>>>>>>>>> selinux and linux users are named equaly (mat in the example).
>>>>>>>>>>>> It seems that something with the context settings and
>>>>>>>>>>>> usermapping
>>>>>>>>>>>> isn't
>>>>>>>>>>>> correct. Do you see the problem?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Somewhere in the policy it is set to default to user_r for
>>>>>>>>>>> sshd,
>>>>>>>>>>> I
>>>>>>>>>>> dont
>>>>>>>>>>> think there is a boolean(but could be wrong)for that feature.
>>>>>>>>>>> maybe
>>>>>>>>>>> it's
>>>>>>>>>>> reading the default_contexts file which is set to use
>>>>>>>>>>> user_r:user_t
>>>>>>>>>>> instead of reading mat_u for sshd(staff_r:staff_t)
>>>>>>>>>>>
>>>>>>>>>>> Justin P. Mattock
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> Unfortunately I can't see a rule doing this. The curious thing
>>>>>>>>>> is,
>>>>>>>>>> that
>>>>>>>>>> it
>>>>>>>>>> works if the selinux user and the linux user are equivalent
>>>>>>>>>> (both
>>>>>>>>>> mat_u).
>>>>>>>>>> But it does NOT work if it is mat (linux user) and mapped to
>>>>>>>>>> mat_u
>>>>>>>>>> (selinux user).
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> hmm.. something seems configured wrong, what OS are you using? do
>>>>>>>>> you
>>>>>>>>> have semanage login/user -l set up correctly?
>>>>>>>>>
>>>>>>>>> over here I build the policy from git, normally edit policy/users
>>>>>>>>> (add)
>>>>>>>>> gen_user(name,system_u, sysadm_r staff_r user_r, s0, s0 -
>>>>>>>>> mls_systemhigh, mcs_allcats)
>>>>>>>>>
>>>>>>>>> then after the policy is built and installed/loaded I do
>>>>>>>>> semanage login -a -s name name (create name in contexts/users)
>>>>>>>>> (or skip the above and just use semanage -a -s user_u name)
>>>>>>>>>
>>>>>>>>> seems sshd works with the given context I specify(user_r) then if
>>>>>>>>> I
>>>>>>>>> want
>>>>>>>>> to add more options I adjust /etc/pam.d/*
>>>>>>>>>
>>>>>>>>> Justin P. Mattock
>>>>>>>>>
>>>>>>>>>
>>>>>>>> Thanks for your reply.
>>>>>>>> I'm using SLES 11 SP1. It wouldn't be the first bug regarding
>>>>>>>> SELinux
>>>>>>>> on
>>>>>>>> this distro... ;)
>>>>>>>> Here is what I've done so far.
>>>>>>>> - Downloaded the latest reference policy from tresys
>>>>>>>> - Compiled and installed it on my sles 11.1
>>>>>>>> - Add selinux user mat_u: "semanage user -R "staff_r system_r" -P
>>>>>>>> user
>>>>>>>> -a
>>>>>>>> mat_u"
>>>>>>>> - Add linux user mat: "useradd mat"
>>>>>>>> - Set password for mat: "passwd mat"
>>>>>>>> - User mapping: "semanage login -s mat_u -a mat"
>>>>>>>> - add security context for mat_u by copying staff_u's context
>>>>>>>> "cp /etc/selinux/refpolicy/contexts/user/staff_u
>>>>>>>> /etc/selinux/refpolicy/contexts/user/mat_u"
>>>>>>>> - set boolean for sysadm ssh login to true: "setsebool -P
>>>>>>>> ssh_sysadm_login
>>>>>>>> on"
>>>>>>>>
>>>>>>>> Do you know good debug options for tracing where it stucks?
>>>>>>>>
>>>>>>>>
>>>>>>> When debugging login-type programs figuring out the context to
>>>>>>> transition
>>>>>>> to, there are a couple of simple useful utilities in
>>>>>>> libselinux/utils.
>>>>>>> These
>>>>>>> are getconlist and getdefaultcon. Most distros won't install these
>>>>>>> (as
>>>>>>> they're just debugging tools), but you can build them yourself out
>>>>>>> of
>>>>>>> the
>>>>>>> tree.
>>>>>>>
>>>>>>> getconlist will print out the contexts returned by
>>>>>>> get_ordered_context_list(), which are all the reachable contexts.
>>>>>>> This
>>>>>>> could
>>>>>>> tell you if the problem is that the context you're trying to
>>>>>>> transition
>>>>>>> to
>>>>>>> is for some reason unreachable.
>>>>>>>
>>>>>>> getdefaultcon can tell you (in verbose mode) the default seuser and
>>>>>>> level
>>>>>>> returned by getseuserbyname() and the default context returned by
>>>>>>> get_default_context_with_rolelevel()/get_default_context_with_level().
>>>>>>> If
>>>>>>> the seuser is wrong, then you know something's going wrong in
>>>>>>> getseuserbyname().
>>>>>>>
>>>>>>> I hope that helps.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Chad Sellers
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> This message was distributed to subscribers of the selinux mailing
>>>>>>> list.
>>>>>>> If you no longer wish to subscribe, send mail to
>>>>>>> majordomo@tycho.nsa.gov with
>>>>>>> the words "unsubscribe selinux" without quotes as the message.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> We ship them in fedora as selinuxconlist and selinuxdefcon
>>>>>> -----BEGIN PGP SIGNATURE-----
>>>>>> Version: GnuPG v1.4.10 (GNU/Linux)
>>>>>> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
>>>>>>
>>>>>> iEYEARECAAYFAkyt8UkACgkQrlYvE4MpobPw+wCfa8sf3A8+xhnMmdz2z3/vuJOM
>>>>>> TYsAn1s18NmE9caf5MpCt312RO2Wh/BI
>>>>>> =N+E/
>>>>>> -----END PGP SIGNATURE-----
>>>>>>
>>>>>>
>>>>>
>>>>> o.k. I just loaded up OpenSUSE11.4, and loaded the policy(this is
>>>>> from
>>>>> git keep in mind, not what suse offers).
>>>>> after getting everything setup I was able to ssh into the machine
>>>>> with
>>>>> my iphone, and issue id -Z.. the context I set is user_r:user_t which
>>>>> the iphone showed(name:user_r:staff_t:s0) so everything is good with
>>>>> this version.(not sure with 11.1, but I know 11.2 works fine, as well
>>>>> as
>>>>> 11.4).
>>>>>
>>>>> Justin P. Mattock
>>>>>
>>>>> --
>>>>> This message was distributed to subscribers of the selinux mailing
>>>>> list.
>>>>> If you no longer wish to subscribe, send mail to
>>>>> majordomo@tycho.nsa.gov
>>>>> with
>>>>> the words "unsubscribe selinux" without quotes as the message.
>>>>>
>>>>>
>>>> Thank you for your answers.
>>>> I've reinstalled the sles11.1 with the newest opensuse selinux
>>>> libraries
>>>> (http://download.opensuse.org/repositories/security:/SELinux/openSUSE_Factory/x86_64/),
>>>> but it still struggles with the ssh login. Local login is working now!
>>>> There must be a problem with pam_selinux. Here's the output of the
>>>> debug
>>>> log:
>>>> Oct 19 16:40:50 testmachine.local sshd[7550]:
>>>> pam_selinux(sshd:session):
>>>> Open Session
>>>> Oct 19 16:40:50 testmachine.local sshd[7550]:
>>>> pam_selinux(sshd:session):
>>>> Username= mat SELinux User = mat_u Level= (null)
>>>> Oct 19 16:40:50 testmachine.local sshd[7550]:
>>>> pam_selinux(sshd:session):
>>>> set mat security context to mat_u:staff_r:insmod_t
>>>> Oct 19 16:40:50 testmachine.local sshd[7550]:
>>>> pam_selinux(sshd:session):
>>>> set mat key creation context to mat_u:staff_r:insmod_t
>>>> Oct 19 16:40:50 testmachine.local sshd[7557]: pam_unix2(sshd:setcred):
>>>> pam_sm_setcred() called
>>>> Oct 19 16:40:50 testmachine.local sshd[7557]: pam_unix2(sshd:setcred):
>>>> username=[mat]
>>>> Oct 19 16:40:50 testmachine.local sshd[7557]: pam_unix2(sshd:setcred):
>>>> pam_sm_setcred: PAM_SUCCESS
>>>> Oct 19 16:40:50 testmachine.local sshd[7557]: fatal:
>>>> ssh_selinux_getctxbyname: Failed to get default SELinux security
>>>> context
>>>> for mat (in enforcing mode)
>>>> Oct 19 16:40:50 testmachine.local sshd[7550]:
>>>> pam_selinux(sshd:session):
>>>> Close Session
>>>>
>>>> @justin: which policy did you installed from git? url? I tried
>>>> refpolicy
>>>> from tresys.
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> from what I remember insmod_t is a context I always received, due to
>>> unlabeled filesystem
>>> i.e. I also use LFS, and will tar ball the whole system, and copy it
>>> over to the new machine,
>>> then receive the insmod_t until I relabel, then all is good, but in
>>> your
>>> case it shouldn't be going to that.
>>>
>>>
>>> as for the policy(sounds like the same one)..:
>>>
>>> git clone http://oss.tresys.com/git/refpolicy.git
>>>
>>> in regards to sles11 im wondering if it's close to opensuse 11.1, if so
>>> I can
>>> load that one up on my machine to see whats happening(right now I'm
>>> kind
>>> of floating
>>> from one distro to the next(I have the "try that out distro itch"..))
>>>
>>> Justin P. Mattock
>>>
>>>
>>
>> I don't think that opensuse 11.1 and sles 11.1 are close enough!?
>> I found out that if the selinux user and the linux user are equal (both
>> mat_u), the ssh login works as well.
>>
>> indeed insmod was gone after "make relabel", but now I can't start the
>> system in enforcing mode anymore, because a couple of denies =>
>> most of them are related to dbus and rpc-statd:
>> ----
>> avc: denied { search } for pid=2320 comm="dbus-daemon" nam
>> e="dbus" dev=dm-7 ino=40172 scontext=system_u:system_r:sysadm_dbusd_t
>> tcontext=system_u:object_r:system_dbusd_var_run_t tclass=dir
>> ----
>> ----
>> avc: denied { read } for pid=3127 comm="rpc.statd" path="p
>> ipe:[9740]" dev=pipefs ino=9740 scontext=system_u:system_r:mount_t
>> tcontext=system_u:system_r:mount_t tclass=fifo_file
>> ----
>> are you familiar with that? are there some booleans to set or do I have
>> to
>> adjust the policy?
>>
>>
>>
>>
>
> from what I remember opensuse 11.2 had issues starting due too
> /etc/selinux/config having the wrong permissions(should be -rw-r--r--.)
the permissions were already correct on my system.
> has issues with /etc/initscript causing SELinux to not transition(thread
> here)..:
> http://oss.tresys.com/pipermail/refpolicy/2010-February/002012.html
>
> for some reason sysvinit craps out with:
> if (access(INITSCRIPT, R_OK) == 0 && runlevel != 'S') {
>
> I played around with sysvinit, but my code skills only took me so far:
> http://www.spinics.net/lists/selinux/msg08983.html
>
> two solutions to this is too mv /etc/initscript{,-bak} or
> setsebool -P init_upstart on
> this way you transistion properly and you wont receive a dbus error(if
> this is whats happening with sles11.1)
You're right. after setting init_upstart=1 I don't receive a dbus error
anymore.
>
> thirdly login context gets the wrong role.. simple fix is on this
> report:
> https://bugzilla.novell.com/show_bug.cgi?id=582366
>
> here are the bug reports that got fixed so opensuse 11.2 is able to get
> up and running in full enforcement mode.
>
> https://bugzilla.novell.com/show_bug.cgi?id=581505
> https://bugzilla.novell.com/show_bug.cgi?id=582399
> https://bugzilla.novell.com/show_bug.cgi?id=582404
>
> hopefully these are similar to what you're hitting...this way you can
> get up and running properly...
>
I was gone through all reports but so far I have an other problem
preventing me from logging in (in enforcing mode).
"Permissions on the password database may be too restrictive." => I'm sure
that the password is correct.
This could be related to pam stuff (like described in aboves bugs), but
first of all I would like to get rid of some other problems:
type=AVC msg=audit(1287563356.696:342): avc: denied { module_request }
for pid=3839 comm="sshd" scontext=system_u:system_r:sshd_t
tcontext=system_u:system_r:kernel_t tclass=system
type=AVC msg=audit(1287563356.848:343): avc: denied { search } for
pid=3839 comm="sshd" name="root" dev=dm-2 ino=7828
scontext=system_u:system_r:sshd_t tcontext=system_u:object_r:default_t
tclass=dir
type=AVC msg=audit(1287563360.848:344): avc: denied { module_request }
for pid=3839 comm="sshd" scontext=system_u:system_r:sshd_t
tcontext=system_u:system_r:kernel_t tclass=system
type=AVC msg=audit(1287563360.904:345): avc: denied { search } for
pid=3848 comm="sshd" name="root" dev=dm-2 ino=7828
scontext=system_u:system_r:sshd_t tcontext=system_u:object_r:default_t
tclass=dir
type=AVC msg=audit(1287563361.056:346): avc: denied { search } for
pid=3849 comm="xauth" name="root" dev=dm-2 ino=7828
scontext=root:staff_r:xauth_t tcontext=system_u:object_r:default_t
tclass=dir
type=AVC msg=audit(1287563361.056:347): avc: denied { write } for
pid=3849 comm="xauth" name="root" dev=dm-2 ino=7828
scontext=root:staff_r:xauth_t tcontext=system_u:object_r:default_t
tclass=dir
Do you see what the problem could be?
And there is another issue which prevents syslogd from starting:
Oct 20 09:21:20 testmachine.local syslog-ng[3103]: Error opening file for
writing; filename='/dev/tty10', error='Permission denied (13)'
Oct 20 09:21:20 testmachine.local syslog-ng[3103]: Error opening file for
writing; filename='/dev/xconsole', error='Permission denied (13)'
Any ideas?
Thanks a lot in advance
> Justin P. Mattock
>
>
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply
* [U-Boot] Please pull u-boot-ppc4xx/master
From: Stefan Roese @ 2010-10-20 8:42 UTC (permalink / raw)
To: u-boot
The following changes since commit 11c8dd36edcc82564a19dbd0103302df66d66db0:
FAT: buffer overflow with FAT12/16 (2010-10-20 09:14:38 +0200)
are available in the git repository at:
git://www.denx.de/git/u-boot-ppc4xx.git master
Stefan Roese (4):
ppc4xx: Change tsr/tcr macros to upper case
ppc4xx/POST: Add board specific UART POST test to lwmon5
ppc4xx: Enable NOR flash support in sequoia_ramboot target
ppc4xx: Fix default environment for AMCC boards
arch/powerpc/cpu/ppc4xx/cpu_init.c | 8 ++++----
arch/powerpc/cpu/ppc4xx/interrupts.c | 7 -------
arch/powerpc/cpu/ppc4xx/traps.c | 11 +----------
board/amcc/sequoia/sequoia.c | 6 ++++--
include/configs/amcc-common.h | 15 ++-------------
include/configs/lwmon5.h | 11 +++++++++++
post/tests.c | 4 ++++
7 files changed, 26 insertions(+), 36 deletions(-)
^ permalink raw reply
* [U-Boot] [PATCH][v0] RTC driver for PT7C4338 chip.
From: Priyanka Jain @ 2010-10-20 8:40 UTC (permalink / raw)
To: u-boot
PT7C4338 chip is manufactured by Pericom Technology Inc.
It is a serial real-time clock which provides:
1)Low-power clock/calendar.
2)Programmable square-wave output.
It has 56 bytes of nonvolatile RAM.
Freescale P1010RDB uses PT7C4338 as RTC.
Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
Acked-by: Timur Tabi <timur@freescale.com>
---
drivers/rtc/Makefile | 1 +
drivers/rtc/pt7c4338.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 162 insertions(+), 0 deletions(-)
create mode 100644 drivers/rtc/pt7c4338.c
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 772a49a..a6dda91 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -62,6 +62,7 @@ COBJS-$(CONFIG_RTC_RX8025) += rx8025.o
COBJS-$(CONFIG_RTC_S3C24X0) += s3c24x0_rtc.o
COBJS-$(CONFIG_RTC_S3C44B0) += s3c44b0_rtc.o
COBJS-$(CONFIG_RTC_X1205) += x1205.o
+COBJS-$(CONFIG_RTC_PT7C4338) += pt7c4338.o
COBJS := $(sort $(COBJS-y))
SRCS := $(COBJS:.o=.c)
diff --git a/drivers/rtc/pt7c4338.c b/drivers/rtc/pt7c4338.c
new file mode 100644
index 0000000..5ce2afc
--- /dev/null
+++ b/drivers/rtc/pt7c4338.c
@@ -0,0 +1,161 @@
+/*
+ * Copyright 2010 Freescale Semiconductor, Inc.
+ *
+ * Author: Priyanka Jain <Priyanka.Jain@freescale.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
+ * GNU General Public License for more details.
+ *
+ * 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
+ */
+
+
+/*
+ * This file provides Date & Time support (no alarms) for PT7C4338 chip.
+ *
+ * This file is based on drivers/rtc/ds1337.c
+ *
+ * PT7C4338 chip is manufactured by Pericom Technology Inc.
+ * It is a serial real-time clock which provides
+ * 1)Low-power clock/calendar.
+ * 2)Programmable square-wave output.
+ * It has 56 bytes of nonvolatile RAM.
+ *
+ * Freescale P1010RDB uses PT7C4338 as RTC.
+ */
+
+
+#include <common.h>
+#include <command.h>
+#include <rtc.h>
+#include <i2c.h>
+
+
+/* RTC register addresses */
+#define RTC_SEC_REG_ADDR 0x0
+#define RTC_MIN_REG_ADDR 0x1
+#define RTC_HR_REG_ADDR 0x2
+#define RTC_DAY_REG_ADDR 0x3
+#define RTC_DATE_REG_ADDR 0x4
+#define RTC_MON_REG_ADDR 0x5
+#define RTC_YR_REG_ADDR 0x6
+#define RTC_CTL_STAT_REG_ADDR 0x7
+
+/* RTC second register address bit */
+#define RTC_SEC_BIT_CH 0x80 /* Clock Halt (in Register 0) */
+
+/* RTC control and status register bits */
+#define RTC_CTL_STAT_BIT_RS0 0x1 /* Rate select 0 */
+#define RTC_CTL_STAT_BIT_RS1 0x2 /* Rate select 1 */
+#define RTC_CTL_STAT_BIT_SQWE 0x10 /* Square Wave Enable */
+#define RTC_CTL_STAT_BIT_OSF 0x20 /* Oscillator Stop Flag */
+#define RTC_CTL_STAT_BIT_OUT 0x80 /* Output Level Control */
+
+/* RTC reset value */
+#define RTC_PT7C4338_RESET_VAL \
+ (RTC_CTL_STAT_BIT_RS0 | RTC_CTL_STAT_BIT_RS1 | RTC_CTL_STAT_BIT_OUT)
+
+
+/****** Helper functions ****************************************/
+
+static u8 rtc_read(u8 reg)
+{
+ return i2c_reg_read(CONFIG_SYS_I2C_RTC_ADDR, reg);
+}
+
+static void rtc_write(u8 reg, u8 val)
+{
+ i2c_reg_write(CONFIG_SYS_I2C_RTC_ADDR, reg, val);
+}
+
+/****************************************************************/
+
+
+/* Get the current time from the RTC */
+int rtc_get(struct rtc_time *tmp)
+{
+ int ret = 0;
+ u8 sec, min, hour, mday, wday, mon, year, ctl_stat;
+
+ ctl_stat = rtc_read(RTC_CTL_STAT_REG_ADDR);
+ sec = rtc_read(RTC_SEC_REG_ADDR);
+ min = rtc_read(RTC_MIN_REG_ADDR);
+ hour = rtc_read(RTC_HR_REG_ADDR);
+ wday = rtc_read(RTC_DAY_REG_ADDR);
+ mday = rtc_read(RTC_DATE_REG_ADDR);
+ mon = rtc_read(RTC_MON_REG_ADDR);
+ year = rtc_read(RTC_YR_REG_ADDR);
+ debug("Get RTC year: %02x mon: %02x mday: %02x wday: %02x "
+ "hr: %02x min: %02x sec: %02x control_status: %02x\n",
+ year, mon, mday, wday, hour, min, sec, ctl_stat);
+
+ if (ctl_stat & RTC_CTL_STAT_BIT_OSF) {
+ printf("### Warning: RTC oscillator has stopped\n");
+ /* clear the OSF flag */
+ rtc_write(RTC_CTL_STAT_REG_ADDR,
+ rtc_read(RTC_CTL_STAT_REG_ADDR)\
+ & ~RTC_CTL_STAT_BIT_OSF);
+ ret = -1;
+ }
+
+ if (sec & RTC_SEC_BIT_CH) {
+ printf("### Warning: RTC oscillator has stopped\n");
+ /* clear the CH flag */
+ rtc_write(RTC_SEC_REG_ADDR,
+ rtc_read(RTC_SEC_REG_ADDR) & ~RTC_SEC_BIT_CH);
+ ret = -1;
+ }
+
+ tmp->tm_sec = bcd2bin(sec & 0x7F);
+ tmp->tm_min = bcd2bin(min & 0x7F);
+ tmp->tm_hour = bcd2bin(hour & 0x3F);
+ tmp->tm_mday = bcd2bin(mday & 0x3F);
+ tmp->tm_mon = bcd2bin(mon & 0x1F);
+ tmp->tm_year = bcd2bin(year) + 2000;
+ tmp->tm_wday = bcd2bin((wday - 1) & 0x07);
+ tmp->tm_yday = 0;
+ tmp->tm_isdst = 0;
+ debug("Get DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
+ tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+ tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+ return ret;
+}
+
+/* Set the RTC */
+int rtc_set(struct rtc_time *tmp)
+{
+ debug("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
+ tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
+ tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+ rtc_write(RTC_YR_REG_ADDR, bin2bcd(tmp->tm_year % 100));
+ rtc_write(RTC_MON_REG_ADDR, bin2bcd(tmp->tm_mon));
+ rtc_write(RTC_DAY_REG_ADDR, bin2bcd(tmp->tm_wday + 1));
+ rtc_write(RTC_DATE_REG_ADDR, bin2bcd(tmp->tm_mday));
+ rtc_write(RTC_HR_REG_ADDR, bin2bcd(tmp->tm_hour));
+ rtc_write(RTC_MIN_REG_ADDR, bin2bcd(tmp->tm_min));
+ rtc_write(RTC_SEC_REG_ADDR, bin2bcd(tmp->tm_sec));
+
+ return 0;
+}
+
+/* Reset the RTC */
+void rtc_reset(void)
+{
+ rtc_write(RTC_SEC_REG_ADDR, 0x00); /* clearing Clock Halt */
+ rtc_write(RTC_CTL_STAT_REG_ADDR, RTC_PT7C4338_RESET_VAL);
+}
--
1.6.5.6
^ permalink raw reply related
* Re: Converting to Git using svn-fe (Was: Speeding up the initial git-svn fetch)
From: Will Palmer @ 2010-10-20 8:39 UTC (permalink / raw)
To: Ramkumar Ramachandra
Cc: Stephen Bash, Matt Stump, git, Jonathan Nieder,
David Michael Barr, Sverre Rabbelier, Tomas Carnecky
In-Reply-To: <20101019064210.GA14309@kytes>
On Tue, 2010-10-19 at 12:12 +0530, Ramkumar Ramachandra wrote:
> Hi Stephen,
>
> Stephen Bash writes:
...
> >
> > I have 32 SVN revs in my history that touch multiple Git commit
> > objects. The simplest example is
> > svn mv svn://svnrepo/branches/badBranchName svn://svnrepo/branches/goodBranchName
> > which creates a single SVN commit that touches two branches
> > (badBranchName will have all it's contents deleted, goodBranchName
> > will have an "empty commit" as described above). The more devious
> > version is the SVN rev where a developer checked out / (yes, I'm not
> > kidding) and proceeded to modify a single file on all branches in
> > one commit. In our case, that one SVN rev touches 23 git commit
> > objects. And while the latter is somewhat a corner case, the former
> > is common and probably needs to be dealt with appropriately (it's
> > kind of a stupid operation in Git-land, so maybe it can just be
> > squashed).
>
> Ouch! Thanks for the illustrative example- I understand now. We have
> to bend backwards to perform a one-to-one mapping. It's finally struck
> me- one-to-one mapping is nearly impossible to achieve, and I don't
> know if it makes sense to strive for it anymore. Looks like Jonathan
> got it earlier.
It's been a while since I was involved in this discussion, so maybe the
design has changed by now, but I was under the impression that there
would be one "one-to-one" mapping branch (which would never be checked
out), containing the history of /, and that the "real" git branches,
tags, etc, would be based on the trees originally referenced by the root
checkout, with git-notes (or similar) being used to track the weirdness
in mappings. How does the "multiple branches touched in a single commit"
complicate anything other than the heuristics for automatic branch
detection (which I assume nobody is at the stage of talking about yet).
I suppose we wouldn't be talking, technically, about a one-to-one
mapping in that case, as we would be turning "one" svn revision into
"many" git branches, but in the conceptual sense of "one svn repository
equals one git repository", I don't see this as being impossible, or so
difficult that it shouldn't be striven-for.
Something else which is at least semi-common in svn is to treat a folder
both as a "directory" and a "branch", which the "checking out /" example
would just be an extreme example of. Think in terms of git branches
being a "view" of the history, with some mapper sitting between each
view and "root" checkout.
^ permalink raw reply
* [Lustre-devel] Queries regarding LDLM_ENQUEUE
From: Nikita Danilov @ 2010-10-20 8:38 UTC (permalink / raw)
To: lustre-devel
In-Reply-To: <4CBEA8A9.9080802@gmail.com>
On 20 October 2010 12:30, <bzzz.tomas@gmail.com> wrote:
> On 10/20/10 12:24 PM, Andreas Dilger wrote:
> > I'm reluctant to expose the whole FID namespace to applications, since
> this completely bypasses all directory permissions and allows opening files
> only based on their inode permissions. If we require a name_to_handle()
> syscall to succeed first, before allowing open_by_handle() to work, then at
> least we know that one of the involved processes was able to do a full path
> traversal.
>
> yes, this is a good point. can be solved if you use FID +
> capability/signature ?
>
> >> another idea was to do whole path traversal on MDS within a single RPC.
> >> bug that'd require amount of changes to llite and/or VFS and keep MDS
> >> a bottleneck.
> >
> > This was discussed a long time ago, and has the potential drawback that
> if one of the path components is over-mounted on the client (e.g. local
> RAM-based tmpfs on a Lustre root filesystem) then the MDS-side path
> traversal would be incorrect. It could return an entry underneath the
> mountpoint, instead of inside it.
>
> yes, and that could be solved if server returns a series of FIDs,
> then client could check whether any of those is over-mounted?
>
This is what sufficiently smart nfsv4 clients are supposed to do, by the
way, I believe: issue a compound RPC with a sequence of LOOKUP requests and
traverse returned sequence of file-id-s locally, checking for mount points.
Nikita.
>
> thanks, z
>
> _______________________________________________
> Lustre-devel mailing list
> Lustre-devel at lists.lustre.org
> http://lists.lustre.org/mailman/listinfo/lustre-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20101020/ae9ad024/attachment.htm>
^ permalink raw reply
* Re: [PATCH v2.6.36-rc7] infiniband: update workqueue usage
From: Tejun Heo @ 2010-10-20 8:38 UTC (permalink / raw)
To: Bart Van Assche
Cc: Roland Dreier, Sean Hefty, Hal Rosenstock, linux-rdma, lkml
In-Reply-To: <AANLkTi=gYununGYK-QuonZASyk49Rj2-+zG+f22fBF=g@mail.gmail.com>
Hello,
On 10/19/2010 08:40 PM, Bart Van Assche wrote:
> On Tue, Oct 19, 2010 at 5:24 PM, Tejun Heo <tj@kernel.org> wrote:
>> [ ... ]
>> This is to prepare for deprecation of flush_scheduled_work().
>> [ ... ]
>> Index: work/include/rdma/ib_verbs.h
>> [ ... ]
>> +extern struct workqueue_struct *ib_wq;
>> [ ... ]
>
> This patch adds a declaration of a global variable to a public header
> file. That might be unavoidable, but it doesn't make me happy.
Hmm... that's one very interesting reason to be unhappy. Can you
please elaborate why addition of a global variable doesn't make you
happy?
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH v2.6.36-rc7] infiniband: update workqueue usage
From: Tejun Heo @ 2010-10-20 8:38 UTC (permalink / raw)
To: Bart Van Assche
Cc: Roland Dreier, Sean Hefty, Hal Rosenstock,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, lkml
In-Reply-To: <AANLkTi=gYununGYK-QuonZASyk49Rj2-+zG+f22fBF=g@mail.gmail.com>
Hello,
On 10/19/2010 08:40 PM, Bart Van Assche wrote:
> On Tue, Oct 19, 2010 at 5:24 PM, Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>> [ ... ]
>> This is to prepare for deprecation of flush_scheduled_work().
>> [ ... ]
>> Index: work/include/rdma/ib_verbs.h
>> [ ... ]
>> +extern struct workqueue_struct *ib_wq;
>> [ ... ]
>
> This patch adds a declaration of a global variable to a public header
> file. That might be unavoidable, but it doesn't make me happy.
Hmm... that's one very interesting reason to be unhappy. Can you
please elaborate why addition of a global variable doesn't make you
happy?
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 1/1] Add Sim Access Plugin
From: Suraj Sumangala @ 2010-10-20 8:37 UTC (permalink / raw)
To: Waldemar Rymarkiewicz
Cc: linux-bluetooth@vger.kernel.org, Marcel Holtmann, Suraj Sumangala,
Johan Hedberg, joakim.xj.ceder@stericsson.com,
arunkr.singh@stericsson.com
In-Reply-To: <1287561308-18611-2-git-send-email-waldemar.rymarkiewicz@tieto.com>
Hi Waldemar,
On 10/20/2010 1:25 PM, Waldemar Rymarkiewicz wrote:
> Sim Access plugin implements Sim Access Profile server role
> according to the Bluetooth Sim Access Profile v1.1 specification.
> ---
> .gitignore | 1 +
> Makefile.am | 25 +-
> acinclude.m4 | 14 +
> doc/sap-api.txt | 57 ++
> sap/main.c | 54 ++
> sap/manager.c | 94 ++++
> sap/manager.h | 21 +
> sap/sap-dummy.c | 306 +++++++++++
> sap/sap-ste.c | 1265 ++++++++++++++++++++++++++++++++++++++++++++++
> sap/sap.h | 187 +++++++
> sap/server.c | 1516 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> sap/server.h | 23 +
> 12 files changed, 3559 insertions(+), 4 deletions(-)
> create mode 100644 doc/sap-api.txt
> create mode 100644 sap/main.c
> create mode 100644 sap/manager.c
> create mode 100644 sap/manager.h
> create mode 100644 sap/sap-dummy.c
> create mode 100644 sap/sap-ste.c
I am assuming that this is the ST specific plugin. May be you can just
keep the dummy plugin only so that someone can use that as a reference.
> create mode 100644 sap/sap.h
> create mode 100644 sap/server.c
> create mode 100644 sap/server.h
I guess it would be better if you can split this into multiple patches
so that it would be easier to review.
Regards
Suraj
^ permalink raw reply
* Re: [PATCH v2.6.36-rc7] infiniband: update workqueue usage
From: Tejun Heo @ 2010-10-20 8:37 UTC (permalink / raw)
To: Ralph Campbell
Cc: Roland Dreier, Sean Hefty, Hal Rosenstock,
linux-rdma@vger.kernel.org, lkml
In-Reply-To: <1287508926.27343.299.camel@chromite.mv.qlogic.com>
Hello,
On 10/19/2010 07:22 PM, Ralph Campbell wrote:
> On Tue, 2010-10-19 at 08:24 -0700, Tejun Heo wrote:
>
>> * qib_cq_wq is a separate singlethread workqueue. Does the queue
>> require strict single thread execution ordering? IOW, does each
>> work have to be executed in the exact queued order and no two works
>> should execute in parallel? Or was the singlethreadedness chosen
>> just to reduce the number of workers?
>
> The work functions need to be called in-order and single threaded
> or memory will be freed multiple times and other "bad things".
I see, so they'll need to be converted to alloc_ordered_workqueue()
once -rc1 merge window opens up. I'll follow up with the conversion.
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH v2.6.36-rc7] infiniband: update workqueue usage
From: Tejun Heo @ 2010-10-20 8:37 UTC (permalink / raw)
To: Ralph Campbell
Cc: Roland Dreier, Sean Hefty, Hal Rosenstock,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lkml
In-Reply-To: <1287508926.27343.299.camel-/vjeY7uYZjrPXfVEPVhPGq6RkeBMCJyt@public.gmane.org>
Hello,
On 10/19/2010 07:22 PM, Ralph Campbell wrote:
> On Tue, 2010-10-19 at 08:24 -0700, Tejun Heo wrote:
>
>> * qib_cq_wq is a separate singlethread workqueue. Does the queue
>> require strict single thread execution ordering? IOW, does each
>> work have to be executed in the exact queued order and no two works
>> should execute in parallel? Or was the singlethreadedness chosen
>> just to reduce the number of workers?
>
> The work functions need to be called in-order and single threaded
> or memory will be freed multiple times and other "bad things".
I see, so they'll need to be converted to alloc_ordered_workqueue()
once -rc1 merge window opens up. I'll follow up with the conversion.
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH hail] const-correctness tweaks
From: Jeff Garzik @ 2010-10-20 8:36 UTC (permalink / raw)
To: Jim Meyering; +Cc: Project Hail
In-Reply-To: <878w1t5m5k.fsf@meyering.net>
On 10/20/2010 04:00 AM, Jim Meyering wrote:
> Jeff Garzik wrote:
>
>> On 10/06/2010 08:07 AM, Jim Meyering wrote:
>>>
>>> Make write_cb callback's buffer parameter const, like all write-like
>>> functions.
>>> Give a few "char *" parameters the "const" attribute.
>>>
>>> Signed-off-by: Jim Meyering<meyering@redhat.com>
>>> ---
>>>
>>> It looks like most of hail's interfaces are const-correct,
>>> but one stood out because it provokes a warning when I tried to
>>> pass a const-correct write_cb function to hstor_get from iwhd:
>>>
>>> proxy.c:382: warning: passing argument 4 of 'hstor_get' from \
>>> incompatible pointer type
>>> /usr/include/hstor.h:173: note: expected \
>>> 'size_t (*)(void *, size_t, size_t, void *)' but argument is of type \
>>> 'size_t (*)(const void *, size_t, size_t, void *)'
>>>
>>> In case you feel comfortable fixing this, here's a patch:
>>
>>
>> Sorry for not getting back to this; I had hoped to solve some
>> additional problems that cropped up, but didn't have time. So, to
>> forestall further delay,
>>
>> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread
>> -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
>> -I/usr/include/libxml2 -O2 -Wall -Wshadow -g -MT hutil.lo -MD -MP -MF
>> .deps/hutil.Tpo -c hutil.c -o hutil.o
>> hutil.c: In function ‘hreq_hdr_push’:
>> hutil.c:145: warning: assignment discards qualifiers from pointer
>> target type
>> hutil.c:146: warning: assignment discards qualifiers from pointer
>> target type
>>
>> warnings appear after this patch. When solving these warnings with
>> const' markers, it quickly becomes a bit of a rat's nest.
>>
>> At a minimum, the write_cb callback signature must match libcurl's,
>> which does not use 'const'. I can see this makes sense from libcurl
>> implementation's perspective, even if it does not really match the
>> constness one expects from a foo-get function.
>
> Hi Jeff.
>
> Sorry I didn't notice that the first time.
> I built with ./autogen.sh&& ./configure&& make.
> It looks like you recommend -Wall -Wshadow.
>
> The two warnings above are the only ones I see with the patch,
> and they're easy to fix. When storing const pointer params into
> a struct like that, I've found that it's best to cast away the "const",
> which really does reflect the semantics: by using "const" on the
> parameter, I view it as promising not to deref through the pointer
> *in that function*. Since it's usually not reasonable to make
> the struct member "const" (as you saw, it propagates too far
> and often ends up being contradictory), the lesser evil of the cast
> is preferable here.
>
> If you're still game, the following incremental patch seems to be
> enough for me: Let me know and I'll resubmit the full one.
Well, my primary concern now originates from curl_easy_setopt(3)
documentation:
CURLOPT_WRITEFUNCTION
Function pointer that should match the following
prototype: size_t function( void *ptr, size_t size,
size_t nmemb, void *stream);
hstor's callback is passed directly to libcurl, so we seem to be bound
by outside constraints, no?
Jeff
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
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.