* [PATCH 8/9] vscode: add a dictionary for cSpell
From: Johannes Schindelin via GitGitGadget @ 2018-07-23 13:52 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Johannes Schindelin
In-Reply-To: <pull.2.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
The quite useful cSpell extension allows VS Code to have "squiggly"
lines under spelling mistakes. By default, this would add too much
clutter, though, because so much of Git's source code uses words that
would trigger cSpell.
Let's add a few words to make the spell checking more useful by reducing
the number of false positives.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
contrib/vscode/init.sh | 169 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 168 insertions(+), 1 deletion(-)
diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh
index 29f2a729d..a134cb4c5 100755
--- a/contrib/vscode/init.sh
+++ b/contrib/vscode/init.sh
@@ -32,7 +32,174 @@ cat >.vscode/settings.json.new <<\EOF ||
"files.associations": {
"*.h": "c",
"*.c": "c"
- }
+ },
+ "cSpell.words": [
+ "DATAW",
+ "DBCACHED",
+ "DFCHECK",
+ "DTYPE",
+ "Hamano",
+ "HCAST",
+ "HEXSZ",
+ "HKEY",
+ "HKLM",
+ "IFGITLINK",
+ "IFINVALID",
+ "ISBROKEN",
+ "ISGITLINK",
+ "ISSYMREF",
+ "Junio",
+ "LPDWORD",
+ "LPPROC",
+ "LPWSTR",
+ "MSVCRT",
+ "NOARG",
+ "NOCOMPLETE",
+ "NOINHERIT",
+ "RENORMALIZE",
+ "STARTF",
+ "STARTUPINFOEXW",
+ "Schindelin",
+ "UCRT",
+ "YESNO",
+ "argcp",
+ "beginthreadex",
+ "committish",
+ "contentp",
+ "cpath",
+ "cpidx",
+ "ctim",
+ "dequote",
+ "envw",
+ "ewah",
+ "fdata",
+ "fherr",
+ "fhin",
+ "fhout",
+ "fragp",
+ "fsmonitor",
+ "hnsec",
+ "idents",
+ "includeif",
+ "interpr",
+ "iprog",
+ "isexe",
+ "iskeychar",
+ "kompare",
+ "mksnpath",
+ "mktag",
+ "mktree",
+ "mmblob",
+ "mmbuffer",
+ "mmfile",
+ "noenv",
+ "nparents",
+ "ntpath",
+ "ondisk",
+ "ooid",
+ "oplen",
+ "osdl",
+ "pnew",
+ "pold",
+ "ppinfo",
+ "pushf",
+ "pushv",
+ "rawsz",
+ "rebasing",
+ "reencode",
+ "repo",
+ "rerere",
+ "scld",
+ "sharedrepo",
+ "spawnv",
+ "spawnve",
+ "spawnvpe",
+ "strdup'ing",
+ "submodule",
+ "submodules",
+ "topath",
+ "topo",
+ "tpatch",
+ "unexecutable",
+ "unhide",
+ "unkc",
+ "unkv",
+ "unmark",
+ "unmatch",
+ "unsets",
+ "unshown",
+ "untracked",
+ "untrackedcache",
+ "unuse",
+ "upos",
+ "uval",
+ "vreportf",
+ "wargs",
+ "wargv",
+ "wbuffer",
+ "wcmd",
+ "wcsnicmp",
+ "wcstoutfdup",
+ "wdeltaenv",
+ "wdir",
+ "wenv",
+ "wenvblk",
+ "wenvcmp",
+ "wenviron",
+ "wenvpos",
+ "wenvsz",
+ "wfile",
+ "wfilename",
+ "wfopen",
+ "wfreopen",
+ "wfullpath",
+ "which'll",
+ "wlink",
+ "wmain",
+ "wmkdir",
+ "wmktemp",
+ "wnewpath",
+ "wotype",
+ "wpath",
+ "wpathname",
+ "wpgmptr",
+ "wpnew",
+ "wpointer",
+ "wpold",
+ "wpos",
+ "wputenv",
+ "wrmdir",
+ "wship",
+ "wtarget",
+ "wtemplate",
+ "wunlink",
+ "xcalloc",
+ "xgetcwd",
+ "xmallocz",
+ "xmemdupz",
+ "xmmap",
+ "xopts",
+ "xrealloc",
+ "xsnprintf",
+ "xutftowcs",
+ "xutftowcsn",
+ "xwcstoutf"
+ ],
+ "cSpell.ignoreRegExpList": [
+ "\\\"(DIRC|FSMN|REUC|UNTR)\\\"",
+ "\\\\u[0-9a-fA-Fx]{4}\\b",
+ "\\b(filfre|frotz|xyzzy)\\b",
+ "\\bCMIT_FMT_DEFAULT\\b",
+ "\\bde-munge\\b",
+ "\\bGET_OID_DISAMBIGUATORS\\b",
+ "\\bHASH_RENORMALIZE\\b",
+ "\\bTREESAMEness\\b",
+ "\\bUSE_STDEV\\b",
+ "\\Wchar *\\*\\W*utfs\\W",
+ "cURL's",
+ "nedmalloc'ed",
+ "ntifs\\.h",
+ ],
}
EOF
die "Could not write settings.json"
--
gitgitgadget
^ permalink raw reply related
* [PATCH 6/9] vscode: wrap commit messages at column 72 by default
From: Johannes Schindelin via GitGitGadget @ 2018-07-23 13:52 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Johannes Schindelin
In-Reply-To: <pull.2.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
When configuring VS Code as core.editor (via `code --wait`), we really
want to adhere to the Git conventions of wrapping commit messages.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
contrib/vscode/init.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh
index ba9469226..face115e8 100755
--- a/contrib/vscode/init.sh
+++ b/contrib/vscode/init.sh
@@ -17,6 +17,10 @@ cat >.vscode/settings.json.new <<\EOF ||
{
"C_Cpp.intelliSenseEngine": "Default",
"C_Cpp.intelliSenseEngineFallback": "Disabled",
+ "[git-commit]": {
+ "editor.wordWrap": "wordWrapColumn",
+ "editor.wordWrapColumn": 72
+ },
"files.associations": {
"*.h": "c",
"*.c": "c"
--
gitgitgadget
^ permalink raw reply related
* [PATCH 5/9] vscode: only overwrite C/C++ settings
From: Johannes Schindelin via GitGitGadget @ 2018-07-23 13:52 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Johannes Schindelin
In-Reply-To: <pull.2.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
The C/C++ settings are special, as they are the only generated VS Code
configurations that *will* change over the course of Git's development,
e.g. when a new constant is defined.
Therefore, let's only update the C/C++ settings, also to prevent user
modifications from being overwritten.
Ideally, we would keep user modifications in the C/C++ settings, but
that would require parsing JSON, a task for which a Unix shell script is
distinctly unsuited. So we write out .new files instead, and warn the
user if they may want to reconcile their changes.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
contrib/vscode/init.sh | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh
index 494a51ac5..ba9469226 100755
--- a/contrib/vscode/init.sh
+++ b/contrib/vscode/init.sh
@@ -13,7 +13,7 @@ die "Could not create .vscode/"
# General settings
-cat >.vscode/settings.json <<\EOF ||
+cat >.vscode/settings.json.new <<\EOF ||
{
"C_Cpp.intelliSenseEngine": "Default",
"C_Cpp.intelliSenseEngineFallback": "Disabled",
@@ -51,7 +51,7 @@ esac
# Default build task
-cat >.vscode/tasks.json <<EOF ||
+cat >.vscode/tasks.json.new <<EOF ||
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
@@ -73,7 +73,7 @@ die "Could not install default build task"
# Debugger settings
-cat >.vscode/launch.json <<EOF ||
+cat >.vscode/launch.json.new <<EOF ||
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
@@ -175,3 +175,20 @@ vscode-init:
echo '}'
EOF
die "Could not write settings for the C/C++ extension"
+
+for file in .vscode/settings.json .vscode/tasks.json .vscode/launch.json
+do
+ if test -f $file
+ then
+ if git diff --no-index --quiet --exit-code $file $file.new
+ then
+ rm $file.new
+ else
+ printf "The file $file.new has these changes:\n\n"
+ git --no-pager diff --no-index $file $file.new
+ printf "\n\nMaybe \`mv $file.new $file\`?\n\n"
+ fi
+ else
+ mv $file.new $file
+ fi
+done
--
gitgitgadget
^ permalink raw reply related
* [PATCH 4/9] mingw: define WIN32 explicitly
From: Johannes Schindelin via GitGitGadget @ 2018-07-23 13:52 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Johannes Schindelin
In-Reply-To: <pull.2.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
This helps VS Code's intellisense to figure out that we want to include
windows.h, and that we want to define the minimum target Windows version
as Windows Vista/2008R2.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
config.mak.uname | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.mak.uname b/config.mak.uname
index 684fc5bf0..2be2f1981 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -528,7 +528,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
compat/win32/pthread.o compat/win32/syslog.o \
compat/win32/dirent.o
- BASIC_CFLAGS += -DPROTECT_NTFS_DEFAULT=1
+ BASIC_CFLAGS += -DWIN32 -DPROTECT_NTFS_DEFAULT=1
EXTLIBS += -lws2_32
GITLIBS += git.res
PTHREAD_LIBS =
--
gitgitgadget
^ permalink raw reply related
* Re: [PATCH v2] xen/spinlock: Don't use pvqspinlock if only 1 vCPU
From: Waiman Long @ 2018-07-23 13:52 UTC (permalink / raw)
To: Davidlohr Bueso, Wanpeng Li
Cc: Paolo Bonzini, Radim Krcmar, Boris Ostrovsky, Juergen Gross,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
the arch/x86 maintainers, xen-devel, LKML, Konrad Rzeszutek Wilk
In-Reply-To: <20180723044257.m7pjrnp7jjqggqij@linux-r8p5>
On 07/23/2018 12:42 AM, Davidlohr Bueso wrote:
> On Mon, 23 Jul 2018, Wanpeng Li wrote:
>
>> On Fri, 20 Jul 2018 at 06:03, Waiman Long <longman@redhat.com> wrote:
>>>
>>> On 07/19/2018 05:54 PM, Davidlohr Bueso wrote:
>>> > On Thu, 19 Jul 2018, Waiman Long wrote:
>>> >
>>> >> On a VM with only 1 vCPU, the locking fast paths will always be
>>> >> successful. In this case, there is no need to use the the PV
>>> qspinlock
>>> >> code which has higher overhead on the unlock side than the native
>>> >> qspinlock code.
>>> >>
>>> >> The xen_pvspin veriable is also turned off in this 1 vCPU case to
>
> s/veriable
> variable
>
>>> >> eliminate unneeded pvqspinlock initialization in xen_init_lock_cpu()
>>> >> which is run after xen_init_spinlocks().
>>> >
>>> > Wouldn't kvm also want this?
>>> >
>>> > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
>>> > index a37bda38d205..95aceb692010 100644
>>> > --- a/arch/x86/kernel/kvm.c
>>> > +++ b/arch/x86/kernel/kvm.c
>>> > @@ -457,7 +457,8 @@ static void __init sev_map_percpu_data(void)
>>> > static void __init kvm_smp_prepare_cpus(unsigned int max_cpus)
>>> > {
>>> > native_smp_prepare_cpus(max_cpus);
>>> > - if (kvm_para_has_hint(KVM_HINTS_REALTIME))
>>> > + if (num_possible_cpus() == 1 ||
>>> > + kvm_para_has_hint(KVM_HINTS_REALTIME))
>>> > static_branch_disable(&virt_spin_lock_key);
>>> > }
>>>
>>> That doesn't really matter as the slowpath will never get executed in
>>> the 1 vCPU case.
>
> How does this differ then from xen, then? I mean, same principle applies.
I am not saying this patch is wrong. I am just saying that this is not
necessary.
In the xen case, they have a single variable that controls if
pvqspinlock should be used and turn off all the knobs accordingly. There
is no such equivalent in kvm. We had talked about that in the past, but
didn't come to a conclusion. In the 1 vCPU case, the most important
thing is to not use the pvqspinlock unlock path which add unneeded
runtime overhead.
The others just have a slight boot time overhead. For me, they are
optional. So I don't bother to add code to explicit turn them off as the
result will be the same with or without them.
>
>>
>> So this is not needed in kvm tree?
>> https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?h=queue&id=3a792199004ec335346cc607d62600a399a7ee02
>>
>
> Hmm I would think that my patch would be more appropiate as it
> actually does
> what the comment says.
The static key controls the behavior of the locking slowpath which will
not be executed at all. So it is essentially a no-op.
-Longman
^ permalink raw reply
* [PATCH 3/9] cache.h: extract enum declaration from inside a struct declaration
From: Johannes Schindelin via GitGitGadget @ 2018-07-23 13:52 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Johannes Schindelin
In-Reply-To: <pull.2.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
While it is technically possible, it is confusing. Not only the user,
but also VS Code's intellisense.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
cache.h | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/cache.h b/cache.h
index 89a107a7f..2380136f6 100644
--- a/cache.h
+++ b/cache.h
@@ -1425,18 +1425,20 @@ extern void *read_object_with_reference(const struct object_id *oid,
extern struct object *peel_to_type(const char *name, int namelen,
struct object *o, enum object_type);
+enum date_mode_type {
+ DATE_NORMAL = 0,
+ DATE_RELATIVE,
+ DATE_SHORT,
+ DATE_ISO8601,
+ DATE_ISO8601_STRICT,
+ DATE_RFC2822,
+ DATE_STRFTIME,
+ DATE_RAW,
+ DATE_UNIX
+};
+
struct date_mode {
- enum date_mode_type {
- DATE_NORMAL = 0,
- DATE_RELATIVE,
- DATE_SHORT,
- DATE_ISO8601,
- DATE_ISO8601_STRICT,
- DATE_RFC2822,
- DATE_STRFTIME,
- DATE_RAW,
- DATE_UNIX
- } type;
+ enum date_mode_type type;
const char *strftime_fmt;
int local;
};
--
gitgitgadget
^ permalink raw reply related
* [PATCH 2/9] vscode: hard-code a couple defines
From: Johannes Schindelin via GitGitGadget @ 2018-07-23 13:52 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Johannes Schindelin
In-Reply-To: <pull.2.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Sadly, we do not get all of the definitions via ALL_CFLAGS. Some defines
are passed to GCC *only* when compiling specific files, such as git.o.
Let's just hard-code them into the script for the time being.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
contrib/vscode/init.sh | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh
index 3cc93243f..494a51ac5 100755
--- a/contrib/vscode/init.sh
+++ b/contrib/vscode/init.sh
@@ -115,7 +115,19 @@ include Makefile
vscode-init:
@mkdir -p .vscode && \
incs= && defs= && \
- for e in $(ALL_CFLAGS); do \
+ for e in $(ALL_CFLAGS) \
+ '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
+ '-DGIT_LOCALE_PATH="$(localedir_relative_SQ)"' \
+ '-DBINDIR="$(bindir_relative_SQ)"' \
+ '-DFALLBACK_RUNTIME_PREFIX="$(prefix_SQ)"' \
+ '-DDEFAULT_GIT_TEMPLATE_DIR="$(template_dir_SQ)"' \
+ '-DETC_GITCONFIG="$(ETC_GITCONFIG_SQ)"' \
+ '-DETC_GITATTRIBUTES="$(ETC_GITATTRIBUTES_SQ)"' \
+ '-DGIT_LOCALE_PATH="$(localedir_relative_SQ)"' \
+ '-DCURL_DISABLE_TYPECHECK', \
+ '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \
+ '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \
+ '-DGIT_INFO_PATH="$(infodir_relative_SQ)"'; do \
case "$$e" in \
-I.) \
incs="$$(printf '% 16s"$${workspaceRoot}",\n%s' \
--
gitgitgadget
^ permalink raw reply related
* Re: [PATCH v2] xen/spinlock: Don't use pvqspinlock if only 1 vCPU
From: Waiman Long @ 2018-07-23 13:52 UTC (permalink / raw)
To: Davidlohr Bueso, Wanpeng Li
Cc: Juergen Gross, xen-devel, Radim Krcmar, the arch/x86 maintainers,
LKML, Ingo Molnar, H. Peter Anvin, Paolo Bonzini, Boris Ostrovsky,
Thomas Gleixner
In-Reply-To: <20180723044257.m7pjrnp7jjqggqij@linux-r8p5>
On 07/23/2018 12:42 AM, Davidlohr Bueso wrote:
> On Mon, 23 Jul 2018, Wanpeng Li wrote:
>
>> On Fri, 20 Jul 2018 at 06:03, Waiman Long <longman@redhat.com> wrote:
>>>
>>> On 07/19/2018 05:54 PM, Davidlohr Bueso wrote:
>>> > On Thu, 19 Jul 2018, Waiman Long wrote:
>>> >
>>> >> On a VM with only 1 vCPU, the locking fast paths will always be
>>> >> successful. In this case, there is no need to use the the PV
>>> qspinlock
>>> >> code which has higher overhead on the unlock side than the native
>>> >> qspinlock code.
>>> >>
>>> >> The xen_pvspin veriable is also turned off in this 1 vCPU case to
>
> s/veriable
> variable
>
>>> >> eliminate unneeded pvqspinlock initialization in xen_init_lock_cpu()
>>> >> which is run after xen_init_spinlocks().
>>> >
>>> > Wouldn't kvm also want this?
>>> >
>>> > diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
>>> > index a37bda38d205..95aceb692010 100644
>>> > --- a/arch/x86/kernel/kvm.c
>>> > +++ b/arch/x86/kernel/kvm.c
>>> > @@ -457,7 +457,8 @@ static void __init sev_map_percpu_data(void)
>>> > static void __init kvm_smp_prepare_cpus(unsigned int max_cpus)
>>> > {
>>> > native_smp_prepare_cpus(max_cpus);
>>> > - if (kvm_para_has_hint(KVM_HINTS_REALTIME))
>>> > + if (num_possible_cpus() == 1 ||
>>> > + kvm_para_has_hint(KVM_HINTS_REALTIME))
>>> > static_branch_disable(&virt_spin_lock_key);
>>> > }
>>>
>>> That doesn't really matter as the slowpath will never get executed in
>>> the 1 vCPU case.
>
> How does this differ then from xen, then? I mean, same principle applies.
I am not saying this patch is wrong. I am just saying that this is not
necessary.
In the xen case, they have a single variable that controls if
pvqspinlock should be used and turn off all the knobs accordingly. There
is no such equivalent in kvm. We had talked about that in the past, but
didn't come to a conclusion. In the 1 vCPU case, the most important
thing is to not use the pvqspinlock unlock path which add unneeded
runtime overhead.
The others just have a slight boot time overhead. For me, they are
optional. So I don't bother to add code to explicit turn them off as the
result will be the same with or without them.
>
>>
>> So this is not needed in kvm tree?
>> https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?h=queue&id=3a792199004ec335346cc607d62600a399a7ee02
>>
>
> Hmm I would think that my patch would be more appropiate as it
> actually does
> what the comment says.
The static key controls the behavior of the locking slowpath which will
not be executed at all. So it is essentially a no-op.
-Longman
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply
* [PATCH 1/9] contrib: add a script to initialize VS Code configuration
From: Johannes Schindelin via GitGitGadget @ 2018-07-23 13:52 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Johannes Schindelin
In-Reply-To: <pull.2.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
VS Code is a lightweight but powerful source code editor which runs on
your desktop and is available for Windows, macOS and Linux. Among other
languages, it has support for C/C++ via an extension.
To start developing Git with VS Code, simply run the Unix shell script
contrib/vscode/init.sh, which creates the configuration files in
.vscode/ that VS Code consumes.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
.gitignore | 1 +
contrib/vscode/.gitattributes | 1 +
contrib/vscode/README.md | 14 +++
contrib/vscode/init.sh | 165 ++++++++++++++++++++++++++++++++++
4 files changed, 181 insertions(+)
create mode 100644 contrib/vscode/.gitattributes
create mode 100644 contrib/vscode/README.md
create mode 100755 contrib/vscode/init.sh
diff --git a/.gitignore b/.gitignore
index 388cc4bee..592e8f879 100644
--- a/.gitignore
+++ b/.gitignore
@@ -206,6 +206,7 @@
/config.mak.autogen
/config.mak.append
/configure
+/.vscode/
/tags
/TAGS
/cscope*
diff --git a/contrib/vscode/.gitattributes b/contrib/vscode/.gitattributes
new file mode 100644
index 000000000..e89f2236e
--- /dev/null
+++ b/contrib/vscode/.gitattributes
@@ -0,0 +1 @@
+init.sh whitespace=-indent-with-non-tab
diff --git a/contrib/vscode/README.md b/contrib/vscode/README.md
new file mode 100644
index 000000000..8202d6203
--- /dev/null
+++ b/contrib/vscode/README.md
@@ -0,0 +1,14 @@
+Configuration for VS Code
+=========================
+
+[VS Code](https://code.visualstudio.com/) is a lightweight but powerful source
+code editor which runs on your desktop and is available for
+[Windows](https://code.visualstudio.com/docs/setup/windows),
+[macOS](https://code.visualstudio.com/docs/setup/mac) and
+[Linux](https://code.visualstudio.com/docs/setup/linux). Among other languages,
+it has [support for C/C++ via an extension](https://github.com/Microsoft/vscode-cpptools).
+
+To start developing Git with VS Code, simply run the Unix shell script called
+`init.sh` in this directory, which creates the configuration files in
+`.vscode/` that VS Code consumes. `init.sh` needs access to `make` and `gcc`,
+so run the script in a Git SDK shell if you are using Windows.
diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh
new file mode 100755
index 000000000..3cc93243f
--- /dev/null
+++ b/contrib/vscode/init.sh
@@ -0,0 +1,165 @@
+#!/bin/sh
+
+die () {
+ echo "$*" >&2
+ exit 1
+}
+
+cd "$(dirname "$0")"/../.. ||
+die "Could not cd to top-level directory"
+
+mkdir -p .vscode ||
+die "Could not create .vscode/"
+
+# General settings
+
+cat >.vscode/settings.json <<\EOF ||
+{
+ "C_Cpp.intelliSenseEngine": "Default",
+ "C_Cpp.intelliSenseEngineFallback": "Disabled",
+ "files.associations": {
+ "*.h": "c",
+ "*.c": "c"
+ }
+}
+EOF
+die "Could not write settings.json"
+
+# Infer some setup-specific locations/names
+
+GCCPATH="$(which gcc)"
+GDBPATH="$(which gdb)"
+MAKECOMMAND="make -j5 DEVELOPER=1"
+OSNAME=
+X=
+case "$(uname -s)" in
+MINGW*)
+ GCCPATH="$(cygpath -am "$GCCPATH")"
+ GDBPATH="$(cygpath -am "$GDBPATH")"
+ MAKE_BASH="$(cygpath -am /git-cmd.exe) --command=usr\\\\bin\\\\bash.exe"
+ MAKECOMMAND="$MAKE_BASH -lc \\\"$MAKECOMMAND\\\""
+ OSNAME=Win32
+ X=.exe
+ ;;
+Linux)
+ OSNAME=Linux
+ ;;
+Darwin)
+ OSNAME=macOS
+ ;;
+esac
+
+# Default build task
+
+cat >.vscode/tasks.json <<EOF ||
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "make",
+ "type": "shell",
+ "command": "$MAKECOMMAND",
+ "group": {
+ "kind": "build",
+ "isDefault": true
+ }
+ }
+ ]
+}
+EOF
+die "Could not install default build task"
+
+# Debugger settings
+
+cat >.vscode/launch.json <<EOF ||
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit:
+ // https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "(gdb) Launch",
+ "type": "cppdbg",
+ "request": "launch",
+ "program": "\${workspaceFolder}/git$X",
+ "args": [],
+ "stopAtEntry": false,
+ "cwd": "\${workspaceFolder}",
+ "environment": [],
+ "externalConsole": true,
+ "MIMode": "gdb",
+ "miDebuggerPath": "$GDBPATH",
+ "setupCommands": [
+ {
+ "description": "Enable pretty-printing for gdb",
+ "text": "-enable-pretty-printing",
+ "ignoreFailures": true
+ }
+ ]
+ }
+ ]
+}
+EOF
+die "Could not write launch configuration"
+
+# C/C++ extension settings
+
+make -f - OSNAME=$OSNAME GCCPATH="$GCCPATH" vscode-init \
+ >.vscode/c_cpp_properties.json <<\EOF ||
+include Makefile
+
+vscode-init:
+ @mkdir -p .vscode && \
+ incs= && defs= && \
+ for e in $(ALL_CFLAGS); do \
+ case "$$e" in \
+ -I.) \
+ incs="$$(printf '% 16s"$${workspaceRoot}",\n%s' \
+ "" "$$incs")" \
+ ;; \
+ -I/*) \
+ incs="$$(printf '% 16s"%s",\n%s' \
+ "" "$${e#-I}" "$$incs")" \
+ ;; \
+ -I*) \
+ incs="$$(printf '% 16s"$${workspaceRoot}/%s",\n%s' \
+ "" "$${e#-I}" "$$incs")" \
+ ;; \
+ -D*) \
+ defs="$$(printf '% 16s"%s",\n%s' \
+ "" "$$(echo "$${e#-D}" | sed 's/"/\\&/g')" \
+ "$$defs")" \
+ ;; \
+ esac; \
+ done && \
+ echo '{' && \
+ echo ' "configurations": [' && \
+ echo ' {' && \
+ echo ' "name": "$(OSNAME)",' && \
+ echo ' "intelliSenseMode": "clang-x64",' && \
+ echo ' "includePath": [' && \
+ echo "$$incs" | sort | sed '$$s/,$$//' && \
+ echo ' ],' && \
+ echo ' "defines": [' && \
+ echo "$$defs" | sort | sed '$$s/,$$//' && \
+ echo ' ],' && \
+ echo ' "browse": {' && \
+ echo ' "limitSymbolsToIncludedHeaders": true,' && \
+ echo ' "databaseFilename": "",' && \
+ echo ' "path": [' && \
+ echo ' "$${workspaceRoot}"' && \
+ echo ' ]' && \
+ echo ' },' && \
+ echo ' "cStandard": "c11",' && \
+ echo ' "cppStandard": "c++17",' && \
+ echo ' "compilerPath": "$(GCCPATH)"' && \
+ echo ' }' && \
+ echo ' ],' && \
+ echo ' "version": 4' && \
+ echo '}'
+EOF
+die "Could not write settings for the C/C++ extension"
--
gitgitgadget
^ permalink raw reply related
* [PATCH 0/9] Add support to develop Git in Visual Studio Code
From: Johannes Schindelin via GitGitGadget @ 2018-07-23 13:52 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
[Visual Studio Code](https://code.visualstudio.com/) (nickname "VS Code") is a light-weight, cross-platform, Open Source development environment, with an increasingly powerful extension to support C/C++ development. In particular the intellisense support as well as all the other niceties developers might have come to expect from Integrated Development Environments will help accelerate development.
This topic branch makes it easy to get started using VS Code to develop Git itself.
To get started, run the script `./contrib/vscode/init.sh`. This will initialize the `.vscode/` directory and some files in that directory. After that, simply open Git's top-level directory as "folder" in VS Code.
The files have to be generated because of the curious way Git determines what flags to pass to the C compiler, in particular which constants are defined, because they change the compile flow in rather dramatic ways (determining, e.g. which SHA-1 backend to use).
Johannes Schindelin (9):
contrib: add a script to initialize VS Code configuration
vscode: hard-code a couple defines
cache.h: extract enum declaration from inside a struct declaration
mingw: define WIN32 explicitly
vscode: only overwrite C/C++ settings
vscode: wrap commit messages at column 72 by default
vscode: use 8-space tabs, no trailing ws, etc for Git's source code
vscode: add a dictionary for cSpell
vscode: let cSpell work on commit messages, too
.gitignore | 1 +
cache.h | 24 ++-
config.mak.uname | 2 +-
contrib/vscode/.gitattributes | 1 +
contrib/vscode/README.md | 14 ++
contrib/vscode/init.sh | 375 ++++++++++++++++++++++++++++++++++
6 files changed, 405 insertions(+), 12 deletions(-)
create mode 100644 contrib/vscode/.gitattributes
create mode 100644 contrib/vscode/README.md
create mode 100755 contrib/vscode/init.sh
base-commit: 53f9a3e157dbbc901a02ac2c73346d375e24978c
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-2%2Fdscho%2Fvscode-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2/dscho/vscode-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2
--
gitgitgadget
^ permalink raw reply
* Re: [Qemu-devel] [PATCH v2] iotests: remove LUKS support from test 226
From: Kevin Wolf @ 2018-07-23 13:51 UTC (permalink / raw)
To: John Snow; +Cc: qemu-block, qemu-devel, Max Reitz
In-Reply-To: <20180713173721.14915-1-jsnow@redhat.com>
Am 13.07.2018 um 19:37 hat John Snow geschrieben:
> This test doesn't actually care about the format anyway, it just
> supports "all formats" as a convenience. LUKS however does not use a
> simple image filename which confuses this iotest.
>
> We can simply skip the test for formats that use IMGOPTSSYNTAX for
> their filenames without missing much coverage.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply
* [PATCH 5/5] coccinelle: extract dedicated make target to clean Coccinelle's results
From: SZEDER Gábor @ 2018-07-23 13:51 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, René Scharfe, Derrick Stolee,
Nguyễn Thái Ngọc Duy, SZEDER Gábor
In-Reply-To: <20180723135100.24288-1-szeder.dev@gmail.com>
Sometimes I want to remove only Coccinelle's results, but keep all
other build artifacts left after my usual 'make all man' build. This
new 'cocciclean' make target will allow just that.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
Makefile | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 72ea29df4e..aee629cbaf 100644
--- a/Makefile
+++ b/Makefile
@@ -2903,7 +2903,10 @@ profile-clean:
$(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
-clean: profile-clean coverage-clean
+cocciclean:
+ $(RM) contrib/coccinelle/*.cocci.patch*
+
+clean: profile-clean coverage-clean cocciclean
$(RM) *.res
$(RM) $(OBJECTS)
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
@@ -2915,7 +2918,6 @@ clean: profile-clean coverage-clean
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
- $(RM) contrib/coccinelle/*.cocci.patch*
$(MAKE) -C Documentation/ clean
ifndef NO_PERL
$(MAKE) -C gitweb clean
@@ -2931,7 +2933,7 @@ endif
$(RM) GIT-USER-AGENT GIT-PREFIX
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
-.PHONY: all install profile-clean clean strip
+.PHONY: all install profile-clean cocciclean clean strip
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
.PHONY: FORCE cscope
--
2.18.0.408.g42635c01bc
^ permalink raw reply related
* Re: [PATCH v3 1/5] drm/vkms: Add functions to map/unmap GEM backing storage
From: Sean Paul @ 2018-07-23 13:51 UTC (permalink / raw)
To: Haneen Mohammed; +Cc: rodrigosiqueiramelo, dri-devel
In-Reply-To: <f1e25df28917993930ffc5db596771fe6de0fa59.1531955948.git.hamohammed.sa@gmail.com>
On Thu, Jul 19, 2018 at 03:18:03AM +0300, Haneen Mohammed wrote:
> This patch add the necessary functions to map/unmap GEM
> backing memory to the kernel's virtual address space.
>
> Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
> ---
> Changes in v2:
> - add vkms_gem_vunmap
> - use vmap_count to guard against multiple prepare_fb calls on the same
> fb
> Changes in v3:
> - change vkms_gem_vmap to retrun int
> - cleanup if vmap failed
> - increment vmap_count after successful vmap
>
> drivers/gpu/drm/vkms/vkms_drv.h | 9 ++++
> drivers/gpu/drm/vkms/vkms_gem.c | 80 ++++++++++++++++++++++++++++++++-
> 2 files changed, 88 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h
> index 07be29f2dc44..47048f707566 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.h
> +++ b/drivers/gpu/drm/vkms/vkms_drv.h
> @@ -39,6 +39,8 @@ struct vkms_gem_object {
> struct drm_gem_object gem;
> struct mutex pages_lock; /* Page lock used in page fault handler */
> struct page **pages;
> + unsigned int vmap_count;
> + void *vaddr;
> };
>
> #define drm_crtc_to_vkms_output(target) \
> @@ -47,6 +49,9 @@ struct vkms_gem_object {
> #define drm_device_to_vkms_device(target) \
> container_of(target, struct vkms_device, drm)
>
> +#define drm_gem_to_vkms_gem(target)\
> + container_of(target, struct vkms_gem_object, gem)
> +
> /* CRTC */
> int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
> struct drm_plane *primary, struct drm_plane *cursor);
> @@ -75,4 +80,8 @@ int vkms_dumb_map(struct drm_file *file, struct drm_device *dev,
>
> void vkms_gem_free_object(struct drm_gem_object *obj);
>
> +int vkms_gem_vmap(struct drm_gem_object *obj);
> +
> +void vkms_gem_vunmap(struct drm_gem_object *obj);
> +
> #endif /* _VKMS_DRV_H_ */
> diff --git a/drivers/gpu/drm/vkms/vkms_gem.c b/drivers/gpu/drm/vkms/vkms_gem.c
> index c7e38368602b..2e55c906d9b2 100644
> --- a/drivers/gpu/drm/vkms/vkms_gem.c
> +++ b/drivers/gpu/drm/vkms/vkms_gem.c
> @@ -37,7 +37,9 @@ void vkms_gem_free_object(struct drm_gem_object *obj)
> struct vkms_gem_object *gem = container_of(obj, struct vkms_gem_object,
> gem);
>
> - kvfree(gem->pages);
> + WARN_ON(gem->pages);
> + WARN_ON(gem->vaddr);
> +
> mutex_destroy(&gem->pages_lock);
> drm_gem_object_release(obj);
> kfree(gem);
> @@ -177,3 +179,79 @@ int vkms_dumb_map(struct drm_file *file, struct drm_device *dev,
>
> return ret;
> }
> +
> +static struct page **_get_pages(struct vkms_gem_object *vkms_obj)
> +{
> + struct drm_gem_object *gem_obj = &vkms_obj->gem;
> +
> + if (!vkms_obj->pages) {
> + struct page **pages = drm_gem_get_pages(gem_obj);
> +
> + if (IS_ERR(pages))
> + return pages;
> +
> + if (cmpxchg(&vkms_obj->pages, NULL, pages))
> + drm_gem_put_pages(gem_obj, pages, false, true);
> + }
> +
> + return vkms_obj->pages;
> +}
> +
> +void vkms_gem_vunmap(struct drm_gem_object *obj)
> +{
> + struct vkms_gem_object *vkms_obj = drm_gem_to_vkms_gem(obj);
> +
> + mutex_lock(&vkms_obj->pages_lock);
> + if (vkms_obj->vmap_count < 1) {
> + WARN_ON(vkms_obj->vaddr);
> + WARN_ON(vkms_obj->pages);
> + mutex_unlock(&vkms_obj->pages_lock);
> + return;
> + }
> +
> + vkms_obj->vmap_count--;
> +
> + if (vkms_obj->vmap_count == 0) {
> + vunmap(vkms_obj->vaddr);
> + vkms_obj->vaddr = NULL;
> + drm_gem_put_pages(obj, vkms_obj->pages, false, true);
> + vkms_obj->pages = NULL;
> + }
> +
> + mutex_unlock(&vkms_obj->pages_lock);
> +}
> +
> +int vkms_gem_vmap(struct drm_gem_object *obj)
> +{
> + struct vkms_gem_object *vkms_obj = drm_gem_to_vkms_gem(obj);
> + int ret = 0;
> +
> + mutex_lock(&vkms_obj->pages_lock);
> +
> + if (!vkms_obj->vaddr) {
> + unsigned int n_pages = obj->size >> PAGE_SHIFT;
> + struct page **pages = _get_pages(vkms_obj);
> +
> + if (IS_ERR(pages)) {
> + ret = PTR_ERR(pages);
> + goto fail;
> + }
> +
> + vkms_obj->vaddr = vmap(pages, n_pages, VM_MAP, PAGE_KERNEL);
> + if (!vkms_obj->vaddr) {
> + ret = -ENOMEM;
> + drm_gem_put_pages(obj, vkms_obj->pages, false, true);
> + vkms_obj->pages = NULL;
> + goto fail;
> + }
> +
> + vkms_obj->vmap_count++;
> + }
> +
> + mutex_unlock(&vkms_obj->pages_lock);
> + return 0;
> +
> +fail:
Since fail does the same as the success path, there are 2 ways of handling this
that would be (IMO) better:
1- Rename fail to out and remove the redundant 2 lines above
2- Add a new label above fail called err_vmap and do the ret/put_pages/pages=NULL
cleanup there, dropping into the unlock and return after.
With either of these changes,
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Sean
> + mutex_unlock(&vkms_obj->pages_lock);
> + return ret;
> +}
> --
> 2.17.1
>
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* [PATCH 4/5] coccinelle: put sane filenames into output patches
From: SZEDER Gábor @ 2018-07-23 13:50 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, René Scharfe, Derrick Stolee,
Nguyễn Thái Ngọc Duy, SZEDER Gábor
In-Reply-To: <20180723135100.24288-1-szeder.dev@gmail.com>
Coccinelle outputs its suggested transformations as patches, whose
header looks something like this:
--- commit.c
+++ /tmp/cocci-output-19250-7ae78a-commit.c
Note the lack of 'diff --opts <old> <new>' line, the differing number
of path components on the --- and +++ lines, and the nonsensical
filename on the +++ line. 'patch -p0' can still apply these patches,
as it takes the filename to be modified from the --- line. Alas, 'git
apply' can't, because it takes the filename from the +++ line, and
then complains about the nonexisting file.
Pass the '--patch .' options to Coccinelle via the SPATCH_FLAGS 'make'
variable, as it seems to make it generate proper context diff patches,
with the header starting with a 'diff ...' line and containing sane
filenames. The resulting 'contrib/coccinelle/*.cocci.patch' files
then can be applied both with 'git apply' and 'patch' (even without
'-p0').
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 73e2d16926..72ea29df4e 100644
--- a/Makefile
+++ b/Makefile
@@ -564,7 +564,7 @@ SPATCH = spatch
export TCL_PATH TCLTK_PATH
SPARSE_FLAGS =
-SPATCH_FLAGS = --all-includes
+SPATCH_FLAGS = --all-includes --patch .
--
2.18.0.408.g42635c01bc
^ permalink raw reply related
* Re: [PATCH 0/6] UBI fixes backported to 4.4.x
From: Greg KH @ 2018-07-23 12:50 UTC (permalink / raw)
To: Richard Weinberger; +Cc: stable
In-Reply-To: <2103747.O1vaRPEiWE@blindfold>
On Mon, Jul 23, 2018 at 02:43:26PM +0200, Richard Weinberger wrote:
> Greg,
>
> Am Montag, 23. Juli 2018, 14:20:49 CEST schrieb Greg KH:
> > On Mon, Jul 23, 2018 at 02:10:08PM +0200, Richard Weinberger wrote:
> > > Greg,
> > >
> > > this series contains backports of the following upstream commits:
> > >
> > > 243a4f8126fc ubi: Introduce vol_ignored()
> > > fdf10ed710c0 ubi: Rework Fastmap attach base code
> > > 74f2c6e9a47c ubi: Be more paranoid while seaching for the most recent Fastmap
> > > 2e8f08deabbc ubi: Fix races around ubi_refill_pools()
> > > f7d11b33d4e8 ubi: Fix Fastmap's update_vol()
> > > 5793f39de7f6 ubi: fastmap: Erase outdated anchor PEBs during attach
> >
> > This last one was really commit f78e5623f45bab2b726eec29dc5cefbbab2d0b1c
> > upstream, please be a bit more careful in the future.
>
> Sorry for that.
> I owe you a beer (at ELCE?). :-)
Sure I'll take you up on that there :)
greg k-h
^ permalink raw reply
* [PATCH 3/5] coccinelle: exclude sha1dc source files from static analysis
From: SZEDER Gábor @ 2018-07-23 13:50 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, René Scharfe, Derrick Stolee,
Nguyễn Thái Ngọc Duy, SZEDER Gábor
In-Reply-To: <20180723135100.24288-1-szeder.dev@gmail.com>
sha1dc is an external library, that we carry in-tree for convenience
or grab as a submodule, so there is no use in applying our semantic
patches to its source files.
Therefore, exclude sha1dc's source files from Coccinelle's static
analysis.
This change also makes the static analysis somewhat faster: presumably
because of the heavy use of repetitive macro declarations, applying
the semantic patches 'array.cocci' and 'swap.cocci' to 'sha1dc/sha1.c'
takes over half a minute each on my machine, which amounts to about a
third of the runtime of applying these two semantic patches to the
whole git source tree.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
Makefile | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 8f509576e9..73e2d16926 100644
--- a/Makefile
+++ b/Makefile
@@ -2666,10 +2666,16 @@ check: command-list.h
fi
C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
-%.cocci.patch: %.cocci $(C_SOURCES)
+ifdef DC_SHA1_SUBMODULE
+COCCI_SOURCES = $(filter-out sha1collisiondetection/%,$(C_SOURCES))
+else
+COCCI_SOURCES = $(filter-out sha1dc/%,$(C_SOURCES))
+endif
+
+%.cocci.patch: %.cocci $(COCCI_SOURCES)
@echo ' ' SPATCH $<; \
ret=0; \
- for f in $(C_SOURCES); do \
+ for f in $(COCCI_SOURCES); do \
$(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \
{ ret=$$?; break; }; \
done >$@+ 2>$@.log; \
--
2.18.0.408.g42635c01bc
^ permalink raw reply related
* [PATCH 2/5] coccinelle: use $(addsuffix) in 'coccicheck' make target
From: SZEDER Gábor @ 2018-07-23 13:50 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, René Scharfe, Derrick Stolee,
Nguyễn Thái Ngọc Duy, SZEDER Gábor
In-Reply-To: <20180723135100.24288-1-szeder.dev@gmail.com>
The dependencies of the 'coccicheck' make target are listed with the
help of the $(patsubst) make function, which in this case doesn't do
any pattern substitution, but only adds the '.patch' suffix.
Use the shorter and more idiomatic $(addsuffix) make function instead.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 27bfc196dd..8f509576e9 100644
--- a/Makefile
+++ b/Makefile
@@ -2683,7 +2683,7 @@ C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
then \
echo ' ' SPATCH result: $@; \
fi
-coccicheck: $(patsubst %.cocci,%.cocci.patch,$(wildcard contrib/coccinelle/*.cocci))
+coccicheck: $(addsuffix .patch,$(wildcard contrib/coccinelle/*.cocci))
.PHONY: coccicheck
--
2.18.0.408.g42635c01bc
^ permalink raw reply related
* [PATCH 1/5] coccinelle: mark the 'coccicheck' make target as .PHONY
From: SZEDER Gábor @ 2018-07-23 13:50 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, René Scharfe, Derrick Stolee,
Nguyễn Thái Ngọc Duy, SZEDER Gábor
In-Reply-To: <20180723135100.24288-1-szeder.dev@gmail.com>
The 'coccicheck' target doesn't create a file with the same name, so
mark it as .PHONY.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
index e4b503d259..27bfc196dd 100644
--- a/Makefile
+++ b/Makefile
@@ -2685,6 +2685,8 @@ C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
fi
coccicheck: $(patsubst %.cocci,%.cocci.patch,$(wildcard contrib/coccinelle/*.cocci))
+.PHONY: coccicheck
+
### Installation rules
ifneq ($(filter /%,$(firstword $(template_dir))),)
--
2.18.0.408.g42635c01bc
^ permalink raw reply related
* [PATCH 0/5] Misc Coccinelle-related improvements
From: SZEDER Gábor @ 2018-07-23 13:50 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, René Scharfe, Derrick Stolee,
Nguyễn Thái Ngọc Duy, SZEDER Gábor
Just a couple of minor Coccinelle-related improvements:
- The first two patches are small cleanups.
- The last three could make life perhaps just a tad bit easier for
devs running 'make coccicheck'.
SZEDER Gábor (5):
coccinelle: mark the 'coccicheck' make target as .PHONY
coccinelle: use $(addsuffix) in 'coccicheck' make target
coccinelle: exclude sha1dc source files from static analysis
coccinelle: put sane filenames into output patches
coccinelle: extract dedicated make target to clean Coccinelle's
results
Makefile | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
--
2.18.0.408.g42635c01bc
^ permalink raw reply
* [PATCH] bq25890_charger.c : add the BQ25896 part
From: Angus Ainslie @ 2018-07-23 13:51 UTC (permalink / raw)
To: Sebastian Reichel, linux-pm, linux-kernel; +Cc: Angus Ainslie, Angus Ainslie
Add some debugging to be able to check the proper initialization
of the BQ25896 part.
Enable the BQ25896 part.
Add 2 new parameters "voltage_now" and "model_name".
Signed-off-by: Angus Ainslie <angus.ainslie@puri.sm>
---
drivers/power/supply/bq25890_charger.c | 68 ++++++++++++++++++++++----
1 file changed, 58 insertions(+), 10 deletions(-)
diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index 8e2c41ded171..32cdae15ce40 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -32,6 +32,7 @@
#define BQ25890_IRQ_PIN "bq25890_irq"
#define BQ25890_ID 3
+#define BQ25896_ID 0
enum bq25890_fields {
F_EN_HIZ, F_EN_ILIM, F_IILIM, /* Reg00 */
@@ -153,8 +154,8 @@ static const struct reg_field bq25890_reg_fields[] = {
[F_CONV_RATE] = REG_FIELD(0x02, 6, 6),
[F_BOOSTF] = REG_FIELD(0x02, 5, 5),
[F_ICO_EN] = REG_FIELD(0x02, 4, 4),
- [F_HVDCP_EN] = REG_FIELD(0x02, 3, 3),
- [F_MAXC_EN] = REG_FIELD(0x02, 2, 2),
+ [F_HVDCP_EN] = REG_FIELD(0x02, 3, 3), // reserved on BQ25896
+ [F_MAXC_EN] = REG_FIELD(0x02, 2, 2), // reserved on BQ25896
[F_FORCE_DPM] = REG_FIELD(0x02, 1, 1),
[F_AUTO_DPDM_EN] = REG_FIELD(0x02, 0, 0),
/* REG03 */
@@ -163,6 +164,7 @@ static const struct reg_field bq25890_reg_fields[] = {
[F_OTG_CFG] = REG_FIELD(0x03, 5, 5),
[F_CHG_CFG] = REG_FIELD(0x03, 4, 4),
[F_SYSVMIN] = REG_FIELD(0x03, 1, 3),
+ /* MIN_VBAT_SEL on BQ25896 */
/* REG04 */
[F_PUMPX_EN] = REG_FIELD(0x04, 7, 7),
[F_ICHG] = REG_FIELD(0x04, 0, 6),
@@ -181,7 +183,7 @@ static const struct reg_field bq25890_reg_fields[] = {
[F_CHG_TMR] = REG_FIELD(0x07, 1, 2),
[F_JEITA_ISET] = REG_FIELD(0x07, 0, 0),
/* REG08 */
- [F_BATCMP] = REG_FIELD(0x08, 6, 7),
+ [F_BATCMP] = REG_FIELD(0x08, 6, 7), // 5-7 on BQ25896
[F_VCLAMP] = REG_FIELD(0x08, 2, 4),
[F_TREG] = REG_FIELD(0x08, 0, 1),
/* REG09 */
@@ -195,12 +197,13 @@ static const struct reg_field bq25890_reg_fields[] = {
[F_PUMPX_DN] = REG_FIELD(0x09, 0, 0),
/* REG0A */
[F_BOOSTV] = REG_FIELD(0x0A, 4, 7),
+ /* PFM_OTG_DIS 3 on BQ25896 */
[F_BOOSTI] = REG_FIELD(0x0A, 0, 2),
/* REG0B */
[F_VBUS_STAT] = REG_FIELD(0x0B, 5, 7),
[F_CHG_STAT] = REG_FIELD(0x0B, 3, 4),
[F_PG_STAT] = REG_FIELD(0x0B, 2, 2),
- [F_SDP_STAT] = REG_FIELD(0x0B, 1, 1),
+ [F_SDP_STAT] = REG_FIELD(0x0B, 1, 1), // reserved on BQ25896
[F_VSYS_STAT] = REG_FIELD(0x0B, 0, 0),
/* REG0C */
[F_WD_FAULT] = REG_FIELD(0x0C, 7, 7),
@@ -401,6 +404,18 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
val->strval = BQ25890_MANUFACTURER;
break;
+ case POWER_SUPPLY_PROP_MODEL_NAME:
+ bq->chip_id = bq25890_field_read(bq, F_PN);
+
+ if (bq->chip_id == BQ25890_ID)
+ val->strval = "BQ25890";
+ else if (bq->chip_id == BQ25896_ID)
+ val->strval = "BQ25896";
+ else
+ val->strval = "UNKNOWN";
+
+ break;
+
case POWER_SUPPLY_PROP_ONLINE:
val->intval = state.online;
break;
@@ -453,6 +468,20 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
val->intval = bq25890_find_val(bq->init_data.iterm, TBL_ITERM);
break;
+ case POWER_SUPPLY_PROP_VOLTAGE_NOW:
+ if (!state.online) {
+ val->intval = 0;
+ break;
+ }
+
+ ret = bq25890_field_read(bq, F_SYSV); /* read measured value */
+ if (ret < 0)
+ return ret;
+
+ /* converted_val = 2.304V + ADC_val * 20mV (table 10.3.15) */
+ val->intval = 2304000 + ret * 20000;
+ break;
+
default:
return -EINVAL;
}
@@ -608,30 +637,43 @@ static int bq25890_hw_init(struct bq25890_device *bq)
};
ret = bq25890_chip_reset(bq);
- if (ret < 0)
+ if (ret < 0) {
+ dev_dbg(bq->dev, "BQ259x reset failed %d\n", ret);
return ret;
+ }
/* disable watchdog */
ret = bq25890_field_write(bq, F_WD, 0);
- if (ret < 0)
+ if (ret < 0) {
+ dev_dbg(bq->dev, "disabling watchdog failed %d\n", ret );
return ret;
+ }
/* initialize currents/voltages and other parameters */
for (i = 0; i < ARRAY_SIZE(init_data); i++) {
ret = bq25890_field_write(bq, init_data[i].id,
init_data[i].value);
- if (ret < 0)
+ if (ret < 0) {
+ dev_dbg(bq->dev, "writing init data failed %d\n",
+ ret);
return ret;
+ }
}
/* Configure ADC for continuous conversions. This does not enable it. */
ret = bq25890_field_write(bq, F_CONV_RATE, 1);
- if (ret < 0)
+ if (ret < 0) {
+ dev_dbg(bq->dev, "Config ADC failed %d\n",
+ ret);
return ret;
+ }
ret = bq25890_get_chip_state(bq, &state);
- if (ret < 0)
+ if (ret < 0) {
+ dev_dbg(bq->dev, "BQ2589x get state failed %d\n",
+ ret);
return ret;
+ }
mutex_lock(&bq->lock);
bq->state = state;
@@ -644,12 +686,14 @@ static enum power_supply_property bq25890_power_supply_props[] = {
POWER_SUPPLY_PROP_MANUFACTURER,
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_ONLINE,
+ POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_HEALTH,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT,
+ POWER_SUPPLY_PROP_VOLTAGE_NOW,
};
static char *bq25890_charger_supplied_to[] = {
@@ -767,6 +811,9 @@ static int bq25890_fw_read_u32_props(struct bq25890_device *bq)
if (props[i].optional)
continue;
+ printk( KERN_ERR "unable to read property %d %s\n", ret
+ , props[i].name );
+
return ret;
}
@@ -840,7 +887,7 @@ static int bq25890_probe(struct i2c_client *client,
return bq->chip_id;
}
- if (bq->chip_id != BQ25890_ID) {
+ if ((bq->chip_id != BQ25890_ID) && (bq->chip_id != BQ25896_ID)) {
dev_err(dev, "Chip with ID=%d, not supported!\n", bq->chip_id);
return -ENODEV;
}
@@ -966,6 +1013,7 @@ MODULE_DEVICE_TABLE(i2c, bq25890_i2c_ids);
static const struct of_device_id bq25890_of_match[] = {
{ .compatible = "ti,bq25890", },
+ { .compatible = "ti,bq25896", },
{ },
};
MODULE_DEVICE_TABLE(of, bq25890_of_match);
--
2.17.1
^ permalink raw reply related
* Re: openbmc test work group - wiki
From: Sivas Srr @ 2018-07-23 13:51 UTC (permalink / raw)
To: geissonator; +Cc: kurt.r.taylor, openbmc
In-Reply-To: <CALLMt=qUzt55cL47j3+vKOKaqFQpKXiMps0FVJHVwd8jJeF-aQ@mail.gmail.com>
[-- Attachment #1: Type: text/html, Size: 5758 bytes --]
^ permalink raw reply
* [meta-oe] [PATCH 7/7] python-cmd2: add native and nativesdk
From: Binghua Guan @ 2018-07-23 13:29 UTC (permalink / raw)
To: openembedded-devel
In-Reply-To: <20180723132950.4543-1-freebendy@gmail.com>
Signed-off-by: Binghua Guan <freebendy@gmail.com>
---
meta-python/recipes-devtools/python/python-cmd2_0.9.2.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta-python/recipes-devtools/python/python-cmd2_0.9.2.bb b/meta-python/recipes-devtools/python/python-cmd2_0.9.2.bb
index 74dbaefc1..95d2601cd 100644
--- a/meta-python/recipes-devtools/python/python-cmd2_0.9.2.bb
+++ b/meta-python/recipes-devtools/python/python-cmd2_0.9.2.bb
@@ -19,3 +19,5 @@ RDEPENDS_${PN} += "\
${PYTHON_PN}-threading \
${PYTHON_PN}-textutils \
"
+
+BBCLASSEXTEND = "native nativesdk"
--
2.11.0
^ permalink raw reply related
* [meta-oe] [PATCH 6/7] python-prettytable: add native and nativesdk
From: Binghua Guan @ 2018-07-23 13:29 UTC (permalink / raw)
To: openembedded-devel
In-Reply-To: <20180723132950.4543-1-freebendy@gmail.com>
Signed-off-by: Binghua Guan <freebendy@gmail.com>
---
meta-python/recipes-devtools/python/python-prettytable_0.7.2.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta-python/recipes-devtools/python/python-prettytable_0.7.2.bb b/meta-python/recipes-devtools/python/python-prettytable_0.7.2.bb
index 6f4390e24..406555ac3 100644
--- a/meta-python/recipes-devtools/python/python-prettytable_0.7.2.bb
+++ b/meta-python/recipes-devtools/python/python-prettytable_0.7.2.bb
@@ -23,3 +23,5 @@ do_install_append() {
UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/PrettyTable/"
UPSTREAM_CHECK_REGEX = "/PrettyTable/(?P<pver>(\d+[\.\-_]*)+)"
+
+BBCLASSEXTEND = "native nativesdk"
--
2.11.0
^ permalink raw reply related
* [meta-oe] [PATCH 5/7] python-pyflakes: add native and nativesdk
From: Binghua Guan @ 2018-07-23 13:29 UTC (permalink / raw)
To: openembedded-devel
In-Reply-To: <20180723132950.4543-1-freebendy@gmail.com>
Signed-off-by: Binghua Guan <freebendy@gmail.com>
---
meta-python/recipes-devtools/python/python-pyflakes_1.6.0.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta-python/recipes-devtools/python/python-pyflakes_1.6.0.bb b/meta-python/recipes-devtools/python/python-pyflakes_1.6.0.bb
index 244485965..a16a880db 100644
--- a/meta-python/recipes-devtools/python/python-pyflakes_1.6.0.bb
+++ b/meta-python/recipes-devtools/python/python-pyflakes_1.6.0.bb
@@ -12,3 +12,5 @@ RDEPENDS_${PN} += " \
${PYTHON_PN}-prettytable \
${PYTHON_PN}-cmd2 \
${PYTHON_PN}-pyparsing"
+
+BBCLASSEXTEND = "native nativesdk"
--
2.11.0
^ permalink raw reply related
* [PATCH] x86/hvm: Disallow unknown MSR_EFER bits
From: Andrew Cooper @ 2018-07-23 13:49 UTC (permalink / raw)
To: Xen-devel
Cc: Andrew Cooper, Sergey Dyasli, Wei Liu, Jan Beulich,
Roger Pau Monné
It turns out that nothing ever prevented HVM guests from trying to set unknown
EFER bits. Generally, this results in a vmentry failure.
For Intel hardware, all implemented bits are covered by the checks.
For AMD hardware, the only EFER bit which isn't covered by the checks is TCE
(which AFAICT is specific to AMD Fam15/16 hardware). We never advertise TCE
in CPUID, but it isn't a security problem to have TCE unexpected enabled in
guest context.
Disallow the setting of bits outside of the EFER_KNOWN_MASK, which prevents
any vmentry failures for guests, yielding #GP instead.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Sergey Dyasli <sergey.dyasli@citrix.com>
Note: On AMD hardware, bits 7:1 are Reserved write-discard rather than
yielding #GP. Implementing this doesn't seem worthwhile (no software will try
to set these bits, because they are strictly reserved on Intel hardware), and
would require rather more complicated changes to hvm_efer_valid() to feed back
a modified efer value.
---
xen/arch/x86/hvm/hvm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 1816faa..c099c61 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -907,6 +907,9 @@ const char *hvm_efer_valid(const struct vcpu *v, uint64_t value,
else
p = &host_cpuid_policy;
+ if ( value & ~EFER_KNOWN_MASK )
+ return "Unknown bits set";
+
if ( (value & EFER_SCE) && !p->extd.syscall )
return "SCE without feature";
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related
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.